diff options
author | Tom Rini <trini@konsulko.com> | 2019-12-28 08:07:16 -0500 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-12-28 08:07:16 -0500 |
commit | 6cb87cbb1475f668689f95911d1521ee6ba7f55c (patch) | |
tree | 2454e7ad7a284c01cc1150f6d6def994e23c99a6 /board/logicpd/imx6/imx6logic.c | |
parent | 831f06fe9af0b45fa2cba64300524d1726fb9241 (diff) | |
parent | fff7b33ce5b1b3687857ea4184d71bf4ce1f6364 (diff) |
Merge tag 'u-boot-imx-20191228' of https://gitlab.denx.de/u-boot/custodians/u-boot-imx
Fixes for 2020.01
-----------------
- Fixes for Nitrogen6x
- Fix corruption for mx51evk
- colibri i.MX6: fix broken ESDHC conversion
- mx6sxsabresd: fix broken mmcdev
- imx6q_logic: cleanup boot sequence
- update ATF for imx8mq_evk
- pfuze: fix pmic_get()
Travis CI: https://travis-ci.org/sbabic/u-boot-imx/builds/630007464
Diffstat (limited to 'board/logicpd/imx6/imx6logic.c')
-rw-r--r-- | board/logicpd/imx6/imx6logic.c | 56 |
1 files changed, 38 insertions, 18 deletions
diff --git a/board/logicpd/imx6/imx6logic.c b/board/logicpd/imx6/imx6logic.c index 5b6584720b..ba69c96686 100644 --- a/board/logicpd/imx6/imx6logic.c +++ b/board/logicpd/imx6/imx6logic.c @@ -156,29 +156,49 @@ void board_boot_order(u32 *spl_boot_list) { struct src *psrc = (struct src *)SRC_BASE_ADDR; unsigned int reg = readl(&psrc->sbmr1) >> 11; - /* - * Upon reading BOOT_CFG register the following map is done: - * Bit 11 and 12 of BOOT_CFG register can determine the current - * mmc port - * 0x1 SD1-SOM - * 0x2 SD2-Baseboard - */ - - reg &= 0x3; /* Only care about bottom 2 bits */ - switch (reg) { - case 0: - spl_boot_list[0] = BOOT_DEVICE_MMC1; + u32 boot_mode = imx6_src_get_boot_mode() & IMX6_BMODE_MASK; + unsigned int bmode = readl(&src_base->sbmr2); + + /* If bmode is serial or USB phy is active, return serial */ + if (((bmode >> 24) & 0x03) == 0x01 || is_usbotg_phy_active()) { + spl_boot_list[0] = BOOT_DEVICE_BOARD; + return; + } + + switch (boot_mode >> IMX6_BMODE_SHIFT) { + case IMX6_BMODE_NAND_MIN ... IMX6_BMODE_NAND_MAX: + spl_boot_list[0] = BOOT_DEVICE_NAND; break; - case 1: - spl_boot_list[0] = BOOT_DEVICE_MMC2; + case IMX6_BMODE_SD: + case IMX6_BMODE_ESD: + case IMX6_BMODE_MMC: + case IMX6_BMODE_EMMC: + /* + * Upon reading BOOT_CFG register the following map is done: + * Bit 11 and 12 of BOOT_CFG register can determine the current + * mmc port + * 0x1 SD1-SOM + * 0x2 SD2-Baseboard + */ + + reg &= 0x3; /* Only care about bottom 2 bits */ + switch (reg) { + case 0: + spl_boot_list[0] = BOOT_DEVICE_MMC1; + break; + case 1: + spl_boot_list[0] = BOOT_DEVICE_MMC2; + break; + } + break; + default: + /* By default use USB downloader */ + spl_boot_list[0] = BOOT_DEVICE_BOARD; break; } - /* If we cannot find a valid MMC/SD card, try NAND */ - spl_boot_list[1] = BOOT_DEVICE_NAND; - /* As a last resort, use serial downloader */ - spl_boot_list[2] = BOOT_DEVICE_BOARD; + spl_boot_list[1] = BOOT_DEVICE_BOARD; } static void ccgr_init(void) |