All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
       [not found] <mailman.4653.1333649145.16643.u-boot@lists.denx.de>
@ 2012-04-05 18:07 ` Bishop, Mark
  0 siblings, 0 replies; 8+ messages in thread
From: Bishop, Mark @ 2012-04-05 18:07 UTC (permalink / raw)
  To: u-boot



> -----Original Message-----
> From: u-boot-bounces at lists.denx.de [mailto:u-boot-
> bounces at lists.denx.de] On Behalf Of u-boot-owner at lists.denx.de
> Sent: Thursday, April 05, 2012 2:06 PM
> To: Bishop, Mark
> Subject: RE: [U-Boot] fw_printenv can't read the uboot enviroment from
> NAND
> 
> Message rejected. No base64 encoded MIME text parts allowed.


No one (even Microsoft) appears to know how to un-muck Outlook.

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
@ 2012-04-05 18:08 Bishop, Mark
  0 siblings, 0 replies; 8+ messages in thread
From: Bishop, Mark @ 2012-04-05 18:08 UTC (permalink / raw)
  To: u-boot

NAND device: Manufacturer ID: 0x2c, Chip ID: 0xda (Micron
MT29F2G08ABAEAWP)

 

I have the data sheet if it is required.  While it isn't the exact flash
on the EZ-Kit (you can't get it anymore anyway) it is as close as I good
get.  

 

And yes, this is BF548.

 

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
  2012-04-05 15:14 Bishop, Mark
@ 2012-04-05 17:41 ` Mike Frysinger
  0 siblings, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2012-04-05 17:41 UTC (permalink / raw)
  To: u-boot

On Thursday 05 April 2012 11:14:47 Bishop, Mark wrote:
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> > might want to figure out why that block is bad in your NAND.
> 
> I have another virgin board and it is doing the same thing.

i don't think you've ever mentioned what hardware exactly you're using.  
SoC/controller/nand flash type would be useful information.  i can guess you're 
running a Blackfin cpu, but that's about all.

> Would this have anything to do with the device page size (2048 + 64
> bytes) or block size (64 pages, 128K + 4K bytes)?

if the driver was broken, then perhaps :)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120405/4f3575de/attachment.pgp>

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
@ 2012-04-05 15:14 Bishop, Mark
  2012-04-05 17:41 ` Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: Bishop, Mark @ 2012-04-05 15:14 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----

> From: Mike Frysinger [mailto:vapier at gentoo.org]

> Sent: Thursday, April 05, 2012 1:23 AM

> To: u-boot at lists.denx.de

> Cc: Bishop, Mark

> Subject: Re: [U-Boot] fw_printenv can't read the uboot enviroment from


> NAND

> 

> might want to figure out why that block is bad in your NAND.

> -mike

 

I have another virgin board and it is doing the same thing.

Would this have anything to do with the device page size (2048 + 64
bytes) or block size (64 pages, 128K + 4K bytes)?

 

(FYI, I have a broken mailer which is why all the mail headers are no
longer intact. The list blocks base64.)

 

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
  2012-04-04 17:15 ` Mike Frysinger
  2012-04-04 19:50   ` Bishop, Mark
@ 2012-04-05  5:23   ` Mike Frysinger
  1 sibling, 0 replies; 8+ messages in thread
From: Mike Frysinger @ 2012-04-05  5:23 UTC (permalink / raw)
  To: u-boot

On Wednesday 04 April 2012 13:15:15 Mike Frysinger wrote:
> On Wednesday 04 April 2012 12:00:42 Bishop, Mark wrote:
> > root:/> cat /etc/fw_env.config
> > /dev/mtd0               0x60000         0x20000         0x20000 1
> > 
> > ioctl(3, MEMGETINFO, {type=MTD_NANDFLASH,
> > flags=MTD_WRITEABLE, size=0x80000, erasesize=0x20000, writesize=0x800,
> > oobsize=0x40, padding=0xffffffff}) = 0
> > ioctl(3, MEMGETBADBLOCK, [0x60000])      = 1
> > ioctl(3, MEMGETBADBLOCK, [0x80000])      = -1 EINVAL (Invalid argument)
> 
> to summarize further: the flash is 0x80000 bytes long, and he's using the
> last sector in flash to hold his env, and fw_printenv seems to have an
> off-by-one in the badblock check.  there's no reason it should be checking
> 0x80000.

actually, reading it a bit more, it seems your NAND has that last block marked 
as bad.  so the fw_printenv code is working correctly.  it moved on to the 
next one.

it should have printed out:
	Too few good blocks within range
but since it walked past the end of the flash, you got:
	Cannot read bad block mark: Invalid argument
so the tool should be updated slightly

might want to figure out why that block is bad in your NAND.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120405/a7cf03c1/attachment.pgp>

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
  2012-04-04 17:15 ` Mike Frysinger
@ 2012-04-04 19:50   ` Bishop, Mark
  2012-04-05  5:23   ` Mike Frysinger
  1 sibling, 0 replies; 8+ messages in thread
From: Bishop, Mark @ 2012-04-04 19:50 UTC (permalink / raw)
  To: u-boot

> -----Original Message-----
> From: Mike Frysinger [mailto:vapier at gentoo.org]
> Sent: Wednesday, April 04, 2012 1:15 PM
> To: u-boot at lists.denx.de
> Cc: Bishop, Mark
> Subject: Re: [U-Boot] fw_printenv can't read the uboot enviroment from
> NAND
> 
> On Wednesday 04 April 2012 12:00:42 Bishop, Mark wrote:
> > root:/> cat /etc/fw_env.config
> > /dev/mtd0               0x60000         0x20000         0x20000 1
> >
> > ioctl(3, MEMGETINFO, {type=MTD_NANDFLASH, flags=MTD_WRITEABLE,
> > size=0x80000, erasesize=0x20000, writesize=0x800, oobsize=0x40,
> > padding=0xffffffff}) = 0
> > ioctl(3, MEMGETBADBLOCK, [0x60000])      = 1
> > ioctl(3, MEMGETBADBLOCK, [0x80000])      = -1 EINVAL (Invalid
> argument)
> 
> to summarize further: the flash is 0x80000 bytes long, and he's using
> the last sector in flash to hold his env, and fw_printenv seems to
have
> an off-by-one in the badblock check.  there's no reason it should be
> checking 0x80000.
> -mike

Don't know if this helps:
root:/> cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# MTD device name       Device offset   Env. size       Flash sector
size       Number of sectors
/dev/mtd0               0x60000         0x1ffff         0x1ffff
1

root:/> fw_printenv
Too few good blocks within range

root:/> strace  fw_printenv
mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2d5c000
stat("/etc/ld.so.cache", {st_mode=S_IFREG|0644, st_size=1108, ...}) = 0
open("/etc/ld.so.cache", O_RDONLY)      = 3
mmap2(NULL, 1108, PROT_READ, MAP_PRIVATE, 3, 0) = 0x209a000
close(3)                                = 0
open("/lib/libgcc_s.so.1", O_RDONLY)    = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=62416, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2d5f000
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\324#\0\0004\0\0\0"...,
4096) = 4096
mmap2(NULL, 57256, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x2e00000
mmap2(NULL, 8184, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2e10000
pread(3,
"\17d\325/\0h\5h;/\353\2708\242\202\316\6\302\322\270\0\0\377\343\35\372
\216/8\256\302\254"..., 8024, 53248) = 8024
close(3)                                = 0
munmap(0x2d5f000, 4096)                 = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=252236, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_PRIVATE|MAP_ANONYMOUS|0x4000000, -1, 0) = 0x2d5f000
read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0j\0\1\0\0\0\f\313\0\0004\0\0\0"...,
4096) = 4096
mmap2(NULL, 243908, PROT_READ|PROT_EXEC,
MAP_PRIVATE|MAP_DENYWRITE|MAP_EXECUTABLE, 3, 0) = 0x2e40000
mmap2(NULL, 17920, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1,
0) = 0x2e18000
pread(3, "__get_myaddress: socket\0__get_my"..., 8840, 241664) = 8840
close(3)                                = 0
munmap(0x2d5f000, 4096)                 = 0
open("/lib/libc.so.0", O_RDONLY)        = 3
fstat(3, {st_mode=S_IFREG|0755, st_size=252236, ...}) = 0
close(3)                                = 0
munmap(0x209a000, 1108)                 = 0
stat("/lib/ld-uClibc.so.0", {st_mode=S_IFREG|0755, st_size=20348, ...})
= 0
ioctl(0, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS,
{B57600 opost isig icanon echo ...}) = 0
ioctl(1, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS,
{B57600 opost isig icanon echo ...}) = 0
open("/etc/fw_env.config", O_RDONLY)    = 3
ioctl(3, SNDCTL_TMR_TIMEBASE or SNDRV_TIMER_IOCTL_NEXT_DEVICE or TCGETS,
0x2dffb78) = -1 ENOTTY (Inappropriate ioctl for device)
mmap2(NULL, 4096, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x209a000
read(3, "# Configuration file for fw_(pri"..., 256) = 256
read(3, "Flash sector size\tNumber of sect"..., 256) = 163
read(3, "", 256)                        = 0
close(3)                                = 0
stat("/dev/mtd0", {st_mode=S_IFCHR|0660, st_rdev=makedev(90, 0), ...}) =
0
mmap2(NULL, 135168, PROT_READ|PROT_WRITE,
MAP_SHARED|MAP_ANONYMOUS|0x4000000, 0, 0) = 0x2e80000
open("/dev/mtd0", O_RDONLY)             = 3
ioctl(3, MEMGETINFO or MFB_SET_CHROMA_KEY, {type=MTD_NANDFLASH,
flags=MTD_WRITEABLE, size=0x80000, erasesize=0x20000, writesize=0x800,
oobsize=0x40, padding=0xffffffff}) = 0
ioctl(3, MEMGETBADBLOCK, [393216])      = 1
ioctl(3, MEMGETBADBLOCK, [524287])      = 1
write(2, "Too few good blocks within range"..., 33Too few good blocks
within range
) = 33
close(3)                                = 0
_exit(1)

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
  2012-04-04 16:00 Bishop, Mark
@ 2012-04-04 17:15 ` Mike Frysinger
  2012-04-04 19:50   ` Bishop, Mark
  2012-04-05  5:23   ` Mike Frysinger
  0 siblings, 2 replies; 8+ messages in thread
From: Mike Frysinger @ 2012-04-04 17:15 UTC (permalink / raw)
  To: u-boot

On Wednesday 04 April 2012 12:00:42 Bishop, Mark wrote:
> root:/> cat /etc/fw_env.config
> /dev/mtd0               0x60000         0x20000         0x20000 1
> 
> ioctl(3, MEMGETINFO, {type=MTD_NANDFLASH,
> flags=MTD_WRITEABLE, size=0x80000, erasesize=0x20000, writesize=0x800,
> oobsize=0x40, padding=0xffffffff}) = 0
> ioctl(3, MEMGETBADBLOCK, [0x60000])      = 1
> ioctl(3, MEMGETBADBLOCK, [0x80000])      = -1 EINVAL (Invalid argument)

to summarize further: the flash is 0x80000 bytes long, and he's using the last 
sector in flash to hold his env, and fw_printenv seems to have an off-by-one in 
the badblock check.  there's no reason it should be checking 0x80000.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120404/515532d4/attachment.pgp>

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

* [U-Boot] fw_printenv can't read the uboot enviroment from NAND
@ 2012-04-04 16:00 Bishop, Mark
  2012-04-04 17:15 ` Mike Frysinger
  0 siblings, 1 reply; 8+ messages in thread
From: Bishop, Mark @ 2012-04-04 16:00 UTC (permalink / raw)
  To: u-boot

Trying to read (and then modify) the uboot environment in NAND from
linux userspace and I am running into some issues.

I downloaded the latest uboot and I am first trying only the latest
fw_printenv on my current system:

root:/> cat /etc/fw_env.config
# Configuration file for fw_(printenv/saveenv) utility.
# MTD device name       Device offset   Env. size       Flash sector
size       Number of sectors
# NAND example
/dev/mtd0               0x60000         0x20000         0x20000
1
root:/>

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

end of thread, other threads:[~2012-04-05 18:08 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <mailman.4653.1333649145.16643.u-boot@lists.denx.de>
2012-04-05 18:07 ` [U-Boot] fw_printenv can't read the uboot enviroment from NAND Bishop, Mark
2012-04-05 18:08 Bishop, Mark
  -- strict thread matches above, loose matches on Subject: below --
2012-04-05 15:14 Bishop, Mark
2012-04-05 17:41 ` Mike Frysinger
2012-04-04 16:00 Bishop, Mark
2012-04-04 17:15 ` Mike Frysinger
2012-04-04 19:50   ` Bishop, Mark
2012-04-05  5:23   ` Mike Frysinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.