RE: bareboxenv on userspace - wrong crc on env

2013-10-11 Thread Vanhauwaert Wouter
> -Original Message-
> From: Sascha Hauer [mailto:s.ha...@pengutronix.de]
> Sent: donderdag 29 augustus 2013 20:44
> To: Vanhauwaert Wouter
> Cc: barebox@lists.infradead.org
> Subject: Re: bareboxenv on userspace - wrong crc on env
> 
> On Thu, Aug 29, 2013 at 11:24:41AM +0200, Vanhauwaert Wouter wrote:
> > Hello all,
> >
> > I'm having issues accessing my barebox environment from within linux
> >
> > My barebox and environment are located on a SPI NOR flash.
> > This boots ok, and barebox is able to save its environment to it.
> >
> > When I want to load it in userspace through:
> >
> > $ bareboxenv -l /mnt /dev/mtd1
> > Or
> > $ dd if=/dev/mtd1 /tmp/barebox
> > Or
> > $ dd if=/dev/mdtblock1 /tmp/barebox
> >
> > Result is:
> > Wrong crc on env
> >
> > However it's working fine in barebox itself
> >
> > What can be wron?
> 
> The only idea I have is that /dev/mtd1 might not be the place where barebox
> stores it's environment, maybe because of different probe order in the kernel 
> or
> different partition layout. Could you send a hexdump of the first 256 bytes 
> or so
> of /dev/mtd1?
> 
> Sascha

I had general issues reading and writing spi nor flash in userspace (without 
being aware of it). Now it works, I can read / write from nor flash from within 
linux.
I can copy the barebox bootloader and uImage to it through dd and this works 
fine. I can also load my barebox environment, change things and write it back 
and read it back out.
However, when I restart my board afterwards, I get an invalid crc on superblock.

(Sorry, some kind of double post with my new topic today)

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


Re: bareboxenv on userspace - wrong crc on env

2013-08-29 Thread Yi Qingliang
On Thursday, August 29, 2013 01:35:06 PM Vanhauwaert Wouter wrote:
> > -Original Message-
> > From: Yi Qingliang [mailto:niqingliang2...@gmail.com]
> > Sent: donderdag 29 augustus 2013 12:44
> > To: barebox@lists.infradead.org
> > Cc: Vanhauwaert Wouter
> > Subject: Re: bareboxenv on userspace - wrong crc on env
> > 
> > On Thursday, August 29, 2013 11:24:41 AM Vanhauwaert Wouter wrote:
> > > Hello all,
> > > 
> > > I'm having issues accessing my barebox environment from within linux
> > > 
> > > My barebox and environment are located on a SPI NOR flash.
> > > This boots ok, and barebox is able to save its environment to it.
> > > 
> > > When I want to load it in userspace through:
> > > 
> > > $ bareboxenv -l /mnt /dev/mtd1
> > > Or
> > > $ dd if=/dev/mtd1 /tmp/barebox
> > > Or
> > > $ dd if=/dev/mdtblock1 /tmp/barebox
> > > 
> > > Result is:
> > > Wrong crc on env
> > > 
> > > However it's working fine in barebox itself
> > > 
> > > What can be wron?
> > 
> > 
> 
> It's SPI NOR flash...
you can ignore the 'nand':

maybe the ecc mode for flash is different in barebox and in kernel,
you should check the config for barebox and kernel.

-- 
Nanjing Jilong
Yi Qingliang
niqingliang2...@gmail.com

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


Re: bareboxenv on userspace - wrong crc on env

2013-08-29 Thread Sascha Hauer
On Thu, Aug 29, 2013 at 11:24:41AM +0200, Vanhauwaert Wouter wrote:
> Hello all, 
> 
> I'm having issues accessing my barebox environment from within linux
> 
> My barebox and environment are located on a SPI NOR flash.
> This boots ok, and barebox is able to save its environment to it.
> 
> When I want to load it in userspace through:
> 
> $ bareboxenv -l /mnt /dev/mtd1
> Or 
> $ dd if=/dev/mtd1 /tmp/barebox
> Or 
> $ dd if=/dev/mdtblock1 /tmp/barebox
> 
> Result is:
> Wrong crc on env
> 
> However it's working fine in barebox itself
> 
> What can be wron?

The only idea I have is that /dev/mtd1 might not be the place where
barebox stores it's environment, maybe because of different probe order
in the kernel or different partition layout. Could you send a hexdump of
the first 256 bytes or so of /dev/mtd1?

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- |

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


RE: bareboxenv on userspace - wrong crc on env

2013-08-29 Thread Vanhauwaert Wouter
> -Original Message-
> From: Yi Qingliang [mailto:niqingliang2...@gmail.com]
> Sent: donderdag 29 augustus 2013 12:44
> To: barebox@lists.infradead.org
> Cc: Vanhauwaert Wouter
> Subject: Re: bareboxenv on userspace - wrong crc on env
> 
> On Thursday, August 29, 2013 11:24:41 AM Vanhauwaert Wouter wrote:
> > Hello all,
> >
> > I'm having issues accessing my barebox environment from within linux
> >
> > My barebox and environment are located on a SPI NOR flash.
> > This boots ok, and barebox is able to save its environment to it.
> >
> > When I want to load it in userspace through:
> >
> > $ bareboxenv -l /mnt /dev/mtd1
> > Or
> > $ dd if=/dev/mtd1 /tmp/barebox
> > Or
> > $ dd if=/dev/mdtblock1 /tmp/barebox
> >
> > Result is:
> > Wrong crc on env
> >
> > However it's working fine in barebox itself
> >
> > What can be wron?
> 
> maybe the ecc mode for nand flash is different in barebox and in kernel, you
> should check the config for barebox and kernel.
> 

It's SPI NOR flash...


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


Re: bareboxenv on userspace - wrong crc on env

2013-08-29 Thread Yi Qingliang
On Thursday, August 29, 2013 11:24:41 AM Vanhauwaert Wouter wrote:
> Hello all,
> 
> I'm having issues accessing my barebox environment from within linux
> 
> My barebox and environment are located on a SPI NOR flash.
> This boots ok, and barebox is able to save its environment to it.
> 
> When I want to load it in userspace through:
> 
> $ bareboxenv -l /mnt /dev/mtd1
> Or
> $ dd if=/dev/mtd1 /tmp/barebox
> Or
> $ dd if=/dev/mdtblock1 /tmp/barebox
> 
> Result is:
> Wrong crc on env
> 
> However it's working fine in barebox itself
> 
> What can be wron?

maybe the ecc mode for nand flash is different in barebox and in kernel, you 
should check the config for barebox and kernel.

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

-- 
Nanjing Jilong
Yi Qingliang
niqingliang2...@gmail.com

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


bareboxenv on userspace - wrong crc on env

2013-08-29 Thread Vanhauwaert Wouter
Hello all, 

I'm having issues accessing my barebox environment from within linux

My barebox and environment are located on a SPI NOR flash.
This boots ok, and barebox is able to save its environment to it.

When I want to load it in userspace through:

$ bareboxenv -l /mnt /dev/mtd1
Or 
$ dd if=/dev/mtd1 /tmp/barebox
Or 
$ dd if=/dev/mdtblock1 /tmp/barebox

Result is:
Wrong crc on env

However it's working fine in barebox itself

What can be wron?

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