[BISECTED] BeagleBone Black doesn't boot after a58147c2dbbf

Nishanth Menon nm at ti.com
Mon Aug 15 19:53:25 CEST 2022


On 20:30-20220815, Matwey V. Kornilov wrote:
> Hi Nishanth,
> 
> I just reverted 0dba4586 and have the following diff in the config:
> 
> diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
> index b500ed0fdd..b403901879 100644
> --- a/configs/am335x_evm_defconfig
> +++ b/configs/am335x_evm_defconfig
> @@ -9,6 +9,9 @@ CONFIG_AM335X_USB0=y
>  CONFIG_AM335X_USB0_PERIPHERAL=y
>  CONFIG_AM335X_USB1=y
>  CONFIG_SPL=y
> +CONFIG_DEBUG_UART_BASE=0x44e09000
> +CONFIG_DEBUG_UART_CLOCK=48000000
> +CONFIG_DEBUG_UART=y
>  CONFIG_DISTRO_DEFAULTS=y
>  CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
>  CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
> @@ -102,6 +105,9 @@ CONFIG_DRIVER_TI_CPSW=y
>  CONFIG_DM_PMIC=y
>  # CONFIG_SPL_DM_PMIC is not set
>  CONFIG_PMIC_TPS65217=y
> +CONFIG_DEBUG_UART_OMAP=y
> +CONFIG_DEBUG_UART_SHIFT=2
> +CONFIG_DEBUG_UART_ANNOUNCE=y
>  CONFIG_SPI=y
>  CONFIG_DM_SPI=y
>  CONFIG_OMAP3_SPI=y
> 
> 
> I've applied your patch and see the following output now:

Thanks.

> 
> <debug_uart>
> ti_i2c_eeprom_get: 97: rc=0 header=0xee3355aa
> ti_i2c_eeprom_get: 101: rc=0
> ti_i2c_eeprom_get: 109: rc=0
> ti_i2c_eeprom_get: 120: header=0xee3355aa

1 byte read operation passed here. so it never enters the 2 byte read op
check. Is'nt this supposed to be a 2 byte addressing eeprom device?

I wonder if changing that code to:
(void)dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
if (hdr_read != header) {
to:

rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
if (rc || (hdr_read != header) {

might help?

> ti_i2c_eeprom_get: 138: header=0xee3355aa

> ti_i2c_eeprom_get: 143: rc=0
> ti_i2c_eeprom_get: 191: Out OK

So the header for sure matched, but not the data, I presume. Can we
cross check with the updated debug printf("ep[%d]=0x%02x\n",i, ep[i]);
that I added below?

> Bad EEPROM or unknown board, cannot configure pinmux.
> 

8<---
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
index ed34991377ee..34dfc1acb3a0 100644
--- a/board/ti/common/board_detect.c
+++ b/board/ti/common/board_detect.c
@@ -90,13 +90,16 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 	int rc;
 
 #if CONFIG_IS_ENABLED(DM_I2C)
+	int i;
 	struct udevice *dev;
 	struct udevice *bus;
 
 	rc = uclass_get_device_by_seq(UCLASS_I2C, bus_addr, &bus);
+	printf("%s: %d: rc=%d header=0x%08x\n", __func__, __LINE__, rc, header);
 	if (rc)
 		return rc;
 	rc = dm_i2c_probe(bus, dev_addr, 0, &dev);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 	if (rc)
 		return rc;
 
@@ -104,6 +107,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 	 * Read the header first then only read the other contents.
 	 */
 	rc = i2c_set_chip_offset_len(dev, 1);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 	if (rc)
 		return rc;
 
@@ -114,6 +118,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 	 * addressing works
 	 */
 	(void)dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
+	printf("%s: %d: header=0x%08x\n", __func__, __LINE__, hdr_read);
 
 	/* Corrupted data??? */
 	if (hdr_read != header) {
@@ -122,24 +127,32 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 		 * 2 byte address (some newer boards need this..)
 		 */
 		rc = i2c_set_chip_offset_len(dev, 2);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 		if (rc)
 			return rc;
 
 		rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 		if (rc)
 			return rc;
 	}
+	printf("%s: %d: header=0x%08x\n", __func__, __LINE__, hdr_read);
 	if (hdr_read != header)
 		return -1;
 
 	rc = dm_i2c_read(dev, 0, ep, size);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 	if (rc)
 		return rc;
+
+	for (i = 0; i< size; i++)
+		printf("ep[%d]=0x%02x\n",i, ep[i]);
 #else
 	u32 byte;
 
 	gpi2c_init();
 	rc = ti_i2c_eeprom_init(bus_addr, dev_addr);
+	printf("%s: %d: rc=%d header=0x%08x\n", __func__, __LINE__, rc, header);
 	if (rc)
 		return rc;
 
@@ -157,6 +170,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 	(void)i2c_read(dev_addr, 0x0, byte, (uint8_t *)&hdr_read, 4);
 
 	/* Corrupted data??? */
+	printf("%s: %d: header=0x%08x\n", __func__, __LINE__, hdr_read);
 	if (hdr_read != header) {
 		/*
 		 * read the eeprom header using i2c again, but use only a
@@ -165,16 +179,20 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
 		byte = 2;
 		rc = i2c_read(dev_addr, 0x0, byte, (uint8_t *)&hdr_read,
 			      4);
+		printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 		if (rc)
 			return rc;
 	}
+	printf("%s: %d: header=0x%08x\n", __func__, __LINE__, hdr_read);
 	if (hdr_read != header)
 		return -1;
 
 	rc = i2c_read(dev_addr, 0x0, byte, ep, size);
+	printf("%s: %d: rc=%d\n", __func__, __LINE__, rc);
 	if (rc)
 		return rc;
 #endif
+	printf("%s: %d: Out OK\n", __func__, __LINE__);
 	return 0;
 }
 
diff --git a/configs/am335x_evm_defconfig b/configs/am335x_evm_defconfig
index b500ed0fdd8d..b4039018793b 100644
--- a/configs/am335x_evm_defconfig
+++ b/configs/am335x_evm_defconfig
@@ -9,6 +9,9 @@ CONFIG_AM335X_USB0=y
 CONFIG_AM335X_USB0_PERIPHERAL=y
 CONFIG_AM335X_USB1=y
 CONFIG_SPL=y
+CONFIG_DEBUG_UART_BASE=0x44e09000
+CONFIG_DEBUG_UART_CLOCK=48000000
+CONFIG_DEBUG_UART=y
 CONFIG_DISTRO_DEFAULTS=y
 CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
 CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x4030ff00
@@ -102,6 +105,9 @@ CONFIG_DRIVER_TI_CPSW=y
 CONFIG_DM_PMIC=y
 # CONFIG_SPL_DM_PMIC is not set
 CONFIG_PMIC_TPS65217=y
+CONFIG_DEBUG_UART_OMAP=y
+CONFIG_DEBUG_UART_SHIFT=2
+CONFIG_DEBUG_UART_ANNOUNCE=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_OMAP3_SPI=y
-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D


More information about the U-Boot mailing list