Skip to contentSkip to conversation

No subject

PATCH New Manuel Reis 2 participants 5 messages Nov 25, 2020 – Dec 9, 2020 1 message not in the archive Arm STM32

lore
Share & tools
lore
#0 lore raw

Hi,

thanks for feedback.

sending new squash commit with grouped variables and code, and corrected git message for initial patch sent:

[PATCH] added check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART

hope this is better now.

regards,
manuel

#1 lore raw

PATCH 1/1 add 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 before using 'auto' i.e. bootable partition

Voids the need to set such partition as bootable to work with the 'dev:auto' tuple

---

 board/st/stm32mp1/stm32mp1.c | 5 +++++
 1 file changed, 5 insertions(+)
board/st/stm32mp1/stm32mp1.c +5 -0
index 03a19af930..09d9bbf07d 100644
@@ -827,7 +827,12 @@ 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;
 	static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+	if (strlen(env_dev_part) > 0)
+		return env_dev_part;
+
 	u32 bootmode = get_bootmode();
 
 	return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
Signature · 1 line
2.27.0

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

PATCH 1/1 add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition

Hi Manuel,

Quoted 32 lines · Patrick DELAUNAY

From: Manuel Reis <[email protected]>
Sent: mercredi 25 novembre 2020 11:16

Check whether user has explicitly defined device and partition where environment file will be located before using 'auto' i.e. bootable partition

Voids the need to set such partition as bootable to work with the 'dev:auto' tuple

---

  board/st/stm32mp1/stm32mp1.c | 5 +++++
  1 file changed, 5 insertions(+)
board/st/stm32mp1/stm32mp1.c +5 -1
@@ -827,7 +827,12 @@ 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;
  	static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+	if (strlen(env_dev_part) > 0)
+		return env_dev_part;
+
  	u32 bootmode = get_bootmode();
 
  	return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
--
Quoted 2 lines

2.27.0

In fact it just is V2 of previous patch

http://patchwork.ozlabs.org/project/uboot/patch/20201122151939.20005-1-mluis.reis at gmail.com/

Applied to u-boot-stm/master.

Thanks

Patrick

#4 lore raw

PATCH 1/1 add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition

Quoted 44 lines · Patrick DELAUNAY

Hi Manuel,

Quoted 36 lines · Patrick DELAUNAY

From: Manuel Reis <[email protected]>
Sent: mercredi 25 novembre 2020 11:16

Check whether user has explicitly defined device and partition where environment file will be located before using 'auto' i.e. bootable partition

Voids the need to set such partition as bootable to work with the 'dev:auto' tuple

---

? board/st/stm32mp1/stm32mp1.c | 5 +++++
? 1 file changed, 5 insertions(+)

(quoted diff) +0 -0

b/board/st/stm32mp1/stm32mp1.c index 03a19af930..09d9bbf07d 100644

board/st/stm32mp1/stm32mp1.c +5 -0
@@ -827,7 +827,12 @@ 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;
 ????? static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+??? if (strlen(env_dev_part) > 0)
+??????? return env_dev_part;
+
 ????? u32 bootmode = get_bootmode();
 ? ????? return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
Signature · 1 line
2.27.0

In fact it just is V2 of previous patch

http://patchwork.ozlabs.org/project/uboot/patch/20201122151939.20005-1-mluis.reis at gmail.com/

Quoted 9 lines

Applied to u-boot-stm/master.

Thanks

Patrick

To solve compilation issue when CONFIG_ENV_EXT4_DEVICE_AND_PART is not defined

I modify the patch before to apply it in u-boot-stm/master.

Regards

Patrick

------------------------- board/st/stm32mp1/stm32mp1.c
-------------------------
index 8a3ce0a6f5..d3cffdd770 100644
@@ -827,11 +827,22 @@ const char *env_ext4_get_intf(void)

?const char *env_ext4_get_dev_part(void)
?{
+??? static char *const env_dev_part =
+#ifdef CONFIG_ENV_EXT4_DEVICE_AND_PART
+??? ??? CONFIG_ENV_EXT4_DEVICE_AND_PART;
+#else
+??? ??? "";
+#endif
???? static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+??? if (strlen(env_dev_part) > 0)
+??? ??? return env_dev_part;
+
???? u32 bootmode = get_bootmode();

???? return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1]; ?}
+

#5 lore raw

PATCH 1/1 add check for ignored CONFIG_ENV_EXT4_DEVICE_AND_PART definition

Hi Patrick,

Apologies. Must have missed that.

Thanks
Manuel

Quoted 92 lines · Patrick DELAUNAY
Quoted 32 lines · Patrick DELAUNAY

Hi Manuel,

Quoted 29 lines · Patrick DELAUNAY

From: Manuel Reis <[email protected]>
Sent: mercredi 25 novembre 2020 11:16

Check whether user has explicitly defined device and partition where environment file will be located before using 'auto' i.e. bootable partition

Voids the need to set such partition as bootable to work with the 'dev:auto' tuple

---

  board/st/stm32mp1/stm32mp1.c | 5 +++++
  1 file changed, 5 insertions(+)
(quoted diff) +0 -0

b/board/st/stm32mp1/stm32mp1.c index 03a19af930..09d9bbf07d 100644

board/st/stm32mp1/stm32mp1.c +3 -0
@@ -827,7 +827,12 @@ 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;
      static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+    if (strlen(env_dev_part) > 0)
Quoted 10 lines
Quoted 7 lines
board/st/stm32mp1/stm32mp1.c +2 -1
+        return env_dev_part;
+
      u32 bootmode = get_bootmode();
        return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
--

2.27.0

In fact it just is V2 of previous patch

http://patchwork.ozlabs.org/project/uboot/patch/20201122151939.20005-1-mluis.reis at gmail.com/

Quoted 11 lines

Applied to u-boot-stm/master.

Thanks

Patrick

To solve compilation issue when CONFIG_ENV_EXT4_DEVICE_AND_PART is not defined

I modify the patch before to apply it in u-boot-stm/master.

Regards

Patrick

------------------------- board/st/stm32mp1/stm32mp1.c
-------------------------
index 8a3ce0a6f5..d3cffdd770 100644

board/st/stm32mp1/stm32mp1.c +11 -0
@@ -827,11 +827,22 @@ const char *env_ext4_get_intf(void)
 
  const char *env_ext4_get_dev_part(void)
  {
+    static char *const env_dev_part =
+#ifdef CONFIG_ENV_EXT4_DEVICE_AND_PART
+        CONFIG_ENV_EXT4_DEVICE_AND_PART;
+#else
+        "";
+#endif
      static char *const dev_part[] = {"0:auto", "1:auto", "2:auto"};
+
+    if (strlen(env_dev_part) > 0)
+        return env_dev_part;
+
      u32 bootmode = get_bootmode();
 
      return dev_part[(bootmode & TAMP_BOOT_INSTANCE_MASK) - 1];
  }
+