arm64/a64: Add support for Multiple UART Ports#9243
Merged
jerpelea merged 1 commit intoapache:masterfrom May 11, 2023
Merged
Conversation
Member
Author
|
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`
jerpelea
approved these changes
May 11, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cModified Files
arch/arm64/src/a64/a64_serial.c: Added ports UART1 to UART4, based ona1x_serial.carch/arm64/src/a64/a64_serial.h: Added IRQs for UART1 to UART4. Moved UART Base Addresses toa64_memorymap.harch/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_CONSOLEtoUART0_SERIAL_CONSOLEUpdated 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:lvgltools/configure.sh pinephone:lvgl make menuconfig ## Enable Allwinner A64 > UART3To 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:nshUART0 works correctly as the Serial Console: