]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: at91sam9x5: add environment var for cpu type
authorEugen Hristev <eugen.hristev@microchip.com>
Mon, 8 Oct 2018 06:54:27 +0000 (09:54 +0300)
committerTom Rini <trini@konsulko.com>
Mon, 22 Oct 2018 13:18:49 +0000 (09:18 -0400)
When booting and CPU is detected from cpuid, we also need an environment
variable that will be used in boot commands to load the proper devicetree.

Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com>
board/atmel/at91sam9x5ek/at91sam9x5ek.c
board/atmel/common/board.c

index 3bb5cd667e54af202ca09132d28916f26ffb4aa2..0856786a0f8a32012044365c6f2967950234a8b5 100644 (file)
@@ -20,6 +20,9 @@ DECLARE_GLOBAL_DATA_PTR;
 /*
  * Miscelaneous platform dependent initialisations
  */
+
+void at91_prepare_cpu_var(void);
+
 #ifdef CONFIG_CMD_NAND
 static void at91sam9x5ek_nand_hw_init(void)
 {
@@ -85,6 +88,7 @@ int board_late_init(void)
 #ifdef CONFIG_DM_VIDEO
        at91_video_show_board_info();
 #endif
+       at91_prepare_cpu_var();
        return 0;
 }
 #endif
index 8f9b5e137c413b98711a6d25844d76b18bbbc572..fc300a4210bdde3ec98ecb49888f4c770d13f5b0 100644 (file)
@@ -13,6 +13,8 @@
 #define AT91_PDA_EEPROM_ID_LENGTH              5
 #define AT91_PDA_EEPROM_DEFAULT_BUS            0
 
+char *get_cpu_name(void);
+
 void dummy(void)
 {
 }
@@ -66,3 +68,8 @@ void at91_pda_detect(void)
 {
 }
 #endif
+
+void at91_prepare_cpu_var(void)
+{
+       env_set("cpu", get_cpu_name());
+}