From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jaehoon Chung Date: Fri, 27 Jun 2014 18:45:20 +0900 Subject: [U-Boot] [PATCH v3 03/11] board:samsung: check the boot device and init the right mmc driver. In-Reply-To: <53AD3C03.3030303@samsung.com> References: <1402566394-23342-1-git-send-email-p.marczak@samsung.com> <1403792137-3113-1-git-send-email-p.marczak@samsung.com> <1403792137-3113-4-git-send-email-p.marczak@samsung.com> <53AD3C03.3030303@samsung.com> Message-ID: <53AD3D30.3080903@samsung.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/27/2014 06:40 PM, Minkyu Kang wrote: > Dear Przemyslaw Marczak, > > On 26/06/14 23:15, Przemyslaw Marczak wrote: >> It is possible to boot device using a micro SD or eMMC slots. >> In this situation, boot device should be registered as a block >> device 0 in the MMC framework, because CONFIG_SYS_MMC_ENV_DEV >> is usually set to "0" in the most config cases. >> >> Signed-off-by: Przemyslaw Marczak >> --- >> Changes V3: >> - separate two changes into two commits >> --- >> board/samsung/common/board.c | 24 +++++++++++++++++------- >> 1 file changed, 17 insertions(+), 7 deletions(-) >> >> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c >> index ecf3f76..f07a900 100644 >> --- a/board/samsung/common/board.c >> +++ b/board/samsung/common/board.c >> @@ -251,18 +251,28 @@ int board_mmc_init(bd_t *bis) >> { >> int ret; >> >> + if (boot_device() == BOOT_DEVICE_SDMMC) { >> +#ifdef CONFIG_SDHCI >> + /* mmc initializattion for available channels */ >> + ret = exynos_mmc_init(gd->fdt_blob); >> +#endif >> #ifdef CONFIG_DWMMC >> - /* dwmmc initializattion for available channels */ >> - ret = exynos_dwmmc_init(gd->fdt_blob); >> - if (ret) >> - debug("dwmmc init failed\n"); >> + /* dwmmc initializattion for available channels */ >> + ret = exynos_dwmmc_init(gd->fdt_blob); >> +#endif >> + } else { >> +#ifdef CONFIG_DWMMC >> + /* dwmmc initializattion for available channels */ >> + ret = exynos_dwmmc_init(gd->fdt_blob); >> #endif >> #ifdef CONFIG_SDHCI >> - /* mmc initializattion for available channels */ >> - ret = exynos_mmc_init(gd->fdt_blob); >> + /* mmc initializattion for available channels */ >> + ret = exynos_mmc_init(gd->fdt_blob); >> +#endif >> + } >> + > > It looks little confused. > Could you please re-arrange this code like this? If re-arrange the below code, i want to call the dwmmc-init function at first. Is there a special reason for sequence(sdhci->dwmmc)? Best Regards, Jaehoon Chung > > #ifdef CONFIG_SDHCI > if (boot....) { > > } else { > > } > #endif > > #ifdef CONFIG_DWMMC > if (boot....) { > > } else { > > } > #endif > > Thanks, > Minkyu Kang. >