Patchwork [2/4] nitrogen6x: use 6x_bootscript/6x_upgrade instead of older 6q_ versions

login
register
mail settings
Submitter Eric Nelson
Date Sept. 25, 2013, 7:07 p.m.
Message ID <1380136072-9879-3-git-send-email-eric.nelson@boundarydevices.com>
Download mbox | patch
Permalink /patch/277969/
State Accepted
Commit c149850baa1286ea04b812acc1443895d878b04b
Headers show

Comments

Eric Nelson - Sept. 25, 2013, 7:07 p.m.
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
---
 board/boundarydevices/nitrogen6x/6q_bootscript | Bin 455 -> 0 bytes
 board/boundarydevices/nitrogen6x/6q_upgrade    | Bin 1587 -> 0 bytes
 board/boundarydevices/nitrogen6x/6x_bootscript | Bin 0 -> 1653 bytes
 board/boundarydevices/nitrogen6x/6x_upgrade    | Bin 0 -> 1744 bytes
 board/boundarydevices/nitrogen6x/post-build.sh |  14 ++++++++------
 5 files changed, 8 insertions(+), 6 deletions(-)
 delete mode 100644 board/boundarydevices/nitrogen6x/6q_bootscript
 delete mode 100644 board/boundarydevices/nitrogen6x/6q_upgrade
 create mode 100644 board/boundarydevices/nitrogen6x/6x_bootscript
 create mode 100644 board/boundarydevices/nitrogen6x/6x_upgrade
Peter Korsgaard - Sept. 26, 2013, 2:37 p.m.
>>>>> "Eric" == Eric Nelson <eric.nelson@boundarydevices.com> writes:

Hi Eric,

 Eric> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>

 Eric> +++ b/board/boundarydevices/nitrogen6x/post-build.sh
 Eric> @@ -1,18 +1,20 @@
 Eric>  #!/bin/sh
 Eric>  # post-build fixups
 Eric> -# for furthe details, see
 Eric> -# http://boundarydevices.com/u-boot-conventions-for-i-mx6-nitrogen6x-and-sabrelite/
 Eric> +# for further details, see
 Eric> +#
 Eric> +#  http://boundarydevices.com/u-boot-on-i-mx6/
 Eric> +#
 
 Eric>  TARGET_DIR=$1
 Eric>  IMAGES_DIR=$1/../images
 Eric>  BOARD_DIR="$(dirname $0)"
 
 Eric>  # bd u-boot looks for bootscript here
 Eric> -cp $BOARD_DIR/6q_bootscript $TARGET_DIR
 Eric> +cp $BOARD_DIR/6x_bootscript $TARGET_DIR
 
 Eric>  # u-boot / update script for bd upgradeu command
 Eric> -if [ -e $IMAGES_DIR/u-boot.bin ];
 Eric> +if [ -e $IMAGES_DIR/u-boot.imx ];
 Eric>  then
 Eric> -    cp $IMAGES_DIR/u-boot.bin $TARGET_DIR
 Eric> -    cp $BOARD_DIR/6q_upgrade $TARGET_DIR
 Eric> +    cp $IMAGES_DIR/u-boot.imx $TARGET_DIR
 Eric> +    cp $BOARD_DIR/6x_upgrade $TARGET_DIR

Hmm, how is that supposed to work? I don't know the details of the imx6
boot sequence, but:

- We don't currently have an option in the u-boot package to install
  u-boot.imx to IMAGES_DIR/, so this will never run

- Comparing 6q_upgrade and 6x_upgrade I see we used to write the raw
  u-boot.bin to offset 0 in the spi flash, and now are writing
  u-boot.imx (which presumably is u-boot.bin with a freescale header) to
  offset 1K. I see that the .imx file is 4K bigger than the .bin
  file, so that's presumably the size of the freescale header.

I'll go and add a option for u-boot.imx to the u-boot package, but would
like to hear if 6x_upgrade is doing the right thing here.
Eric Nelson - Sept. 26, 2013, 3:13 p.m.
Hi Peter,

On 09/26/2013 07:37 AM, Peter Korsgaard wrote:
>>>>>> "Eric" == Eric Nelson <eric.nelson@boundarydevices.com> writes:
>
> Hi Eric,
>
>   Eric> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
>
>   Eric> +++ b/board/boundarydevices/nitrogen6x/post-build.sh
>   Eric> @@ -1,18 +1,20 @@
>   Eric>  #!/bin/sh
>   Eric>  # post-build fixups
>   Eric> -# for furthe details, see
>   Eric> -# http://boundarydevices.com/u-boot-conventions-for-i-mx6-nitrogen6x-and-sabrelite/
>   Eric> +# for further details, see
>   Eric> +#
>   Eric> +#  http://boundarydevices.com/u-boot-on-i-mx6/
>   Eric> +#
>
>   Eric>  TARGET_DIR=$1
>   Eric>  IMAGES_DIR=$1/../images
>   Eric>  BOARD_DIR="$(dirname $0)"
>
>   Eric>  # bd u-boot looks for bootscript here
>   Eric> -cp $BOARD_DIR/6q_bootscript $TARGET_DIR
>   Eric> +cp $BOARD_DIR/6x_bootscript $TARGET_DIR
>
>   Eric>  # u-boot / update script for bd upgradeu command
>   Eric> -if [ -e $IMAGES_DIR/u-boot.bin ];
>   Eric> +if [ -e $IMAGES_DIR/u-boot.imx ];
>   Eric>  then
>   Eric> -    cp $IMAGES_DIR/u-boot.bin $TARGET_DIR
>   Eric> -    cp $BOARD_DIR/6q_upgrade $TARGET_DIR
>   Eric> +    cp $IMAGES_DIR/u-boot.imx $TARGET_DIR
>   Eric> +    cp $BOARD_DIR/6x_upgrade $TARGET_DIR
>
> Hmm, how is that supposed to work? I don't know the details of the imx6
> boot sequence, but:
>
> - We don't currently have an option in the u-boot package to install
>    u-boot.imx to IMAGES_DIR/, so this will never run
>
> - Comparing 6q_upgrade and 6x_upgrade I see we used to write the raw
>    u-boot.bin to offset 0 in the spi flash, and now are writing
>    u-boot.imx (which presumably is u-boot.bin with a freescale header) to
>    offset 1K. I see that the .imx file is 4K bigger than the .bin
>    file, so that's presumably the size of the freescale header.
>
The switch from "u-boot.bin" to "u-boot.imx" occurred when we
switched from using a Freescale-derived U-Boot 2009.08 to
main-line U-Boot sources (currently 2013.07).

Details in this post:
	http://boundarydevices.com/switching-u-boot-versions-on-i-mx6/

> I'll go and add a option for u-boot.imx to the u-boot package, but would
> like to hear if 6x_upgrade is doing the right thing here.
>
A short description of the change is that Freescale's build process
generated u-boot.bin with 512 bytes of padding at the beginning,
while main-line U-Boot generates u-boot.imx without the padding.

There are also a handful of discrepancies in the syntax for
various commands between the two versions, especially in the
areas of SPI NOR (sf probe command), which prompted us to switch
the name of the upgrade script (6q_upgrade == old/6x_upgrade == new)
when switching to main-line based code.

Note that unlike many ARM-based boards out there, our devices boot
to SPI-NOR, so building U-Boot is a convenience. It's not needed
to build an SD card image and the choice of when to upgrade should
largely be based on the need for features or bug fixes and not
tied to each userspace build.

The 6x_bootscript is required though, and provides the distribution-
specifics of how/where to load kernel, DTS file, ram disk, et cetera.

Regards,


Eric
Peter Korsgaard - Sept. 26, 2013, 7:10 p.m.
>>>>> "Eric" == Eric Nelson <eric.nelson@boundarydevices.com> writes:

Hi Eric,

 >> - Comparing 6q_upgrade and 6x_upgrade I see we used to write the raw
 >> u-boot.bin to offset 0 in the spi flash, and now are writing
 >> u-boot.imx (which presumably is u-boot.bin with a freescale header) to
 >> offset 1K. I see that the .imx file is 4K bigger than the .bin
 >> file, so that's presumably the size of the freescale header.
 >> 
 Eric> The switch from "u-boot.bin" to "u-boot.imx" occurred when we
 Eric> switched from using a Freescale-derived U-Boot 2009.08 to
 Eric> main-line U-Boot sources (currently 2013.07).

Ahh, I guess the confusion comes from the fact that I missed the change
to u-boot.imx when I updated the u-boot version back in April:

http://git.buildroot.net/buildroot/commit/configs/nitrogen6x_defconfig?id=184850a4239c967742


 Eric> Details in this post:
 Eric> 	http://boundarydevices.com/switching-u-boot-versions-on-i-mx6/

 >> I'll go and add a option for u-boot.imx to the u-boot package, but would
 >> like to hear if 6x_upgrade is doing the right thing here.
 >> 
 Eric> A short description of the change is that Freescale's build process
 Eric> generated u-boot.bin with 512 bytes of padding at the beginning,
 Eric> while main-line U-Boot generates u-boot.imx without the padding.

I guess you mean 1K of padding to match the new script?

hexdump -C u-boot.bin|head   /tmp/boundarydevices-u-boot-2009-08-1f7edab
00000000  c6 01 00 ea 00 00 00 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000400  d1 00 20 40 20 07 80 27  00 00 00 00 2c 04 80 27  |.. @ ..'....,..'|
00000410  20 04 80 27 00 04 80 27  00 00 00 00 00 00 00 00  | ..'...'........|
00000420  00 00 80 27 74 30 03 00  00 00 00 00 d2 02 f0 40  |...'t0.........@|
00000430  cc 02 ec 04 02 0e 05 a8  00 00 00 30 02 0e 05 b0  |...........0....|
00000440  00 00 00 30 02 0e 05 24  00 00 00 30 02 0e 05 1c  |...0...$...0....|
00000450  00 00 00 30 02 0e 05 18  00 00 00 30 02 0e 05 0c  |...0.......0....|
00000460  00 00 00 30 02 0e 05 b8  00 00 00 30 02 0e 05 c0  |...0.......0....|


 Eric> There are also a handful of discrepancies in the syntax for
 Eric> various commands between the two versions, especially in the
 Eric> areas of SPI NOR (sf probe command), which prompted us to switch
 Eric> the name of the upgrade script (6q_upgrade == old/6x_upgrade == new)
 Eric> when switching to main-line based code.

 Eric> Note that unlike many ARM-based boards out there, our devices boot
 Eric> to SPI-NOR, so building U-Boot is a convenience. It's not needed
 Eric> to build an SD card image and the choice of when to upgrade should
 Eric> largely be based on the need for features or bug fixes and not
 Eric> tied to each userspace build.

Yes, I know. My nitrogen6x board still runs the original 2009.08
bootloader it was shipped with (which has problems using ext2 rev0
filesystems among others), so I should probably upgrade ;)

Thanks for the info.
Peter Korsgaard - Sept. 26, 2013, 7:20 p.m.
>>>>> "Eric" == Eric Nelson <eric.nelson@boundarydevices.com> writes:

 Eric> Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>

Committed, thanks.
Eric Nelson - Sept. 26, 2013, 8:20 p.m.
Hi Peter,

On 09/26/2013 12:10 PM, Peter Korsgaard wrote:
>>>>>> "Eric" == Eric Nelson <eric.nelson@boundarydevices.com> writes:
>
> Hi Eric,
>
>   >> - Comparing 6q_upgrade and 6x_upgrade I see we used to write the raw
>   >> u-boot.bin to offset 0 in the spi flash, and now are writing
>   >> u-boot.imx (which presumably is u-boot.bin with a freescale header) to
>   >> offset 1K. I see that the .imx file is 4K bigger than the .bin
>   >> file, so that's presumably the size of the freescale header.
>   >>
>   Eric> The switch from "u-boot.bin" to "u-boot.imx" occurred when we
>   Eric> switched from using a Freescale-derived U-Boot 2009.08 to
>   Eric> main-line U-Boot sources (currently 2013.07).
>
> Ahh, I guess the confusion comes from the fact that I missed the change
> to u-boot.imx when I updated the u-boot version back in April:
>
> http://git.buildroot.net/buildroot/commit/configs/nitrogen6x_defconfig?id=184850a4239c967742
>

I'll try to post updates to the ML with each quarterly release.

The next upgrade will be 2013-10, that I hope enables USB OTG support.

>
>   Eric> Details in this post:
>   Eric> 	http://boundarydevices.com/switching-u-boot-versions-on-i-mx6/
>
>   >> I'll go and add a option for u-boot.imx to the u-boot package, but would
>   >> like to hear if 6x_upgrade is doing the right thing here.
>   >>
>   Eric> A short description of the change is that Freescale's build process
>   Eric> generated u-boot.bin with 512 bytes of padding at the beginning,
>   Eric> while main-line U-Boot generates u-boot.imx without the padding.
>
> I guess you mean 1K of padding to match the new script?
>
> hexdump -C u-boot.bin|head   /tmp/boundarydevices-u-boot-2009-08-1f7edab
> 00000000  c6 01 00 ea 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> 00000010  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
> *
> 00000400  d1 00 20 40 20 07 80 27  00 00 00 00 2c 04 80 27  |.. @ ..'....,..'|
> 00000410  20 04 80 27 00 04 80 27  00 00 00 00 00 00 00 00  | ..'...'........|
> 00000420  00 00 80 27 74 30 03 00  00 00 00 00 d2 02 f0 40  |...'t0.........@|
> 00000430  cc 02 ec 04 02 0e 05 a8  00 00 00 30 02 0e 05 b0  |...........0....|
> 00000440  00 00 00 30 02 0e 05 24  00 00 00 30 02 0e 05 1c  |...0...$...0....|
> 00000450  00 00 00 30 02 0e 05 18  00 00 00 30 02 0e 05 0c  |...0.......0....|
> 00000460  00 00 00 30 02 0e 05 b8  00 00 00 30 02 0e 05 c0  |...0.......0....|
>

Yep. 1k (0x400)

>
>   Eric> There are also a handful of discrepancies in the syntax for
>   Eric> various commands between the two versions, especially in the
>   Eric> areas of SPI NOR (sf probe command), which prompted us to switch
>   Eric> the name of the upgrade script (6q_upgrade == old/6x_upgrade == new)
>   Eric> when switching to main-line based code.
>
>   Eric> Note that unlike many ARM-based boards out there, our devices boot
>   Eric> to SPI-NOR, so building U-Boot is a convenience. It's not needed
>   Eric> to build an SD card image and the choice of when to upgrade should
>   Eric> largely be based on the need for features or bug fixes and not
>   Eric> tied to each userspace build.
>
> Yes, I know. My nitrogen6x board still runs the original 2009.08
> bootloader it was shipped with (which has problems using ext2 rev0
> filesystems among others), so I should probably upgrade ;)
>

Upgrading is definitely recommended.

The other notable enhancements are display support and support for SATA.

Regards,


Eric

Patch

diff --git a/board/boundarydevices/nitrogen6x/6q_bootscript b/board/boundarydevices/nitrogen6x/6q_bootscript
deleted file mode 100644
index e10cfeb0b742f401e36f0f242ca72e45fab26944..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 455
zcma)&!AiqG5QbB+9`Xj>h7#%}CA*=<(z;+3DS`p<P`xI*n|8@=wrpaol;Y8Y58>5^
z(RVTlQ9(qU%MAa_d_OY>-TgVceOq1)j$bXS^JKO0{J#6r-PyBZtqaJh5v$^}^&@v4
zYa!<a)U%OU<luZ&RA;%CoD{`_T2t&|eCQ(trHZ7~lnfCH!BlI+W4!c~qOnZT3OCw)
zBnoH&v5c~mAeh*d5zorsyh_2iCY4PRqj7~JOQwX2{SjIp`6xUIkSh{$Jv;S>|D)iB
zA}MpvE~nGM&3ra(2|*D2fk<M-74b)*i&1Dhn<U>#9WkiR182iTo^Hn&FdCscz^lLI
n-Cd|?!J*%8PE+6Q32?g9&^tFq8>m4dTR_T9#wCb)sb||C*>#HV

diff --git a/board/boundarydevices/nitrogen6x/6q_upgrade b/board/boundarydevices/nitrogen6x/6q_upgrade
deleted file mode 100644
index 2f20efa2e85c761b09da7ae5a935589280dae5eb..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 1587
zcmb_c!H&}~5Ur33YQ=>kx6x9GQ>!#AEU-634;)ykT><CBo-|gIII`V#w`dRi1s}ti
zpW(<4Ft(F6?IwFb_>jiwy!XcQ#`C=Y^vlo3Pqy>^k4L>;|4*-4-`Bss_8&a##Zns3
zOo`Iee;xhyf7=hpQVAz4MYe>`<9CEQf%BnAVDv4~x0#GM<T;}q7kYX7b_&xla0^yr
zt1*d10q0;+EQa8gXH-bYQ6e(bVv7*p7}Ss`nZwn4V3Fch#sf%9Cr~OGBTOMYtN1I@
z0R?$V7s26b{sAsOeca<6izjia!Syse^*IKO6b_Q~%Jd{0%gad&7F8)X2=*svhg%+>
z-Po_Hh_FVbg)B7WkzwgkvJRDLtO{VayXDy~5P40tDi<o^*ur5!K7Otw1?50yOasu!
zWWjX@B9RIT8~Fxa!x_ASmv9O%Af)04WF?nvX}SEI*2wzZ8KN`9l9+09cjvM%ToyPS
z>>WiFX;CaX@}#D)0Z3T|*UnI4b?9ecHWIYKQiGAyI=IHdK&%8?5?@n-n#L9;zgK3X
zgdv$m2Q>SpNk_Jd<ffbKU)!)Q(|>5knrf5M<!dzOQ9JPoDAZ`LyS02ktMV=k?5?uQ
zzjfJ-9Zg*4;G6T(&H`6C!6HMqf_zm{b=YpPiD*;2SItY!EHNEyY$pNP1hd)v?y#uS
zyDM|}rA_cq$BVdOYiA`YKjT_ecihLcO-fM+Bce=f+mcTN-GDvX<1S?FtjMDULLyfM
N2P$%7(313U_!p)>ak>Bi

diff --git a/board/boundarydevices/nitrogen6x/6x_bootscript b/board/boundarydevices/nitrogen6x/6x_bootscript
new file mode 100644
index 0000000000000000000000000000000000000000..dc9eea481c03145d16959e5ebcc47120ff3cc2c3
GIT binary patch
literal 1653
zcmdT^!EVz)5RED|Qv3sm+sLwt1dg(H(-1YXMA|~B)LeQf+^V%bPF7j(8hc3{Mfnas
zf+HWq5AYGJ9Xn}4p+dR9Ue@-^zMc0x^IjZ2zy0##+xX`E<@ZLTdD5uXv#<8S;X$+E
zOQ|3WQkJMXw6izc#fJ<PiWwB?G#zJvg8Cfq?kQ7uu?*3ZQDjs}0&^8e0c2npEP_cG
zvk(;wKuu5>tz9T<4LZ|#(u?yT@~uUMvOEoO<`o#W<Mv7Z+9jhmJz}%SySY4byKB72
zk1+<b+&s5GG6$<ro}^G$WYrI^z%h_#XtXexNHE*w0wLl3#pnuRDVUO}hKQKv;0B<J
z0JmUMyd<gg5lBwDdy(RyZ(m=WwLe}CD>}Vi&uHmO6lMxcVnQ1~L0xpMUoGGkVTY82
zSDdyptVNl*v~`Zr(uB(JU&`_>Ma%-q5ki(FoX%@)wiP+<@2!YK+-}|@5C8JND@$GM
zpH=DZsY(#q=hwqw`@`*j&?$XF@@}8(C~`kxx_4H6eXRRh;JUAM$Aoe{#%nWp$`-WY
zz!M{`<DnF2)W-A(wpGr?FA3)6cI{-D<mf3i*UseFj&tG?0<)NME(5QtI~A%NpHngQ
z2&CF23uiP-|67sHsG=r#U|Ne%%@bUjznzo^mlsH0N1IP43#p@zRIXKdsQCz^&5<|`
zd_E;fc}~y0HiB%)B@Lmjp?F}~bb0E4L-dc+3pxd6=krxe#|TG9rRB$)u&$tV%(rPO
TQz+1w7{e4(fgD(I$TWTea_I@(

literal 0
HcmV?d00001

diff --git a/board/boundarydevices/nitrogen6x/6x_upgrade b/board/boundarydevices/nitrogen6x/6x_upgrade
new file mode 100644
index 0000000000000000000000000000000000000000..cd26b616b0024424764e95f4d54d917c626d36d4
GIT binary patch
literal 1744
zcmb_dO^?$s5Ur55Qu7bEjh0F)AzG!SD<paYD#2lwsw+4kE@?bztu}UKyI;%pz>OmZ
zeh>eEpM=CX&R4tXN(g*toOI^BmwDsK#o6PJgReh-OkO|z-DotwH?no{>+PqrN6p4m
zN&`AnJTduSN7v>z`#_^Xu?B6JTu}ll9xR`&XMu;|T*7%c$8Z53I<E-s9EM&NE~AKc
z;BN=M@9_xQUn0F<%7D?1nO%Z=yWx7Vf7ydx-%l5;I#yMe$6L6&`@0+=lYlWUW-tUZ
zN8v%boJfV1IO0px{1#!lGpHd_GKQNs5C)1_<t~A=>If1gr)V`)_n*C1dEbNni%fMj
ztnxV1(IQ-@A_Zk|Gkyn?_g5ulO6+)3q5ihlr?Sz4c2>ty`@!2e$@ELvVVrcQRPdsh
zRhZ({>(ecc)7Wt<GZfaSG?zj{9GGx^BstAmYRoEUZ;R#7t`S)dwMu3xU|54;lU)2*
zNeYUA3%I0K3#DNCL_#DL2p2ej=g@~98P8;$mQ++q&=!Tyh0<c9mxzglsl#AWpw}wB
zL=|XiwiDv0Yit05PljBkP7Yo66EGV|hY1r6MpB>Q8ij$W;^Bhusua{Nwixk)G#kYY
z(Uh*&bW9bL4CT@8G~~avVP4Ds(2hCOW=^NJ(ws-_#JZr6CJh;3-EYy#eC+%7j$l&j
za=4=_o@n1Z%(dmjj*ql*JPZt-2Xa?Qb;5j`8}Yg(dXUXgjVv&|QpZjLvI$0`@%>?u
z%ezl=_@s{TkjIgv-vT?GQMs{L%UWO`!&V`=;D){s{I*Vf#OZXE*)H!|=AQC6m?1=R
NB^XeVE3=uX{{YL7tK|Ry

literal 0
HcmV?d00001

diff --git a/board/boundarydevices/nitrogen6x/post-build.sh b/board/boundarydevices/nitrogen6x/post-build.sh
index 2f3c464..1dc5643 100755
--- a/board/boundarydevices/nitrogen6x/post-build.sh
+++ b/board/boundarydevices/nitrogen6x/post-build.sh
@@ -1,18 +1,20 @@ 
 #!/bin/sh
 # post-build fixups
-# for furthe details, see
-# http://boundarydevices.com/u-boot-conventions-for-i-mx6-nitrogen6x-and-sabrelite/
+# for further details, see
+#
+#  http://boundarydevices.com/u-boot-on-i-mx6/
+#
 
 TARGET_DIR=$1
 IMAGES_DIR=$1/../images
 BOARD_DIR="$(dirname $0)"
 
 # bd u-boot looks for bootscript here
-cp $BOARD_DIR/6q_bootscript $TARGET_DIR
+cp $BOARD_DIR/6x_bootscript $TARGET_DIR
 
 # u-boot / update script for bd upgradeu command
-if [ -e $IMAGES_DIR/u-boot.bin ];
+if [ -e $IMAGES_DIR/u-boot.imx ];
 then
-    cp $IMAGES_DIR/u-boot.bin $TARGET_DIR
-    cp $BOARD_DIR/6q_upgrade $TARGET_DIR
+    cp $IMAGES_DIR/u-boot.imx $TARGET_DIR
+    cp $BOARD_DIR/6x_upgrade $TARGET_DIR
 fi