rcar_gen3: drivers: ddr-a: Pass ddrBackup around
authorMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 14 Jul 2019 10:09:56 +0000 (12:09 +0200)
committerMarek Vasut <marek.vasut+renesas@gmail.com>
Sun, 14 Jul 2019 10:15:46 +0000 (12:15 +0200)
Pass the ddrBackup variable around instead of making it a global variable.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Change-Id: Ib796181247712e464b77f5f8be5f851745727d74
---
NOTE: The camelcase is fixed in later patch.

drivers/staging/renesas/rcar/ddr/ddr_a/ddr_init_e3.c

index 71bd696c5a8c8284d6be456b9411bff698885645..df3bd74fa8b1d162f188ccda1f2e860ec1b624dd 100644 (file)
 #endif
 #endif
 
-/*******************************************************************************
- *  variables
- ******************************************************************************/
-uint32_t ddrBackup;
-
 /*******************************************************************************
  *  Initialize ddr
  ******************************************************************************/
@@ -820,7 +815,7 @@ if (pdqsr_ctl == 1) {
 } /*  init_ddr */
 
 /*  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"
@@ -1648,6 +1643,7 @@ int32_t rcar_dram_init(void)
     uint32_t failcount;
     uint32_t md = 0;
     uint32_t ddr = 0;
+    uint32_t ddrBackup;
 
     md = *((volatile uint32_t*)RST_MODEMR);
     ddr = (md & 0x00080000) >> 19;
@@ -1660,7 +1656,7 @@ int32_t rcar_dram_init(void)
     rcar_dram_get_boot_status(&ddrBackup);
 
     if (ddrBackup == DRAM_BOOT_STATUS_WARM) {
-        dataL = recovery_from_backup_mode(); /*  WARM boot */
+        dataL = recovery_from_backup_mode(ddrBackup); /*  WARM boot */
     } else {
         dataL = init_ddr();                  /*  COLD boot */
     } /*  ddrBackup */