linguini1 opened a new pull request, #18837:
URL: https://github.com/apache/nuttx/pull/18837
## Summary
This commit refactors the PL011 UART driver so that it can be re-used for
any number of UART interfaces depending on the board/chip. This commit also
hooks the UART interface configuration/selection for PL011 UART interfaces into
the same Kconfig used for regular UART interfaces. Now UART interfaces are
configured in a standard, extensible way.
## Impact
Impacts only the 4 (simulator) boards that used PL011 UART.
## Testing
For each of the QEMU boards, I tested their `gdbstub` demos since those
configurations use both UART interfaces, not just a console.
QEMU ARMv8A
<details>
```console
$ qemu-system-aarch64 -cpu cortex-a53 -nographic -machine
virt,virtualization=on,gic-version=3 -net none -kernel ./nuttx -serial
mon:stdio -serial pty
char device redirected to /dev/pts/1 (label serial1)
- Ready to Boot Primary CPU
- Boot from EL2
- Boot from EL1
- Boot to C runtime for OS Initialize
NuttShell (NSH) NuttX-12.13.0
nsh> ps
TID PID PPID PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread - Ready
0000000000000000 0008144 0001664 20.4% Idle_Task
1 0 0 192 RR Kthread - Waiting Semaphore
0000000000000000 0008080 0001152 14.2% hpwork 0x403cf6d0 0x403cf758
3 3 0 100 RR Task - Running
0000000000000000 0008112 0003840 47.3% nsh_main
nsh> ls
/:
dev/
proc/
tmp/
```
```console
$ gdb nuttx -ex "target remote /dev/pts/1"
GNU gdb (GDB) 17.1
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nuttx...
Remote debugging using /dev/pts/1
0x0000000040297528 in up_idle () at common/arm64_idle.c:65
65 }
(gdb) exit
```
</details>
QEMU ARMv7A
<details>
```console
$ qemu-system-arm -cpu cortex-a7 -nographic -machine
virt,virtualization=off,gic-version=2 -net none -kernel ./nuttx -serial
mon:stdio -serial pty
char device redirected to /dev/pts/2 (label serial1)
nx_start: Entry
uart_register: Registering /dev/console
uart_register: Registering /dev/ttyS0
work_start_highpri: Starting high-priority kernel worker thread(s)
nxtask_activate: hpwork pid=1,TCB=0x4020d5c0
nxtask_activate: AppBringUp pid=2,TCB=0x4020e690
nx_start_application: Starting init thread
task_spawn: name=nsh_main entry=0x60ccac file_actions=0 attr=0x4020f724
argv=0x4020f720
nxtask_activate: nsh_main pid=3,TCB=0x4020f790
nxtask_exit: AppBringUp pid=2,TCB=0x4020e690
lib_cxx_initialize: _sinit: 0x631110 _einit: 0x631110
NuttShell (NSH) NuttX-12.13.0
nsh> nx_start: CPU0: Beginning Idle Loop
nsh> ps
TID PID PPID PRI POLICY TYPE NPX STATE EVENT SIGMASK
STACK USED FILLED COMMAND
0 0 0 0 FIFO Kthread - Ready
0000000000000000 0004072 0000704 17.2% Idle_Task
1 0 0 192 RR Kthread - Waiting Semaphore
0000000000000000 0004024 0000456 11.3% hpwork 0x40200150 0x40200198
3 3 0 100 RR Task - Running
0000000000000000 0004048 0001552 38.3% nsh_main
nsh>
```
```console
$ gdb nuttx -ex "target remote /dev/pts/2"
GNU gdb (GDB) 17.1
Copyright (C) 2025 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-pc-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nuttx...
Remote debugging using /dev/pts/2
0x0060c488 in up_idle () at chip/qemu_idle.c:63
63 }
(gdb) exit
```
</details>
For the FVP boards, I tested compilation only.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]