-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
arm64/a64: Add support for Multiple UART Ports #9243
Conversation
Rebased with Master, to restart macOS Build. Now the "Linux (Other)" Build fails because I fixed the A64 Kconfig from
UPDATE: I fixed the |
Currently only Port UART0 is supported for Allwinner A64. This PR adds support for all UART Ports: UART1 to UART4. (Except R-UART, which is a special low-power UART) This is required for the upcoming LTE Modem Driver (Quectel EG25-G) for PINE64 PinePhone, which uses UART3. [(Details here)](https://lupyuen.github.io/articles/lte2) The code was adapted from the NuttX UART Driver for Allwinner A1X: [`a1x_serial.c`](https://github.com/apache/nuttx/blob/master/arch/arm/src/a1x/a1x_serial.c) `arch/arm64/src/a64/a64_serial.c`: Added ports UART1 to UART4, based on [`a1x_serial.c`](https://github.com/apache/nuttx/blob/master/arch/arm/src/a1x/a1x_serial.c) `arch/arm64/src/a64/a64_serial.h`: Added IRQs for UART1 to UART4. Moved UART Base Addresses to `a64_memorymap.h` `arch/arm64/src/a64/hardware/a64_memorymap.h`: Added UART Base Addresses for UART0 to UART4 `arch/arm64/src/a64/Kconfig`: Added UART1 to UART4 to Allwinner A64 Peripheral Selection menu `boards/arm64/a64/pinephone/configs/lcd/defconfig`, `lvgl/defconfig`, `nsh/defconfig`, `sensor/defconfig`: Fixed `UART1_SERIAL_CONSOLE` to `UART0_SERIAL_CONSOLE`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Summary
Currently only Port UART0 is supported for Allwinner A64. This PR adds support for all UART Ports: UART1 to UART4. (Except R-UART, which is a special low-power UART)
This is required for the upcoming LTE Modem Driver (Quectel EG25-G) for PINE64 PinePhone, which uses UART3. (Details here)
The code was adapted from the NuttX UART Driver for Allwinner A1X:
a1x_serial.c
Modified Files
arch/arm64/src/a64/a64_serial.c
: Added ports UART1 to UART4, based ona1x_serial.c
arch/arm64/src/a64/a64_serial.h
: Added IRQs for UART1 to UART4. Moved UART Base Addresses toa64_memorymap.h
arch/arm64/src/a64/hardware/a64_memorymap.h
: Added UART Base Addresses for UART0 to UART4arch/arm64/src/a64/Kconfig
: Added UART1 to UART4 to Allwinner A64 Peripheral Selection menuboards/arm64/a64/pinephone/configs/lcd/defconfig
,lvgl/defconfig
,nsh/defconfig
,sensor/defconfig
: FixedUART1_SERIAL_CONSOLE
toUART0_SERIAL_CONSOLE
Updated Documentation
Documentation/platforms/arm/a64/boards/pinephone/index.rst
: UART Driver now supports all UART PortsImpact
With this PR, Allwinner A64 will support UART1 to UART4. This is required for the upcoming LTE Modem Driver (Quectel EG25-G) for PINE64 PinePhone, which uses UART3. (Details here)
There is no impact to existing code, which uses only UART0.
Testing
We tested UART3 on PINE64 PinePhone. For Regression Testing, we tested UART0.
UART3 Test
We tested UART3 with the Build Configuration
pinephone:lvgl
tools/configure.sh pinephone:lvgl make menuconfig ## Enable Allwinner A64 > UART3
To activate serial comms on UART3, we started PinePhone's Quectel EG25-G LTE Modem in pinephone_bringup.c
(Explained here)
UART3 works correctly (for both runs) when we sent AT Commands for Phone Call and SMS:
Modem Test App (run twice): hello_main.c
(Explained here)
Modem Test Log
Regression Test
We tested UART0 with the Build Configuration
pinephone:nsh
UART0 works correctly as the Serial Console: