From: Roy Spliet <r.spliet@ultimaker.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [linux-sunxi] [RFC 11/11] mtd/nand: Sunxi NAND boot partition definitions
Date: Mon, 08 Jun 2015 13:35:04 +0200 [thread overview]
Message-ID: <55757DE8.6070708@ultimaker.com> (raw)
In-Reply-To: <213E9959-2EE7-4AE4-A95E-CC86FA5984B3@gmail.com>
Hello Yassin,
Op 08-06-15 om 12:48 schreef Yassin:
> Hi Roy
> Thank you for working on this, I would like to suggest if you could implement separate control commands to switch ECC and Randomisation modes per partitions. I know this is not the best approach but it will provide more controls.
Thanks for the suggestion. However, for now I do not see the immediate
need for this in U-boot. U-boot should really only care about one thing:
load Linux. Therefore, the only partition it needs to be able to read is
whatever partition is used for storing boot data on. And if we only care
about one NAND partition, we don't need per-partition settings.
I agree that it would be nice to have eventually, but I think this
problem first needs to be solved in Linux properly. Then in U-boot we
can sync MTD up with Linux and we get the support we need "for free".
I'd personally recommend to take this approach over now first hacking up
all sorts of new commands in U-boot, as the latter will create more
problems with syncing up MTD and doing the right thing on the longer run.
Yours,
Roy
>
>
>> On 8 Jun 2015, at 7:11 pm, Roy Spliet <r.spliet@ultimaker.com> wrote:
>>
>> Dear Michal,
>>
>> Op 08-06-15 om 10:54 schreef Michal Suchanek:
>>> On 8 June 2015 at 10:38, Roy Spliet <r.spliet@ultimaker.com> wrote:
>>>> Hello Michal,
>>>>
>>>> Op 07-06-15 om 18:48 schreef Michal Suchanek:
>>>>
>>>> Hello,
>>>>
>>>> On 5 June 2015 at 13:52, Roy Spliet <r.spliet@ultimaker.com> wrote:
>>>>
>>>> Based on the default layout of the android image used at least on Olimex
>>>> Lime
>>>>
>>>> Signed-off-by: Roy Spliet <r.spliet@ultimaker.com>
>>>> ---
>>>> include/configs/sunxi-common.h | 9 +++++++++
>>>> 1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/include/configs/sunxi-common.h b/include/configs/sunxi-common.h
>>>> index ec28c40..b38f2f5 100644
>>>> --- a/include/configs/sunxi-common.h
>>>> +++ b/include/configs/sunxi-common.h
>>>> @@ -404,8 +404,15 @@ extern int soft_i2c_gpio_scl;
>>>> #define BOOT_TARGET_DEVICES_USB(func)
>>>> #endif
>>>>
>>>> +#ifdef CONFIG_NAND
>>>> +#define BOOT_TARGET_DEVICES_NAND(func) func(NAND, nand , 0)
>>>> +#else
>>>> +#define BOOT_TARGET_DEVICES_NAND(func)
>>>> +#endif
>>>> +
>>>> #define BOOT_TARGET_DEVICES(func) \
>>>> BOOT_TARGET_DEVICES_MMC(func) \
>>>> + BOOT_TARGET_DEVICES_NAND(func) \
>>>> BOOT_TARGET_DEVICES_SCSI(func) \
>>>> BOOT_TARGET_DEVICES_USB(func) \
>>>> func(PXE, pxe, na) \
>>>> @@ -441,6 +448,8 @@ extern int soft_i2c_gpio_scl;
>>>> MEM_LAYOUT_ENV_SETTINGS \
>>>> "fdtfile=" CONFIG_DEFAULT_DEVICE_TREE ".dtb\0" \
>>>> "console=ttyS0,115200\0" \
>>>> + "mtdids=nand0=mtd2\0" \
>>>> + "mtdparts=mtdparts=mtd2:0xffc00000 at 0x400000(nand0_main)\0" \
>>>> BOOTENV
>>>>
>>>> From what I heard the nand boot partition size should be specified in
>>>> nand pages rather than bytes because the boot rom loads a fixed number
>>>> of pages and just uses the start of each page regardless of page size.
>>>>
>>>> Although I believe you have the facts mostly right, they do not apply in
>>>> this situation.
>>>> What you are looking for is the partition definition for U-boot. At this
>>>> point the boot
>>>> rom (BROM) is no longer active and thus it's inner workings are mostly
>>>> irrelevant.
>>>> The NAND partition lay-out for the boards I have seen (various Olimex +
>>>> Cubietruck..)
>>>> are as follows:
>>>> 0-2MB U-Boot-SPL + U-Boot
>>> OK, so 0-2 MB has to be read (at least in part) by brom to load the
>>> SPL so it must be in the format brom understands. The part containing
>>> the SPL which is read by brom has certain number of pages. The u-boot
>>> part can contain whatever we define.
>>>
>>>> 2-4MB U-Boot SPL + U-Boot (for recovery)
>>>> 4MB+ Main file system
>>> The main filesystem has to be in format suitable for UBIFS. It has to
>>> follow u-boot part possibly with some space in between.
>>>
>>> If support for non-uniform flash format is not available then there
>>> are basically two options:
>>>
>>> 1) SPL supports brom format and u-boot binary is part of boot
>>> partition. SPL can read/write itself and u-boot and u-boot can
>>> read/write the main partition
>>>
>>> 2) SPL and u-boot support the main partition format. While u-boot is
>>> written to the boot partition its pages are written in the format
>>> suitable for ubifs. This will get hairy when you want to actually
>>> write u-boot and SPL.
>>>
>>> The problem with counting the partition sizes in bytes is obvious -
>>> whatever you do the brom reads predefined number of pages from the
>>> start of the nand to load the SPL and unless you know maximum page
>>> size of every nand ever made that is compatible with Allwinner brom
>>> you cannot tell what is even the maximum size of this part in bytes.]
>> The solution already implemented now and carried to Hans' tree is 1)
>> with the size of SPL aligned to 8KB blocks (the largest of the page sizes
>> attempted). The modes tried by BROM are listed in [1]. SPL currently
>> tries only a single mode whose params are defined in sunxi-common.h,
>> but this is likely to change to a "brute-force" approach to resemble
>> BROM in the near future.
>> Yours,
>>
>> Roy
>>> Thanks
>>>
>>> Michal
>> [1] https://linux-sunxi.org/NAND
>>
>> --
>>
>>
>> IMAGINE IT >> MAKE IT
>>
>> Meet us online at Twitter <http://twitter.com/ultimaker>, Facebook <http://facebook.com/ultimaker>, Google+ <http://google.com/+Ultimaker>
>>
>> www.ultimaker.com
>>
>> --
>> You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe at googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.
--
IMAGINE IT >> MAKE IT
Meet us online at Twitter <http://twitter.com/ultimaker>, Facebook
<http://facebook.com/ultimaker>, Google+ <http://google.com/+Ultimaker>
www.ultimaker.com
next prev parent reply other threads:[~2015-06-08 11:35 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-05 11:52 [U-Boot] [RFC] Sunxi NAND support for U-Boot Roy Spliet
2015-06-05 11:52 ` [U-Boot] [RFC 01/11] mtd/nand: define struct nand_timings Roy Spliet
2015-06-05 11:52 ` [U-Boot] [RFC 02/11] mtd/nand: add ONFI timing mode to nand_timings converter Roy Spliet
2015-06-05 22:02 ` Scott Wood
2015-06-08 8:11 ` Roy Spliet
2015-06-08 8:34 ` [U-Boot] [linux-sunxi] " Michal Suchanek
2015-06-08 8:41 ` Roy Spliet
2015-06-14 11:59 ` Boris Brezillon
2015-06-08 20:24 ` [U-Boot] " Scott Wood
2015-06-10 8:33 ` Hans de Goede
2015-06-10 19:06 ` Scott Wood
2015-06-05 11:52 ` [U-Boot] [RFC 03/11] mtd/nand: support ONFI timing mode retrieval for non-ONFI Roy Spliet
2015-06-14 11:53 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 04/11] mtd/nand: add page status table (pst) Roy Spliet
2015-06-14 11:52 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 05/11] mtd/nand: take nand_ecc_ctrl initialization out of nand_scan_tail Roy Spliet
2015-06-14 11:50 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 06/11] mtd/nand: Add randomisation layer Roy Spliet
2015-06-14 11:47 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 07/11] mtd/nand Add Sunxi NAND driver Roy Spliet
2015-06-14 11:42 ` Boris Brezillon
2015-06-14 11:45 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 08/11] mtd/nand: Add DT definitions for Olimex Lime Roy Spliet
2015-06-14 11:39 ` Boris Brezillon
2015-06-05 11:52 ` [U-Boot] [RFC 09/11] sunxi/nand: Enable UBI and NAND commands Roy Spliet
2015-06-06 15:13 ` Hans de Goede
2015-06-06 15:36 ` Ian Campbell
2015-06-08 7:38 ` Roy Spliet
2015-06-08 9:12 ` Ian Campbell
2015-06-05 11:52 ` [U-Boot] [RFC 10/11] mtd/nand: Define bootcmd for nand Roy Spliet
2015-06-05 11:52 ` [U-Boot] [RFC 11/11] mtd/nand: Sunxi NAND boot partition definitions Roy Spliet
2015-06-07 16:48 ` [U-Boot] [linux-sunxi] " Michal Suchanek
2015-06-08 8:38 ` Roy Spliet
2015-06-08 8:54 ` Michal Suchanek
2015-06-08 9:11 ` Roy Spliet
2015-06-08 10:48 ` Yassin
2015-06-08 11:35 ` Roy Spliet [this message]
2015-06-14 11:31 ` Boris Brezillon
2015-06-15 8:00 ` Hans de Goede
2015-06-08 13:16 ` Hans de Goede
2015-06-08 13:56 ` Roy Spliet
2015-06-14 11:25 ` Boris Brezillon
2015-06-14 11:56 ` Michal Suchanek
2015-06-14 12:18 ` Boris Brezillon
2015-06-14 17:42 ` Michal Suchanek
2015-06-14 19:07 ` Boris Brezillon
2015-06-06 15:09 ` [U-Boot] [RFC] Sunxi NAND support for U-Boot Hans de Goede
2015-06-06 15:11 ` Hans de Goede
2015-06-14 11:13 ` Boris Brezillon
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=55757DE8.6070708@ultimaker.com \
--to=r.spliet@ultimaker.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox