From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-yw0-f49.google.com ([209.85.213.49]) by canuck.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RG6E2-0005QQ-0u for barebox@lists.infradead.org; Tue, 18 Oct 2011 09:44:47 +0000 Received: by ywe9 with SMTP id 9so426854ywe.36 for ; Tue, 18 Oct 2011 02:44:44 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <20111018082356.GJ18141@pengutronix.de> References: <20111017195801.GF18141@pengutronix.de> <20111018065810.GH18141@pengutronix.de> <20111018082356.GJ18141@pengutronix.de> From: Kamel BOUHARA Date: Tue, 18 Oct 2011 11:44:24 +0200 Message-ID: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1485567188==" Sender: barebox-bounces@lists.infradead.org Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: Re: NAND Boot Issue To: barebox@lists.infradead.org --===============1485567188== Content-Type: multipart/alternative; boundary=bcaec53961d6bfb08a04af8f927a --bcaec53961d6bfb08a04af8f927a Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable > > Unaligned partitions are fine, but the partition code should mark > them as readonly. > > That's why I was unable to erase it getting -EINVAL, things are clear now It works fine, my kernel is booting :) ! Thank you Sascha 2011/10/18 Sascha Hauer > On Tue, Oct 18, 2011 at 09:35:38AM +0200, Kamel BOUHARA wrote: > > I tried with a zImage, here is what I'm getting : > > > > barebox:/ bootz /dev/nand0.kernel.bb > > invalid magic 0x00002018 > > > > And here the ls -l /dev/nand0.* output : > > > > barebox:/ ls -l /dev/nand0.* > > crw------- 393216 /dev/nand0.barebox.bb > > crw------- 131072 /dev/nand0.bareboxenv.bb > > crw------- 2883584 /dev/nand0.kernel.bb > > crw------- 533200896 /dev/nand0.root.bb > > crw------- 533667840 /dev/nand0.root > > crw------- 2764800 /dev/nand0.kernel > > crw------- 131072 /dev/nand0.bareboxenv > > crw------- 307200 /dev/nand0.barebox > > > > Here is how I did my kernel and root partitions, following this steps : > > > > addpart /dev/nand0 300k(barebox)ro,128k(bareboxenv),2700k(kernel),-(roo= t) > > Ok, that puts some light into this. Please make sure your partitions are > aligned to eraseblock boundaries, usually 128k. so: > > addpart /dev/nand0 512k(barebox)ro,128k(bareboxenv),3M(kernel),-(root) > > barebox currently does not enforce this, it's probably time to change > this. Unaligned partitions are fine, but the partition code should mark > them as readonly. > Currently we have no way of passing the eraseblocksize through to the > partition code, so it's not trivial to enforce alignment. > > Sascha > > > -- > Pengutronix e.K. | = | > Industrial Linux Solutions | http://www.pengutronix.de/ = | > Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 = | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 = | > --=20 __________________________________ *Kamel BOUHARA* 7 rue Jules C=E9sar 02100 SAINT-QUENTIN 06.17.83.29.04 --bcaec53961d6bfb08a04af8f927a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Unaligned partiti= ons are fine, but the partition code should mark
them as readonly.


That's why I was unable = to erase it getting -EINVAL, things are clear now

It works fine, my= kernel is booting :) !

Thank you Sascha
=A0
2011/10/18 Sascha Hauer <s.hauer@pengutronix.de>
On Tue, Oct 18, 2011 at 09:35:38AM +0200, Kamel BOUHARA w= rote:
> I tried with a zImage, here is what I'm getting :
>
> barebox:/ bootz /dev/nand0.kernel.bb
> invalid magic 0x00002018
>
> And here the ls -l /dev/nand0.* output :
>
> =A0barebox:/ ls -l /dev/nand0.*
> crw------- =A0 =A0 393216 /dev/nand0.barebox.bb
> crw------- =A0 =A0 131072 /dev/nand0.bareboxenv.bb
> crw------- =A0 =A02883584 /dev/nand0.kernel.bb
> crw------- =A05332008= 96 /dev/nand0.root.b= b
> crw------- =A05336678= 40 /dev/nand0.root
> crw------- =A0 =A02764800 /dev/nand0.kernel
> crw------- =A0 =A0 131072 /dev/nand0.bareboxenv
> crw------- =A0 =A0 307200 /dev/nand0.barebox
>
> Here is how I did my kernel and root partitions, following this steps = :
>
> addpart /dev/nand0 300k(barebox)ro,128k(bareboxenv),2700k(kernel),-(ro= ot)

Ok, that puts some light into this. Please make sure your partitions = are
aligned to eraseblock boundaries, usually 128k. so:

addpart /dev/nand0 512k(barebox)ro,128k(bareboxenv),3M(kernel),-(root)

barebox currently does not enforce this, it's probably time to change this. Unaligned partitions are fine, but the partition code should mark
them as readonly.
Currently we have no way of passing the eraseblocksize through to the
partition code, so it's not trivial to enforce alignment.

Sascha


--
Pengutronix e.K. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | =A0 = =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 |
Industrial Linux Solutions =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 | http://www.pengutronix.de/ = =A0|
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 =A0 =A0|
Amtsgericht Hildesheim, HRA 2686 =A0 =A0 =A0 =A0 =A0 | Fax: =A0 +49-5121-20= 6917-5555 |



--
___________= _______________________
Kamel BOUHARA
7 rue Jules C=E9sar
02100 SAINT-QUEN= TIN
06.17.83.29.04


--bcaec53961d6bfb08a04af8f927a-- --===============1485567188== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ barebox mailing list barebox@lists.infradead.org http://lists.infradead.org/mailman/listinfo/barebox --===============1485567188==--