u-boot/arch/arm
Michal Simek 52ff1626cf xilinx: common: Enabling generic function for DT reselection
U-Boot support board detection at run time and based on it change DT.
This feature is implemented for SOM Kria platforms which contain two
eeproms which contain information about SOM module and CC (Carrier card).
Full U-Boot starts with minimal DT file defined by
CONFIG_DEFAULT_DEVICE_TREE which is available in multi DTB fit image.
It is using default setup of board_name variable initializaed to
DEVICE_TREE which corresponds to CONFIG_DEFAULT_DEVICE_TREE option.

When DTB_RESELECT is enabled board_detection() is called. Keep it your mind
that this code is called before relocation. board_detection() is calling
xilinx_read_eeprom() which fills board_info (xilinx_board_description)
structure which are parsed in board_name_decode().
Based on DT configuration and amount of nvmemX aliases name of the board is
composed by concatenating CONFIG_SYS_BOARD "-" <board_name> "-rev"
<board_revision> "-" <cc_name> "-rev" <cc_revision>.

If CC is not present or more are available it keeps going.

When board name is composed and returned from board_name_decode() it is
assigned to board_name variable which is used by
board_fit_config_name_match() which is called via fdtdec_setup() when it
goes over config options in multi dtb FIT image.

From practical point of view multi DTB image is key point here which has to
contain configs for detected combinations. Unfortunately as of now they
have to be full DTBs and DTBOs are not supported.

That's why configuration like:
config_X {
	description = "zynqmp-board-cc";
	fdt = "board", "cc";
};

needs to be squashed together with:
fdtoverlay -o zynqmp-board-cc -i arch/arm/dts/zynqmp-board.dtb \
arch/arm/dts/zynqmp-cc.dtbo

and only one dtb is in fit:
config_X {
	description = "zynqmp-board-cc";
	fdt = "board-cc";
};

For creating multi DTBs fit image use mkimage -E, e.g.:
mkimage -E -f all.its all.dtb

When DTB_RESELECT is enabled xilinx_read_eeprom() is called before
relocation and it uses calloc for getting a buffer. Because this is dynamic
memory it is not relocated that's why xilinx_read_eeprom() is called again
as the part of board_init(). This second read with calloc buffer placed in
proper position board_late_init_xilinx() can setup u-boot variables as
before.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
2021-08-26 08:14:43 +02:00
..
cpu global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
dts xilinx: common: Enabling generic function for DT reselection 2021-08-26 08:14:43 +02:00
include Merge https://source.denx.de/u-boot/custodians/u-boot-sunxi 2021-07-31 20:51:24 -04:00
lib global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
mach-aspeed common: Drop asm/global_data.h from common header 2021-02-02 15:33:42 -05:00
mach-at91 arm: Remove at91rm9200ek boards 2021-07-07 22:22:42 -04:00
mach-bcm283x reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-bcmstb
mach-cortina
mach-davinci reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-exynos Merge https://source.denx.de/u-boot/custodians/u-boot-samsung 2021-08-03 09:07:01 -04:00
mach-highbank
mach-imx global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
mach-integrator
mach-ipq40xx dm: treewide: Rename auto_alloc_size members to be shorter 2020-12-13 08:00:25 -07:00
mach-k3 arm: mach-k3: Cleanup common start_non_linux_remote_cores() 2021-07-27 11:00:44 +05:30
mach-keystone global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
mach-kirkwood global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
mach-lpc32xx arm: lpc32xx: add EA LPC3250 DevKitv2 board support 2021-07-06 14:12:14 -04:00
mach-mediatek arm: use the correct prototype for reset_cpu function 2021-07-28 19:30:22 -04:00
mach-meson arm: meson: remove static ethernet link setup 2021-04-06 11:10:29 +02:00
mach-mvebu arm: mvebu: Load U-Boot proper binary in SPL code based on kwbimage header 2021-07-31 09:59:58 +02:00
mach-nexell global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
mach-octeontx reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-octeontx2 reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-omap2 i2c: Rename SPL/TPL_I2C_SUPPORT to I2C 2021-07-28 14:29:37 -04:00
mach-orion5x reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-owl reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-qemu qemu: arm: Initialise virtio devices in board_late_init 2020-12-31 14:41:31 +01:00
mach-rmobile ARM: rmobile: Align CPU: print with other prints 2021-07-20 23:33:54 +02:00
mach-rockchip Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISC 2021-07-28 14:29:37 -04:00
mach-s5pc1xx
mach-snapdragon global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
mach-socfpga global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
mach-sti
mach-stm32 Rename DRIVERS_MISC_SUPPORT to DRIVERS_MISC 2021-07-28 14:29:37 -04:00
mach-stm32mp global: Convert simple_strtoul() with decimal to dectoul() 2021-08-02 13:32:14 -04:00
mach-sunxi i2c: Rename SPL/TPL_I2C_SUPPORT to I2C 2021-07-28 14:29:37 -04:00
mach-tegra Rename GPIO_SUPPORT to GPIO 2021-07-28 14:29:36 -04:00
mach-u8500 board: stemmy: Copy atags for booting downstream/vendor kernel 2021-07-14 16:48:12 -04:00
mach-uniphier global: Convert simple_strtoul() with hex to hextoul() 2021-08-02 13:32:14 -04:00
mach-versal soc: xilinx: versal: Add soc_xilinx_versal driver 2021-08-26 08:08:11 +02:00
mach-versatile
mach-zynq reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
mach-zynqmp xilinx: zynqmp: Generate different u-boot.itb for MULTI_DTB_FIT 2021-08-26 08:14:43 +02:00
mach-zynqmp-r5 reset: Remove addr parameter from reset_cpu() 2021-03-02 14:03:02 -05:00
thumb1/include/asm/proc-armv
config.mk ARM: don't use --gc-sections with LTO when using private libgcc 2021-05-24 14:21:30 -04:00
Kconfig soc: xilinx: versal: Add soc_xilinx_versal driver 2021-08-26 08:08:11 +02:00
Kconfig.debug
Makefile