[U-Boot] [PATCH 03/17] ARM: SPL: Move the omap SPL framework to arch/arm/lib

Tom Rini trini at ti.com
Thu Aug 16 16:38:16 CEST 2012


On 08/16/2012 12:45 AM, Stefano Babic wrote:
> On 15/08/2012 23:30, Tom Rini wrote:
>> Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the arch/arm/lib SPL
>> framework, enable on all of the previously using boards.
>>
>> Signed-off-by: Tom Rini <trini at ti.com>
>> ---
> 
> Hi Tom,
> 
>>  README                                      |    5 +
>>  arch/arm/cpu/armv7/omap-common/Makefile     |   13 --
>>  arch/arm/cpu/armv7/omap-common/spl.c        |  225 ---------------------------
>>  arch/arm/cpu/armv7/omap-common/spl_mmc.c    |  154 ------------------
>>  arch/arm/cpu/armv7/omap-common/spl_nand.c   |  111 -------------
>>  arch/arm/cpu/armv7/omap-common/spl_ymodem.c |   76 ---------
>>  arch/arm/lib/Makefile                       |    9 +-
>>  arch/arm/lib/spl.c                          |  225 +++++++++++++++++++++++++++
>>  arch/arm/lib/spl_mmc.c                      |  154 ++++++++++++++++++
>>  arch/arm/lib/spl_nand.c                     |  111 +++++++++++++
>>  arch/arm/lib/spl_ymodem.c                   |   76 +++++++++
>>  include/configs/am335x_evm.h                |    1 +
>>  include/configs/am3517_crane.h              |    1 +
>>  include/configs/am3517_evm.h                |    1 +
>>  include/configs/devkit8000.h                |    1 +
>>  include/configs/mcx.h                       |    1 +
>>  include/configs/omap3_beagle.h              |    1 +
>>  include/configs/omap3_evm_common.h          |    1 +
>>  include/configs/omap3_overo.h               |    1 +
>>  include/configs/omap4_common.h              |    1 +
>>  include/configs/omap5_evm.h                 |    1 +
>>  include/configs/tam3517-common.h            |    1 +
>>  include/configs/tricorder.h                 |    1 +
>>  23 files changed, 591 insertions(+), 580 deletions(-)
>>  delete mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>  delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_mmc.c
>>  delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_nand.c
>>  delete mode 100644 arch/arm/cpu/armv7/omap-common/spl_ymodem.c
>>  create mode 100644 arch/arm/lib/spl.c
>>  create mode 100644 arch/arm/lib/spl_mmc.c
>>  create mode 100644 arch/arm/lib/spl_nand.c
>>  create mode 100644 arch/arm/lib/spl_ymodem.c
>>
> 
> In my attempt I moved files from arch/arm/cpu/armv7/omap-common/ to
> common. This is because to make it available to all SOCs, not only
> armv7. What do you think about ? I would like to add an example with an
> arm1136 (MX35).

Second request so yes, for v2 I'll move things to common/

[snip]
>> +#include <asm/omap_common.h>
> 
> This is a conflict I got. This file should be generic code, and should
> not have reference to a specific SOC or SOC family, as omap here. So I
> have added a include/spl.h with only the SPL relevant part, dropping
> other OMAP specific from this file (I see you did the same with
> omap_boot_device and omap_boot_mode).
> 
> 
>> +#include <asm/arch/mmc_host_def.h>
> 
> As far as I have understood, this is only for MMCSD_SECTOR_SIZE, that
> can be moved into another header file. Not all SOCs have
> asm/arch/mmc_host_def.h

Yes, mandating what the asm/ mmc header file names should be is
something I've thought about but not had to step on, yet.

>> +#include <common.h>
>> +#include <asm/u-boot.h>
>> +#include <asm/utils.h>
>> +#include <asm/arch/sys_proto.h>
>> +#include <mmc.h>
>> +#include <fat.h>
>> +#include <version.h>
>> +#include <asm/omap_common.h>
>> +#include <asm/arch/mmc_host_def.h>
> 
> Both files are OMAP specific
> 
>> +
>> +DECLARE_GLOBAL_DATA_PTR;
>> +
>> +#ifdef CONFIG_GENERIC_MMC
>> +int board_mmc_init(bd_t *bis)
>> +{
>> +	switch (omap_boot_device()) {
> 
> And this is also omap specific. Replaced by soc_boot_device ?

My goal with this series, and part of why I added CONFIG_SPL_FRAMEWORK
was that indeed, there's a lot of omap-isms in the code at the start.  I
believe by the end of the series they're all removed and the code is
common.  If it's a concern I can re-work things so that the move is one
of the last steps.

-- 
Tom


More information about the U-Boot mailing list