u-boot/arch/arm/mach-uniphier
Masahiro Yamada 3e9952be23 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>
2017-01-29 20:59:08 +09:00
..
arm32 ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
arm64 ARM: uniphier: make SPL optional for ARVv8 SoCs 2017-01-22 15:11:12 +09:00
bcu ARM: uniphier: make BCU init into void function 2017-01-17 09:00:40 +09:00
boot-mode ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
clk ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
debug-uart ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
dram ARM: uniphier: shrink arrays of DDR-PHY parameters for LD20 SoC 2017-01-29 20:59:08 +09:00
sbc ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
board_init.c ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
board_late_init.c ARM: uniphier: adjust fdt_file environment handling to latest Linux 2016-10-29 17:01:40 +09:00
boards.c ARM: dts: uniphier: sync DT with latest Linux 2016-10-18 14:06:46 +09:00
cpu-info.c ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
debug.h ARM: uniphier: add PSCI support for UniPhier ARMv7 SoCs 2016-08-11 17:58:06 +09:00
dram_init.c ARM: uniphier: detect RAM size by decoding HW register instead of DT 2017-01-29 20:59:08 +09:00
init.h ARM: uniphier: detect RAM size by decoding HW register instead of DT 2017-01-29 20:59:08 +09:00
Kconfig ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
Makefile ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
memconf.c ARM: uniphier: replace <linux/err.h> with <linux/errno.h> 2017-01-22 15:32:56 +09:00
micro-support-card.c ARM: uniphier: refactor Support Card init code 2017-01-17 09:00:40 +09:00
micro-support-card.h ARM: uniphier: refactor Support Card init code 2017-01-17 09:00:40 +09:00
pinctrl-glue.c ARM: uniphier: replace <linux/err.h> with <linux/errno.h> 2017-01-22 15:32:56 +09:00
reset.c ARM: uniphier: support system reset functionality for PSCI 2016-08-28 13:09:19 +09:00
sc-regs.h ARM: uniphier: add clock/reset settings for xHCI of ProXstream2 2016-07-24 00:44:55 +09:00
sc64-regs.h ARM: uniphier: enable clocks to MIO/STDMAC on LD11 if USB is enabled 2016-10-29 17:24:30 +09:00
sg-regs.h ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
soc-info.c ARM: uniphier: simplify SoC ID get function 2017-01-22 16:49:27 +09:00
soc-info.h ARM: uniphier: add PXs3 SoC support 2017-01-22 16:49:34 +09:00
spl_board_init.c ARM: uniphier: add macro to generate SoC data look-up function 2017-01-22 16:49:33 +09:00