2014-07-18 49 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>;