Browse Source

feat(imx93): add reset & poweroff support

Add system reset & system power off support on i.MX93.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Change-Id: Id180461541a1b3f73b2dc00c9cad33f484c145e6
pull/1999/head
Jacky Bai 1 year ago
parent
commit
cf7ef4c762
  1. 26
      plat/imx/imx93/imx93_psci.c
  2. 11
      plat/imx/imx93/include/platform_def.h

26
plat/imx/imx93/imx93_psci.c

@ -144,11 +144,37 @@ void imx_pwr_domain_off(const psci_power_state_t *target_state)
gpc_set_cpu_mode(CPU_A55C0 + core_id, CM_MODE_SUSPEND);
}
void __dead2 imx_system_reset(void)
{
mmio_write_32(WDOG3_BASE + WDOG_CNT, 0xd928c520);
while ((mmio_read_32(WDOG3_BASE + WDOG_CS) & WDOG_CS_ULK) == 0U) {
;
}
mmio_write_32(WDOG3_BASE + WDOG_TOVAL, 0x10);
mmio_write_32(WDOG3_BASE + WDOG_CS, 0x21e3);
while (1) {
wfi();
}
}
void __dead2 imx_system_off(void)
{
mmio_setbits_32(BBNSM_BASE + BBNSM_CTRL, BBNSM_DP_EN | BBNSM_TOSP);
while (1) {
wfi();
}
}
static const plat_psci_ops_t imx_plat_psci_ops = {
.validate_ns_entrypoint = imx_validate_ns_entrypoint,
.pwr_domain_on = imx_pwr_domain_on,
.pwr_domain_off = imx_pwr_domain_off,
.pwr_domain_on_finish = imx_pwr_domain_on_finish,
.system_reset = imx_system_reset,
.system_off = imx_system_off,
};
/* export the platform specific psci ops */

11
plat/imx/imx93/include/platform_def.h

@ -65,6 +65,17 @@
#define TRDC_N_BASE U(0x49010000)
#define TRDC_x_SISE U(0x20000)
#define WDOG3_BASE U(0x42490000)
#define WDOG_CS U(0x0)
#define WDOG_CS_ULK BIT(11)
#define WDOG_CNT U(0x4)
#define WDOG_TOVAL U(0x8)
#define BBNSM_BASE U(0x44440000)
#define BBNSM_CTRL U(0x8)
#define BBNSM_DP_EN BIT(24)
#define BBNSM_TOSP BIT(25)
#define SRC_BASE U(0x44460000)
#define GPC_BASE U(0x44470000)
#define BLK_CTRL_S_BASE U(0x444F0000)

Loading…
Cancel
Save