[U-Boot] i2c: mxc: refactor i2c driver and support dm

3 messages, 2 authors, 2016-10-18 · open the first message on its own page

[U-Boot] i2c: mxc: refactor i2c driver and support dm

From: Jagan Teki <hidden>
Date: 2016-10-17 11:17:11

Hi Peng/all,

Observed an issue while setting the bus on mxc_i2c driver
addr = dev_get_addr(bus); is getting failed to get invalid address.

Commit details:
"i2c: mxc: refactor i2c driver and support dm"
(sha1: 71204e95ce13228a0c742cce137c3238f64581d8)

Log:
icorem6qdl> i2c bus
Bus 0:  i2c at 021a0000
Bus 1:  i2c at 021a4000
icorem6qdl> i2c dev 0
Setting bus to 0
cmd_i2c_set_bus_num: Trying bus 0
mxc_i2c_probe
0. mxc_i2c_probe
dev_get_addr_index: OF_TRANSLATE
dev_get_addr_index: i2c at 021a0000 - 0xffffffff
cmd_i2c_set_bus_num: No bus 0
Failure changing bus number (-19)

Any help? did you tested on any board?

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.

[U-Boot] i2c: mxc: refactor i2c driver and support dm

From: Peng Fan <hidden>
Date: 2016-10-18 05:03:49

Hi Jagan,
On Mon, Oct 17, 2016 at 04:47:11PM +0530, Jagan Teki wrote:
Hi Peng/all,

Observed an issue while setting the bus on mxc_i2c driver
addr = dev_get_addr(bus); is getting failed to get invalid address.

Commit details:
"i2c: mxc: refactor i2c driver and support dm"
(sha1: 71204e95ce13228a0c742cce137c3238f64581d8)

Log:
icorem6qdl> i2c bus
Bus 0:  i2c at 021a0000
Bus 1:  i2c at 021a4000
icorem6qdl> i2c dev 0
Setting bus to 0
cmd_i2c_set_bus_num: Trying bus 0
mxc_i2c_probe
0. mxc_i2c_probe
dev_get_addr_index: OF_TRANSLATE
dev_get_addr_index: i2c at 021a0000 - 0xffffffff
cmd_i2c_set_bus_num: No bus 0
Failure changing bus number (-19)

Any help? did you tested on any board?
It works well on i.MX6ULL 14x14 EVK board.
"
=> i2c bus
Bus 0:  i2c at 021a0000
Bus 1:  i2c at 021a4000
=> i2c dev 0
Setting bus to 0
i2c bus 0 at 35258368, no gpio pinctrl state.
=> i2c probe
Valid chip addresses: 0E 1E
=> i2c dev 1
Setting bus to 1
i2c bus 1 at 35274752, no gpio pinctrl state.
=> i2c probe
Valid chip addresses: 1A
=> i2c bus
Bus 0:  i2c at 021a0000  (active 0)
0e: generic_e, offset len 1, flags 0
1e: generic_1e, offset len 1, flags 0
Bus 1:  i2c at 021a4000  (active 1)
1a: generic_1a, offset len 1, flags 0
"

Add alias, and have a try.
 aliases {
         i2c0 = &i2c1;                                                   
         i2c1 = &i2c2;
 };


Regards,
Peng.
thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
_______________________________________________
U-Boot mailing list
U-Boot at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

[U-Boot] i2c: mxc: refactor i2c driver and support dm

From: Jagan Teki <hidden>
Date: 2016-10-18 11:30:25

On Mon, Oct 17, 2016 at 4:47 PM, Jagan Teki [off-list ref] wrote:
Hi Peng/all,

Observed an issue while setting the bus on mxc_i2c driver
addr = dev_get_addr(bus); is getting failed to get invalid address.

Commit details:
"i2c: mxc: refactor i2c driver and support dm"
(sha1: 71204e95ce13228a0c742cce137c3238f64581d8)

Log:
icorem6qdl> i2c bus
Bus 0:  i2c at 021a0000
Bus 1:  i2c at 021a4000
icorem6qdl> i2c dev 0
Setting bus to 0
cmd_i2c_set_bus_num: Trying bus 0
mxc_i2c_probe
0. mxc_i2c_probe
dev_get_addr_index: OF_TRANSLATE
dev_get_addr_index: i2c at 021a0000 - 0xffffffff
cmd_i2c_set_bus_num: No bus 0
Failure changing bus number (-19)
Seen like some issue on my dts or fdt_get_patch (lib/libfdt/fdt_ro.c)
it is returning FDT_ERR_BADSTRUCTURE

U-Boot> dm tree
...
 simple_bus  [ + ]        `-- aips-bus at 02100000
 eth         [ + ]              |-- FEC
 mmc         [ + ]            |-- usdhc at 02190000
 i2c         [   ]               |-- i2c at 021a0000
 i2c         [   ]               |-- i2c at 021a4000
 i2c         [   ]            `-- i2c at 021a8000

So when I uncomment the "phy-mode" on the dts file [1] I was able to
get the proper i2c addr.
Couldn't find why the phy-mode node as a corrupt block based on
comment from include/libfdt.h about FDT_ERR_BADSTRUCTURE.

Simon, any help?

[1] https://patchwork.ozlabs.org/patch/678825/

thanks!
-- 
Jagan Teki
Free Software Engineer | www.openedev.com
U-Boot, Linux | Upstream Maintainer
Hyderabad, India.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help