[U-Boot] [PATCH v3 12/15] arm, davinci: Add SPL support for DA850 SoCs

Christian Riesch christian.riesch at omicron.at
Wed Nov 30 17:39:23 CET 2011


Hi Tom,

On Wed, Nov 30, 2011 at 3:18 PM, Tom Rini <tom.rini at gmail.com> wrote:
> On Wed, Nov 30, 2011 at 12:22 AM, Christian Riesch
> <christian.riesch at omicron.at> wrote:
>> On Tue, Nov 29, 2011 at 7:27 PM, Tom Rini <tom.rini at gmail.com> wrote:
>>> On Fri, Nov 25, 2011 at 5:37 AM, Christian Riesch
>>> <christian.riesch at omicron.at> wrote:
>>>> This code adds an SPL for booting from SPI flash on DA850 SoCs.
>>>>
>>>> Signed-off-by: Christian Riesch <christian.riesch at omicron.at>
>>>> Cc: Heiko Schocher <hs at denx.de>
>>>> Cc: Sandeep Paulraj <s-paulraj at ti.com>
>>>
>>> Parts of this remind me of omap-common/spl.c so I think longer term we
>>> need to figure out if we can make everyone live with a few more common
>>> SPL files and functions.
>>
>> I stole some ideas from omap-common/spl.c and yes, there are similarities :-)
>
> OK, note made on my TODO list

Maybe we could then also implement this idea from Heiko to select the
boot method, see
http://lists.denx.de/pipermail/u-boot/2011-November/109997.html

---snip---
Hmm.. as it is a RFC ... maybe we should go the following way:
(just a fast idea):

create new file u-boot:spl/boot.c:

/* could be board specific */
static int __weak get_boot_method(void)
{
#if defined SPL_BOOTMETHOD_NAND
	return SPL_BOOTMETHOD_NAND
#endif
#if defined SPL_BOOTMETHOD_SPI
	return SPL_BOOTMETHOD_SPI
#endif
[...]

/*
 * if more options are defined for one board
 * board specific code has to be written, to decide
 * which boot method is used (gpio pin?)
 * So it is possible to boot from different
 * devices...
 */
}

void board_init_r(gd_t *id, ulong dummy)
{
	int boot_method;

	boot_method = get_boot_method();
	switch (boot_ethod) {
#if defined SPL_BOOTMETHOD_NAND
	case SPL_BOOTMETHOD_NAND:
		nand_init();
		puts("Nand boot...\n");
		nand_boot();
		break;
#endif
#if defined SPL_BOOTMETHOD_SPI
	case SPL_BOOTMETHOD_NAND:
		puts("SPI boot...\n");
		break;
#endif
	default:
		/* error */
		puts("no valid boot method\n");
		hang();
		break;
	}
}

That should be usable from other architectures too ...
---snip---

Regards, Christian


More information about the U-Boot mailing list