пн, 15 авг. 2022 г. в 20:53, Nishanth Menon <n...@ti.com>: > > 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; > }
<debug_uart> ti_i2c_eeprom_get: 98: rc=0 header=0xee3355aa ti_i2c_eeprom_get: 102: rc=0 ti_i2c_eeprom_get: 110: rc=0 ti_i2c_eeprom_get: 121: header=0xee3355aa ti_i2c_eeprom_get: 139: header=0xee3355aa ti_i2c_eeprom_get: 144: rc=0 ep[0]=0xff ep[1]=0xff ep[2]=0xff ep[3]=0xff ep[4]=0xff ep[5]=0xff ep[6]=0xff ep[7]=0xff ep[8]=0xff ep[9]=0xff ep[10]=0xff ep[11]=0xff ep[12]=0xff ep[13]=0xff ep[14]=0xff ep[15]=0xff ep[16]=0xff ep[17]=0xff ep[18]=0xff ep[19]=0xff ep[20]=0xff ep[21]=0xff ep[22]=0xff ep[23]=0xff ep[24]=0xff ep[25]=0xff ep[26]=0xff ep[27]=0xff ep[28]=0xff ep[29]=0xff ep[30]=0xff ep[31]=0xff ep[32]=0xff ep[33]=0xff ep[34]=0xff ep[35]=0xff ep[36]=0xff ep[37]=0xff ep[38]=0xff ep[39]=0xff ep[40]=0xff ep[41]=0xff ep[42]=0xff ep[43]=0xff ep[44]=0xff ep[45]=0xff ep[46]=0xff ep[47]=0xff ep[48]=0xff ep[49]=0xff ep[50]=0xff ep[51]=0xff ep[52]=0xff ep[53]=0xff ep[54]=0xff ep[55]=0xff ep[56]=0xff ep[57]=0xff ep[58]=0xff ep[59]=0xff ep[60]=0xff ep[61]=0xff ep[62]=0xff ep[63]=0xff ep[64]=0xff ep[65]=0xff ep[66]=0xff ep[67]=0xff ep[68]=0xff ep[69]=0xff ep[70]=0xff ep[71]=0xff ep[72]=0xff ep[73]=0xff ep[74]=0xff ep[75]=0xff ep[76]=0xff ep[77]=0xff ti_i2c_eeprom_get: 195: Out OK Bad EEPROM or unknown board, cannot configure pinmux. > > 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 -- With best regards, Matwey V. Kornilov