<html><head></head><body bgcolor="#FFFFFF"><div><br></div><div><br>On 28 dec 2011, at 14:36, "Frans Meulenbroeks" <<a href="mailto:fransmeulenbroeks@gmail.com">fransmeulenbroeks@gmail.com</a>> wrote:<br></div><blockquote type="cite"><div><br><div class="gmail_quote">2011/12/28 Anders Darander <span dir="ltr"><<a href="mailto:anders@chargestorm.se" target="_blank">anders@chargestorm.se</a>></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" <<a href="mailto:fransmeulenbroeks@gmail.com" target="_blank">fransmeulenbroeks@gmail.com</a>> wrote:<br>
<br>
> This adds building the u-boot tools for target.<br>
> (fw_printenv, fw_setenv).<br>
> They are put into a separate package<br>
> With these files it becomes possible to modify<br>
> the u-boot environment when linux is booted<br>
><br>
> The #ifdef's in fw_env.h were needed to avoid compilation issues<br>
> The constants have been changed to more meaningful defaults<br>
> (as 128k flash pages are much more common than 4k pages)<br>
> but can be overridden using a configuration file.<br>
><br>
> This resolves bug 1800<br>
><br>
> Signed-off-by: Frans Meulenbroeks <<a href="mailto:fransmeulenbroeks@gmail.com" target="_blank">fransmeulenbroeks@gmail.com</a>><br>
><br>
> ---<br>
> Note: development and testing was done under openembedded classic.<br>
> I've tested it there quite heavily (for mpc8313 if that matters).<br>
> I was requested to provide a patch for oe-core too (to resolve bug 1800)<br>
> so here it is, although at the moment I am unable to test the patch for oe-core.<br>
> I suggest that this is carefully reviewed and tested before being merged.<br>
<br>
<br>
</div><div>> create mode 100644 meta/recipes-bsp/u-boot/files/tools_fwenv.patch<br>
><br>
> diff --git a/meta/recipes-bsp/u-boot/files/tools_fwenv.patch b/meta/recipes-bsp/u-boot/files/tools_fwenv.patch<br>
> new file mode 100644<br>
> index 0000000..8e87800<br>
> --- /dev/null<br>
> +++ 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>
> ++<br>
> ++#include "config.h"<br>
> +<br>
> + #define HAVE_REDUND /* For systems with 2 env sectors */<br>
> +-#define DEVICE1_NAME "/dev/mtd1"<br>
> +-#define DEVICE2_NAME "/dev/mtd2"<br>
> ++#define DEVICE1_NAME "/dev/mtd0"<br>
> ++#define DEVICE2_NAME "/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>
> + #define DEVICE1_OFFSET 0x0000<br>
> +-#define ENV1_SIZE 0x4000<br>
> +-#define DEVICE1_ESIZE 0x4000<br>
> +-#define DEVICE2_OFFSET 0x0000<br>
> +-#define ENV2_SIZE 0x4000<br>
> +-#define DEVICE2_ESIZE 0x4000<br>
> ++#define ENV1_SIZE 0x2000<br>
> ++#define DEVICE1_ESIZE 0x20000<br>
> ++#define DEVICE1_ENVSECTORS 1<br>
> ++#define DEVICE2_OFFSET 0x20000<br>
> ++#define ENV2_SIZE 0x2000<br>
> ++#define DEVICE2_ESIZE 0x20000<br>
> ++#define DEVICE2_ENVSECTORS 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>