summaryrefslogtreecommitdiff
path: root/include/configs/uniphier.h
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-27 21:53:43 (GMT)
committerMasahiro Yamada <yamada.masahiro@socionext.com>2017-01-29 11:59:08 (GMT)
commit3e9952be23e1fdc8b576dfeed80e442d3045cd87 (patch)
tree992f14233ca580bc72197974c647cdec6fb8d924 /include/configs/uniphier.h
parent773f5f63dc0db5e39b4782947e761479ecf1bef2 (diff)
downloadu-boot-3e9952be23e1fdc8b576dfeed80e442d3045cd87.tar.xz
ARM: uniphier: detect RAM size by decoding HW register instead of DT
U-Boot needs to set up available memory area(s) in dram_init() and dram_init_banksize(). It is platform-dependent how to detect the memory banks. Currently, UniPhier adopts the memory banks _alleged_ by DT. This is based on the assumption that users bind a correct DT in their build process. Come to think of it, the DRAM controller has already been set up before U-Boot is entered (because U-Boot runs on DRAM). So, the DRAM controller setup register seems a more reliable source of any information about DRAM stuff. The DRAM banks are initialized by preliminary firmware (SPL, ARM Trusted Firmware BL2, or whatever), so this means the source of the reliability is shifted from Device Tree to such early-stage firmware. However, if the DRAM controller is wrongly configured, the system will crash. If your system is running, the DRAM setup register is very likely to provide the correct DRAM mapping. Decode the SG_MEMCONF register to get the available DRAM banks. The dram_init() and dram_init_banksize() need similar decoding. It would be nice if dram_init_banksize() could reuse the outcome of dram_init(), but global variables are unavailable at this stage because the .bss section is available only after the relocation. As a result, SG_MEMCONF must be checked twice, but a new helper uniphier_memconf_decode() will help to avoid code duplication. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Diffstat (limited to 'include/configs/uniphier.h')
-rw-r--r--include/configs/uniphier.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/configs/uniphier.h b/include/configs/uniphier.h
index c991b2d..a6deda8 100644
--- a/include/configs/uniphier.h
+++ b/include/configs/uniphier.h
@@ -236,7 +236,7 @@
#define CONFIG_SYS_BOOTMAPSZ 0x20000000
#define CONFIG_SYS_SDRAM_BASE 0x80000000
-#define CONFIG_NR_DRAM_BANKS 2
+#define CONFIG_NR_DRAM_BANKS 3
/* for LD20; the last 64 byte is used for dynamic DDR PHY training */
#define CONFIG_SYS_MEM_TOP_HIDE 64