[U-Boot] [PATCH v2 3/3] board: stm32: Add set_env_soc_name() in board_late_init()
patrice.chotard at st.com
patrice.chotard at st.com
Mon Feb 5 10:33:27 UTC 2018
From: Patrice Chotard <patrice.chotard at st.com>
Add set_env_soc_name() call in board_late_init() to set environment
variable "soc_name" with the name of current STM32 SoC.
Signed-off-by: Christophe Priouzeau <christophe.priouzeau at st.com>
Signed-off-by: Patrice Chotard <patrice.chotard at st.com>
---
v2: _ None
board/st/stm32f429-discovery/stm32f429-discovery.c | 7 +++++++
board/st/stm32f429-evaluation/stm32f429-evaluation.c | 7 +++++++
board/st/stm32f469-discovery/stm32f469-discovery.c | 7 +++++++
board/st/stm32f746-disco/stm32f746-disco.c | 2 ++
board/st/stm32h743-disco/stm32h743-disco.c | 4 ++++
board/st/stm32h743-eval/stm32h743-eval.c | 4 ++++
6 files changed, 31 insertions(+)
diff --git a/board/st/stm32f429-discovery/stm32f429-discovery.c b/board/st/stm32f429-discovery/stm32f429-discovery.c
index 3d90218faa61..44dcca5be508 100644
--- a/board/st/stm32f429-discovery/stm32f429-discovery.c
+++ b/board/st/stm32f429-discovery/stm32f429-discovery.c
@@ -60,6 +60,13 @@ int board_init(void)
return 0;
}
+int board_late_init(void)
+{
+ set_env_soc_name();
+
+ return 0;
+}
+
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
diff --git a/board/st/stm32f429-evaluation/stm32f429-evaluation.c b/board/st/stm32f429-evaluation/stm32f429-evaluation.c
index 25e020784d62..9041dca5937b 100644
--- a/board/st/stm32f429-evaluation/stm32f429-evaluation.c
+++ b/board/st/stm32f429-evaluation/stm32f429-evaluation.c
@@ -54,6 +54,13 @@ int board_init(void)
return 0;
}
+int board_late_init(void)
+{
+ set_env_soc_name();
+
+ return 0;
+}
+
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
diff --git a/board/st/stm32f469-discovery/stm32f469-discovery.c b/board/st/stm32f469-discovery/stm32f469-discovery.c
index 36f7b2e8e176..263d995c1534 100644
--- a/board/st/stm32f469-discovery/stm32f469-discovery.c
+++ b/board/st/stm32f469-discovery/stm32f469-discovery.c
@@ -54,6 +54,13 @@ int board_init(void)
return 0;
}
+int board_late_init(void)
+{
+ set_env_soc_name();
+
+ return 0;
+}
+
#ifdef CONFIG_MISC_INIT_R
int misc_init_r(void)
{
diff --git a/board/st/stm32f746-disco/stm32f746-disco.c b/board/st/stm32f746-disco/stm32f746-disco.c
index 8da70281f976..d259bb14fee3 100644
--- a/board/st/stm32f746-disco/stm32f746-disco.c
+++ b/board/st/stm32f746-disco/stm32f746-disco.c
@@ -115,6 +115,8 @@ int board_late_init(void)
struct gpio_desc gpio = {};
int node;
+ set_env_soc_name();
+
node = fdt_node_offset_by_compatible(gd->fdt_blob, 0, "st,led1");
if (node < 0)
return -1;
diff --git a/board/st/stm32h743-disco/stm32h743-disco.c b/board/st/stm32h743-disco/stm32h743-disco.c
index 226b7045d278..d4ad9230c06e 100644
--- a/board/st/stm32h743-disco/stm32h743-disco.c
+++ b/board/st/stm32h743-disco/stm32h743-disco.c
@@ -8,6 +8,8 @@
#include <common.h>
#include <dm.h>
+#include <asm/arch/stm32.h>
+
DECLARE_GLOBAL_DATA_PTR;
int dram_init(void)
@@ -46,6 +48,8 @@ u32 get_board_rev(void)
int board_late_init(void)
{
+ set_env_soc_name();
+
return 0;
}
diff --git a/board/st/stm32h743-eval/stm32h743-eval.c b/board/st/stm32h743-eval/stm32h743-eval.c
index 226b7045d278..d4ad9230c06e 100644
--- a/board/st/stm32h743-eval/stm32h743-eval.c
+++ b/board/st/stm32h743-eval/stm32h743-eval.c
@@ -8,6 +8,8 @@
#include <common.h>
#include <dm.h>
+#include <asm/arch/stm32.h>
+
DECLARE_GLOBAL_DATA_PTR;
int dram_init(void)
@@ -46,6 +48,8 @@ u32 get_board_rev(void)
int board_late_init(void)
{
+ set_env_soc_name();
+
return 0;
}
--
1.9.1
More information about the U-Boot
mailing list