<html><head></head><body bgcolor="#FFFFFF"><div><br></div><div><br>On 28 dec 2011, at 14:36, "Frans Meulenbroeks" &lt;<a href="mailto:fransmeulenbroeks@gmail.com">fransmeulenbroeks@gmail.com</a>&gt; wrote:<br></div><blockquote type="cite"><div><br><div class="gmail_quote">2011/12/28 Anders Darander <span dir="ltr">&lt;<a href="mailto:anders@chargestorm.se" target="_blank">anders@chargestorm.se</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><br>
On 27 dec 2011, at 21:35, "Frans Meulenbroeks" &lt;<a href="mailto:fransmeulenbroeks@gmail.com" target="_blank">fransmeulenbroeks@gmail.com</a>&gt; wrote:<br>
<br>
&gt; This adds building the u-boot tools for target.<br>
&gt; (fw_printenv, fw_setenv).<br>
&gt; They are put into a separate package<br>
&gt; With these files it becomes possible to modify<br>
&gt; the u-boot environment when linux is booted<br>
&gt;<br>
&gt; The #ifdef's in fw_env.h were needed to avoid compilation issues<br>
&gt; The constants have been changed to more meaningful defaults<br>
&gt; (as 128k flash pages are much more common than 4k pages)<br>
&gt; but can be overridden using a configuration file.<br>
&gt;<br>
&gt; This resolves bug 1800<br>
&gt;<br>
&gt; Signed-off-by: Frans Meulenbroeks &lt;<a href="mailto:fransmeulenbroeks@gmail.com" target="_blank">fransmeulenbroeks@gmail.com</a>&gt;<br>
&gt;<br>
&gt; ---<br>
&gt; Note: development and testing was done under openembedded classic.<br>
&gt; I've tested it there quite heavily (for mpc8313 if that matters).<br>
&gt; I was requested to provide a patch for oe-core too (to resolve bug 1800)<br>
&gt; so here it is, although at the moment I am unable to test the patch for oe-core.<br>
&gt; I suggest that this is carefully reviewed and tested before being merged.<br>
<br>
<br>
</div><div>&gt; create mode 100644 meta/recipes-bsp/u-boot/files/tools_fwenv.patch<br>
&gt;<br>
&gt; diff --git a/meta/recipes-bsp/u-boot/files/tools_fwenv.patch b/meta/recipes-bsp/u-boot/files/tools_fwenv.patch<br>
&gt; new file mode 100644<br>
&gt; index 0000000..8e87800<br>
&gt; --- /dev/null<br>
&gt; +++ b/meta/recipes-bsp/u-boot/files/tools_fwenv.patch<span class="Apple-style-span" style="-webkit-tap-highlight-color: rgba(26, 26, 26, 0.296875); -webkit-composition-fill-color: rgba(175, 192, 227, 0.230469); -webkit-composition-frame-color: rgba(77, 128, 180, 0.230469); ">.</span></div></blockquote></div></div></blockquote><br><blockquote type="cite"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>
&gt; ++<br>
&gt; ++#include "config.h"<br>
&gt; +<br>
&gt; + #define HAVE_REDUND /* For systems with 2 env sectors */<br>
&gt; +-#define DEVICE1_NAME &nbsp; &nbsp; &nbsp;"/dev/mtd1"<br>
&gt; +-#define DEVICE2_NAME &nbsp; &nbsp; &nbsp;"/dev/mtd2"<br>
&gt; ++#define DEVICE1_NAME &nbsp; &nbsp; &nbsp;"/dev/mtd0"<br>
&gt; ++#define DEVICE2_NAME &nbsp; &nbsp; &nbsp;"/dev/mtd0"<br>
<br>
</div>Would this really be a more comman case than he original defines? (Personally, I'm usually using the config file, so this doesn't really matter. But I'd still question changing these to mtd0...)<br></blockquote>

<div>I can live with either value. This was what was used in our project. <br>Personally I'm somewhat inclined to keep the # of partitions small, so I am less inclined to make two partitions for the env.<br></div></div></div></blockquote><div><br></div><div>I'm personally fine with either, as I'm often using config-files, or otherwise there's likely more customization anyway.</div><div><br></div><div>Though, I'd probably argue that if we are to change the defaults in this case compared to upstream, it should be due to a either that most/a lage number of boards are using that scheme, or that the new seem is at least used by reference boards for OE-Core and yocto (although, I don't know which reference boards uses nandflash, and how they are configured).</div><br><blockquote type="cite"><div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">


<div><br>
&gt; + #define DEVICE1_OFFSET &nbsp; &nbsp;0x0000<br>
&gt; +-#define ENV1_SIZE &nbsp; &nbsp; &nbsp; &nbsp; 0x4000<br>
&gt; +-#define DEVICE1_ESIZE &nbsp; &nbsp; 0x4000<br>
&gt; +-#define DEVICE2_OFFSET &nbsp; &nbsp;0x0000<br>
&gt; +-#define ENV2_SIZE &nbsp; &nbsp; &nbsp; &nbsp; 0x4000<br>
&gt; +-#define DEVICE2_ESIZE &nbsp; &nbsp; 0x4000<br>
&gt; ++#define ENV1_SIZE &nbsp; &nbsp; &nbsp; &nbsp; 0x2000<br>
&gt; ++#define DEVICE1_ESIZE &nbsp; &nbsp; 0x20000<br>
&gt; ++#define DEVICE1_ENVSECTORS &nbsp; &nbsp; 1<br>
&gt; ++#define DEVICE2_OFFSET &nbsp; &nbsp;0x20000<br>
&gt; ++#define ENV2_SIZE &nbsp; &nbsp; &nbsp; &nbsp; 0x2000<br>
&gt; ++#define DEVICE2_ESIZE &nbsp; &nbsp; 0x20000<br>
&gt; ++#define DEVICE2_ENVSECTORS &nbsp; &nbsp; 1<br>
<br>
</div>Ok, I can agree with you that 128k pages are more common, thus that could be a sensible default.<br>
<br>
I can also see a few reasons for changing the size of the environments, ENV1_SIZE and ENV2_SIZE, but there is no reason given in the commit log.<br>
<br></blockquote><div>Again probably a personal preference that crept in. <br>I did a quick grep: in u-boot/include/configs 146 boards have a size of 0x2000, and 78 have a size of 0x4000, so it seems 0x2000 is more used.<br>

THen again perhaps the code should be modified to make use of whatever config/include says.</div></div></div></blockquote><div><br></div><div>If the numbers quoted above are the same/similar if you only look at boards with 128k pages, then we should keep your patch.</div><br><blockquote type="cite"><div>I'll see if I can come up with an update.<br>But actually the most important part of this patch is to add the code in .inc and .bb to compile the tools.<br></div></blockquote><div><br></div><div>Yes, I agree that that's the most important part of the patch. And a welcomed patch. (I've a local patch doing something similar, that I've never got around to submit).</div><div><br></div><div>Cheers,</div><div>Anders</div><br><blockquote type="cite"><div>Best regards, Frans<br><br>PS: it could also be decided to make a separate u-boot-env recipe.<br>PPS: if interested in why fw_prntenv is compiled with HOSTCC: see this thread: <a href="http://old.nabble.com/-U-Boot---PATCH-1-4--tools%3A-enable-img2srec-for-%22all%22-target-td29440508.html#a29440510">http://old.nabble.com/-U-Boot---PATCH-1-4--tools%3A-enable-img2srec-for-%22all%22-target-td29440508.html#a29440510</a><br>
discussion starts somewhere halfway the thread.<br><br>
</div></blockquote></body></html>