From mboxrd@z Thu Jan 1 00:00:00 1970 From: Minkyu Kang Date: Thu, 19 Jun 2014 10:10:05 +0900 Subject: [U-Boot] [PATCH v2 03/11] board:samsung: check the mmc boot device and init the right mmc driver. In-Reply-To: <53A16E55.9040709@samsung.com> References: <1402399510-8965-1-git-send-email-p.marczak@samsung.com> <1402566394-23342-1-git-send-email-p.marczak@samsung.com> <1402566394-23342-3-git-send-email-p.marczak@samsung.com> <53A13202.5040405@samsung.com> <53A16E55.9040709@samsung.com> Message-ID: <53A2386D.7070309@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 18/06/14 19:47, Przemyslaw Marczak wrote: > Hello Minkyu, > On 06/18/2014 08:30 AM, Minkyu Kang wrote: >> Dear Przemyslaw Marczak, >> >> On 12/06/14 18:46, Przemyslaw Marczak wrote: >>> It is possible to boot from a few media devices, especially using a micro >>> SD or eMMC slots. In this situation, boot device should be registered >>> as 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 >>> Cc: Piotr Wilczek >>> Cc: Minkyu Kang >>> --- >>> board/samsung/common/board.c | 32 ++++++++++++++++++++++++-------- >>> include/samsung/misc.h | 5 +++++ >>> 2 files changed, 29 insertions(+), 8 deletions(-) >>> >>> diff --git a/board/samsung/common/board.c b/board/samsung/common/board.c >>> index 9dc7c83..2970340 100644 >>> --- a/board/samsung/common/board.c >>> +++ b/board/samsung/common/board.c >>> @@ -25,6 +25,8 @@ >>> #include >>> #include >>> >>> +static int bootmode; >>> + >>> DECLARE_GLOBAL_DATA_PTR; >>> >>> int __exynos_early_init_f(void) >>> @@ -243,19 +245,33 @@ int board_eth_init(bd_t *bis) >>> int board_mmc_init(bd_t *bis) >>> { >>> int ret; >>> + struct exynos4_power *pwr = (struct exynos4_power *) >>> + samsung_get_base_power(); >> >> Hm, no. This file is samsung common not only for exynos4. >> Although this code will not be made any problems for other SoCs (because om_stat is always first item of power), it looks weird. >> I think you can make new function for getting boot mode. >> > Yes, this was bad. What about that: > # unsigned int om_stat = samsung_get_base_power(); > # > # bootmode = BOOT_MODE(readl(om_stat)); > > or maybe just > > # bootmode = BOOT_MODE(readl(samsung_get_base_power())); looks good to me. both of them. Thanks, Minkyu Kang.