From mboxrd@z Thu Jan 1 00:00:00 1970 From: Simon Glass Date: Tue, 29 Nov 2016 19:26:55 -0700 Subject: [U-Boot] [PATCH 07/14] mmc: Tinification of the mmc code In-Reply-To: <120f93c5-1edc-4099-459f-3b51074ee908@denx.de> References: <20161125223235.3434-1-marex@denx.de> <20161125223235.3434-7-marex@denx.de> <120f93c5-1edc-4099-459f-3b51074ee908@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Marek, On 29 November 2016 at 18:28, Marek Vasut wrote: > 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). Well it should default to n anyway so I don't think you need that line. Regards, Simon