diff options
author | Jason Liu <r64343@freescale.com> | 2013-02-04 10:43:28 +0800 |
---|---|---|
committer | Jason Liu <r64343@freescale.com> | 2013-02-04 14:34:06 +0800 |
commit | 9a7e8ff76f84751fa4fbf65c102d619111651382 (patch) | |
tree | adafc4e8d1be61670248160aeb424c203eae834f | |
parent | 98a5299c945cb7e440e3c3d9c572f017e5a02ede (diff) | |
download | u-boot-imx-9a7e8ff76f84751fa4fbf65c102d619111651382.zip u-boot-imx-9a7e8ff76f84751fa4fbf65c102d619111651382.tar.gz u-boot-imx-9a7e8ff76f84751fa4fbf65c102d619111651382.tar.bz2 |
ENGR00243038: make get_mmc_env_devno to be a generic function
Currently, each board has one same function called get_mmc_env_devno,
this will make the code a little bit duplication. We can make the
get_mmc_env_devno to be a generic function, thus we can remove all the
scattered function definition in each board file.
And the patch also remove the boot check. Firstly, this check is needless,
secondly, this will break the second boot support,for example:
first boot from SPI, then switch to SD/MMC boot.
Signed-off-by: Jason Liu <r64343@freescale.com>
-rw-r--r-- | board/freescale/mx6q_arm2/mx6q_arm2.c | 15 | ||||
-rw-r--r-- | board/freescale/mx6q_sabreauto/mx6q_sabreauto.c | 15 | ||||
-rw-r--r-- | board/freescale/mx6q_sabrelite/mx6q_sabrelite.c | 12 | ||||
-rw-r--r-- | board/freescale/mx6q_sabresd/mx6q_sabresd.c | 16 | ||||
-rw-r--r-- | board/freescale/mx6sl_arm2/mx6sl_arm2.c | 16 | ||||
-rw-r--r-- | board/freescale/mx6sl_evk/mx6sl_evk.c | 16 | ||||
-rw-r--r-- | cpu/arm_cortexa8/mx6/generic.c | 12 |
7 files changed, 17 insertions, 85 deletions
diff --git a/board/freescale/mx6q_arm2/mx6q_arm2.c b/board/freescale/mx6q_arm2/mx6q_arm2.c index 490cb68..41c5c3b 100644 --- a/board/freescale/mx6q_arm2/mx6q_arm2.c +++ b/board/freescale/mx6q_arm2/mx6q_arm2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -659,19 +659,6 @@ struct fsl_esdhc_cfg usdhc_cfg[4] = { {USDHC4_BASE_ADDR, 1, 1, 1, 0}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) { - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; - } else - return -1; - -} -#endif #if defined CONFIG_MX6Q iomux_v3_cfg_t usdhc1_pads[] = { MX6Q_PAD_SD1_CLK__USDHC1_CLK, diff --git a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c index d97647f..011e0f1 100644 --- a/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c +++ b/board/freescale/mx6q_sabreauto/mx6q_sabreauto.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -622,19 +622,6 @@ struct fsl_esdhc_cfg usdhc_cfg[4] = { {USDHC4_BASE_ADDR, 1, 1, 1, 0}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) { - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; - } else - return -1; - -} -#endif #ifdef CONFIG_CMD_WEIMNOR #if defined CONFIG_MX6Q diff --git a/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c b/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c index a57f58c..1b0679d 100644 --- a/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c +++ b/board/freescale/mx6q_sabrelite/mx6q_sabrelite.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -318,16 +318,6 @@ struct fsl_esdhc_cfg usdhc_cfg[2] = { {USDHC4_BASE_ADDR, 1, 1, 1}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; -} -#endif - iomux_v3_cfg_t mx6q_usdhc1_pads[] = { MX6Q_PAD_SD1_CLK__USDHC1_CLK, MX6Q_PAD_SD1_CMD__USDHC1_CMD, diff --git a/board/freescale/mx6q_sabresd/mx6q_sabresd.c b/board/freescale/mx6q_sabresd/mx6q_sabresd.c index 7be4d26..155aef2 100644 --- a/board/freescale/mx6q_sabresd/mx6q_sabresd.c +++ b/board/freescale/mx6q_sabresd/mx6q_sabresd.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Freescale Semiconductor, Inc. + * Copyright (C) 2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -954,20 +954,6 @@ struct fsl_esdhc_cfg usdhc_cfg[4] = { {USDHC4_BASE_ADDR, 1, 1, 1, 0}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) { - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; - } else - return -1; - -} -#endif - #if defined CONFIG_MX6Q iomux_v3_cfg_t usdhc1_pads[] = { MX6Q_PAD_SD1_CLK__USDHC1_CLK, diff --git a/board/freescale/mx6sl_arm2/mx6sl_arm2.c b/board/freescale/mx6sl_arm2/mx6sl_arm2.c index ad6f47f..7c278ce 100644 --- a/board/freescale/mx6sl_arm2/mx6sl_arm2.c +++ b/board/freescale/mx6sl_arm2/mx6sl_arm2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -160,20 +160,6 @@ struct fsl_esdhc_cfg usdhc_cfg[3] = { {USDHC3_BASE_ADDR, 1, 1, 1, 1}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) { - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; - } else - return -1; - -} -#endif - iomux_v3_cfg_t usdhc1_pads[] = { /* 8 bit SD */ MX6SL_PAD_SD1_CLK__USDHC1_CLK, diff --git a/board/freescale/mx6sl_evk/mx6sl_evk.c b/board/freescale/mx6sl_evk/mx6sl_evk.c index 87ef68e..bb727b6 100644 --- a/board/freescale/mx6sl_evk/mx6sl_evk.c +++ b/board/freescale/mx6sl_evk/mx6sl_evk.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -156,20 +156,6 @@ struct fsl_esdhc_cfg usdhc_cfg[3] = { {USDHC3_BASE_ADDR, 1, 1, 1, 1}, }; -#ifdef CONFIG_DYNAMIC_MMC_DEVNO -int get_mmc_env_devno(void) -{ - uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); - - if (SD_BOOT == boot_dev || MMC_BOOT == boot_dev) { - /* BOOT_CFG2[3] and BOOT_CFG2[4] */ - return (soc_sbmr & 0x00001800) >> 11; - } else - return -1; - -} -#endif - iomux_v3_cfg_t usdhc1_pads[] = { /* 8 bit SD */ MX6SL_PAD_SD1_CLK__USDHC1_CLK, diff --git a/cpu/arm_cortexa8/mx6/generic.c b/cpu/arm_cortexa8/mx6/generic.c index 12cfc51..724fcd8 100644 --- a/cpu/arm_cortexa8/mx6/generic.c +++ b/cpu/arm_cortexa8/mx6/generic.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2010-2012 Freescale Semiconductor, Inc. + * Copyright (C) 2010-2013 Freescale Semiconductor, Inc. * * See file CREDITS for list of people who contributed to this * project. @@ -1534,3 +1534,13 @@ void get_board_serial(struct tag_serialnr *serialnr) imx_otp_read_one_u32(CPU_UID_HIGH_FUSE_INDEX, &serialnr->high); } #endif + +#ifdef CONFIG_DYNAMIC_MMC_DEVNO +int get_mmc_env_devno(void) +{ + uint soc_sbmr = readl(SRC_BASE_ADDR + 0x4); + + /* BOOT_CFG2[3] and BOOT_CFG2[4] */ + return (soc_sbmr & 0x00001800) >> 11; +} +#endif |