All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Matwey V. Kornilov" <matwey.kornilov@gmail.com>
To: Nishanth Menon <nm@ti.com>,
	U-Boot Mailing List <u-boot@lists.denx.de>,
	 Robert Nelson <robertcnelson@gmail.com>,
	Tom Rini <trini@konsulko.com>
Subject: Re: [BISECTED] BeagleBone Black doesn't boot after a58147c2dbbf
Date: Tue, 16 Aug 2022 17:18:17 +0300	[thread overview]
Message-ID: <CAJs94EYHWCLY2HpP=s7a8b0w+jdMKnVMXgp96Ldg58sxPQnp8Q@mail.gmail.com> (raw)
In-Reply-To: <20220816012722.bt2xcizturouc4fi@nursing>

I cannot understand what is going on. As far as I understand, read
consists of i2c write of address and subsequent i2c read of data.
During the i2c write process, EEPROM handles ACK/NOACK and - since
there is no error code - the EEPROM handles i2c write correctly. And
then it looks like no EEPROM device during the i2c read stage.

вт, 16 авг. 2022 г. в 04:27, Nishanth Menon <nm@ti.com>:
>
> On 23:32-20220815, Matwey V. Kornilov wrote:
> > Only the first one dm_i2c_read is successful, whenever the size value.
>
> I wonder if we need to add complete ep read... this is what I see on my
> element 14 board:
> <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=0xffffffff rc=0
> ti_i2c_eeprom_get: 130: rc=0
> ti_i2c_eeprom_get: 135: rc=0
> ti_i2c_eeprom_get: 139: header=0xee3355aa
> ti_i2c_eeprom_get: 144: rc=0
> ep[0]=0xaa
> ep[1]=0x55
> ep[2]=0x33
> ep[3]=0xee
> ep[4]=0x41
> ep[5]=0x33
> ep[6]=0x33
> ep[7]=0x35
> ep[8]=0x42
> ep[9]=0x4e
> ep[10]=0x4c
> ep[11]=0x54
> ep[12]=0x30
> ep[13]=0x30
> ep[14]=0x43
> ep[15]=0x30
> ep[16]=0x34
> ep[17]=0x31
> ep[18]=0x34
> ep[19]=0x42
> ep[20]=0x42
> ep[21]=0x42
> ep[22]=0x4b
> ep[23]=0x30
> ep[24]=0x31
> ep[25]=0x36
> ep[26]=0x37
> 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
>
> U-Boot SPL 2022.10-rc2-00030-g29d075bc05ca-dirty (Aug 15 2022 - 14:50:17 -0500)
> Trying to boot from MMC1
>
>
> U-Boot 2022.10-rc2-00030-g29d075bc05ca-dirty (Aug 15 2022 - 14:50:17 -0500)
>
> CPU  : AM335X-GP rev 2.1
> Model: TI AM335x BeagleBone Black
> DRAM:  512 MiB
> Core:  160 devices, 18 uclasses, devicetree: separate
> WDT:   Started wdt@44e35000 with servicing (60s timeout)
> NAND:  0 MiB
> MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> Loading Environment from FAT... Unable to read "uboot.env" from mmc0:1...
> <ethaddr> not set. Validating first E-fuse MAC
> Net:   eth2: ethernet@4a100000, eth3: usb_ether
> Hit any key to stop autoboot:  0
> =>
>
> >
> > пн, 15 авг. 2022 г. в 23:21, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
> > >
> > > I have one idea. I'll try dm_i2c_read() with different `size' argument
> > > values tomorrow.
> > >
> > > пн, 15 авг. 2022 г. в 23:13, Matwey V. Kornilov <matwey.kornilov@gmail.com>:
> > > >
> > > > пн, 15 авг. 2022 г. в 22:56, Nishanth Menon <nm@ti.com>:
> > > > >
> > > > > On 21:12-20220815, Matwey V. Kornilov wrote:
> > > > > [....]
> > > > >
> > > > > Trying offline for now (I am also on libera.chat #linux-ti and #u-boot)..
> > > > >
> > > > > >
> > > > > > <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
> > > > >
> > > > > gaah... data seems stuck... with one more potential fixup... Dont know
> > > > > how this might behave..
> > > >
> > > > ti_i2c_eeprom_get: 121: header=0xee3355aa rc=0
> > > >
> > > > >
> > > > > main change is this:
> > > > > @@ -113,33 +117,42 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
> > > > >          * We must allow for fall through to check the data if 2 byte
> > > > >          * addressing works
> > > > >          */
> > > > > -       (void)dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
> > > > > +       rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
> > > > > +       printf("%s: %d: header=0x%08x rc=%d\n", __func__, __LINE__, hdr_read, rc);
> > > > >
> > > > >         /* Corrupted data??? */
> > > > > -       if (hdr_read != header) {
> > > > > +       if (rc || hdr_read != header) {
> > > > >
> > > > > 8<---
> > > > > diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c
> > > > > index ed34991377ee..f4e5da34b70a 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;
> > > > >
> > > > > @@ -113,33 +117,42 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
> > > > >          * We must allow for fall through to check the data if 2 byte
> > > > >          * addressing works
> > > > >          */
> > > > > -       (void)dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
> > > > > +       rc = dm_i2c_read(dev, 0, (uint8_t *)&hdr_read, 4);
> > > > > +       printf("%s: %d: header=0x%08x rc=%d\n", __func__, __LINE__, hdr_read, rc);
> > > > >
> > > > >         /* Corrupted data??? */
> > > > > -       if (hdr_read != header) {
> > > > > +       if (rc || hdr_read != header) {
> > > > >                 /*
> > > > >                  * read the eeprom header using i2c again, but use only a
> > > > >                  * 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
> > > >
> > > >
> > > >
> > > > --
> > > > With best regards,
> > > > Matwey V. Kornilov
> > >
> > >
> > >
> > > --
> > > With best regards,
> > > Matwey V. Kornilov
> >
> >
> >
> > --
> > With best regards,
> > Matwey V. Kornilov
>
> --
> Regards,
> Nishanth Menon
> Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D



-- 
With best regards,
Matwey V. Kornilov

  parent reply	other threads:[~2022-08-16 14:18 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 16:20 [BISECTED] BeagleBone Black doesn't boot after a58147c2dbbf Matwey V. Kornilov
2022-07-29 16:32 ` Tom Rini
2022-07-29 16:38   ` Matwey V. Kornilov
2022-07-29 16:46     ` Tom Rini
2022-07-29 17:06       ` Matwey V. Kornilov
2022-08-02  7:46         ` Matwey V. Kornilov
2022-08-05 15:00         ` Robert Nelson
2022-08-07  8:40           ` Matwey V. Kornilov
2022-08-10 22:52             ` Nishanth Menon
2022-08-11  6:56               ` Matwey V. Kornilov
2022-08-11  7:47                 ` Matwey V. Kornilov
2022-08-11 12:46                   ` Tom Rini
2022-08-11 12:53                     ` Alex Kiernan
2022-08-11 16:11                       ` Matwey V. Kornilov
2022-08-13 15:31                         ` Matwey V. Kornilov
2022-08-13 15:42                           ` Tom Rini
2022-08-13 15:50               ` Matwey V. Kornilov
     [not found]                 ` <20220815121657.nvjae4zjjftfo4gb@matcher>
2022-08-15 17:30                   ` Matwey V. Kornilov
2022-08-15 17:53                     ` Nishanth Menon
2022-08-15 18:12                       ` Matwey V. Kornilov
     [not found]                         ` <20220815195644.l6or6z6hg5igxzzm@humbly>
     [not found]                           ` <CAJs94EbKW3OLKXxTUX7PANWkY5QEOC0DREfhxP6fTOVEFydbdA@mail.gmail.com>
     [not found]                             ` <CAJs94Ea-2n56j-=gu4VyjQMro9nQFCj7JtRQVTGSSoAc+CqbVw@mail.gmail.com>
     [not found]                               ` <CAJs94EbReuKoq_28jrdrdHQDmpAn9zW0YS=9s20yS=p_mF5pNA@mail.gmail.com>
     [not found]                                 ` <20220816012722.bt2xcizturouc4fi@nursing>
2022-08-16 14:18                                   ` Matwey V. Kornilov [this message]
2022-08-18  8:28                                     ` Matwey V. Kornilov
2022-08-19  9:30                                       ` Nishanth Menon
2022-08-19 13:56                                         ` Robert Nelson
2022-08-23  3:54                                           ` Nishanth Menon
2022-08-23  5:47                                             ` Matwey V. Kornilov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJs94EYHWCLY2HpP=s7a8b0w+jdMKnVMXgp96Ldg58sxPQnp8Q@mail.gmail.com' \
    --to=matwey.kornilov@gmail.com \
    --cc=nm@ti.com \
    --cc=robertcnelson@gmail.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.