Commit 9951e98e authored by Abel Vesa's avatar Abel Vesa

plat: imx8mq: gpc: Fix the gpc_saved_imrs offset for pdn

The offset of the gpc_saved_imrs was computed wrong.
Now, the offset is consistent between saving and restoring.

Fixes: 0df4c895 ("plat: imx8mq: gpc: Add array for cores IMR offset")
Signed-off-by: default avatarAbel Vesa <abel.vesa@nxp.com>
Reviewed-by: default avatarLeonard Crestez <leonard.crestez@nxp.com>
parent 0e91ff59
......@@ -233,7 +233,7 @@ static void gpc_save_imr_lpm(unsigned int core_id, unsigned int imr_idx)
gpc_imr_core_spin_lock(core_id);
gpc_saved_imrs[core_id + imr_idx] = mmio_read_32(reg);
gpc_saved_imrs[core_id + imr_idx * 4] = mmio_read_32(reg);
mmio_write_32(reg, ~gpc_wake_irqs[imr_idx]);
gpc_imr_core_spin_unlock(core_id);
......@@ -242,7 +242,7 @@ static void gpc_save_imr_lpm(unsigned int core_id, unsigned int imr_idx)
static void gpc_restore_imr_lpm(unsigned int core_id, unsigned int imr_idx)
{
uint32_t reg = gpc_imr_offset[core_id] + imr_idx * 4;
uint32_t val = gpc_saved_imrs[imr_idx + (core_id * 4)];
uint32_t val = gpc_saved_imrs[core_id + imr_idx * 4];
gpc_imr_core_spin_lock(core_id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment