Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-31 Thread Lubomir Popov
Hi Tom,

[snip]

>> 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.
> 
[snip]

Just tested on Beaglebone, works fine as well.

-- 
Lubo
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-31 Thread Lubomir Popov
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 
>>
>> With CONFIG_I2C_PROBE_WRITE set:
>> Tested-by: Tom Rini  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
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Lubomir Popov
Hi Tom,

> 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 
>>
>> With CONFIG_I2C_PROBE_WRITE set:
>> Tested-by: Tom Rini  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.

How does it actually break? Does not build, or I2C is not working,
or what?

If I2C is not working, could you try changing the condition

#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX)

to

#if defined(CONFIG_OMAP243X) || defined(CONFIG_OMAP34XX) || 
defined(CONFIG_AM33XX)

found in 3 places in driver (lines 155, 554, 585) and test again?

Thanks,
Lubo

___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Lubomir Popov
Hi Tom,

> 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 
>>
>> With CONFIG_I2C_PROBE_WRITE set:
>> Tested-by: Tom Rini  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.
>
OK, holding off. And thanks for testing.
>
> --
> Tom
>
-- 
Lubo


___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Tom Rini
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 
> 
> With CONFIG_I2C_PROBE_WRITE set:
> Tested-by: Tom Rini  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.


-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Tom Rini
On Thu, May 30, 2013 at 05:51:44PM +0300, Lubomir Popov wrote:
> Hi Tom,
> 
> On 30/05/13 17:37, 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 
> > 
> > With CONFIG_I2C_PROBE_WRITE set:
> > Tested-by: Tom Rini  on Beagleboard / Beagleboard xM
> > 
> > So lets just go with the write probe always being on again.
> > 
> > Now, when I git am'd I saw some whitespace problems, so please make sure
> > v4 is checkpatch clean.  And note that printf("Long than 80 char wide",
> > a, b) is OK and expected to NOT break the string (but do align the
> > args).
> > 
> OK, shall do it tonight. I see a minor problem however: if we are not
> going to support all OMAP2 chips (the 2420 in particular), isn't it
> somewhat misleading to keep the driver named omap24xx_i2c? Letting
> you decide...

Please add a comment that this driver needs some re-adaptation for the
OMAP2420 implementation of this IP block now.  Thanks!

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Lubomir Popov
Hi Tom,

On 30/05/13 17:37, 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 
> 
> With CONFIG_I2C_PROBE_WRITE set:
> Tested-by: Tom Rini  on Beagleboard / Beagleboard xM
> 
> So lets just go with the write probe always being on again.
> 
> Now, when I git am'd I saw some whitespace problems, so please make sure
> v4 is checkpatch clean.  And note that printf("Long than 80 char wide",
> a, b) is OK and expected to NOT break the string (but do align the
> args).
> 
OK, shall do it tonight. I see a minor problem however: if we are not
going to support all OMAP2 chips (the 2420 in particular), isn't it
somewhat misleading to keep the driver named omap24xx_i2c? Letting
you decide...

-- 
Lubo
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH v3] OMAP: I2C: New read, write and probe functions

2013-05-30 Thread Tom Rini
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 

With CONFIG_I2C_PROBE_WRITE set:
Tested-by: Tom Rini  on Beagleboard / Beagleboard xM

So lets just go with the write probe always being on again.

Now, when I git am'd I saw some whitespace problems, so please make sure
v4 is checkpatch clean.  And note that printf("Long than 80 char wide",
a, b) is OK and expected to NOT break the string (but do align the
args).

-- 
Tom


signature.asc
Description: Digital signature
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot