mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* NAND Boot Issue
@ 2011-10-17 16:03 Kamel BOUHARA
  2011-10-17 19:58 ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Kamel BOUHARA @ 2011-10-17 16:03 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2324 bytes --]

Hi all,

Im working on my own imx27 designed board and wanted to try barebox on
it.Actually I'm trying it with the phytec board config and it seems to work
fine booting on my nfs kernel and rootfs.
But when Im trying to boot from my 128MiB NAND memory then it doesn't work
and there is no decompression stage from the kernel.
Here is what Im getting :

Board: Phytec phyCard-i.MX27
registered netconsole as cs1
cfi_probe: cfi_flash base: 0xc0000000 size: 0x02000000
NAND device: Manufacturer ID: 0x2c, Chip ID: 0xac (Micron NAND 512MiB 1,8V
8-bit)
Bad block table found at page 262080, version 0x01
Bad block table found at page 262016, version 0x01
Before PHY reset
After PHY reset
ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
No ISP1504 found
ehci@ehci0: USB EHCI 1.00
ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
No ISP1504 found
ehci@ehci1: USB EHCI 1.00
Malloc space: 0xa7a00000 -> 0xa7f00000 (size  5 MB)
Stack space : 0xa79f8000 -> 0xa7a00000 (size 32 kB)
running /env/bin/init...

Hit any key to stop autoboot:  1
booting kernel of type uImage from /dev/nand0.kernel.bb
barebox:/ bootu /dev/nand0.kernel.bb
commandline: console=ttymxc0,115200 video=imxfb:Chimei-LW700AT9003
arch_number: 1698

It seems I'm getting some issues with my nand since when I tried to flash it
and the erase task failed :

erasing partition /dev/nand0.kernel.bb

erase: Invalid argument

flashing uImage-apf27 to /dev/nand0.kernel.bb

TFTP from server 192.168.0.2 ('uImage-apf27' -> '/dev/nand0.kernel.bb')
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #################################################################
        #

How can I fix that ?
Thanks for the help.



-- 
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04

[-- Attachment #1.2: Type: text/html, Size: 3224 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-17 16:03 NAND Boot Issue Kamel BOUHARA
@ 2011-10-17 19:58 ` Sascha Hauer
  2011-10-17 20:31   ` Kamel BOUHARA
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2011-10-17 19:58 UTC (permalink / raw)
  To: Kamel BOUHARA; +Cc: barebox

On Mon, Oct 17, 2011 at 06:03:56PM +0200, Kamel BOUHARA wrote:
> Hi all,
> 
> Im working on my own imx27 designed board and wanted to try barebox on
> it.Actually I'm trying it with the phytec board config and it seems to work
> fine booting on my nfs kernel and rootfs.
> But when Im trying to boot from my 128MiB NAND memory then it doesn't work
> and there is no decompression stage from the kernel.
> Here is what Im getting :
> 
> Board: Phytec phyCard-i.MX27
> registered netconsole as cs1
> cfi_probe: cfi_flash base: 0xc0000000 size: 0x02000000
> NAND device: Manufacturer ID: 0x2c, Chip ID: 0xac (Micron NAND 512MiB 1,8V
> 8-bit)
> Bad block table found at page 262080, version 0x01
> Bad block table found at page 262016, version 0x01
> Before PHY reset
> After PHY reset
> ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
> No ISP1504 found
> ehci@ehci0: USB EHCI 1.00
> ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
> No ISP1504 found
> ehci@ehci1: USB EHCI 1.00
> Malloc space: 0xa7a00000 -> 0xa7f00000 (size  5 MB)
> Stack space : 0xa79f8000 -> 0xa7a00000 (size 32 kB)
> running /env/bin/init...
> 
> Hit any key to stop autoboot:  1
> booting kernel of type uImage from /dev/nand0.kernel.bb
> barebox:/ bootu /dev/nand0.kernel.bb

bootu is for starting raw kernel images. Do you have such an image?
Normally you have an uImage (bootm) or a zImage (bootz)

> commandline: console=ttymxc0,115200 video=imxfb:Chimei-LW700AT9003
> arch_number: 1698
> 
> It seems I'm getting some issues with my nand since when I tried to flash it
> and the erase task failed :
> 
> erasing partition /dev/nand0.kernel.bb
> 
> erase: Invalid argument

Works here. I can't see how erase could return -EINVAL. can you please
post the output of 'ls /dev/nand0*'?

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-17 19:58 ` Sascha Hauer
@ 2011-10-17 20:31   ` Kamel BOUHARA
  2011-10-18  6:58     ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Kamel BOUHARA @ 2011-10-17 20:31 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 3258 bytes --]

> bootu is for starting raw kernel images. Do you have such an image?
> Normally you have an uImage (bootm) or a zImage (bootz)


Ok so that maybe the solution because I didn't tried with the bootm .... my
bad ! But why did I don't have the "Bad magic number" error like when I
tried the boot command ???

Here is the ls /dev result:

barebox:/ ls /dev/
zero                   defaultenv             mem
nor0                   nand0                  nand_oob0
ram0                   phy0                   self_raw
self0                  env_raw                env0
nor0.barebox           nor0.bareboxenv        nor0.kernel
nor0.root              nand0.barebox          nand0.bareboxenv
nand0.kernel           nand0.root             nand0.root.bb
nand0.kernel.bb        nand0.bareboxenv.bb    nand0.barebox.bb



2011/10/17 Sascha Hauer <s.hauer@pengutronix.de>

> On Mon, Oct 17, 2011 at 06:03:56PM +0200, Kamel BOUHARA wrote:
> > Hi all,
> >
> > Im working on my own imx27 designed board and wanted to try barebox on
> > it.Actually I'm trying it with the phytec board config and it seems to
> work
> > fine booting on my nfs kernel and rootfs.
> > But when Im trying to boot from my 128MiB NAND memory then it doesn't
> work
> > and there is no decompression stage from the kernel.
> > Here is what Im getting :
> >
> > Board: Phytec phyCard-i.MX27
> > registered netconsole as cs1
> > cfi_probe: cfi_flash base: 0xc0000000 size: 0x02000000
> > NAND device: Manufacturer ID: 0x2c, Chip ID: 0xac (Micron NAND 512MiB
> 1,8V
> > 8-bit)
> > Bad block table found at page 262080, version 0x01
> > Bad block table found at page 262016, version 0x01
> > Before PHY reset
> > After PHY reset
> > ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
> > No ISP1504 found
> > ehci@ehci0: USB EHCI 1.00
> > ULPI Vendor ID 0xffffff92    Product ID 0xffffff92
> > No ISP1504 found
> > ehci@ehci1: USB EHCI 1.00
> > Malloc space: 0xa7a00000 -> 0xa7f00000 (size  5 MB)
> > Stack space : 0xa79f8000 -> 0xa7a00000 (size 32 kB)
> > running /env/bin/init...
> >
> > Hit any key to stop autoboot:  1
> > booting kernel of type uImage from /dev/nand0.kernel.bb
> > barebox:/ bootu /dev/nand0.kernel.bb
>
> bootu is for starting raw kernel images. Do you have such an image?
> Normally you have an uImage (bootm) or a zImage (bootz)
>
> > commandline: console=ttymxc0,115200 video=imxfb:Chimei-LW700AT9003
> > arch_number: 1698
> >
> > It seems I'm getting some issues with my nand since when I tried to flash
> it
> > and the erase task failed :
> >
> > erasing partition /dev/nand0.kernel.bb
> >
> > erase: Invalid argument
>
> Works here. I can't see how erase could return -EINVAL. can you please
> post the output of 'ls /dev/nand0*'?
>
> 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 |
>



-- 
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04

[-- Attachment #1.2: Type: text/html, Size: 4852 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-17 20:31   ` Kamel BOUHARA
@ 2011-10-18  6:58     ` Sascha Hauer
  2011-10-18  7:35       ` Kamel BOUHARA
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2011-10-18  6:58 UTC (permalink / raw)
  To: Kamel BOUHARA; +Cc: barebox

On Mon, Oct 17, 2011 at 10:31:38PM +0200, Kamel BOUHARA wrote:
> > bootu is for starting raw kernel images. Do you have such an image?
> > Normally you have an uImage (bootm) or a zImage (bootz)
> 
> 
> Ok so that maybe the solution because I didn't tried with the bootm .... my
> bad ! But why did I don't have the "Bad magic number" error like when I
> tried the boot command ???

A raw image does not have any magic number you could check, so the bootu
command relies on the user passing the correct image.

> 
> Here is the ls /dev result:
> 
> barebox:/ ls /dev/
> zero                   defaultenv             mem
> nor0                   nand0                  nand_oob0
> ram0                   phy0                   self_raw
> self0                  env_raw                env0
> nor0.barebox           nor0.bareboxenv        nor0.kernel
> nor0.root              nand0.barebox          nand0.bareboxenv
> nand0.kernel           nand0.root             nand0.root.bb
> nand0.kernel.bb        nand0.bareboxenv.bb    nand0.barebox.bb

Sorry, I meant the output of 'ls -l /dev/nand0.*' to check the sizes of
your partitions.

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-18  6:58     ` Sascha Hauer
@ 2011-10-18  7:35       ` Kamel BOUHARA
  2011-10-18  8:23         ` Sascha Hauer
  0 siblings, 1 reply; 7+ messages in thread
From: Kamel BOUHARA @ 2011-10-18  7:35 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2563 bytes --]

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),-(root)
nand -a /dev/nand0.*
update -t kernel -d nand
update -t rootfs -d nand

Is there any specific command to erase the nand before flashing it ?



2011/10/18 Sascha Hauer <s.hauer@pengutronix.de>

> On Mon, Oct 17, 2011 at 10:31:38PM +0200, Kamel BOUHARA wrote:
> > > bootu is for starting raw kernel images. Do you have such an image?
> > > Normally you have an uImage (bootm) or a zImage (bootz)
> >
> >
> > Ok so that maybe the solution because I didn't tried with the bootm ....
> my
> > bad ! But why did I don't have the "Bad magic number" error like when I
> > tried the boot command ???
>
> A raw image does not have any magic number you could check, so the bootu
> command relies on the user passing the correct image.
>
> >
> > Here is the ls /dev result:
> >
> > barebox:/ ls /dev/
> > zero                   defaultenv             mem
> > nor0                   nand0                  nand_oob0
> > ram0                   phy0                   self_raw
> > self0                  env_raw                env0
> > nor0.barebox           nor0.bareboxenv        nor0.kernel
> > nor0.root              nand0.barebox          nand0.bareboxenv
> > nand0.kernel           nand0.root             nand0.root.bb
> > nand0.kernel.bb        nand0.bareboxenv.bb    nand0.barebox.bb
>
> Sorry, I meant the output of 'ls -l /dev/nand0.*' to check the sizes of
> your partitions.
>
> 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 |
>



-- 
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04

[-- Attachment #1.2: Type: text/html, Size: 3774 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-18  7:35       ` Kamel BOUHARA
@ 2011-10-18  8:23         ` Sascha Hauer
  2011-10-18  9:44           ` Kamel BOUHARA
  0 siblings, 1 reply; 7+ messages in thread
From: Sascha Hauer @ 2011-10-18  8:23 UTC (permalink / raw)
  To: Kamel BOUHARA; +Cc: barebox

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),-(root)

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 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: NAND Boot Issue
  2011-10-18  8:23         ` Sascha Hauer
@ 2011-10-18  9:44           ` Kamel BOUHARA
  0 siblings, 0 replies; 7+ messages in thread
From: Kamel BOUHARA @ 2011-10-18  9:44 UTC (permalink / raw)
  To: barebox


[-- Attachment #1.1: Type: text/plain, Size: 2102 bytes --]

>
> 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 <s.hauer@pengutronix.de>

> 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),-(root)
>
> 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 |
>



-- 
__________________________________
*Kamel BOUHARA*
7 rue Jules César
02100 SAINT-QUENTIN
06.17.83.29.04

[-- Attachment #1.2: Type: text/html, Size: 3329 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-10-18  9:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-17 16:03 NAND Boot Issue Kamel BOUHARA
2011-10-17 19:58 ` Sascha Hauer
2011-10-17 20:31   ` Kamel BOUHARA
2011-10-18  6:58     ` Sascha Hauer
2011-10-18  7:35       ` Kamel BOUHARA
2011-10-18  8:23         ` Sascha Hauer
2011-10-18  9:44           ` Kamel BOUHARA

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox