Skip to contentSkip to conversation

board: at91sam9x5: add environment var for cpu type

PATCH In review Eugen Hristev 2 participants 2 messages Oct 8, 2018 – Oct 22, 2018 Arm/Microchip (AT91) SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board: at91sam9x5: add environment var for cpu type

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.

---
 board/atmel/at91sam9x5ek/at91sam9x5ek.c | 4 ++++
 board/atmel/common/board.c              | 7 +++++++
 2 files changed, 11 insertions(+)
board/atmel/at91sam9x5ek/at91sam9x5ek.c +4 -0
index 3bb5cd6..0856786 100644
@@ -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
board/atmel/common/board.c +7 -0
index 8f9b5e1..fc300a4 100644
@@ -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());
+}
Signature · 1 line
2.7.4
#1 lore raw
Quoted 4 lines · Eugen Hristev

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.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20181022/c713e402/attachment.sig>