RK平台 android系统 修改uart2调试串口为普通串口

一般情况下,RK系列主板的ttyS2(即uart2)基本都是设计为debug调试口, 提供fiq debugger功能。
将调试口更改为普通串口,具体修改如下:

  1. 移除掉kernel里的fiq debugger驱动:
//dts中disabled掉fiq debugger驱动节点
fiq-debugger {
    
    
    compatible = "rockchip,fiq-debugger";
    interrupts = <GIC_SPI 155 IRQ_TYPE_LEVEL_HIGH>;
    rockchip,serial-id = <2>;
    rockchip,wake-irq = <0>;
    rockchip,irq-mode-enable = <0>;  /* If enable uart uses irq instead of fiq */
    rockchip,baudrate = <115200>;  /* Only 115200 and 1500000 */
    pinctrl-names = "default";
    pinctrl-0 = <&uart2_xfer>;
+   status = "disabled";
};

//或者注释掉kernel config里的FIQ_DEBUGGER相关配置
#CONFIG_FIQ_DEBUGGER=y
#CONFIG_FIQ_DEBUGGER_NO_SLEEP=y
#CONFIG_FIQ_DEBUGGER_CONSOLE=y
#CONFIG_FIQ_DEBUGGER_CONSOLE_DEFAULT_ENABLE=y
#CONFIG_FIQ_DEBUGGER_TRUST_ZONE=y
  1. 打开uart2(由于之前做调试串口需要关闭):
&uart2 {
    
    
-       status = "disabled";
+       status = "okay";
};
  1. 删除bootargs:
        chosen {
    
    
-               bootargs = "earlycon=uart8250,mmio32,0xff690000 vmalloc=496M";
+               //bootargs = "earlycon=uart8250,mmio32,0xff690000 vmalloc=496M";
        };
  1. 修改parameter.txt(去掉 ttyFIQ0):
-CMDLINE: console=ttyFIQ0 androidboot.baseband
+CMDLINE: console= androidboot.baseband
  1. device/rockchip/common/recovery/etc/init.rc文件中 移除console:
service recovery /sbin/recovery
-    console
+    #console
     seclabel u:r:recovery:s0

修改编译烧录后,ttyS2即可作为普通串口使用,短接TX,RX可自发自收!

猜你喜欢

转载自blog.csdn.net/weixin_45639314/article/details/132412447