[PATCH 1/2] board: stm32mp1: convert to livetree

Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com ---
board/st/stm32mp1/stm32mp1.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 07b1a63db7..700ff9ca07 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -82,11 +82,6 @@ #define SYSCFG_PMCSETR_ETH_SEL_RGMII BIT(21) #define SYSCFG_PMCSETR_ETH_SEL_RMII BIT(23)
-/* - * Get a global data pointer - */ -DECLARE_GLOBAL_DATA_PTR; - #define USB_LOW_THRESHOLD_UV 200000 #define USB_WARNING_LOW_THRESHOLD_UV 660000 #define USB_START_LOW_THRESHOLD_UV 1230000 @@ -116,8 +111,8 @@ int checkboard(void) mode = "basic"; }
- fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", - &fdt_compat_len); + fdt_compat = ofnode_get_property(ofnode_root(), "compatible", + &fdt_compat_len);
log_info("Board: stm32mp1 in %s mode (%s)\n", mode, fdt_compat && fdt_compat_len ? fdt_compat : ""); @@ -690,8 +685,8 @@ int board_late_init(void) int buf_len;
if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) { - fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", - &fdt_compat_len); + fdt_compat = ofnode_get_property(ofnode_root(), "compatible", + &fdt_compat_len); if (fdt_compat && fdt_compat_len) { if (strncmp(fdt_compat, "st,", 3) != 0) { env_set("board_name", fdt_compat);

Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com ---
board/engicam/stm32mp1/stm32mp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/board/engicam/stm32mp1/stm32mp1.c b/board/engicam/stm32mp1/stm32mp1.c index 20d8603c78..0a3e580f5b 100644 --- a/board/engicam/stm32mp1/stm32mp1.c +++ b/board/engicam/stm32mp1/stm32mp1.c @@ -14,8 +14,6 @@ #include <asm/arch/sys_proto.h> #include <power/regulator.h>
-DECLARE_GLOBAL_DATA_PTR; - int checkboard(void) { char *mode; @@ -28,8 +26,8 @@ int checkboard(void) mode = "basic";
printf("Board: stm32mp1 in %s mode", mode); - fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible", - &fdt_compat_len); + fdt_compat = ofnode_get_property(ofnode_root(), "compatible", + &fdt_compat_len); if (fdt_compat && fdt_compat_len) printf(" (%s)", fdt_compat); puts("\n");

Hi Patrick
On 5/19/22 09:07, Patrick Delaunay wrote:
Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com
board/engicam/stm32mp1/stm32mp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/board/engicam/stm32mp1/stm32mp1.c b/board/engicam/stm32mp1/stm32mp1.c index 20d8603c78..0a3e580f5b 100644 --- a/board/engicam/stm32mp1/stm32mp1.c +++ b/board/engicam/stm32mp1/stm32mp1.c @@ -14,8 +14,6 @@ #include <asm/arch/sys_proto.h> #include <power/regulator.h>
-DECLARE_GLOBAL_DATA_PTR;
int checkboard(void) { char *mode; @@ -28,8 +26,8 @@ int checkboard(void) mode = "basic";
printf("Board: stm32mp1 in %s mode", mode);
- fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
&fdt_compat_len);
- fdt_compat = ofnode_get_property(ofnode_root(), "compatible",
if (fdt_compat && fdt_compat_len) printf(" (%s)", fdt_compat); puts("\n");&fdt_compat_len);
Reviewed-by: Patrice Chotard patrice.chotard@foss.st.com
Thanks Patrice

Hi,
On 5/19/22 09:07, Patrick Delaunay wrote:
Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com
board/engicam/stm32mp1/stm32mp1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
Applied to u-boot-stm/next, thanks!
Regards Patrick

Hi Patrick
On 5/19/22 09:07, Patrick Delaunay wrote:
Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com
board/st/stm32mp1/stm32mp1.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
diff --git a/board/st/stm32mp1/stm32mp1.c b/board/st/stm32mp1/stm32mp1.c index 07b1a63db7..700ff9ca07 100644 --- a/board/st/stm32mp1/stm32mp1.c +++ b/board/st/stm32mp1/stm32mp1.c @@ -82,11 +82,6 @@ #define SYSCFG_PMCSETR_ETH_SEL_RGMII BIT(21) #define SYSCFG_PMCSETR_ETH_SEL_RMII BIT(23)
-/*
- Get a global data pointer
- */
-DECLARE_GLOBAL_DATA_PTR;
#define USB_LOW_THRESHOLD_UV 200000 #define USB_WARNING_LOW_THRESHOLD_UV 660000 #define USB_START_LOW_THRESHOLD_UV 1230000 @@ -116,8 +111,8 @@ int checkboard(void) mode = "basic"; }
- fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
&fdt_compat_len);
fdt_compat = ofnode_get_property(ofnode_root(), "compatible",
&fdt_compat_len);
log_info("Board: stm32mp1 in %s mode (%s)\n", mode, fdt_compat && fdt_compat_len ? fdt_compat : "");
@@ -690,8 +685,8 @@ int board_late_init(void) int buf_len;
if (IS_ENABLED(CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG)) {
fdt_compat = fdt_getprop(gd->fdt_blob, 0, "compatible",
&fdt_compat_len);
fdt_compat = ofnode_get_property(ofnode_root(), "compatible",
if (fdt_compat && fdt_compat_len) { if (strncmp(fdt_compat, "st,", 3) != 0) { env_set("board_name", fdt_compat);&fdt_compat_len);
Reviewed-by: Patrice Chotard patrice.chotard@foss.st.com
Thanks Patrice

Hi,
On 5/19/22 09:07, Patrick Delaunay wrote:
Replace gd->fdt_blob access with fdt_getprop() function to the function ofnode_get_property() to support a live tree.
Signed-off-by: Patrick Delaunay patrick.delaunay@foss.st.com
board/st/stm32mp1/stm32mp1.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-)
Applied to u-boot-stm/next, thanks!
Regards Patrick
participants (3)
-
Patrice CHOTARD
-
Patrick DELAUNAY
-
Patrick Delaunay