summaryrefslogtreecommitdiff
path: root/board/freescale/mx7d_12x12_lpddr3_arm2
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2015-05-20 17:19:44 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:35 +0100
commite164a9cc09421907353ce94a52d68af3d5da46cb (patch)
treeef8d548798cc6fbaa89af208181709998b79ec41 /board/freescale/mx7d_12x12_lpddr3_arm2
parent4c1248c22476295ac173b2786b70d7d824ae7d19 (diff)
MLK-10936 imx: mx7d: Change to use bootrom_sw_info for getting boot device
On MX7D, boot rom can provide some boot information such as boot device, arm freq, axi freq, etc. (see the structure below) Offset Byte4 | Byte3 | Byte2 | Byte1 0x0 Reserved | Boot Device Type | Boot Device Instance | Reserved 0x4 ARM core frequency(in Hz) 0x8 AXI bus frequency(in Hz) 0x0C DDR frequency(in Hz) 0x10 GPT1 input clock frequency(in Hz) 0x14 Reserved 0x18 0x1C The boot information can be accessed by get the pointer at 0x1E8. This patch changes the u-boot to use the new approach. When manufacture boot, the info recorded is the actual SD port, not the failed device. Signed-off-by: Ye.Li <B37916@freescale.com>
Diffstat (limited to 'board/freescale/mx7d_12x12_lpddr3_arm2')
-rw-r--r--board/freescale/mx7d_12x12_lpddr3_arm2/mx7d_12x12_lpddr3_arm2.c13
1 files changed, 5 insertions, 8 deletions
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 0770818e983..5ecc8e4b31c 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;
}