diff options
author | Bai Ping <ping.bai@nxp.com> | 2018-04-18 16:16:48 +0800 |
---|---|---|
committer | Abel Vesa <abel.vesa@nxp.com> | 2018-06-11 10:33:03 +0300 |
commit | 02871d54a6beda8bb0c09e43aacfd138bd5fe35a (patch) | |
tree | 0591cda83547c2145ebff9e39191b6d8503dc8d9 /plat/imx/common | |
parent | e3e75661d00db8f88d35018a19a9c43b16bc8f9a (diff) |
plat: imx: add platfrom gicv3 save/restore
The GICv3 save/restore is necessary when GIC is going
to power off. the save/restore is common for all imx8
platform, so make it common for imx8.
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Diffstat (limited to 'plat/imx/common')
-rw-r--r-- | plat/imx/common/include/plat_imx8.h | 10 | ||||
-rw-r--r-- | plat/imx/common/plat_imx8_gic.c | 14 |
2 files changed, 24 insertions, 0 deletions
diff --git a/plat/imx/common/include/plat_imx8.h b/plat/imx/common/include/plat_imx8.h index ee2c5522..9dfdbc7f 100644 --- a/plat/imx/common/include/plat_imx8.h +++ b/plat/imx/common/include/plat_imx8.h @@ -31,6 +31,14 @@ #ifndef __PLAT_IMX8_H__ #define __PLAT_IMX8_H__ +#include <gicv3.h> + +/* gicv3 context save */ +struct plat_gic_ctx { + gicv3_redist_ctx_t rdist_ctx; + gicv3_dist_ctx_t dist_ctx; +}; + unsigned int plat_calc_core_pos(u_register_t mpidr); void imx_mailbox_init(uintptr_t base_addr); void plat_gic_driver_init(void); @@ -38,5 +46,7 @@ void plat_gic_init(void); void plat_gic_cpuif_enable(void); void plat_gic_cpuif_disable(void); void plat_gic_pcpu_init(void); +void plat_gic_save(unsigned int proc_num, struct plat_gic_ctx *ctx); +void plat_gic_restore(unsigned int proc_num, struct plat_gic_ctx *ctx); #endif /*__PLAT_IMX8_H__ */ diff --git a/plat/imx/common/plat_imx8_gic.c b/plat/imx/common/plat_imx8_gic.c index e889f957..d6f33041 100644 --- a/plat/imx/common/plat_imx8_gic.c +++ b/plat/imx/common/plat_imx8_gic.c @@ -89,3 +89,17 @@ void plat_gic_pcpu_init(void) { gicv3_rdistif_init(plat_my_core_pos()); } + +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); + 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); +} |