summaryrefslogtreecommitdiff
path: root/board/ti/am57xx/board.c
diff options
context:
space:
mode:
authorCaleb Robey <c-robey@ti.com>2020-01-02 17:17:25 +0300
committerLokesh Vutla <lokeshvutla@ti.com>2020-01-20 07:40:28 +0300
commitd6eaaae3d3066efadab3899e3f66ee8db85368b2 (patch)
tree9bf6cf93ad7129c5a18d778659771171dd2c2202 /board/ti/am57xx/board.c
parent4250bf8ed96b50cf78d04fb2564fed351f7daeb2 (diff)
downloadu-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/board.c')
-rw-r--r--board/ti/am57xx/board.c37
1 files changed, 37 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)
{