u-boot/arch/arm/mach-uniphier
Masahiro Yamada 34ded87506 ARM: uniphier: detect register base addresses run-time
Until the last SoC, the register addresses have been hard-coded because
they are always constant. For a planned new SoC, the register bases
will be completely changed. I insist on supporting multiple SoCs/boards
by a single defconfig (uniphier_v8_defconfig) since duplicating similar
defconfig files is a maintenance burden. The base addresses must be
fixed-up at run-time somehow.

Previously, the board init code identified the SoC by reading out the
SG_REVISION register. This is much easier than parsing DT.

You cannot do it any more because the base address of SG will be
changed. The SG_REVISION register exists to read out the SoC ID, but
you never know its address before identifying the SoC. Oh well.

So, the possible solution is to parse the DT, and find out the node
with "*-soc-glue" compatible string. Then, sg_base is set to the value
of the "reg" property. The sc_base is set up likewise.

It is worth noting a pit-fall. Having sc_base and sg_base in the global
scope will make the life easier, but the global variables are poorly
supported before the relocation. In fact, the .bss section overwraps
with DT. Allocating them in the .bss section would break DT. So, I gave
dummy initializers to assign them in the .data section.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2019-07-10 22:42:03 +09:00
..
arm32 ARM: uniphier: de-couple SC macros into base address and offset 2019-07-10 22:42:02 +09:00
arm64 SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
bcu SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
boot-device ARM: uniphier: de-couple SG macros into base address and offset 2019-07-10 22:42:00 +09:00
clk ARM: uniphier: de-couple SC macros into base address and offset 2019-07-10 22:42:02 +09:00
debug-uart ARM: uniphier: de-couple SC macros into base address and offset 2019-07-10 22:42:02 +09:00
dram SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
sbc ARM: uniphier: make boot_is_swapped() code optional 2019-07-10 22:41:58 +09:00
base-address.c ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
base-address.h ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
board_init.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
board_late_init.c ARM: uniphier: detect SD boot mode 2019-07-10 22:41:59 +09:00
boards.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
cpu-info.c ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
debug.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
dram_init.c ARM: uniphier: de-couple SG macros into base address and offset 2019-07-10 22:42:00 +09:00
fdt-fixup.c ARM: uniphier: support fdt_fixup_mtdparts 2018-07-25 08:47:53 +09:00
init.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
Kconfig Kconfig: Sort bool, default, select and imply options 2018-07-30 07:18:48 -04:00
Makefile ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
memconf.c ARM: uniphier: de-couple SG macros into base address and offset 2019-07-10 22:42:00 +09:00
micro-support-card.c ARM: uniphier: check DT to determine whether to use support card 2019-07-10 22:41:56 +09:00
micro-support-card.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mmc-boot-mode.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
mmc-first-dev.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
pinctrl-glue.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
reset.c ARM: uniphier: de-couple SC macros into base address and offset 2019-07-10 22:42:02 +09:00
sc-regs.h ARM: uniphier: de-couple SC macros into base address and offset 2019-07-10 22:42:02 +09:00
sc64-regs.h ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
sg-regs.h ARM: uniphier: detect register base addresses run-time 2019-07-10 22:42:03 +09:00
soc-info.c ARM: uniphier: de-couple SG macros into base address and offset 2019-07-10 22:42:00 +09:00
soc-info.h SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spl_board_init.c SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00