diff options
author | Bai Ping <ping.bai@nxp.com> | 2018-06-16 01:13:20 +0800 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2018-06-20 11:00:11 +0300 |
commit | 76673d693f8cdadb776e0c89df5d1c6902f47d47 (patch) | |
tree | 633519d7f1b4dd38ef10f0e3421a010930311690 | |
parent | 6bc321eee4ccee407a4486dad6ec8319750b7f7a (diff) |
plat: imx: fix smp boot hang issue when GIC is power down
When GIC is power down, all the GIC state will be lost. All
the redistributor's state need save/resotre. Additionally,
the redistributor's restore need to be done after distributor
Signed-off-by: Bai Ping <ping.bai@nxp.com>
-rw-r--r-- | plat/imx/common/include/plat_imx8.h | 3 | ||||
-rw-r--r-- | plat/imx/common/plat_imx8_gic.c | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/plat/imx/common/include/plat_imx8.h b/plat/imx/common/include/plat_imx8.h index 63b7d58a..0c505903 100644 --- a/plat/imx/common/include/plat_imx8.h +++ b/plat/imx/common/include/plat_imx8.h @@ -8,10 +8,11 @@ #define __PLAT_IMX8_H__ #include <gicv3.h> +#include <platform_def.h> /* gicv3 context save */ struct plat_gic_ctx { - gicv3_redist_ctx_t rdist_ctx; + gicv3_redist_ctx_t rdist_ctx[PLATFORM_CORE_COUNT]; gicv3_dist_ctx_t dist_ctx; }; diff --git a/plat/imx/common/plat_imx8_gic.c b/plat/imx/common/plat_imx8_gic.c index a2d6b8bb..1d552ea7 100644 --- a/plat/imx/common/plat_imx8_gic.c +++ b/plat/imx/common/plat_imx8_gic.c @@ -69,13 +69,15 @@ void plat_gic_pcpu_init(void) void plat_gic_save(unsigned int proc_num, struct plat_gic_ctx *ctx) { /* save the gic rdist/dist context */ - gicv3_rdistif_save(proc_num, &ctx->rdist_ctx); + for (int i = 0; i < PLATFORM_CORE_COUNT; i++) + gicv3_rdistif_save(i, &ctx->rdist_ctx[i]); gicv3_distif_save(&ctx->dist_ctx); } void plat_gic_restore(unsigned int proc_num, struct plat_gic_ctx *ctx) { /* restore the gic rdist/dist context */ - gicv3_rdistif_init_restore(proc_num, &ctx->rdist_ctx); gicv3_distif_init_restore(&ctx->dist_ctx); + for (int i = 0; i < PLATFORM_CORE_COUNT; i++) + gicv3_rdistif_init_restore(i, &ctx->rdist_ctx[i]); } |