aboutsummaryrefslogtreecommitdiff
path: root/hdata
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2019-12-08 22:22:49 +1000
committerOliver O'Halloran <oohall@gmail.com>2019-12-16 14:50:56 +1100
commit8d49ff5356f0aadf84e54d3ced04632f0d748436 (patch)
tree1903df2922a8d6daa7780b7dd3cb0edae43c9155 /hdata
parent518e55426f4ae7298eb13f8b64e1c6839131f3d7 (diff)
downloadskiboot-8d49ff5356f0aadf84e54d3ced04632f0d748436.zip
skiboot-8d49ff5356f0aadf84e54d3ced04632f0d748436.tar.gz
skiboot-8d49ff5356f0aadf84e54d3ced04632f0d748436.tar.bz2
hdata: endian conversions
Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Diffstat (limited to 'hdata')
-rw-r--r--hdata/memory.c3
-rw-r--r--hdata/spira.c6
2 files changed, 5 insertions, 4 deletions
diff --git a/hdata/memory.c b/hdata/memory.c
index 9af7ae7..9e5e99b 100644
--- a/hdata/memory.c
+++ b/hdata/memory.c
@@ -135,7 +135,8 @@ static bool add_address_range(struct dt_node *root,
"on Chip 0x%x mattr: 0x%x pattr: 0x%x status:0x%x\n",
(long long)be64_to_cpu(arange->start),
(long long)be64_to_cpu(arange->end),
- chip_id, arange->mirror_attr, mem_type, mem_status);
+ chip_id, be32_to_cpu(arange->mirror_attr),
+ mem_type, mem_status);
/* reg contains start and length */
reg[0] = cleanup_addr(be64_to_cpu(arange->start));
diff --git a/hdata/spira.c b/hdata/spira.c
index 2d0e875..f621707 100644
--- a/hdata/spira.c
+++ b/hdata/spira.c
@@ -953,7 +953,7 @@ static void dt_init_secureboot_node(const struct iplparams_sysparams *sysparams)
static void opal_dump_add_mpipl_boot(const struct iplparams_iplparams *p)
{
- u32 mdrt_cnt = spira.ntuples.mdump_res.act_cnt;
+ u32 mdrt_cnt = be16_to_cpu(spira.ntuples.mdump_res.act_cnt);
u32 mdrt_max_cnt = MDRT_TABLE_SIZE / sizeof(struct mdrt_table);
struct dt_node *dump_node;
@@ -976,7 +976,7 @@ static void opal_dump_add_mpipl_boot(const struct iplparams_iplparams *p)
return;
}
- if (p->cec_ipl_attrib != IPLPARAMS_ATTRIB_MEM_PRESERVE) {
+ if (be16_to_cpu(p->cec_ipl_attrib) != IPLPARAMS_ATTRIB_MEM_PRESERVE) {
prlog(PR_DEBUG, "DUMP: Memory not preserved\n");
return;
}
@@ -1660,7 +1660,7 @@ static void add_npus(void)
static void fixup_spira(void)
{
#if !defined(TEST)
- spiras = (struct spiras *)CPU_TO_BE64(SPIRA_HEAP_BASE);
+ spiras = (struct spiras *)SPIRA_HEAP_BASE;
#endif
/* Validate SPIRA-S signature */