diff options
Diffstat (limited to 'board')
5 files changed, 25 insertions, 40 deletions
diff --git a/board/freescale/mx7d_12x12_ddr3_arm2/mx7d_12x12_ddr3_arm2.c b/board/freescale/mx7d_12x12_ddr3_arm2/mx7d_12x12_ddr3_arm2.c index 225539a..3f5dcf5 100644 --- a/board/freescale/mx7d_12x12_ddr3_arm2/mx7d_12x12_ddr3_arm2.c +++ b/board/freescale/mx7d_12x12_ddr3_arm2/mx7d_12x12_ddr3_arm2.c @@ -130,19 +130,16 @@ static struct fsl_esdhc_cfg usdhc_cfg[2] = { int mmc_get_env_devno(void) { - u32 soc_sbmr = readl(SRC_BASE_ADDR + 0x58); - u32 dev_no; - u32 bootsel; + struct bootrom_sw_info **p = + (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; - bootsel = (soc_sbmr & 0x0000F000) >> 12; + u8 boot_type = (*p)->boot_dev_type; + u8 dev_no = (*p)->boot_dev_instance; /* If not boot from sd/mmc, use default value */ - if ((bootsel != BOOT_TYPE_SD) && (bootsel != BOOT_TYPE_MMC)) + if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) return CONFIG_SYS_MMC_ENV_DEV; - /* BOOT_CFG2[2] and BOOT_CFG2[3] */ - dev_no = (soc_sbmr & 0x00000C00) >> 10; - return dev_no - 1; } diff --git a/board/freescale/mx7d_12x12_lpddr3_arm2/mx7d_12x12_lpddr3_arm2.c b/board/freescale/mx7d_12x12_lpddr3_arm2/mx7d_12x12_lpddr3_arm2.c index 0770818..5ecc8e4 100644 --- a/board/freescale/mx7d_12x12_lpddr3_arm2/mx7d_12x12_lpddr3_arm2.c +++ b/board/freescale/mx7d_12x12_lpddr3_arm2/mx7d_12x12_lpddr3_arm2.c @@ -355,19 +355,16 @@ static struct fsl_esdhc_cfg usdhc_cfg[3] = { int mmc_get_env_devno(void) { - u32 soc_sbmr = readl(SRC_BASE_ADDR + 0x58); - u32 dev_no; - u32 bootsel; + struct bootrom_sw_info **p = + (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; - bootsel = (soc_sbmr & 0x0000F000) >> 12; + u8 boot_type = (*p)->boot_dev_type; + u8 dev_no = (*p)->boot_dev_instance; /* If not boot from sd/mmc, use default value */ - if ((bootsel != BOOT_TYPE_SD) && (bootsel != BOOT_TYPE_MMC)) + if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) return CONFIG_SYS_MMC_ENV_DEV; - /* BOOT_CFG2[2] and BOOT_CFG2[3] */ - dev_no = (soc_sbmr & 0x00000C00) >> 10; - return dev_no; } diff --git a/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c b/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c index a746cc9..6fbde13 100644 --- a/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c +++ b/board/freescale/mx7d_19x19_ddr3_arm2/mx7d_19x19_ddr3_arm2.c @@ -356,19 +356,16 @@ static struct fsl_esdhc_cfg usdhc_cfg[3] = { int mmc_get_env_devno(void) { - u32 soc_sbmr = readl(SRC_BASE_ADDR + 0x58); - u32 dev_no; - u32 bootsel; + struct bootrom_sw_info **p = + (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; - bootsel = (soc_sbmr & 0x0000F000) >> 12; + u8 boot_type = (*p)->boot_dev_type; + u8 dev_no = (*p)->boot_dev_instance; /* If not boot from sd/mmc, use default value */ - if ((bootsel != BOOT_TYPE_SD) && (bootsel != BOOT_TYPE_MMC)) + if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) return CONFIG_SYS_MMC_ENV_DEV; - /* BOOT_CFG2[2] and BOOT_CFG2[3] */ - dev_no = (soc_sbmr & 0x00000C00) >> 10; - return dev_no; } diff --git a/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c b/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c index f0706eb..74a0581 100644 --- a/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c +++ b/board/freescale/mx7d_19x19_lpddr3_arm2/mx7d_19x19_lpddr3_arm2.c @@ -318,19 +318,16 @@ static struct fsl_esdhc_cfg usdhc_cfg[1] = { int mmc_get_env_devno(void) { - u32 soc_sbmr = readl(SRC_BASE_ADDR + 0x58); - u32 dev_no; - u32 bootsel; + struct bootrom_sw_info **p = + (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; - bootsel = (soc_sbmr & 0x0000F000) >> 12; + u8 boot_type = (*p)->boot_dev_type; + u8 dev_no = (*p)->boot_dev_instance; /* If not boot from sd/mmc, use default value */ - if ((bootsel != BOOT_TYPE_SD) && (bootsel != BOOT_TYPE_MMC)) + if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) return CONFIG_SYS_MMC_ENV_DEV; - /* BOOT_CFG2[2] and BOOT_CFG2[3] */ - dev_no = (soc_sbmr & 0x00000C00) >> 10; - return dev_no; } diff --git a/board/freescale/mx7dsabresd/mx7dsabresd.c b/board/freescale/mx7dsabresd/mx7dsabresd.c index 4db309f..0f1a0c4 100644 --- a/board/freescale/mx7dsabresd/mx7dsabresd.c +++ b/board/freescale/mx7dsabresd/mx7dsabresd.c @@ -500,19 +500,16 @@ static struct fsl_esdhc_cfg usdhc_cfg[3] = { int mmc_get_env_devno(void) { - u32 soc_sbmr = readl(SRC_BASE_ADDR + 0x58); - u32 dev_no; - u32 bootsel; + struct bootrom_sw_info **p = + (struct bootrom_sw_info **)ROM_SW_INFO_ADDR; - bootsel = (soc_sbmr & 0x0000F000) >> 12; + u8 boot_type = (*p)->boot_dev_type; + u8 dev_no = (*p)->boot_dev_instance; /* If not boot from sd/mmc, use default value */ - if ((bootsel != BOOT_TYPE_SD) && (bootsel != BOOT_TYPE_MMC)) + if ((boot_type != BOOT_TYPE_SD) && (boot_type != BOOT_TYPE_MMC)) return CONFIG_SYS_MMC_ENV_DEV; - /* BOOT_CFG2[2] and BOOT_CFG2[3] */ - dev_no = (soc_sbmr & 0x00000C00) >> 10; - if (2 == dev_no) dev_no--; |