diff options
author | Wu, Josh <Josh.wu@atmel.com> | 2015-08-19 19:11:19 +0800 |
---|---|---|
committer | Andreas Bießmann <andreas.devel@googlemail.com> | 2015-08-21 15:47:04 +0200 |
commit | 89a3658ac02873f32d7ad0a3b1d3c5308c5e2528 (patch) | |
tree | 74fee6fea163498a5ad21021461edcf3388bd676 /board/atmel | |
parent | 372ca03fcd3cc777677d683336e9965c02fc42f2 (diff) | |
download | u-boot-imx-89a3658ac02873f32d7ad0a3b1d3c5308c5e2528.zip u-boot-imx-89a3658ac02873f32d7ad0a3b1d3c5308c5e2528.tar.gz u-boot-imx-89a3658ac02873f32d7ad0a3b1d3c5308c5e2528.tar.bz2 |
ARM: at91: sama5d3xek: use a $dtb_name to load dtb
Since sama5d3xek boards has different type of dtb blobs, so we need to detect
the cpu type in runtime.
So we add a new variable $dtb_name. if $dtb_name is not defined, we just use
at91-${board_name}.dtb
as the $dtb_name. Otherwise, we will just load the dtb with
$dtb_name.
For sama5d3xek, we will detect cpu type and make up $dtb_name in
runtime.
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Diffstat (limited to 'board/atmel')
-rw-r--r-- | board/atmel/sama5d3xek/sama5d3xek.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/board/atmel/sama5d3xek/sama5d3xek.c b/board/atmel/sama5d3xek/sama5d3xek.c index 2bd436a..7c95f33 100644 --- a/board/atmel/sama5d3xek/sama5d3xek.c +++ b/board/atmel/sama5d3xek/sama5d3xek.c @@ -15,6 +15,7 @@ #include <asm/arch/gpio.h> #include <asm/arch/clk.h> #include <lcd.h> +#include <linux/ctype.h> #include <atmel_hlcdc.h> #include <atmel_mci.h> #include <phy.h> @@ -369,6 +370,25 @@ void spi_cs_deactivate(struct spi_slave *slave) } #endif /* CONFIG_ATMEL_SPI */ +#ifdef CONFIG_BOARD_LATE_INIT +int board_late_init(void) +{ +#ifdef CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG + const int MAX_STR_LEN = 32; + char name[MAX_STR_LEN], *p; + int i; + + strncpy(name, get_cpu_name(), MAX_STR_LEN); + for (i = 0, p = name; (*p) && (i < MAX_STR_LEN); p++, i++) + *p = tolower(*p); + + strcat(name, "ek.dtb"); + setenv("dtb_name", name); +#endif + return 0; +} +#endif + /* SPL */ #ifdef CONFIG_SPL_BUILD void spl_board_init(void) |