public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 03/11] board:samsung: check the mmc boot device and init the right mmc driver.
Date: Wed, 18 Jun 2014 15:30:26 +0900	[thread overview]
Message-ID: <53A13202.5040405@samsung.com> (raw)
In-Reply-To: <1402566394-23342-3-git-send-email-p.marczak@samsung.com>

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 <p.marczak@samsung.com>
> Cc: Piotr Wilczek <p.wilczek@samsung.com>
> Cc: Minkyu Kang <mk7.kang@samsung.com>
> ---
>  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 <lcd.h>
>  #include <samsung/misc.h>
>  
> +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.

> +
> +	bootmode = BOOT_MODE(readl(&pwr->om_stat));
> +	if (bootmode == BOOT_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
> +	}
> +
>  	if (ret)
>  		debug("mmc init failed\n");
> -#endif
> +
>  	return ret;
>  }
>  #endif
> diff --git a/include/samsung/misc.h b/include/samsung/misc.h
> index 10653a1..87b53ec 100644
> --- a/include/samsung/misc.h
> +++ b/include/samsung/misc.h
> @@ -28,4 +28,9 @@ void check_boot_mode(void);
>  void draw_logo(void);
>  #endif
>  
> +#define BOOT_SDMMC	0x2
> +#define BOOT_MODE_MASK	(0x1f)
> +#define BOOT_MODE_SHIFT	(0x1)
> +#define BOOT_MODE(x)	((x >> BOOT_MODE_SHIFT) & BOOT_MODE_MASK)

((x) >> BOOT_MODE_SHIFT)

> +
>  #endif /* __SAMSUNG_MISC_COMMON_H__ */
> 

Thanks,
Minkyu Kang.

  reply	other threads:[~2014-06-18  6:30 UTC|newest]

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-10 11:25 [U-Boot] [PATCH 01/10] samsung: misc: fix soc revision setting in the set_board_info() Przemyslaw Marczak
2014-06-10 11:25 ` [U-Boot] [PATCH 02/10] exynos: pinmux: fix the gpio names for exynos4x12 mmc Przemyslaw Marczak
2014-06-11 10:03   ` Jaehoon Chung
2014-06-10 11:32 ` [U-Boot] [PATCH 03/10] board:samsung: check the mmc boot device and init the right mmc driver Przemyslaw Marczak
2014-06-10 11:32 ` [U-Boot] [PATCH 04/10] samsung: misc: set the dfu bootloader setting at boot time Przemyslaw Marczak
2014-06-11  2:03   ` Inha Song
2014-06-11 13:07     ` Przemyslaw Marczak
2014-06-10 11:32 ` [U-Boot] [PATCH 05/10] arm:reset: call the reset_misc() before the cpu reset Przemyslaw Marczak
2014-06-10 11:33 ` [U-Boot] [PATCH 06/10] samsung: misc: set_board_info: check the board type to set fdt file name Przemyslaw Marczak
2014-06-10 11:33 ` [U-Boot] [PATCH 07/10] samsung: board: checkboard: call get_board_type() for CONFIG_BOARD_TYPES Przemyslaw Marczak
2014-06-10 11:33 ` [U-Boot] [PATCH 08/10] odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412 Przemyslaw Marczak
2014-06-11  1:33   ` Inha Song
2014-06-11 12:48     ` Przemyslaw Marczak
2014-06-10 11:33 ` [U-Boot] [PATCH 09/10] odroid: add odroid U3/X2 device tree description Przemyslaw Marczak
2014-06-10 11:33 ` [U-Boot] [PATCH 10/10] odroid: add odroid_config Przemyslaw Marczak
2014-06-12  9:46 ` [U-Boot] [PATCH v2 01/11] samsung: misc: fix soc revision setting in the set_board_info() Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 02/11] exynos: pinmux: fix the gpio names for exynos4x12 mmc Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 03/11] board:samsung: check the mmc boot device and init the right mmc driver Przemyslaw Marczak
2014-06-18  6:30     ` Minkyu Kang [this message]
2014-06-18 10:47       ` Przemyslaw Marczak
2014-06-19  1:10         ` Minkyu Kang
2014-06-12  9:46   ` [U-Boot] [PATCH v2 04/11] drivers:dfu: new feature: separated bootloader alt setting Przemyslaw Marczak
2014-06-16 19:52     ` Stephen Warren
2014-06-17 10:20       ` Przemyslaw Marczak
2014-06-17 16:36         ` Stephen Warren
2014-06-18 10:56           ` Przemyslaw Marczak
2014-06-18 15:46             ` Stephen Warren
2014-06-23 10:09               ` Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 05/11] samsung: misc: set the dfu bootloader setting at boot time Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 06/11] arm:reset: call the reset_misc() before the cpu reset Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 07/11] samsung: misc: set_board_info: check the board type to set fdt file name Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 08/11] samsung: board: checkboard: call get_board_type() for CONFIG_BOARD_TYPES Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 09/11] odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412 Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 10/11] odroid: add odroid U3/X2 device tree description Przemyslaw Marczak
2014-06-12  9:46   ` [U-Boot] [PATCH v2 11/11] odroid: add odroid_config Przemyslaw Marczak
2014-06-26 14:15   ` [U-Boot] [PATCH v3 00/11] Add support to Odroid U3/X2 Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 01/11] exynos: pinmux: fix the gpio names for exynos4x12 mmc Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 02/11] board:samsung: add function boot_device() for checking boot medium Przemyslaw Marczak
2014-06-27  9:40       ` Minkyu Kang
2014-06-27 11:33         ` Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 03/11] board:samsung: check the boot device and init the right mmc driver Przemyslaw Marczak
2014-06-27  9:40       ` Minkyu Kang
2014-06-27  9:45         ` Jaehoon Chung
2014-06-27 11:38           ` Przemyslaw Marczak
2014-06-27 11:34         ` Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 04/11] samsung: misc: add function for setting $dfu_alt_info Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 05/11] samsung:board: misc_init_r: call set_dfu_alt_info() Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 06/11] arm:reset: call the reset_misc() before the cpu reset Przemyslaw Marczak
2014-06-27  9:40       ` Minkyu Kang
2014-06-27 11:34         ` Przemyslaw Marczak
2014-06-27 20:20           ` Jeroen Hofstee
2014-06-30  8:41             ` Przemyslaw Marczak
2014-06-30 18:30               ` Jeroen Hofstee
2014-07-01 14:16                 ` Przemyslaw Marczak
2014-07-01 14:36           ` Przemyslaw Marczak
2014-07-02  7:03             ` Minkyu Kang
2014-07-02 10:27               ` Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 07/11] samsung: board: enable support of multiple board types Przemyslaw Marczak
2014-06-27  9:40       ` Minkyu Kang
2014-06-27 11:34         ` Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 08/11] samsung: misc: use board specific functions to set env board info Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 09/11] odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412 Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 10/11] odroid: add odroid U3/X2 device tree description Przemyslaw Marczak
2014-06-26 14:15     ` [U-Boot] [PATCH v3 11/11] odroid: add odroid_config Przemyslaw Marczak
2014-07-02 11:50     ` [U-Boot] [PATCH v4 00/12] Add support to Odroid U3/X2 Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 01/12] samsung: misc: fix soc revision setting in the set_board_info() Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 02/12] exynos: pinmux: fix the gpio names for exynos4x12 mmc Przemyslaw Marczak
2014-07-04  5:37         ` Jaehoon Chung
2014-07-02 11:50       ` [U-Boot] [PATCH v4 03/12] arch:exynos: boot mode: add get_boot_mode(), code cleanup Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 04/12] board:samsung: check the boot device and init the right mmc driver Przemyslaw Marczak
2014-07-04  5:45         ` Jaehoon Chung
2014-07-04  8:07           ` Przemyslaw Marczak
2014-07-04 11:08             ` Jaehoon Chung
2014-07-02 11:50       ` [U-Boot] [PATCH v4 05/12] samsung: misc: add function for setting $dfu_alt_info Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 06/12] samsung:board: misc_init_r: call set_dfu_alt_info() Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 07/12] arm:reset: call the reset_misc() before the cpu reset Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 08/12] samsung: board: enable support of multiple board types Przemyslaw Marczak
2014-07-04  5:49         ` Jaehoon Chung
2014-07-04  8:08           ` Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 09/12] samsung: misc: use board specific functions to set env board info Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 10/12] odroid: add board file for Odroid X2/U3 based on Samsung Exynos4412 Przemyslaw Marczak
2014-07-04  6:07         ` Jaehoon Chung
2014-07-04  8:08           ` Przemyslaw Marczak
2014-07-04 11:12             ` Jaehoon Chung
2014-07-02 11:50       ` [U-Boot] [PATCH v4 11/12] odroid: add odroid U3/X2 device tree description Przemyslaw Marczak
2014-07-02 11:50       ` [U-Boot] [PATCH v4 12/12] odroid: add odroid_config Przemyslaw Marczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53A13202.5040405@samsung.com \
    --to=mk7.kang@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox