From: Stefan Roese <sr@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] RFC: i.MX6 write U-Boot to NAND
Date: Tue, 26 Apr 2016 08:05:55 +0200 [thread overview]
Message-ID: <571F0543.1000807@denx.de> (raw)
In-Reply-To: <571F0001.8080504@denx.de>
Hi Sergey, Hi Heiko,
On 26.04.2016 07:43, Heiko Schocher wrote:
> add Stefano to Cc as he is the imx6 custodian,
>
> Am 25.04.2016 um 22:29 schrieb Sergey Kubushyn:
>> Hi everybody,
>>
>> It looks like using kobs-ng utility is the only way to make a bootable
>> NAND
>> for i.MX6 and their siblings. There might be other utilities I'm not
>> aware
>> of but that doesn't change anything -- you need Linux (or whatever that
>> utility runs on) running on your board to create and write all those
>> FCB and
>> other parts onto a virgin raw NAND device.
>
> Yes, I stumbled over that too recently ...
>
>> This makes initial programming a cumbersome and complicated operation.
>> One
>> can not program NAND on a development machine as it is easy to do with
>> e.g.
>> SD Card -- the OS must run on the same board where that NAND is
>> because NAND
>> is not removable.
>>
>> It is possible, of course, to assemble something on an SD Card and use
>> that
>> to program NAND but that assumes there is an SD Card slot on a target
>> system
>> and some means to tell it to boot off of SD Card. However it is not
>> always a
>> case -- there might be boards with NAND as only storage device available.
>> That leaves only Serial/USB boot as only options for initial boot on a
>> virgin board. However it does not provide means for writing the NAND
>> U-Boot
>> into actual NAND.
>>
>> There are many different varieties of NAND chips so those FCB and other
>> structures are not generic i.e. they can not be defined beforehead and
>> just
>> prepended to the actual U-Boot image. Even if we have made those a
>> configuration parameters there are still bad block tables that are chip
>> specific so they should be discovered first i.e. FCB should be built
>> dynamically based on NAND scanning results.
>>
>> Sure, one can write a custom first stage SPL that would've booted the
>> actual
>> U-Boot via the same Serial/USB interface and run it but then what? Let's
>> assume the target board doesn't have ethernet so it would make it
>> impossible
>> to mount rootfs over NFS and no other storage devices available. It is
>> still
>> possible to load Linux kernel and bare minimal rootfs in initramfs
>> image but
>> that's a lot of serial downloading just for initializing NAND...
>>
>> It would be nice to have a U-Boot command that would've allowed
>> initial NAND
>> setup and writing NAND U-Boot image to it properly updating the headers.
>
> Yes, that would be great!
>
>> There might be other ways to do this that I might've overlooked...
>>
>> Does anybody knows a ready-made solution or works on something
>> suitable for
>> this purpose? I don't want to re-invent the wheel starting my own
>> solution
>> so it would've been good to hear from other guys who might've solved this
>> dilemma.
>
> Sorry, I do not know another way.
>
>> Any thoughts?
>
> I think, an U-Boot command which writes the headers into the nand would
> be a good thing.
>
> tools/imximage.c is may the wrong place, as the infos in FCB and DBBT
> are dependend on the boards nand.
I've missed such a tool a few years ago while porting U-Boot & Linux
to a i.MX6 based NAND booting board as well. And noticed since then
that barebox has included such a tool:
http://lists.infradead.org/pipermail/barebox/2014-March/018202.html
Perhaps its not too much work to port this tool over to U-Boot?
Just an idea...
Thanks,
Stefan
next prev parent reply other threads:[~2016-04-26 6:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-25 20:29 [U-Boot] RFC: i.MX6 write U-Boot to NAND Sergey Kubushyn
2016-04-26 5:43 ` Heiko Schocher
2016-04-26 6:05 ` Stefan Roese [this message]
2016-04-26 6:58 ` Sergey Kubushyn
2016-04-26 7:03 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=571F0543.1000807@denx.de \
--to=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.