Commit 2c400e94 authored by Marek Vasut's avatar Marek Vasut
Browse files

rcar_gen3: drivers: ddr-a: Pass ddrBackup around



Pass the ddrBackup variable around instead of making it a global variable.
Signed-off-by: default avatarMarek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ib796181247712e464b77f5f8be5f851745727d74
---
NOTE: The camelcase is fixed in later patch.
parent 32e6b50e
...@@ -26,11 +26,6 @@ ...@@ -26,11 +26,6 @@
#endif #endif
#endif #endif
/*******************************************************************************
* variables
******************************************************************************/
uint32_t ddrBackup;
/******************************************************************************* /*******************************************************************************
* Initialize ddr * Initialize ddr
******************************************************************************/ ******************************************************************************/
...@@ -820,7 +815,7 @@ if (pdqsr_ctl == 1) { ...@@ -820,7 +815,7 @@ if (pdqsr_ctl == 1) {
} /* init_ddr */ } /* init_ddr */
/* rev.0.04 add function */ /* rev.0.04 add function */
uint32_t recovery_from_backup_mode(void) static uint32_t recovery_from_backup_mode(uint32_t ddrBackup)
{ {
/**************************************************************************** /****************************************************************************
* recovery_Step0(DBSC Setting 1) / same "init_ddr" * recovery_Step0(DBSC Setting 1) / same "init_ddr"
...@@ -1648,6 +1643,7 @@ int32_t rcar_dram_init(void) ...@@ -1648,6 +1643,7 @@ int32_t rcar_dram_init(void)
uint32_t failcount; uint32_t failcount;
uint32_t md = 0; uint32_t md = 0;
uint32_t ddr = 0; uint32_t ddr = 0;
uint32_t ddrBackup;
md = *((volatile uint32_t*)RST_MODEMR); md = *((volatile uint32_t*)RST_MODEMR);
ddr = (md & 0x00080000) >> 19; ddr = (md & 0x00080000) >> 19;
...@@ -1660,7 +1656,7 @@ int32_t rcar_dram_init(void) ...@@ -1660,7 +1656,7 @@ int32_t rcar_dram_init(void)
rcar_dram_get_boot_status(&ddrBackup); rcar_dram_get_boot_status(&ddrBackup);
if (ddrBackup == DRAM_BOOT_STATUS_WARM) { if (ddrBackup == DRAM_BOOT_STATUS_WARM) {
dataL = recovery_from_backup_mode(); /* WARM boot */ dataL = recovery_from_backup_mode(ddrBackup); /* WARM boot */
} else { } else {
dataL = init_ddr(); /* COLD boot */ dataL = init_ddr(); /* COLD boot */
} /* ddrBackup */ } /* ddrBackup */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment