[U-Boot] [linux-sunxi] Re: Proposal to add NAND-boot support for Sunxi SPL

Michal Suchanek hramrach at gmail.com
Fri May 22 09:38:53 CEST 2015


On 21 May 2015 at 20:08, Hans de Goede <hdegoede at redhat.com> wrote:
> Hi Roy,
>
> On 21-05-15 15:59, Roy Spliet wrote:
>>
>> The following patches take the work by Daniel Kochmánski, and make some
>> heavy modifications for readability and functionality, based on Boris
>> Brezillon's Linux driver. Tested on an Olimex Lime w/ A20.
>> Patches are sent as RFC. Open questions:
>> - Config options added are partially NAND-chip specific. Some options can
>> be autodetected based on the NAND ID, others require either brute-forcing
>> or config options like these. Do they belong in sunxi-common? Should

I did not look at the u-boot patches but on the kernel side this is
not completely solved I think.

AFAIK the BROM reads the nand in blocks and takes 1k from the start of
block and discards the rest regardless of block size. On the other
hand, the partition size in the DT is in bytes, not blocks. A person
soldered an uncommon nand chip on an Olinuxino board without nand and
the whole driver fell apart probably due to uncommon block size of the
chip.

>> we make a Kconfig option for this? If bikeshedding is desired, are defines
>> in sunxi-common.h good enough for now?
>> - Style is mostly kernel-like. Satisfied?
>> - Daniel: do you think we can work from here?
>>
>> Please comment away!
>
>
> Cool stuff. Overall this looks good I'll reply with more detailed feedback
> to your individual patches, 2 questions:
>
> 1) Can you provide a quick howto (at developer level) on how to actually
> get the spl and u-boot into the nand, what I'm looking for is unstructions
> like this:
>
> a) Take this git repo + branch, build a kernel from it

I have some extra nand patches here:
https://github.com/hramrach/linux-sunxi/commits/sunxi-nand-next

Unfortunately, this branch does not boot on a20 atm, at least from
mmc. I suspect I picked a few too many clock patches but have to
figure out what exactly breaks it.

However, you can cherry-pick

nand IDs
nand partitions on cubieboards
patch to ignore BBMs in case you have Allwinner formatted nand and it
appears 90%+ bad.

with the bbrezillion sunxi-nand-next and these you should be able to
access the cubieboard nand from Linux.

> b) Look at this dts file for a nand settings example, adjust it for your
> board
> c) Once booted into the kernel using an updated dts you should have these
> block devices, dd spl to this one, and u-boot to this one.

You will probably need mtd-utils mtd_debug/nandwrite/ubiformat/ubiattach/...

There are some tutorials on how to use these but I personally did not
try booting from nand so have no definitive answer what to write
where.

Thanks

Michal


More information about the U-Boot mailing list