summaryrefslogtreecommitdiff
path: root/arch/arm/cpu/armv7/mx7
diff options
context:
space:
mode:
authorYe.Li <B37916@freescale.com>2015-05-20 17:19:44 +0800
committerYe.Li <B37916@freescale.com>2015-05-20 18:05:33 +0800
commitf7775862aa7eb6d5e978f9059e981f57f7f76f1a (patch)
treecded4b1d5fde87dfe45f151f934432b2567c4fe5 /arch/arm/cpu/armv7/mx7
parent7ae2b544aedaf79c59c54a8cfd917da76eac4d73 (diff)
downloadu-boot-imx-f7775862aa7eb6d5e978f9059e981f57f7f76f1a.zip
u-boot-imx-f7775862aa7eb6d5e978f9059e981f57f7f76f1a.tar.gz
u-boot-imx-f7775862aa7eb6d5e978f9059e981f57f7f76f1a.tar.bz2
MLK-10936 imx: mx7d: Change to use bootrom_sw_info for getting boot deviceimx_3.14.38_6ul_engr
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 'arch/arm/cpu/armv7/mx7')
-rw-r--r--arch/arm/cpu/armv7/mx7/soc.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/arch/arm/cpu/armv7/mx7/soc.c b/arch/arm/cpu/armv7/mx7/soc.c
index 0e80d0e..5b8ae2e 100644
--- a/arch/arm/cpu/armv7/mx7/soc.c
+++ b/arch/arm/cpu/armv7/mx7/soc.c
@@ -338,32 +338,30 @@ const struct boot_mode soc_boot_modes[] = {
enum boot_device get_boot_device(void)
{
- enum boot_device boot_dev = UNKNOWN_BOOT;
- uint32_t soc_smbr = readl(&src_reg->sbmr1);
- uint32_t bt_mem_ctl = (soc_smbr & 0xF000) >> 12;
- uint32_t bt_dev_port = (soc_smbr & 0xC00) >> 10;
- uint32_t bt_mem_type = (soc_smbr & 0x800) >> 11;
-
- switch (bt_mem_ctl) {
- case 0x1:
- boot_dev = bt_dev_port + SD1_BOOT;
+ struct bootrom_sw_info **p =
+ (struct bootrom_sw_info **)ROM_SW_INFO_ADDR;
+
+ enum boot_device boot_dev = SD1_BOOT;
+ u8 boot_type = (*p)->boot_dev_type;
+ u8 boot_instance = (*p)->boot_dev_instance;
+
+ switch (boot_type) {
+ case BOOT_TYPE_SD:
+ boot_dev = boot_instance + SD1_BOOT;
break;
- case 0x2:
- boot_dev = bt_dev_port + MMC1_BOOT;
+ case BOOT_TYPE_MMC:
+ boot_dev = boot_instance + MMC1_BOOT;
break;
- case 0x3:
+ case BOOT_TYPE_NAND:
boot_dev = NAND_BOOT;
break;
- case 0x4:
+ case BOOT_TYPE_QSPI:
boot_dev = QSPI_BOOT;
break;
- case 0x5:
- if (bt_mem_type)
- boot_dev = ONE_NAND_BOOT;
- else
- boot_dev = WEIM_NOR_BOOT;
+ case BOOT_TYPE_WEIM:
+ boot_dev = WEIM_NOR_BOOT;
break;
- case 0x6:
+ case BOOT_TYPE_SPINOR:
boot_dev = SPI_NOR_BOOT;
break;
default: