把调试串口即FIQ串口修改为普通串口
Kernel部分:
注释掉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
或者修改DTSI
&fiq_debugger {
status = "disabled";
};
其实就是移除kernel里的FIQ_DEBUGGER驱动
因为uart2做调试串口时,uart2是关闭的
在DTSI里添加
&uart2 {
status = "okay";
};
以上修改其实就已经可以了,只是uboot部分仍会打印log,如需屏蔽uboot部分需做如下修改
Uboot:
无需修改,不影响
如果开机遇到异常,建议做以下修改:
DTSI:删除bootargs
chosen {
- bootargs = "earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m";
+// bootargs = "earlycon=uart8250,mmio32,0xff1a0000 swiotlb=1 coherent_pool=1m";
+ bootargs = "";
};
parameter.txt:
androidboot.console=ttyFIQ0 改为 androidboot.console=NULL
init.rc:
移除init.rc中 console
修改FIQ debug 串口使用的串口号
KERNEL DTSI:
例由串口2改为串口0
fiq_debugger: fiq-debugger {
compatible = "rockchip,fiq-debugger";
rockchip,serial-id = <2>; 设置串口id,比如改为0
rockchip,signal-irq = <182>;
rockchip,wake-irq = <0>;
rockchip,irq-mode-enable = <1>; /* If enable uart uses irq instead of fiq */
rockchip,baudrate = <1500000>; /* Only 115200 and 1500000 */
pinctrl-names = "default";
pinctrl-0 = <&uart2c_xfer>; 配置iomux,改为uart0_xfer
};
关闭原串口0
&uart0 {
pinctrl-names = "default";
pinctrl-0 = <&uart0_xfer &uart0_cts>;
status = "disabled";
};
//bootargs尝试修改,若修改不开机或不打log就不要改,我的3399不能改
chosen {
bootargs = "earlyprintk=uart8250-32bit,0xff180000"; uart0对应的地址
};
UBOOT:
u-boot/configs/rk3***_defconfig
CONFIG_SYS_EXTRA_OPTIONS 中添加 ,UART_NUM=UART_CH0
u-boot/include/configs/rk_default_config.h
-#define CONFIG_UART_NUM UART_CH2
+#define CONFIG_UART_NUM UART_CH0
如果需要修改波特率为115200 ,kernel就修改dtsi fiq_debugger中配置
uboot修改u-boot/configs/rk3***_defconfig 的BAUDRATE=1500000