RK3288把debug口从uart2修改为uart3步骤

kernel/arch/arm/mach-rockchip/rk_fiq_debugger.c


搜索:static int debug_port_init(struct platform_device *pdev)
将该函数内容替换为以下即可:
int dll = 0, dlm = 0;
    struct rk_fiq_debugger *t;


    t = container_of(dev_get_platdata(&pdev->dev), typeof(*t), pdata);


    if (rk_fiq_read(t, UART_LSR) & UART_LSR_DR)
        (void)rk_fiq_read(t, UART_RX);


    //switch (t->baudrate) {
    //case 1500000:
        //dll = 0x1;
        //break;
    //case 115200:
    //default:
        dll = 0xd;
        //break;
    //}


    rk_fiq_write(t, 0x83, UART_LCR);
    /* set baud rate */
    rk_fiq_write(t, dll, UART_DLL);
    rk_fiq_write(t, dlm, UART_DLM);
    rk_fiq_write(t, 0x03, UART_LCR);


    /* enable rx and lsr interrupt */
    rk_fiq_write(t, UART_IER_RLSI | UART_IER_RDI, UART_IER);
    /* interrupt on every character when receive,but we can enable fifo for TX
    I found that if we enable the RX fifo, some problem may vanish such as when
    you continuously input characters in the command line the uart irq may be disable
    because of the uart irq is served when CPU is at IRQ exception,but it is
    found unregistered, so it is disable.
    hhb@rock-chips.com */
    rk_fiq_write(t, 0xc1, UART_FCR);


    return 0;


rk3288.dtsi里fiq_debugger改成以下:
fiq_debugger: fiq-debugger {
compatible = "rockchip,fiq-debugger";
rockchip,serial-id = <3>;
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 = <&uart1_xfer>;
};


rk3288-popmetal.dts里需要添加:
&uart_gps{
status = "okay";
dma-names = "!tx", "!rx";
pinctrl-0 = <&uart3_xfer &uart3_cts>; 
};
--------------------- 
作者:困于往事 
来源:CSDN 
原文:https://blog.csdn.net/HWQ331717300/article/details/72275982?utm_source=copy 
版权声明:本文为博主原创文章,转载请附上博文链接!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值