Device Tree Configuration

For Linux 5.15, UART has the following configuration for a general UART Controller:
uart0: serial@10000000 {
        compatible = "snps,dw-apb-uart";
        reg = <0x0 0x10000000 0x0 0xl0000>;
        reg-io-width = <4>;
        reg-shift = <2>;
        clocks = <&clkgen JH7110_UART0_CLK_CORE>, 
                 <&clkgen JH7110_UART0_CLK_APB>;
        clock-names = "baudclk", ”apb_pclk";
        resets = <&rstgen RSTN_U0_DW_UART_APB>,
                 <&rstgen RSTN_U0_DW_UART_CORE>;
        interrupts = <32>;
        status = "disabled";
};
The following list provides explanations for the parameters included in the above code block.
  • compatible: Compatibility information, used to associate the driver and its target device.
  • reg: Register base address "0x10000000" and range "0x10000". Make sure you do not change the 2 bits after it, reg-io-width and reg-shift.
  • clocks: The clocks used by the UART module.
  • clock-names: The names of the above clocks.
  • resets: The reset signals used by the UART module.
  • interrupts: Hardware interrupt ID.
  • status: The work status of the UART module. To enable the module, set this bit as "okay" or to disable the module, set this bit as "disabled".

You can configure each UART controller in the device tree. A UART node represents a UART controller. You need to specify an alias for the UART node so that you can identify it from the others.