dcgong2917 opened a new pull request, #20334:
URL: https://github.com/apache/nuttx/pull/20334
## Summary
Expose the RTL8730E (AmebaSmart, dual-core Cortex-A32) general-purpose
UARTs through the shared Ameba serial driver, plus a chip-side SMP
stability fix that multi-port UART traffic surfaced.
Three commits:
1. **boards/arm/rtl8730e: fix SMP cache-line false sharing on Cortex-A32**
Under sustained dual-core critical-section traffic (e.g. several UART
ISRs) the two A32 cores live-lock. The generic `g_cpu_irqlock`
(LDREX/STREX spinlock) and `g_cpu_irqset` (plain non-atomic bitmap)
sit in the same 64-byte cache line; the A32 exclusive monitor reserves
a full cache line, so one core's store to `g_cpu_irqset` clears the
other core's LDREX reservation on `g_cpu_irqlock`. Separated onto their
own cache lines in the board link script — the generic scheduler source
is left untouched (relies on `-fdata-sections`).
2. **arch/arm/rtl8730e: add UART character driver support**
Chip glue (`ameba_uart_chip.h`: register bases, GIC IRQs SPI 50/51/52,
APB clocks, pin-mux), build wiring, and a board port table registering
UART0-2 as `/dev/ttyS1-3` at 115200 8N1 (LOG-UART keeps the console and
`/dev/ttyS0`; UART3 reserved for Bluetooth). Gated by
`CONFIG_AMEBA_UART`
(default off). Also fixes an RX-timeout interrupt storm in the shared
driver: the latched RX-timeout status (LSR bit9) isn't cleared by
draining the FIFO, so on the level-triggered GIC the ISR must write
TOICF, matching the vendor SDK. Harmless on the NVIC-based M33 parts.
3. **Documentation/rtl8730e: document the general-purpose UART ports**
## Impact
New optional feature for RTL8730E only; `CONFIG_AMEBA_UART` defaults off,
so existing configs are unaffected. The shared `ameba_uart.c` change (TOICF
clear) is a no-op on M33 Ameba parts.
## Testing
- `checkpatch` / `cmake-format`: clean on all 3 commits.
- Builds: `rtl8730e_evb:uart`, `rtl8730e_evb:nsh` (no AMEBA_UART), and
`rtl8721f_evb:nsh` (M33 regression for the shared driver) all pass;
`uart` defconfig matches `savedefconfig`.
- Hardware (RTL8730E EVB): `/dev/ttyS1` (UART0 PA3↔PA2) and `/dev/ttyS2`
(UART1 PA5↔PA4) loopback each report `Total bytes received = 26` with no
live-lock; NSH stays responsive across repeated runs.
--
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]