[Arm-netbook] Flashing the NAND

luke.leighton luke.leighton at gmail.com
Fri Dec 6 11:32:08 GMT 2013


On Fri, Dec 6, 2013 at 9:10 AM, Marco Martin <notmart at gmail.com> wrote:
> On Friday 06 December 2013, luke.leighton wrote:
>> hi marco, welcome to the list, and thanks for agreeing to post these
>
> thanks :)
>
>>  https://github.com/cubieboard2/linux-sunxi/tree/sunxi-3.4-cb2-dev/drivers/
>> block/sun7i_nand
>>
>>  yep, there you go.  that's what i recall using [over 4 months ago]
>> and i remember it working correctly.
>
> ok, so i have a small update on this already: the driver is there and is
> working in the sunxi-3.4 branch, i built all the pieces in the kernel and i
> now have from
> /dev/nanda to /dev/nandj

 awesome!

> nanda is the boot partition, nandd seems the ext4 root, nande a 512m vfat
> partition, nandh and nandi empty ext4 ones, nandj a 2gb vfat one.
> all the other seems to not be accessible

 i don't know what they're for.

> i suppose this layouthas to be maintained?

 not at all.  the only critical one from what i gather is that the 1st
partition has to start at a very specific offset (or, more
specifically, the start of boot0 has to be at a hard-coded absolute
location on the NAND).  i recommend taking a dd of nanda then examine
it with hexdump -C to see what's going on.

> (the space is very fragmented,
> doesn't let much storage space in the end
>
>>  so there are several pieces to the puzzle:
>>
>>  1) boot0 and boot1.  the GPL-compliant source for this has been
>> tracked down.  it should be easy to find, let me know if you have any
>> difficulties.
>
> is it in https://github.com/linux-sunxi/sunxi-tools  ?

 those are tools (userspace applications).  boot0 and boot1 are *very*
early bootloaders, they're small enough to fit into the 1st level
cache so that they can do things like set up the DDR3 timings so that
it even becomes possible to do things like... y'know... use the
memory? :)

 here's a hint worth investigating to track the code down:
 https://github.com/hno/allwinner-boot/commits/lichee-a20-dev

 henrik committed the A20 SDK to lichee-a20-dev so that would be a
good place to start investigating.  several others have copies as well
i'm sure.

 ahhhhh here we go:
 https://github.com/hno/allwinner-boot/tree/d29c34b7f221979724275b4861c50de3bd5b47fb

 that's the one.

>>  2) libnand-aware u-boot released by allwinner  this, again, should be
>> easy to find, on hno's github u-boot repo and in several other places.
>>  *quick search*... https://github.com/linux-sunxi/u-boot-sunxi/wiki  -
>> ah, there you go - lichee-a20-dev branch.  that'll do.
>>
>>  3) libnand-aware sunxi 3.4 kernel.  see above: that's at least one
>> version that i know of which works (and i've tested on EOMA68-A20 CPU
>> Cards).
>
> yes, this seem to work..
>
> will investigate on the other pieces of the puzzle

 let us know how you get on ok?  also much of this stuff is
current-knowledge in henrik (hno)'s head :)  can i possibly recommend
catching his attention on irc?



More information about the arm-netbook mailing list