[U-Boot] soft-i2c and i2c-gpio issues with at91

Matt Wood mattwood2000 at gmail.com
Wed May 27 21:21:02 CEST 2015


On Wed, May 27, 2015 at 7:32 AM, Przemyslaw Marczak <p.marczak at samsung.com>
wrote:

> Hi all,
>
> On 05/26/2015 07:23 PM, Matt Wood wrote:
>
>> Thank you Simon.  Getting there, but now I get a data abort and system
>> reset when trying to set the i2c bus.  I need to chase this down, but if
>> you have any suggestions I'd appreciate it.
>>
>> Below is the output of dm tree and dm uclass.
>>
>> Thanks, Matt.
>>
>> U-Boot> i2c dev 3
>>
>
> ...snip...
>
> You should first be sure that dm gpio for your board is working properly.
>
> Are you able to test the output state of some GPIOs on your board, e.g. by
> the LED?
> If yes, then you can test it with gpio command or just using some
> dm_gpio..() calls for some GPIO with the LED.
>
> And about your data abort.
> I can't check your board config/driver at present but will try to give you
> a quick suggestion.
>
> So, when you type i2c dev 3, then the i2c device:
>
> "gpio-i2c at 1 @ 3fb58348, seq -1, (req 3)"
>
>  with alias number 3 (as you requested) is probed.
>
> One of the routine is calling the function:
>  * i2c_gpio_ofdata_to_platdata() in gpio-i2c.c - probably succeeds.
>
> Then,
> * post_probe() of i2c uclass is called, and next:
> * i2c_post_probe() - from drivers/i2c/i2c-uclass.c, this goes to:
> * i2c_gpio_set_bus_speed() - from gpio-i2c.c
>
> And here probably starts the magic which ends by data abort.
> The driver just operates on GPIOs defined in your device tree.
>
> If you enable the gpio command (CONFIG_CMD_GPIO), then you can easy test,
> that change state of some GPIO pins works properly, or you can make some
> test by printing the results of dm_gpio..() calls in somewhere.
>
> Best regards,
> --
> Przemyslaw Marczak
> Samsung R&D Institute Poland
> Samsung Electronics
> p.marczak at samsung.com


OK very interesting, I enabled CONFIG_CMD_GPIO and if I do a "gpio status"
I get a data abort and reset, however if I simply do a "gpio
set/clear/toggle ..." on a known pin, the output of the pin changes
accordingly.  I'm not sure specifically what this means but I know the GPIO
driver model is at least partly working.

Anyway, due to time constraints I went back to the old I2C driver interface
as I don't have time to debug this anymore:
https://github.com/linux4sam/u-boot-at91/commit/7ff618b526a04b7fb72df1a3e04a91fe40b6ccf3

Thanks Josh for pointing me to this, I can successfully read the EEPROM I'm
after.

Regards, Matt.


More information about the U-Boot mailing list