From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Wed, 30 Nov 2016 02:28:58 +0100 Subject: [U-Boot] [PATCH 07/14] mmc: Tinification of the mmc code In-Reply-To: References: <20161125223235.3434-1-marex@denx.de> <20161125223235.3434-7-marex@denx.de> Message-ID: <120f93c5-1edc-4099-459f-3b51074ee908@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 11/30/2016 01:32 AM, Simon Glass wrote: > Hi Marek, > > On 25 November 2016 at 15:32, Marek Vasut 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 >> Cc: Tom Rini >> Cc: Simon Glass >> --- >> 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 > > 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