<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hello Patrick,</p>
<p>sorry for the late answer but I'll try to explain you my issue.<br>
</p>
<div class="moz-cite-prefix">On 10/29/19 9:38 AM, Patrick DELAUNAY wrote:<br>
</div>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">Hi Bartosz,

Please ad get maintainers or tools/patman to sent patch for stm32mp1 platform.</pre>
</blockquote>
Ok, I'll remember about that.<br>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">From: U-Boot <a class="moz-txt-link-rfc2396E" href="mailto:u-boot-bounces@lists.denx.de"><u-boot-bounces@lists.denx.de></a> On Behalf Of Bartosz Bilas
Sent: dimanche 27 octobre 2019 15:46
To: <a class="moz-txt-link-abbreviated" href="mailto:u-boot@lists.denx.de">u-boot@lists.denx.de</a>
Subject: [U-Boot] [PATCH] stm32mp1: configs: fix checking the presence of an
environment

Execute env check command within extra env settings section instead of bootcmd
whereby we are able to mount rootfs partition from sd card properly.

Signed-off-by: Bartosz Bilas <a class="moz-txt-link-rfc2396E" href="mailto:bartosz.bilas@hotmail.com"><bartosz.bilas@hotmail.com></a>
---
 include/configs/stm32mp1.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/configs/stm32mp1.h b/include/configs/stm32mp1.h index
988992b336..cadc0358fd 100644
--- a/include/configs/stm32mp1.h
+++ b/include/configs/stm32mp1.h
@@ -115,7 +115,6 @@
        "if test ${boot_device} = serial || test ${boot_device} = usb;" \
        "then stm32prog ${boot_device} ${boot_instance}; " \
        "else " \
-               "run env_check;" \
                "if test ${boot_device} = mmc;" \
                "then env set boot_targets \"mmc${boot_instance}\"; fi;" \
                "if test ${boot_device} = nand;" \
@@ -160,6 +159,7 @@
        "initrd_high=0xffffffff\0" \
        "altbootcmd=run bootcmd\0" \
        "env_default=1\0" \
+   "run env_check;" \
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
It is not a correct place, this define CONFIG_EXTRA_ENV_SETTINGS only the default environment (only set env variable).
Only "bootcmd"  or "preboot" is really executed, this command will be never executed here.

</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">   "env_check=if test $env_default -eq 1;"\
                " then env set env_default 0;env save;fi\0" \
        STM32MP_BOOTCMD \
--
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Can you explain you issue and the board used.</pre>
</blockquote>
The problem which I've <span style="color: rgb(29, 28, 29);
      font-family: Slack-Lato, appleLogo, sans-serif; font-size: 15px;
      font-style: normal; font-variant-ligatures: common-ligatures;
      font-variant-caps: normal; font-weight: 400; letter-spacing:
      normal; orphans: 2; text-align: left; text-indent: 0px;
      text-transform: none; white-space: normal; widows: 2;
      word-spacing: 0px; -webkit-text-stroke-width: 0px;
      background-color: rgb(255, 255, 255); text-decoration-style:
      initial; text-decoration-color: initial; display: inline
      !important; float: none;">
encountered</span> is that I'm not able to boot my rootfs partition properly using the latest U-Boot version (2019.10) using stm32mp157c-dk2 board (I've been getting kernel panic because it wasn't able to mount partition). On the previous version (2019.07)
 there is no any problems with that. I've used git bisect to check which commit causes the problem and it turned out that the problem is with commit
<span class="sha-block"><span class="sha user-select-contain">22bed7ee4988aadfaef0c0da9746bf8541549ed4.</span></span>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

I think your patch only mask the issue, as environment is not saved, U-Boot never write in EXT4 file system.
You should have again the issue if you execute manually by the command "env save".</pre>
</blockquote>
Hmm, it makes sense.<br>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

Today I have no issue on my side with environment in ext4 file system (generated by donwstrean yocto); 
the requests done by U-Boot are acceptable if the ext4 file system is generated with only the features supported by U-Boot.</pre>
</blockquote>
I use buildroot and if you wanna you can build and check that image yourself. Here is a link to guide
<a class="moz-txt-link-freetext" href="https://github.com/buildroot/buildroot/tree/master/board/stmicroelectronics/stm32mp157c-dk2">
https://github.com/buildroot/buildroot/tree/master/board/stmicroelectronics/stm32mp157c-dk2</a> but remember to comment this line -> BR2_GLOBAL_PATCH_DIR="board/stmicroelectronics/stm32mp157c-dk2/patches" in stm32mp157c_dk2_defconfig file to disable my faulty
 patch.<br>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

But we solved issue with latest ext4 tools; since e2fsprogs 1.43 at least, we have ascendance incompatibility as new enable features are enable by default = metadata_csum and dir_index.

We remove them with the mkfs.ext4 option: -O ^metadata_csum,^dir_index

Example : mkfs.ext4 -L rootfs -O ^metadata_csum,^dir_index /dev/sdb4</pre>
</blockquote>
I'll check that and let you know about the results.<br>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

For details of restriction, see commit 10a7a1b8 : update with hash tree directory of EXT4 not support by U-Boot (EXT4_INDEX_FL)</pre>
</blockquote>
Thanks<br>
<blockquote type="cite" cite="mid:b88103917685448fb193eef6cc3877cc@SFHDAG6NODE3.st.com">
<pre class="moz-quote-pre" wrap="">

Best regards

Patrick


</pre>
</blockquote>
Best<br>
Bartek<br>
</body>
</html>