aboutsummaryrefslogtreecommitdiff
path: root/platforms
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-12-08 22:22:58 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-12-16 14:50:56 +1100
commit1959efa66e9f9626f83a41a870057d8eb0426c54 (patch)
tree08619420f01d6cf562f4a2ee67eee5e91c0c5c1b /platforms
parent45c1436a000707a2da7e8e50bae43e1466dcf15a (diff)
downloadskiboot-1959efa66e9f9626f83a41a870057d8eb0426c54.zip
skiboot-1959efa66e9f9626f83a41a870057d8eb0426c54.tar.gz
skiboot-1959efa66e9f9626f83a41a870057d8eb0426c54.tar.bz2
debug descriptor: make endian-clean
Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'platforms')
-rw-r--r--platforms/ibm-fsp/common.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/platforms/ibm-fsp/common.c b/platforms/ibm-fsp/common.c
index 48b9fd8..c288bff 100644
--- a/platforms/ibm-fsp/common.c
+++ b/platforms/ibm-fsp/common.c
@@ -24,14 +24,14 @@ static void map_debug_areas(void)
fsp_tce_map(PSI_DMA_MEMCONS, &memcons, 0x1000);
fsp_tce_map(PSI_DMA_LOG_BUF, (void*)INMEM_CON_START, INMEM_CON_LEN);
- debug_descriptor.memcons_tce = PSI_DMA_MEMCONS;
+ debug_descriptor.memcons_tce = cpu_to_be32(PSI_DMA_MEMCONS);
t = be64_to_cpu(memcons.obuf_phys) - INMEM_CON_START + PSI_DMA_LOG_BUF;
- debug_descriptor.memcons_obuf_tce = t;
+ debug_descriptor.memcons_obuf_tce = cpu_to_be32(t);
t = be64_to_cpu(memcons.ibuf_phys) - INMEM_CON_START + PSI_DMA_LOG_BUF;
- debug_descriptor.memcons_ibuf_tce = t;
+ debug_descriptor.memcons_ibuf_tce = cpu_to_be32(t);
t = PSI_DMA_TRACE_BASE;
- for (i = 0; i < debug_descriptor.num_traces; i++) {
+ for (i = 0; i < be32_to_cpu(debug_descriptor.num_traces); i++) {
/*
* Trace buffers are misaligned by 0x10 due to the lock
* in the trace structure, and their size is also not
@@ -46,15 +46,16 @@ static void map_debug_areas(void)
* Note: Maybe we should map them read-only...
*/
uint64_t tstart, tend, toff, tsize;
+ uint64_t trace_phys = be64_to_cpu(debug_descriptor.trace_phys[i]);
+ uint32_t trace_size = be32_to_cpu(debug_descriptor.trace_size[i]);
- tstart = ALIGN_DOWN(debug_descriptor.trace_phys[i], 0x1000);
- tend = ALIGN_UP(debug_descriptor.trace_phys[i] +
- debug_descriptor.trace_size[i], 0x1000);
- toff = debug_descriptor.trace_phys[i] - tstart;
+ tstart = ALIGN_DOWN(trace_phys, 0x1000);
+ tend = ALIGN_UP(trace_phys + trace_size, 0x1000);
+ toff = trace_phys - tstart;
tsize = tend - tstart;
fsp_tce_map(t, (void *)tstart, tsize);
- debug_descriptor.trace_tce[i] = t + toff;
+ debug_descriptor.trace_tce[i] = cpu_to_be32(t + toff);
t += tsize;
}
}