Skip to content

Commit

Permalink
ARM: mvebu: clearfog: run-time selection of DT file
Browse files Browse the repository at this point in the history
Set the kernel device-tree file (fdtfile environment variable) based on
run-time detection of the platform.

Reviewed-by: Stefan Roese <[email protected]>
Signed-off-by: Baruch Siach <[email protected]>
  • Loading branch information
baruchsiach authored and stroese committed Jan 21, 2020
1 parent 7211fa6 commit 867572f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions arch/arm/mach-mvebu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ choice
config TARGET_CLEARFOG
bool "Support ClearFog"
select 88F6820
select BOARD_LATE_INIT

config TARGET_HELIOS4
bool "Support Helios4"
Expand Down
14 changes: 14 additions & 0 deletions board/solidrun/clearfog/clearfog.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 867572f

Please sign in to comment.