Browse Source

rcar_gen3: plat: Clean up rcar_pwrc_code_copy_to_system_ram()

Call the function only from architecture setup and at the end of
suspend cycle instead of calling it all over the place.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
pull/1734/head
Marek Vasut 6 years ago
parent
commit
b51a773ec3
  1. 5
      drivers/renesas/rcar/pwrc/pwrc.c
  2. 1
      plat/renesas/rcar/bl31_plat_setup.c
  3. 5
      plat/renesas/rcar/plat_pm.c

5
drivers/renesas/rcar/pwrc/pwrc.c

@ -650,7 +650,6 @@ void rcar_pwrc_set_suspend_to_ram(void)
DEVICE_SRAM_STACK_SIZE);
uint32_t sctlr;
rcar_pwrc_code_copy_to_system_ram();
rcar_pwrc_save_generic_timer(rcar_stack_generic_timer);
/* disable MMU */
@ -665,10 +664,7 @@ void rcar_pwrc_init_suspend_to_ram(void)
{
#if PMIC_ROHM_BD9571
uint8_t mode;
#endif
rcar_pwrc_code_copy_to_system_ram();
#if PMIC_ROHM_BD9571
if (rcar_iic_dvfs_receive(PMIC, PMIC_BKUP_MODE_CNT, &mode))
panic();
@ -683,7 +679,6 @@ void rcar_pwrc_suspend_to_ram(void)
#if RCAR_SYSTEM_RESET_KEEPON_DDR
int32_t error;
rcar_pwrc_code_copy_to_system_ram();
error = rcar_iic_dvfs_send(PMIC, REG_KEEP10, 0);
if (error) {
ERROR("Failed send KEEP10 init ret=%d \n", error);

1
plat/renesas/rcar/bl31_plat_setup.c

@ -100,6 +100,7 @@ void bl31_plat_arch_setup(void)
, BL31_COHERENT_RAM_BASE, BL31_COHERENT_RAM_LIMIT
#endif
);
rcar_pwrc_code_copy_to_system_ram();
}
void bl31_platform_setup(void)

5
plat/renesas/rcar/plat_pm.c

@ -155,6 +155,7 @@ static void rcar_pwr_domain_suspend_finish(const psci_power_state_t
write_cntfrq_el0(plat_get_syscnt_freq2());
mmio_write_32(RCAR_CNTC_BASE + CNTCR_OFF, CNTCR_FCREQ(U(0)) | CNTCR_EN);
rcar_pwrc_setup();
rcar_pwrc_code_copy_to_system_ram();
#if RCAR_SYSTEM_SUSPEND
rcar_pwrc_init_suspend_to_ram();
@ -167,11 +168,9 @@ static void __dead2 rcar_system_off(void)
{
#if PMIC_ROHM_BD9571
#if PMIC_LEVEL_MODE
rcar_pwrc_code_copy_to_system_ram();
if (rcar_iic_dvfs_send(PMIC, DVFS_SET_VID, DVFS_SET_VID_0V))
ERROR("BL3-1:Failed the SYSTEM-OFF.\n");
#else
rcar_pwrc_code_copy_to_system_ram();
if (rcar_iic_dvfs_send(PMIC, BKUP_MODE_CNT, P_ALL_OFF))
ERROR("BL3-1:Failed the SYSTEM-RESET.\n");
#endif
@ -204,7 +203,6 @@ static void __dead2 rcar_system_reset(void)
uint8_t mode;
int32_t error;
rcar_pwrc_code_copy_to_system_ram();
error = rcar_iic_dvfs_send(PMIC, REG_KEEP10, KEEP10_MAGIC);
if (error) {
ERROR("Failed send KEEP10 magic ret=%d \n", error);
@ -227,7 +225,6 @@ static void __dead2 rcar_system_reset(void)
rcar_pwrc_set_suspend_to_ram();
done:
#else
rcar_pwrc_code_copy_to_system_ram();
if (rcar_iic_dvfs_send(PMIC, BKUP_MODE_CNT, P_ALL_OFF))
ERROR("BL3-1:Failed the SYSTEM-RESET.\n");
#endif

Loading…
Cancel
Save