public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lubomir Popov <lpopov@mm-sol.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions
Date: Fri, 31 May 2013 13:39:05 +0300	[thread overview]
Message-ID: <51A87DC9.60507@mm-sol.com> (raw)
In-Reply-To: <20130530170709.GP11917@bill-the-cat>

Hi Tom,

On 30/05/13 20:07, Tom Rini wrote:
> On Thu, May 30, 2013 at 10:37:42AM -0400, Tom Rini wrote:
>> On Thu, May 30, 2013 at 01:24:42AM +0300, Lubomir Popov wrote:
>>
>>> Tested on OMAP4/5 only, but should work on older OMAPs and
>>> derivatives as well.
>>>
>>> - Rewritten i2c_read to operate correctly with all types of chips
>>>   (old function could not read consistent data from some I2C slaves).
>>> - Optimised i2c_write.
>>> - New i2c_probe, optionally selectable via CONFIG_I2C_PROBE_WRITE,
>>>   performs write access vs read. The old probe could hang the system
>>>   under certain conditions (e.g. unconfigured pads).
>>> - The read/write/probe functions try to identify unconfigured bus.
>>> - Status functions now read irqstatus_raw as per TRM guidelines
>>>   (except for OMAP243X and OMAP34XX).
>>> - Driver now supports up to I2C5 (OMAP5).
>>>
>>> Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
>>
>> With CONFIG_I2C_PROBE_WRITE set:
>> Tested-by: Tom Rini <trini@ti.com> on Beagleboard / Beagleboard xM
> 
> But, crap, breaks am335x_evm (and probably beaglebones, etc).  I'll
> dig into this more to see if I can spot something obvious tomorrow.
Made it work on the am335x_evm (tested, with AM3359 on board).
Problem was in the new i2c_probe, which on this board is called by
the SPL and caused a hang (interestingly, when called from regular
u-boot, works fine). Fix is to add a small delay. Clocking and I2C
speed should be identical between SPL and U-Boot, but probably are
not; I did not have time to look with a scope, but don't have any
other reasonable explanation. Whatever, now it is working. I shall
submit the patch tonight.

Would like as well to note that the current u-boot-ti/master
(freshly cloned, no changes whatsoever) does not boot on the
am335x-evm:

U-Boot SPL 2013.04-11562-g47c6ea0 (May 31 2013 - 09:56:46)
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0 
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Peripheral mode controller at 47401000 using PIO, IRQ 0
musb-hdrc: ConfigData=0xde (UTMI-8, dyn FIFOs, HB-ISO Rx, HB-ISO Tx, SoftConn)
musb-hdrc: MHDRC RTL version 2.0 
musb-hdrc: setup fifo_mode 4
musb-hdrc: 28/31 max ep, 16384/16384 memory
USB Host mode controller at 47401800 using PIO, IRQ 0
### ERROR ### Please RESET the board ###

-- 
Lubo

  parent reply	other threads:[~2013-05-31 10:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 22:24 [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions Lubomir Popov
2013-05-30 14:37 ` Tom Rini
2013-05-30 14:51   ` Lubomir Popov
2013-05-30 15:01     ` Tom Rini
2013-05-30 17:07   ` Tom Rini
2013-05-30 18:41     ` Lubomir Popov
2013-05-30 19:34     ` Lubomir Popov
2013-05-31 10:39     ` Lubomir Popov [this message]
2013-05-31 10:58       ` Lubomir Popov

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=51A87DC9.60507@mm-sol.com \
    --to=lpopov@mm-sol.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox