2011-03-10 14:56:47     BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2011-03-10 14:56:47     BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98853   

 

I have uboot booting out of NAND and I can download a copy of vmImage and boot out of memory, but I am losing something in translation.

 

The board's kernel is setup as (I only bring this up because I think I need to specify  'root=/dev/mtdblock7' when I eventually get the filesystem into NAND).  I haven't changed anything from the EZ-KIT defines.

....

mtd5: 00080000 000200000 "bootloader (nand)"

mtd6: 00400000 00020000 "linux kernel (nand)"

mtd7: 0fb80000 00020000 "file system (nand)"

 

Now I have uboot at offset 0x0 in nand and I am trying to get the kernel into NAND next.  I've tried this:

 

bfin> tftp 0x1000000 vmImage

bfin> nand erase 0x80000 0x480000

and erase.jffs2 in seprate test run

 

bfin> nand write 0x1000000 0x80000 0x480000

and write.jffs2 in separate test run

 

bfin>  nboot 0x2000000 0x80000

**Device 524288 not available (address 0x80000)

 

I look at the contents of nand:

 

bfin> nand read 0x20000 0x80000 0x1000

 

NAND read: device 0 offset 0x80000, size 0x1000

4096 bytes read: OK

bfin> md.b 0x20000 0xFF

00020000: 27 05 19 56 9f 43 19 18 4d 76 90 43 00 17 d1 6f    '..V.C..Mv.C...o

00020010: 00 00 10 00 00 2b 5d f4 f4 3b b6 13 05 10 02 01    .....+]..;......

00020020: 62 66 35 34 38 2d 30 2e 32 2d 32 2e 36 2e 33 37    bf548-0.2-2.6.37

00020030: 2e 32 2d 41 44 49 2d 32 30 31 31 52 31 2d 70 72    .2-ADI-2011R1-pr

00020040: 1f 8b 08 00 41 90 76 4d 02 03 c4 bd 79 7c 14 45    ....A.vM....y|.E

00020050: da 38 5e 3d c9 cc f4 0c 9d a4 27 0c 4c 87 0c 64    .8^=......'.L..d

00020060: 12 ae 49 50 a6 d3 a0 06 cf c9 81 0e 81 24 93 90    ..IP.........$..

00020070: 20 06 16 1b 12 48 d4 60 40 5d c5 63 d7 24 28 22     ....H.`@].c.$("

00020080: ba 9a 21 e2 bd bb 93 a0 18 11 75 12 3c 40 70 17    ..!.......u.<@p.

00020090: 15 11 5d 16 d0 95 5d 74 5d 97 a6 93 80 8a 1a 40    ..]...]t]......@

000200a0: 24 9c f3 7b 9e ea ee 1c 80 fb ee fb 7e ff f8 e5    $..{........~...

000200b0: f3 49 4d f5 f3 54 3d 55 f5 d4 f5 3c 75 3c f5 bd    .IM..T=U...<u<..

000200c0: d9 2b 5d 2b 56 17 54 17 b1 52 15 e3 57 52 c9 82    .+]+V.T..R..WR..

000200d0: da 02 31 3f 44 94 af 94 c4 8e 4b 48 bc 5a f3 08    ..1?D.....KH.Z..

000200e0: a3 de 96 9f 25 66 8a f3 89 57 64 d4 9a fc ac 12    ....%f...Wd.....

000200f0: 2e 46 30 99 4c 8b 4b 8a 4b b2 c4 3a ce e2 f4    .F0.L.K.K..:...

bfin>

 

Sorry to waste the bandwidth but I am stuck right now - I've been searching through the forums last few days looking to see if someone was as clueless as I in some point in the past.

QuoteReplyEditDelete

 

 

2011-03-10 16:02:17     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98855   

 

Ok, I forgot that there are three parameters to 'nboot'

 

bfin> nboot 0x2000000 0 0x80000

 

Loading from NAND 256MiB 3,3V 8-bit, offset 0x80000

   Image Name:   bf548-0.2-2.6.37.2-ADI-2011R1-pr

   Created:      2011-03-08  20:23:31 UTC

   Image Type:   Blackfin Linux Kernel Image (gzip compressed)

   Data Size:    1560943 Bytes = 1.5 MiB

   Load Address: 00001000

   Entry Point:  002b5df4

bfin>

QuoteReplyEditDelete

 

 

2011-03-10 16:03:43     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mike Frysinger (UNITED STATES)

Message: 98856   

 

that's basically what i was going to say.  so you're all set now ?

QuoteReplyEditDelete

 

 

2011-03-10 17:31:53     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98858   

 

Finishing touches.... autoboot

 

 

 

bfin>  setenv nandboot 'nand read $(loadaddr) 0x80000 0x480000;run nandargs;bootm'

 

bfin> saveenv

Saving Environment to NAND...

Erasing Nand...

Erasing at 0x40000 -- 100% complete.

Writing to Nand... done

bfin>

 

 

 

Completely destroys my NAND uboot at 0x0 and I have to re-load it.

QuoteReplyEditDelete

 

 

2011-03-10 20:02:32     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mike Frysinger (UNITED STATES)

Message: 98860   

 

presumably the variable in question is irrelevant and a simple "save" breaks things.  check your env settings to see what u-boot is being told to do.

QuoteReplyEditDelete

 

 

2011-03-11 09:10:04     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98894   

 

Not that I can't find it myself, but where are those settings at?

QuoteReplyEditDelete

 

 

2011-03-11 09:30:42     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98895   

 

(include/configs/bf548-ezkit.h)

 

#define CONFIG_ENV_OFFSET       0x40000

#define CONFIG_ENV_SIZE              0x20000

 

 

The uboot code takes the first two pages 0x00000 - 0x3ffff and the uboot environment takes 0x40000-0x5ffff, but the config in the kernel defines all of the uboot partition from 0x0 to 0x7ffff, so what is going on with 0x60000-0x7ffff?

 

 

 

 

arch/blackfin/mach-bf548/boards/ezkit.c  static struct mtd_partition partition_info[] = {

    {

        .name = "bootloader(nand)",

        .offset = 0,

        .size = 0x80000,

    }, {

.....

 

QuoteReplyEditDelete

 

 

2011-03-11 09:43:55     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98896   

 

Weird, the default NAND uboot image is 0x41638 large, so it would require 0x0-0x5ffff, but the header files wants to save the environment at 0x4000.  Is this correct?

QuoteReplyEditDelete

 

 

2011-03-11 10:32:35     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mike Frysinger (UNITED STATES)

Message: 98898   

 

it depends on whether you have embedded the env.  if not, then that isnt going to work.

QuoteReplyEditDelete

 

 

2011-03-11 11:13:30     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mark Bishop (UNITED STATES)

Message: 98899   

 

Should I submit a patch (this is all default bf548-ezkit stuff)?

QuoteReplyEditDelete

 

 

2011-03-12 02:02:02     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mike Frysinger (UNITED STATES)

Message: 98904   

 

sorry, i thought you were using a custom board.  a bunch of NAND threads recently and i'm getting them mixed up.

 

this should probably fix it:

-#define CONFIG_ENV_OFFSET  0x40000

+#define CONFIG_ENV_OFFSET  0x60000

QuoteReplyEditDelete

 

 

2011-04-02 13:30:59     Re: BF548 EZ-Kit and NAND flash (uboot/kernel/filesystem)

Mike Frysinger (UNITED STATES)

Message: 99539   

 

ive made this change to svn trunk at any rate

QuoteReplyEditDelete

Attachments

    Outcomes