diff options
author | Caleb Robey <c-robey@ti.com> | 2020-01-02 17:17:25 +0300 |
---|---|---|
committer | Lokesh Vutla <lokeshvutla@ti.com> | 2020-01-20 07:40:28 +0300 |
commit | d6eaaae3d3066efadab3899e3f66ee8db85368b2 (patch) | |
tree | 9bf6cf93ad7129c5a18d778659771171dd2c2202 /board/ti/am57xx | |
parent | 4250bf8ed96b50cf78d04fb2564fed351f7daeb2 (diff) | |
download | u-boot-d6eaaae3d3066efadab3899e3f66ee8db85368b2.tar.xz |
board: ti: beagleboneai: emmc read changes
BeagleBoard.org BeagleBone AI rev A1 does not include a board
identifier I2C EEPROM due to a design oversight. These boards have
been put into production and are generally available now.
The board identifier information, however, has been included in the
second eMMC linear boot partition (/dev/mmcblk1boot1).
This patch works by:
* First, looking for a board identifier I2C EEPROM and if not found,
* Then seeing if the boot mode matches BeagleBone AI with eMMC in the
boot chain to make sure we don't enable eMMC pinmuxes on boards
that don't support it, and
* Finally, initializes the eMMC pins and reading the header.
Signed-off-by: Jason Kridner <jdk@ti.com>
Signed-off-by: Caleb Robey <c-robey@ti.com>
Cc: Robert Nelson <robertcnelson@gmail.com>
Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'board/ti/am57xx')
-rw-r--r-- | board/ti/am57xx/board.c | 37 | ||||
-rw-r--r-- | board/ti/am57xx/mux_data.h | 16 |
2 files changed, 53 insertions, 0 deletions
diff --git a/board/ti/am57xx/board.c b/board/ti/am57xx/board.c index c755821b74..52f5e954e6 100644 --- a/board/ti/am57xx/board.c +++ b/board/ti/am57xx/board.c @@ -14,6 +14,7 @@ #include <sata.h> #include <serial.h> #include <usb.h> +#include <errno.h> #include <asm/omap_common.h> #include <asm/omap_sec_common.h> #include <asm/emif.h> @@ -37,6 +38,10 @@ #include "../common/board_detect.h" #include "mux_data.h" +#ifdef CONFIG_SUPPORT_EMMC_BOOT +static int board_bootmode_has_emmc(void); +#endif + #define board_is_x15() board_ti_is("BBRDX15_") #define board_is_x15_revb1() (board_ti_is("BBRDX15_") && \ !strncmp("B.10", board_ti_get_rev(), 3)) @@ -507,6 +512,14 @@ void do_board_detect(void) CONFIG_EEPROM_CHIP_ADDRESS); if (rc) printf("ti_i2c_eeprom_init failed %d\n", rc); + +#ifdef CONFIG_SUPPORT_EMMC_BOOT + rc = board_bootmode_has_emmc(); + if (!rc) + rc = ti_emmc_boardid_get(); + if (rc) + printf("ti_emmc_boardid_get failed %d\n", rc); +#endif } #else /* CONFIG_SPL_BUILD */ @@ -522,6 +535,14 @@ void do_board_detect(void) if (rc) printf("ti_i2c_eeprom_init failed %d\n", rc); +#ifdef CONFIG_SUPPORT_EMMC_BOOT + rc = board_bootmode_has_emmc(); + if (!rc) + rc = ti_emmc_boardid_get(); + if (rc) + printf("ti_emmc_boardid_get failed %d\n", rc); +#endif + if (board_is_x15()) bname = "BeagleBoard X15"; else if (board_is_am572x_evm()) @@ -744,6 +765,11 @@ void set_muxconf_regs(void) { do_set_mux32((*ctrl)->control_padconf_core_base, early_padconf, ARRAY_SIZE(early_padconf)); + +#ifdef CONFIG_SUPPORT_EMMC_BOOT + do_set_mux32((*ctrl)->control_padconf_core_base, + emmc_padconf, ARRAY_SIZE(emmc_padconf)); +#endif } #ifdef CONFIG_IODELAY_RECALIBRATION @@ -1113,6 +1139,17 @@ int fastboot_set_reboot_flag(void) } #endif +#ifdef CONFIG_SUPPORT_EMMC_BOOT +static int board_bootmode_has_emmc(void) +{ + /* Check that boot mode is same as BBAI */ + if (gd->arch.omap_boot_mode != 2) + return -EIO; + + return 0; +} +#endif + #ifdef CONFIG_TI_SECURE_DEVICE void board_fit_image_post_process(void **p_image, size_t *p_size) { diff --git a/board/ti/am57xx/mux_data.h b/board/ti/am57xx/mux_data.h index d4a15ae93d..51df977817 100644 --- a/board/ti/am57xx/mux_data.h +++ b/board/ti/am57xx/mux_data.h @@ -1000,6 +1000,22 @@ const struct pad_conf_entry early_padconf[] = { {I2C1_SCL, (PIN_INPUT_PULLUP | M0)}, /* I2C1_SCL */ }; +#ifdef CONFIG_SUPPORT_EMMC_BOOT +const struct pad_conf_entry emmc_padconf[] = { + {GPMC_A19, (M1 | PIN_INPUT_PULLUP)}, /* K7: gpmc_a19.mmc2_dat4 */ + {GPMC_A20, (M1 | PIN_INPUT_PULLUP)}, /* M7: gpmc_a20.mmc2_dat5 */ + {GPMC_A21, (M1 | PIN_INPUT_PULLUP)}, /* J5: gpmc_a21.mmc2_dat6 */ + {GPMC_A22, (M1 | PIN_INPUT_PULLUP)}, /* K6: gpmc_a22.mmc2_dat7 */ + {GPMC_A23, (M1 | PIN_INPUT_PULLUP)}, /* J7: gpmc_a23.mmc2_clk */ + {GPMC_A24, (M1 | PIN_INPUT_PULLUP)}, /* J4: gpmc_a24.mmc2_dat0 */ + {GPMC_A25, (M1 | PIN_INPUT_PULLUP)}, /* J6: gpmc_a25.mmc2_dat1 */ + {GPMC_A26, (M1 | PIN_INPUT_PULLUP)}, /* H4: gpmc_a26.mmc2_dat2 */ + {GPMC_A27, (M1 | PIN_INPUT_PULLUP)}, /* H5: gpmc_a27.mmc2_dat3 */ + {GPMC_CS1, (M1 | PIN_INPUT_PULLUP)}, /* H6: gpmc_cs1.mmc2_cmd */ + {MCASP1_AXR5, (M14 | PIN_OUTPUT_PULLUP)}, /* F13: eMMC_RSTn (missing on schematic): mcasp1_axr5.gpio5_7 */ +}; +#endif + #ifdef CONFIG_IODELAY_RECALIBRATION const struct iodelay_cfg_entry iodelay_cfg_array_x15_sr1_1[] = { {0x0114, 2980, 0}, /* CFG_GPMC_A0_IN */ |