普通串口的配置

下面以开启uart1为例,来描述开启普通串口时内核中的配置。将DTS中的status改为ok:

# vi infinity2m.dtsi
        uart1: uart1@1F221200 {
            compatible = "sstar,uart";
            reg = <0x1F221200 0x100>;
            interrupts = <GIC_SPI INT_IRQ_UART_1 IRQ_TYPE_LEVEL_HIGH>;
            clocks = <&CLK_uart1>;
            status = "ok";
        };

将对应的引脚配置为UART_MODE_1:

# vi infinity2m-ssc011a-s01a-padmux-display.dtsi
    <PAD_UART1_RX         PINMUX_FOR_UART1_MODE_1       MDRV_PUSE_UART1_RX >,
    <PAD_UART1_TX         PINMUX_FOR_UART1_MODE_1       MDRV_PUSE_UART1_TX >,

加载SStarSerial/UART驱动:

# cd kernel && ARCH=arm make menuconfig

文档更新时间: 2020-12-16 15:26   作者:Aeeditor