as follow: you can try it
On 2015/9/18 15:29, Grant Likely wrote:
This is what I've done so far, but I don't have it working yet:
I've added what I think are appropriate nodes to the DT and the i2c busses are registered with the kernel:
diff --git a/arch/arm64/boot/dts/hi6220.dtsi b/arch/arm64/boot/dts/hi6220.dtsi index 7ffdc2b22333..9b2cf708d7bb 100644 --- a/arch/arm64/boot/dts/hi6220.dtsi +++ b/arch/arm64/boot/dts/hi6220.dtsi @@ -683,6 +683,40 @@ status = "ok"; };
i2c0: i2c@f7100000 {
compatible = "snps,designware-i2c";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0 0xf7100000 0x0 0x1000>;
interrupts = <0 44 4>;
clocks = <&clock_sys HI6220_I2C0_CLK>;
clock-names = "clk_i2c0";
i2c-sda-hold-time-ns = <300>;
delay-reg = <0x0 0x0f8 0x0 4>;
reset-controller-reg = <0x330 0x334 0x338 1>;
pinctrl-names = "default";
pinctrl-0 = <&i2c0_pmx_func &i2c0_cfg_func>;
%s pinctrl-names = "default", "idle"; pinctrl-0 = <&I2C0_SCL_pmx_func &I2C0_SDA_pmx_func &I2C0_SCL_cfg_func &I2C0_SDA_cfg_func>; pinctrl-1 = <&I2C0_SCL_pmx_idle &I2C0_SDA_pmx_idle &I2C0_SCL_cfg_idle &I2C0_SDA_cfg_idle>;
status = "ok";
};
i2c1: i2c@f7101000 {
compatible = "snps,designware-i2c";
#address-cells = <1>;
#size-cells = <0>;
reg = <0x0 0xf7101000 0x0 0x1000>;
interrupts = <0 45 4>;
clocks = <&clock_sys HI6220_I2C1_CLK>;
clock-names = "clk_i2c1";
i2c-sda-hold-time-ns = <300>;
delay-reg = <0x0 0x0f8 0x0 4>;
reset-controller-reg = <0x330 0x334 0x338 2>;
pinctrl-names = "default";
pinctrl-0 = <&i2c1_pmx_func &i2c1_cfg_func>;
pinctrl-names = "default", "idle"; pinctrl-0 = <&I2C1_SCL_pmx_func &I2C1_SDA_pmx_func &I2C1_SCL_cfg_func &I2C1_SDA_cfg_func>; pinctrl-1 = <&I2C1_SCL_pmx_idle &I2C1_SDA_pmx_idle &I2C1_SCL_cfg_idle &I2C1_SDA_cfg_idle>;
status = "ok";
};
It's doing /something/, but I don't know if it is correct. When I've got my i2c device plugged into the other end I get arbitration and timeout errors:
libsoc-debug: debug enabled (libsoc_set_debug) [ 314.454093] i2c_designware f7101000.i2c: i2c_dw_handle_tx_abort: lost arbitration libsoc-i2c-debug: initialising i2c bus 1 at address 98 (NULL, libsoc_i2c_init) libsoc-i2c-debug: timeout set to 10ms (i2c-1, 98, libsoc_i2c_set_timeout) libsoc-i2c-debug: Writing buffer of length 2 (i2c-1, 98, libsoc_i2c_write) libsoc-i2c-debug: message failed (i2c-1, 98, libsoc_i2c_ioctl) libsoc-i2c-debug: Resource temporarily unavailable libsoc-i2c-debug: Writing buffer of length 2 (i2c-1, 98, libsoc_i2c_write) [ 315.461594] i2c_designware f7101000.i2c: controller timed out libsoc-i2c-debug: message failed (i2c-1, 98, libsoc_i2c_ioctl) libsoc-i2c-debug: Connection timed out libsoc-i2c-debug: freeing i2c device (i2c-1, 98, libsoc_i2c_free)
But with an empty bus I get this: # ~grant/hacking/lcd/i2c_lcd libsoc-debug: debug enabled (libsoc_set_debug) libsoc-i2c-debug: initialising i2c bus 1 at address 98 (NULL, libsoc_i2c_init) libsoc-i2c-debug: timeout set to 10ms (i2c-1, 98, libsoc_i2c_set_timeout) libsoc-i2c-debug: Writing buffer of length 2 (i2c-1, 98, libsoc_i2c_write) libsoc-i2c-debug: message failed (i2c-1, 98, libsoc_i2c_ioctl) libsoc-i2c-debug: Remote I/O error
I need to get an oscilliscope out and see what is happening on the bus.
g.
On Fri, Sep 18, 2015 at 8:23 AM, Xinwei Kong kong.kongxinwei@hisilicon.com wrote:
hi
this iic driver enable one port which has been used by adv7533 module. if you enable other iic port you should require to some code in dts.
Low Speed expansion connector.
thank you xinwei
On 2015/9/18 15:17, Guodong Xu wrote:
Date: Fri, 18 Sep 2015 14:34:03 +0800 From: kong.kongxinwei@hisilicon.com To: dev@lists.96boards.org Subject: Re: [Dev] I2C on HiKey
On 2015/9/16 20:57, Grant Likely wrote:
Has anyone played with i2c on the HiKey board? I only see one i2c bus registered in sysfs. I want to use both i2c buses on the LS connector.
what is LS connector.
The low-speed connector, labelled as "J2" on HiKey board.
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev
Dev mailing list Dev@lists.96boards.org https://lists.96boards.org/mailman/listinfo/dev
.