extern uint32_t __bl31_sram_text_start, __bl31_sram_text_end;
extern uint32_t __bl31_sram_data_start, __bl31_sram_data_end;
+extern uint32_t __sram_incbin_start, __sram_incbin_end;
- /******************************************************************************
- * For rockchip socs pm ops
- ******************************************************************************/
- struct rockchip_pm_ops_cb {
- int (*cores_pwr_dm_on)(unsigned long mpidr, uint64_t entrypoint);
- int (*cores_pwr_dm_off)(void);
- int (*cores_pwr_dm_on_finish)(void);
- int (*cores_pwr_dm_suspend)(void);
- int (*cores_pwr_dm_resume)(void);
- /* hlvl is used for clusters or system level */
- int (*hlvl_pwr_dm_suspend)(uint32_t lvl, plat_local_state_t lvl_state);
- int (*hlvl_pwr_dm_resume)(uint32_t lvl, plat_local_state_t lvl_state);
- int (*hlvl_pwr_dm_off)(uint32_t lvl, plat_local_state_t lvl_state);
- int (*hlvl_pwr_dm_on_finish)(uint32_t lvl,
- plat_local_state_t lvl_state);
- int (*sys_pwr_dm_suspend)(void);
- int (*sys_pwr_dm_resume)(void);
- void (*sys_gbl_soft_reset)(void) __dead2;
- void (*system_off)(void) __dead2;
- void (*sys_pwr_down_wfi)(const psci_power_state_t *state_info) __dead2;
- };
/******************************************************************************
* The register have write-mask bits, it is mean, if you want to set the bits,
}
}
-static void m0_clock_init(void)
+static void m0_configure_suspend(void)
{
- /* enable clocks for M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_CLKGATE_CON2,
- BITS_WITH_WMASK(0x0, 0x2f, 0));
-
- /* switch the parent to xin24M and div == 1 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_CLKSEL_CON0,
- BIT_WITH_WMSK(15) | BITS_WITH_WMASK(0x0, 0x1f, 8));
-
- /* start M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_SOFTRST_CON0,
- BITS_WITH_WMASK(0x0, 0x24, 0));
-
- /* gating disable for M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_GATEDIS_CON0, BIT_WITH_WMSK(1));
-}
-
-static void m0_reset(void)
-{
- /* stop M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_SOFTRST_CON0,
- BITS_WITH_WMASK(0x24, 0x24, 0));
-
- /* recover gating bit for M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_GATEDIS_CON0, WMSK_BIT(1));
-
- /* disable clocks for M0 */
- mmio_write_32(PMUCRU_BASE + PMUCRU_CLKGATE_CON2,
- BITS_WITH_WMASK(0x2f, 0x2f, 0));
+ /* set PARAM to M0_FUNC_SUSPEND */
+ mmio_write_32(M0_PARAM_ADDR + PARAM_M0_FUNC, M0_FUNC_SUSPEND);
}
- static int sys_pwr_domain_suspend(void)
+ int rockchip_soc_sys_pwr_dm_suspend(void)
{
uint32_t wait_cnt = 0;
uint32_t status = 0;