2014-07-18 35 views
2

我已启用I2C总线2黑在DTB启用I2C1上beaglebone黑色使用上比格骨DTB

i2c2: [email protected] { 
    pinctrl-names = "default"; 
    pinctrl-0 = <&i2c2_pins>; 
    status = "okay"; 
    clock-frequency = <100000>; 
};  

i2c2_pins: pinmux_i2c2_pins { 
    pinctrl-single,pins = < 
     0x178 0x73 
     0x17c 0x73 
    >; 
}; 

使用下列行但是,当我同使用下面

代码使I2C总线1
i2c1: [email protected] { 
    pinctrl-names = "default"; 
    pinctrl-0 = <&i2c1_pins>; 
    status = "okay"; 
    clock-frequency = <100000>; 
}; 

i2c1_pins: pinmux_i2c1_pins { 
    pinctrl-single,pins = < 
     0x154 0x72 /* i2c1_scl.i2c1_scl */ 
     0x15c 0x72 /* i2c1_sda.i2c1_sda */ 
    >; 
}; 

总线在i2cdetect -l命令中列出。但探测使用i2cdetect -r 1命令总线给我下面的错误

0 1 2 3 4 5 6 7 8 9 a b c d e f 
00:   [ 18.322700] omap_i2c 4802a000.i2c: timeout waiting for bus ready 
-- [ 19.342694] omap_i2c 4802a000.i2c: timeout waiting for bus ready 
-- [ 20.362695] omap_i2c 4802a000.i2c: timeout waiting for bus ready 

我使用AM3359芯片的ZCZ包。任何人都可以指出我在dtb文件中犯的错误吗?

+0

什么是“dtb”? – user391339

回答

1

问题解决了我启用了错误的行。引用错误的数据表。它应该是

+    i2c1_pins: pinmux_i2c1_pins { 
+      pinctrl-single,pins = < 
+        0x158 0x72  /* uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ 
+        0x15c 0x72  /* uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ 
+      >; 
+    }; 
+0

您好@Prajosh您能发布完整的设备树覆盖.dts代码吗?我在尝试在引脚24和26上启用I2C1时遇到了问题。目前,我正在使用此设备树[此处为github](https://github.com/beagleboard/devicetree-source/blob/master/arch/arm /boot/dts/BB-I2C1A1-00A0.dts)。当我的StrongLink SL030 RFID使用i2cdetect时,地址0x50为空白。 – RobHurd

+0

感谢您的回答,但是您能否更详细地解释一下“dtb”是什么以及您正在编辑什么文件? – user391339

-1

以下命令将启用beaglebone上的i2c1黑色。 (内核3.8 - 新的内核不支持bone_capemgr.*

echo BB-I2C1 > /sys/devices/bone_capemgr.8/slots 

注:下拉被启用。

参考

+0

我需要启动i2c总线,因为我的触控芯片连接在此总线上。所以我需要通过dtb启用它 –

+0

这看起来使I2C1成为I2C2。但是,使用i2cdetect时,它无法识别位于地址0x50的我的SL030 RFID阅读器。我使用24和26针。 – RobHurd

0

@RobHurd

我已经用在这个地方找到的文件https://git.ti.com/ti-linux-kernel/ti-linux-kernel/trees/ti-linux-3.12.y/arch/arm/boot/dts

请找我加

补丁
diff --git a/arch/arm/boot/dts/am335x-bone-common.dtsi b/arch/arm/boot/dts/am335x-bone-common.dtsi 
index a0efb06..835c973 100644 
--- a/arch/arm/boot/dts/am335x-bone-common.dtsi 
+++ b/arch/arm/boot/dts/am335x-bone-common.dtsi 
@@ -31,6 +31,7 @@ 
       0x58 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a6.gpio1_22 */ 
       0x5c (PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a7.gpio1_23 */ 
       0x60 (PIN_OUTPUT_PULLUP | MUX_MODE7) /* gpmc_a8.gpio1_24 */ 
+    0x164 (PIN_OUTPUT_PULLUP | MUX_MODE7) 
      >; 
     }; 

@@ -41,6 +42,20 @@ 
      >; 
     }; 

+  i2c1_pins: pinmux_i2c1_pins { 
+   pinctrl-single,pins = < 
+    0x158 0x72  /* uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ 
+        0x15c 0x72  /* uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE2 */ 
+   >; 
+  }; 
+ 
+  i2c2_pins: pinmux_i2c2_pins { 
+   pinctrl-single,pins = < 
+    0x178 0x73 /* uart1_ctsn.i2c2_sda, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */ 
+    0x17c 0x73 /* uart1_rtsn.i2c2_scl, SLEWCTRL_SLOW | INPUT_PULLUP | MODE3 */ 
+   >; 
+  }; 
+ 
     uart0_pins: pinmux_uart0_pins { 
      pinctrl-single,pins = < 
       0x170 (PIN_INPUT_PULLUP | MUX_MODE0) /* uart0_rxd.uart0_rxd */ 

@@ -202,6 +223,20 @@ 
      }; 

     }; 
+ 
+  i2c1: [email protected] { 
+   pinctrl-names = "default"; 
+   pinctrl-0 = <&i2c1_pins>; 
+   status = "okay"; 
+   clock-frequency = <400000>; 
+  }; 
+ 
+  i2c2: [email protected] { 
+   pinctrl-names = "default"; 
+   pinctrl-0 = <&i2c2_pins>; 
+   status = "okay"; 
+   clock-frequency = <400000>; 
+  }; 
    }; 
diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts 
index 2f64afa..0954ac1 100644 
--- a/arch/arm/boot/dts/am335x-boneblack.dts 
+++ b/arch/arm/boot/dts/am335x-boneblack.dts 
@@ -69,6 +69,15 @@ 
    }; 
}; 

+&i2c2 { 
+ touchcontroller: [email protected] { 
+  compatible = "atmel,maxtouch"; 
+  reg = <0x4b>; 
+  interrupt-parent = <&gpio2>; 
+  interrupts = <1 8>; // gpio2[1] 8 
+ }; 
+}; 
+ 
&lcdc { 
    pinctrl-names = "default", "off"; 
    pinctrl-0 = <&nxp_hdmi_bonelt_pins>;