aarch64/raspberrypi: improve UART

- Add support for four new ports, UART2-UART5.
- Add build options to allow console device configuration.
- Segregate device-specific definitions from the device family files. X macros
  are used to maintain a single source of truth and have the configuration
  done at compile-time
- Add raspberrypi_uart_init() to make it convenient for users to install uart
  devices

Close #5130

Co-authored-by: Ning Yang <yangn0@qq.com>
This commit is contained in:
Utkarsh Verma
2024-10-26 12:42:38 +08:00
committed by Kinsey Moore
parent ee34dd12f4
commit d17116d310
9 changed files with 365 additions and 34 deletions

View File

@@ -39,8 +39,6 @@ links:
uid: ../optgtuseps
- role: build-dependency
uid: abi
- role: build-dependency
uid: ../../optconsoleirq
- role: build-dependency
uid: ../../optcachedata
- role: build-dependency
@@ -55,10 +53,10 @@ links:
uid: ../../dev/irq/objarmgicv2
- role: build-dependency
uid: ../../obj
- role: build-dependency
uid: ../../objdevserialarmpl011
- role: build-dependency
uid: ../../objirq
- role: build-dependency
uid: objconsole
- role: build-dependency
uid: objgpio
- role: build-dependency
@@ -66,7 +64,6 @@ links:
- role: build-dependency
uid: objwatchdog
source:
- bsps/aarch64/raspberrypi/console/console.c
- bsps/aarch64/raspberrypi/start/bspstart.c
- bsps/aarch64/raspberrypi/start/bspstarthooks.c
- bsps/aarch64/raspberrypi/start/bspstartmmu.c
@@ -75,8 +72,6 @@ source:
- bsps/aarch64/shared/mmu/vmsav8-64.c
- bsps/aarch64/shared/start/start-cpu-mpidr.S
- bsps/shared/dev/irq/arm-gicv2-get-attributes.c
- bsps/shared/dev/serial/console-termios-init.c
- bsps/shared/dev/serial/console-termios.c
- bsps/shared/dev/getentropy/getentropy-cpucounter.c
- bsps/shared/dev/btimer/btimer-cpucounter.c
- bsps/shared/irq/irq-default-handler.c

View File

@@ -0,0 +1,30 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
build-type: objects
cflags: []
copyrights:
- Copyright (C) 2023 Utkarsh Verma
- Copyright (C) 2024 Ning Yang
cppflags: []
cxxflags: []
enabled-by: true
includes: []
install:
- destination: ${BSP_INCLUDEDIR}/bsp
source:
- bsps/aarch64/raspberrypi/include/bsp/console.h
- destination: ${BSP_INCLUDEDIR}/bsp
source:
- bsps/aarch64/raspberrypi/include/bsp/raspberrypi-uart.h
links:
- role: build-dependency
uid: ../../optconsoleirq
- role: build-dependency
uid: ../../objdevserialarmpl011
- role: build-dependency
uid: optclockpl011freq
- role: build-dependency
uid: optconsoleport
source:
- bsps/aarch64/raspberrypi/console/console.c
- bsps/shared/dev/serial/console-termios.c
type: build

View File

@@ -0,0 +1,17 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-integer: null
- define: null
build-type: option
copyrights:
- Copyright (C) 2023 Utkarsh Verma
default:
- enabled-by:
- aarch64/raspberrypi4b
value: 48000000
description: PL011 UART clock frequency in Hz.
enabled-by: true
format: '{}'
links: []
name: BSP_PL011_CLOCK_FREQ
type: build

View File

@@ -0,0 +1,23 @@
SPDX-License-Identifier: CC-BY-SA-4.0 OR BSD-2-Clause
actions:
- get-string: null
- define-unquoted: null
- assert-in-set:
- UART0
- UART2
- UART3
- UART4
- UART5
build-type: option
copyrights:
- Copyright (C) 2023 Utkarsh Verma
default:
- enabled-by:
- aarch64/raspberrypi4b
value: UART0
description: Default UART port for the console device.
enabled-by: true
format: '{}'
links: []
name: BSP_CONSOLE_PORT
type: build