From mboxrd@z Thu Jan 1 00:00:00 1970 From: Walter Lozano Date: Mon, 9 Mar 2020 16:55:11 -0300 Subject: [PATCH 2/4] mx6cuboxi: enable MMC iomux on board_early_init_f In-Reply-To: <878skbxxyu.fsf@tarshish> References: <20200304144125.8564-1-walter.lozano@collabora.com> <20200304144125.8564-3-walter.lozano@collabora.com> <878skbxxyu.fsf@tarshish> Message-ID: <782f5e9f-77c2-d314-1f11-6fce7576fa31@collabora.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Baruch, Thanks for you comments. On 8/3/20 01:38, Baruch Siach wrote: > Hi Walter, > > Thanks for your SPL_DM support work on this platform. > > One comment inline below. > > On Wed, Mar 04 2020, Walter Lozano wrote: >> MMC iomux is done on board_mmc_init which is valid when DM_MMC is not >> enabled. After enabling it, the iomux setup needs to be moved to a >> valid place. >> >> This patch moves the MMC iomux to board_early_init_f where other iomux >> is done. >> >> Signed-off-by: Walter Lozano >> --- >> board/solidrun/mx6cuboxi/mx6cuboxi.c | 25 +++++++++++++++++++++++++ >> 1 file changed, 25 insertions(+) >> >> diff --git a/board/solidrun/mx6cuboxi/mx6cuboxi.c b/board/solidrun/mx6cuboxi/mx6cuboxi.c >> index 6a96f9ecdb..71c77ad2a2 100644 >> --- a/board/solidrun/mx6cuboxi/mx6cuboxi.c >> +++ b/board/solidrun/mx6cuboxi/mx6cuboxi.c >> @@ -179,6 +179,28 @@ int board_mmc_get_env_dev(int devno) >> >> #define USDHC2_CD_GPIO IMX_GPIO_NR(1, 4) >> >> +static int setup_iomux_mmc(void) >> +{ >> + struct src *psrc = (struct src *)SRC_BASE_ADDR; >> + unsigned reg = readl(&psrc->sbmr1) >> 11; > This mostly duplicates the existing mmc_init_spl() routine. As I understand, > mmc_init_spl() becomes dead code once you enable CONFIG_SPL_DM in patch #4 of > this series. Can you remove mmc_init_spl() in a followup patch? Both > struct fsl_esdhc_cfg can also be removed, I believe. You are right, if we enable both CONFIG_SPL_DM and CONFIG_SPL_DM_MMC the function mmc_init_spl is useless, so I understand we can safety remove it. > baruch > Regards, Walter