ARM: mvebu: clearfog: run-time selection of DT file
authorBaruch Siach <baruch@tkos.co.il>
Mon, 20 Jan 2020 12:20:13 +0000 (14:20 +0200)
committerStefan Roese <sr@denx.de>
Tue, 21 Jan 2020 14:56:15 +0000 (15:56 +0100)
Set the kernel device-tree file (fdtfile environment variable) based on
run-time detection of the platform.

Reviewed-by: Stefan Roese <sr@denx.de>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
arch/arm/mach-mvebu/Kconfig
board/solidrun/clearfog/clearfog.c

index fdd39685b75dbd512b80f2d302e482d98a5531f0..bc5eaa5a767962757bff081928c45d005022f745 100644 (file)
@@ -91,6 +91,7 @@ choice
 config TARGET_CLEARFOG
        bool "Support ClearFog"
        select 88F6820
+       select BOARD_LATE_INIT
 
 config TARGET_HELIOS4
        bool "Support Helios4"
index 8050cca55ab76a851f82493c93127049c2a9491c..e178b06cd34d3f19b452aafa62a3ad416c5daa90 100644 (file)
@@ -175,3 +175,17 @@ int board_eth_init(bd_t *bis)
        cpu_eth_init(bis); /* Built in controller(s) come first */
        return pci_eth_init(bis);
 }
+
+int board_late_init(void)
+{
+       cf_read_tlv_data();
+
+       if (sr_product_is(&cf_tlv_data, "Clearfog Base"))
+               env_set("fdtfile", "armada-388-clearfog-base.dtb");
+       else if (sr_product_is(&cf_tlv_data, "Clearfog GTR S4"))
+               env_set("fdtfile", "armada-385-clearfog-gtr-s4.dtb");
+       else if (sr_product_is(&cf_tlv_data, "Clearfog GTR L8"))
+               env_set("fdtfile", "armada-385-clearfog-gtr-l8.dtb");
+
+       return 0;
+}