added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition
PATCH 1/1 added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition
Check whether user has explicitly defined device and partition where environment file will be located. Voids the need to set such partition as bootable to work with the 'dev:auto'
---
board/st/stm32mp1/stm32mp1.c | 5 +++++ 1 file changed, 5 insertions(+)
board/st/stm32mp1/stm32mp1.c +5 -0
@@ -868,6 +868,11 @@ const char *env_ext4_get_intf(void)const char *env_ext4_get_dev_part (void ) { +static char *const env_dev_part =CONFIG_ENV_EXT4_DEVICE_AND_PART ; + +if (strlen (env_dev_part) >0 ) +return env_dev_part; +static char *const dev_part[] = {"0:auto" ,"1:auto" ,"2:auto" };u32 bootmode =get_bootmode ();
Signature · 1 line
2.27.0
PATCH 1/1 added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition
Hi Manuel,
Thanks for this fix. Indeed, without it, I don't manage to get U-Boot to use the EXT4 partition for the environment on stm32mp1 with the below configuration:
CONFIG_ENV_IS_IN_EXT4=yCONFIG_ENV_EXT4_INTERFACE="mmc"CONFIG_ENV_EXT4_DEVICE_AND_PART="0:4"
Quoted 18 lines · Manuel Reis
Check whether user has explicitly defined device and partition where environment file will be located. Voids the need to set such partition as bootable to work with the 'dev:auto'
Signed-off-by Manuel Reis <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Patrice Chotard <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 5 +++++ 1 file changed, 5 insertions(+)board/st/stm32mp1/stm32mp1.c +0
-0@@ -868,6 +868,11 @@ const char *env_ext4_get_intf(void)
board/st/stm32mp1/stm32mp1.c const char *env_ext4_get_intf(void) · line 878
Quoted 10 lines
board/st/stm32mp1/stm32mp1.c +5
-0const char *env_ext4_get_dev_part (void ) { +static char *const env_dev_part =CONFIG_ENV_EXT4_DEVICE_AND_PART ; + +if (strlen (env_dev_part) >0 ) +return env_dev_part; +static char *const dev_part[] = {"0:auto" ,"1:auto" ,"2:auto" };u32 bootmode =get_bootmode ();
Signature · 3 lines
Michael Opdenacker, CEO, Bootlin Embedded Linux and Kernel engineering https://bootlin.com
PATCH 1/1 added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition
In reply to Manuel ReisHi,
Quoted 32 lines
From: Manuel Reis <[email protected]>
Sent: dimanche 22 novembre 2020 16:20Check whether user has explicitly defined device and partition where environment file will be located. Voids the need to set such partition as bootable to work with the 'dev:auto'
Signed-off-by Manuel Reis <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Patrice Chotard <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 5 +++++ 1 file changed, 5 insertions(+)board/st/stm32mp1/stm32mp1.c +5
-1@@ -868,6 +868,11 @@ const char *env_ext4_get_intf(void)const char *env_ext4_get_dev_part (void ) { +static char *const env_dev_part =CONFIG_ENV_EXT4_DEVICE_AND_PART ; + +if (strlen (env_dev_part) >0 ) +return env_dev_part; +static char *const dev_part[] = {"0:auto" ,"1:auto" ,"2:auto" };u32 bootmode =get_bootmode (); --
Quoted 1 line
2.27.0
Behavior seems ok, but patch mixes code and variables. can you move the code part after the variables definitions ?
const char *env_ext4_get_dev_part(void) {
static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; u32 bootmode = get_bootmode();
+ static char *const env_dev_part =
CONFIG_ENV_EXT4_DEVICE_AND_PART;
+
+ if (strlen(env_dev_part) > 0)
+ return env_dev_part;
+
Regards
PAtrick
PATCH 1/1 added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition
Hi,
thanks for the feedback.
Just sent a new corrected patch with fixed commit message title:
[PATCH] add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition.
regards,
Manuel
Quoted 55 lines · Patrick DELAUNAY
Hi,
Quoted 34 lines
From: Manuel Reis <[email protected]>
Sent: dimanche 22 novembre 2020 16:20Check whether user has explicitly defined device and partition
where environment
file will be located. Voids the need to set such partition as
bootable to work with
the 'dev:auto'Signed-off-by Manuel Reis <[email protected]>Cc Patrick Delaunay <[email protected]>Cc Patrice Chotard <[email protected]>---
board/st/stm32mp1/stm32mp1.c | 5 +++++ 1 file changed, 5 insertions(+)diff --git
a/board/st/stm32mp1/stm32mp1.cb/board/st/stm32mp1/stm32mp1.c
index4553329b25..4dda70740d100644
---a/board/st/stm32mp1/stm32mp1.c
+++b/board/st/stm32mp1/stm32mp1.c
@@ -868,6 +868,11 @@ const char*env_ext4_get_intf(void)const char
*env_ext4_get_dev_part(void){
+ static char *constenv_dev_part=
CONFIG_ENV_EXT4_DEVICE_AND_PART;
+
+ if (strlen(env_dev_part)> 0)
+ returnenv_dev_part;
+
static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; u32 bootmode =get_bootmode();Quoted 2 lines
--
2.27.0Behavior seems ok, but patch mixes code and variables. can you move the code part after the variables definitions ?
const char
*env_ext4_get_dev_part(void){
static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"}; u32 bootmode =get_bootmode();
+ static char *constenv_dev_part=
CONFIG_ENV_EXT4_DEVICE_AND_PART;
+
+ if (strlen(env_dev_part)> 0)
+ returnenv_dev_part;
+Regards
PAtrick