標籤:title androi span date test evel normal tail lan
本文轉載自:http://blog.csdn.net/kris_fei/article/details/54574073
標籤: rk3288 串口添加 2017-01-16 14:52 1079人閱讀 評論(0) 收藏 舉報
著作權聲明:本文為博主原創文章,未經博主允許不得轉載。
Platform: ROCKCHIP
OS: Android 6.0
Kernel: 3.10.92
uart0,1,3,4 (普通串口) 用的是同一個串口驅動.
uart2(調試串口)的驅動代碼嵌在fiq debugger的code中.
相關的配置在rk3288.dtsi中:
aliases {
serial0 = &uart_bt;
serial1 = &uart_bb;
serial2 = &uart_dbg;
serial3 = &uart_gps;
serial4 = &uart_exp;
......
}
uart_bb: [email protected] {
compatible = "rockchip,serial";
reg = <0xff190000 0x100>;
interrupts = <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>;
clock-frequency = <24000000>;
clocks = <&clk_uart1>, <&clk_gates6 9>;
clock-names = "sclk_uart", "pclk_uart";
reg-shift = <2>;
reg-io-width = <4>;
dmas = <&pdma1 3>, <&pdma1 4>;
#dma-cells = <2>;
pinctrl-names = "default";
pinctrl-0 = <&uart1_xfer &uart1_cts &uart1_rts>;
status = "disabled";
};
假設這裡要使用uart1,也就是uart_bb, 那麼只要在主dts中添加:
&uart_bb {
status = "okay";
dma-names = "!tx", "!rx";
};
另外,由於uart1預設作為base band通訊用,所以在.rc修改成你需要的許可權
diff --git a/init.connectivity.rc b/init.connectivity.rc
index 71d125a..1e06417 100755
--- a/init.connectivity.rc
+++ b/init.connectivity.rc
@@ -54,10 +54,8 @@ on boot
# bluetooth power up/down interface
chmod 0660 /dev/ttyS0
- chmod 0660 /dev/ttyS1
chmod 0660 /dev/vflash
chown bluetooth net_bt_stack /dev/vflash
- chown bluetooth net_bt_stack /dev/ttyS1
chown bluetooth net_bt_stack /dev/ttyS0
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/type
chown bluetooth net_bt_stack /sys/class/rfkill/rfkill0/state
diff --git a/ueventd.rockchip.rc b/ueventd.rockchip.rc
index b7f45c2..c6d773a 100644
--- a/ueventd.rockchip.rc
+++ b/ueventd.rockchip.rc
@@ -31,6 +31,9 @@
/dev/mirroring 0664 media media
/dev/iep 0660 media media
+#Kris
+/dev/ttyS1 0666 system system
+
# for Sensor HAL
/dev/akm8973 0660 system system
/dev/accelerometer 0660 system system
測試:
可以弄兩塊板子, 然後將兩個一樣的串口串連起來,一塊收一塊發
1.
# cat /dev/ttyS1
2.
# echo test > /dev/ttyS1
[RK3288][Android6.0] 調試筆記 --- 普通串口的添加 【轉】