[U-Boot] [PATCH 07/14] mmc: Tinification of the mmc code

Marek Vasut marex at denx.de
Wed Nov 30 02:28:58 CET 2016


On 11/30/2016 01:32 AM, Simon Glass wrote:
> Hi Marek,
> 
> On 25 November 2016 at 15:32, Marek Vasut <marex at denx.de> wrote:
>> Add new configuration option CONFIG_MMC_TINY which strips away all
>> memory allocation within the MMC code and code for handling multiple
>> cards. This allows extremely space-constrained SPL code use the MMC
>> framework.
>>
>> Signed-off-by: Marek Vasut <marex at denx.de>
>> Cc: Tom Rini <trini at konsulko.com>
>> Cc: Simon Glass <sjg at chromium.org>
>> ---
>> V2: Switch the MMC_TINY option to Kconfig
>> ---
>>  common/spl/spl_mmc.c     |  6 +++++-
>>  drivers/mmc/Kconfig      | 16 ++++++++++++++++
>>  drivers/mmc/mmc.c        | 31 ++++++++++++++++++++++++++++++-
>>  drivers/mmc/mmc_legacy.c | 32 ++++++++++++++++++++++++++++++++
>>  include/mmc.h            |  1 +
>>  5 files changed, 84 insertions(+), 2 deletions(-)
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> 
> nit below.
> 
> I assume this does not use DM?

Nope, DM does not fit into those 14 kiB I have for SPL, no way.

>> diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
>> index 43c1030..3cad998 100644
>> --- a/common/spl/spl_mmc.c
>> +++ b/common/spl/spl_mmc.c
>> @@ -306,7 +306,11 @@ static int spl_mmc_load_image(struct spl_image_info *spl_image,
>>                         if (part == 7)
>>                                 part = 0;
>>
>> -                       err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
>> +                       if (CONFIG_IS_ENABLED(MMC_TINY))
>> +                               err = mmc_switch_part(mmc, part);
>> +                       else
>> +                               err = blk_dselect_hwpart(mmc_get_blk_desc(mmc), part);
>> +
>>                         if (err) {
>>  #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
>>                                 puts("spl: mmc partition switch failed\n");
>> diff --git a/drivers/mmc/Kconfig b/drivers/mmc/Kconfig
>> index 24f4b28..aca438b8 100644
>> --- a/drivers/mmc/Kconfig
>> +++ b/drivers/mmc/Kconfig
>> @@ -26,6 +26,22 @@ config DM_MMC_OPS
>>           option will be removed as soon as all DM_MMC drivers use it, as it
>>           will the only supported behaviour.
>>
>> +config SPL_MMC_TINY
>> +       bool "Tiny MMC framework in SPL"
>> +       default n
> 
> Not needed?

Why not ? This makes the tinification configurable and is used on the
CI20 (JZ4780 horrorchip).

-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list