ARM平台UART问题

问题背景

最近遇到一个问题: 鲲鹏920机器串口无法修改波特率
后面发现该硬件使用的是芯片自带的SBSA UART,该UART本身就无法修改波特率, 可见内核文档说明(arm_sbsa_uart.txt):

ARM SBSA defined generic UART
This UART uses a subset of the PL011 registers and consequently lives
in the PL011 driver. It’s baudrate and other communication parameters
cannot be adjusted at runtime, so it lacks a clock specifier here.

Required properties:

  • compatible: must be “arm,sbsa-uart”
  • reg: exactly one register range
  • interrupts: exactly one interrupt specifier
  • current-speed: the (fixed) baud rate set by the firmware

扩展

PL011

ARM平台芯片常用uart的是PL011 ,对应的驱动源码为:drivers/tty/serial/amba-pl011.c
ARM官方说明:
https://developer.arm.com/ip-products/system-ip/system-controllers/peripheral-controllers

PL011 is a synthesizable Universal Asynchronous Receiver Transmitter (UART) serial port controller.

It is an Advanced Microcontroller Bus Architecture (AMBA) compliant System-on-Chip (SoC) peripheral that is developed, tested, and licensed by Arm. The UART is an AMBA requester module that connects to the Advanced Peripheral Bus (APB). The UART includes an Infrared Data Association (IrDA) Serial InfraRed (SIR) protocol ENcoder/DECoder (ENDEC).

AMBA

AMBA(Advanced Microcontroller Bus Architecture) 总线是由ARM公司提出的一种开放性的片上总线标准

AMBA总线体系包括以下三种总线:

  • AHB(Advanced High-performance Bus):高性能总线,用于高性能、高时钟工作频率模块
  • ASB(Advanced System Bus):系统总线,用于高性能系统模块
  • APB(Advanced Peripheral Bus):外设总线,用于低速外设模块

UART就是接在APB上面

SBSA

Server Base System Architecture (SBSA) specification specifies a hardware system architecture based on the Arm 64-bit architecture