U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] I can not read Linux image from my nand flash
@ 2009-11-27 12:14 Peter Pan
  2009-11-30 22:02 ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Pan @ 2009-11-27 12:14 UTC (permalink / raw)
  To: u-boot

My u-boot version is u-boot-2009-08.
In my U-boot, after I entered "nboot 800000 0 0",
the following messages shows:

Loading from NAND 1GiB 3,3V 8-bit, offset 0x0
   Image Name:   Linux-2.6.22.sac.rd
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1045865 Bytes = 1021.4 kB
   Load Address: 00000000
   Entry Point:  00000000
NAND read from offset ffffffff failed 0
** Read error

The image in nand is written in linux 2.6.22 using
nandwrite -p /dev/mtd3 uImage
This command works fine before.

I looked into the source tree, and u-boot should read out
the first block in my nand flash to show the information
of my image. But, after that, U-boot just think all the following
blocks are bad blocks, so it read failed. But when booting
linux using nfs with linux image in norflash, there is no
bad block shown when linux scan nand for bad blocks. How
could this happen? I have no idea right now.

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

* [U-Boot] I can not read Linux image from my nand flash
  2009-11-27 12:14 [U-Boot] I can not read Linux image from my nand flash Peter Pan
@ 2009-11-30 22:02 ` Scott Wood
  2009-12-01  0:27   ` Peter Pan
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-11-30 22:02 UTC (permalink / raw)
  To: u-boot

On Fri, Nov 27, 2009 at 08:14:41PM +0800, Peter Pan wrote:
> My u-boot version is u-boot-2009-08.
> In my U-boot, after I entered "nboot 800000 0 0",
> the following messages shows:
> 
> Loading from NAND 1GiB 3,3V 8-bit, offset 0x0
>    Image Name:   Linux-2.6.22.sac.rd
>    Image Type:   PowerPC Linux Kernel Image (gzip compressed)
>    Data Size:    1045865 Bytes = 1021.4 kB
>    Load Address: 00000000
>    Entry Point:  00000000
> NAND read from offset ffffffff failed 0
> ** Read error
> 
> The image in nand is written in linux 2.6.22 using
> nandwrite -p /dev/mtd3 uImage
> This command works fine before.

What u-boot verison is "before"?  What platform?

Are you getting any build warnings about 64-bit printf, BTW?

> I looked into the source tree, and u-boot should read out
> the first block in my nand flash to show the information
> of my image. But, after that, U-boot just think all the following
> blocks are bad blocks, so it read failed.

Perhaps u-boot and your version of Linux disagree about NAND layout.

-Scott

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

* [U-Boot] I can not read Linux image from my nand flash
  2009-11-30 22:02 ` Scott Wood
@ 2009-12-01  0:27   ` Peter Pan
  2009-12-01  0:31     ` Scott Wood
  0 siblings, 1 reply; 5+ messages in thread
From: Peter Pan @ 2009-12-01  0:27 UTC (permalink / raw)
  To: u-boot

The previous u-boot version I use is U-boot 1.2.0, an ancient version.
So I upgrade the u-boot to 2009-08.
The platform is MPC8247.
About build warnings, some warnings in printf for not proper type, and
yes, I get the 64-bit printf warning :

nand_util.c:45:2: warning: #warning Please define
CONFIG_SYS_64BIT_VSPRINTF for correct output!

After I change the loff_t from long long to unsigned long, it works fine now.

2009/12/1 Scott Wood <scottwood@freescale.com>
>
> On Fri, Nov 27, 2009 at 08:14:41PM +0800, Peter Pan wrote:
> > My u-boot version is u-boot-2009-08.
> > In my U-boot, after I entered "nboot 800000 0 0",
> > the following messages shows:
> >
> > Loading from NAND 1GiB 3,3V 8-bit, offset 0x0
> > ? ?Image Name: ? Linux-2.6.22.sac.rd
> > ? ?Image Type: ? PowerPC Linux Kernel Image (gzip compressed)
> > ? ?Data Size: ? ?1045865 Bytes = 1021.4 kB
> > ? ?Load Address: 00000000
> > ? ?Entry Point: ?00000000
> > NAND read from offset ffffffff failed 0
> > ** Read error
> >
> > The image in nand is written in linux 2.6.22 using
> > nandwrite -p /dev/mtd3 uImage
> > This command works fine before.
>
> What u-boot verison is "before"? ?What platform?
>
> Are you getting any build warnings about 64-bit printf, BTW?
>
> > I looked into the source tree, and u-boot should read out
> > the first block in my nand flash to show the information
> > of my image. But, after that, U-boot just think all the following
> > blocks are bad blocks, so it read failed.
>
> Perhaps u-boot and your version of Linux disagree about NAND layout.
>
> -Scott

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

* [U-Boot] I can not read Linux image from my nand flash
  2009-12-01  0:27   ` Peter Pan
@ 2009-12-01  0:31     ` Scott Wood
  2009-12-01  0:44       ` Peter Pan
  0 siblings, 1 reply; 5+ messages in thread
From: Scott Wood @ 2009-12-01  0:31 UTC (permalink / raw)
  To: u-boot

Peter Pan wrote:
> The previous u-boot version I use is U-boot 1.2.0, an ancient version.
> So I upgrade the u-boot to 2009-08.
> The platform is MPC8247.

That's a chip, not a platform.  Which NAND controller driver?  What 
happens if you also use a non-ancient Linux?  Have you compared the OOB 
layout between U-Boot and Linux?

> About build warnings, some warnings in printf for not proper type, and
> yes, I get the 64-bit printf warning :
> 
> nand_util.c:45:2: warning: #warning Please define
> CONFIG_SYS_64BIT_VSPRINTF for correct output!
> 
> After I change the loff_t from long long to unsigned long, it works fine now.

I suggest doing as it says, and defining CONFIG_SYS_64BIT_VSPRINTF in 
your board config file instead.

-Scott

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

* [U-Boot] I can not read Linux image from my nand flash
  2009-12-01  0:31     ` Scott Wood
@ 2009-12-01  0:44       ` Peter Pan
  0 siblings, 0 replies; 5+ messages in thread
From: Peter Pan @ 2009-12-01  0:44 UTC (permalink / raw)
  To: u-boot

I defined the CONFIG_SYS_64BIT_VSPRINTF, and change the __kernel__loff_t back
to long long, and it works.

My platform is a MPC8247 based customized board, which designed by my
colleagues.
 Nand is Samsung K9K8G08U0M.

Thank you very much for your advice. Now my u-boot works fine now.

2009/12/1 Scott Wood <scottwood@freescale.com>:
> Peter Pan wrote:
>>
>> The previous u-boot version I use is U-boot 1.2.0, an ancient version.
>> So I upgrade the u-boot to 2009-08.
>> The platform is MPC8247.
>
> That's a chip, not a platform. ?Which NAND controller driver? ?What happens
> if you also use a non-ancient Linux? ?Have you compared the OOB layout
> between U-Boot and Linux?
>
>> About build warnings, some warnings in printf for not proper type, and
>> yes, I get the 64-bit printf warning :
>>
>> nand_util.c:45:2: warning: #warning Please define
>> CONFIG_SYS_64BIT_VSPRINTF for correct output!
>>
>> After I change the loff_t from long long to unsigned long, it works fine
>> now.
>
> I suggest doing as it says, and defining CONFIG_SYS_64BIT_VSPRINTF in your
> board config file instead.
>
> -Scott
>

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

end of thread, other threads:[~2009-12-01  0:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-27 12:14 [U-Boot] I can not read Linux image from my nand flash Peter Pan
2009-11-30 22:02 ` Scott Wood
2009-12-01  0:27   ` Peter Pan
2009-12-01  0:31     ` Scott Wood
2009-12-01  0:44       ` Peter Pan

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