Skip to content

arm64/am62x: add initial BeaglePlay and PocketBeagle2 bring-up#18907

Merged
xiaoxiang781216 merged 5 commits into
apache:masterfrom
PiyushPatle26:am62x-beagleplay-bringup
May 28, 2026
Merged

arm64/am62x: add initial BeaglePlay and PocketBeagle2 bring-up#18907
xiaoxiang781216 merged 5 commits into
apache:masterfrom
PiyushPatle26:am62x-beagleplay-bringup

Conversation

@PiyushPatle26
Copy link
Copy Markdown
Contributor

Note: Please adhere to Contributing Guidelines.

Summary

This PR adds initial NuttX bring-up support for TI AM62x boards and introduces board support for:

  • BeaglePlay
  • PocketBeagle2

The main goal is to make AM62x boot reliably into NuttX with a working serial console and interactive NSH on BeaglePlay.

What this PR adds:

  • common ARM64 EL2 handoff update so EL1 can use the GICv3 system-register interface
  • AM62x arch support under arch/arm64
  • AM62x low-level boot, memory map, IRQ definitions, low-level console, and 16550 lower-half serial support
  • 16550 driver fixes needed for AM62x console bring-up
  • BeaglePlay board support with:
    • beagleplay:nsh
    • beagleplay:ostest
  • PocketBeagle2 board support with matching AM62x integration
  • AM62x platform and board documentation

The 16550 changes are required because AM62x UART bring-up was not stable with the generic initialization sequence alone. This PR keeps the generic 16550 path, but adjusts it so the AM62x/TI K3 UART setup works correctly during both early console and runtime console use.

For BeaglePlay, the documented and validated boot flow is manual U-Boot boot from microSD:

mmc dev 1 0
fatload mmc 1:1 0x82000000 nuttx.bin
go 0x82000000

ostest was also validated on hardware using:

mmc dev 1 0
fatload mmc 1:1 0x82000000 nuttx-ostest.bin
go 0x82000000

Impact

Is a part towards completing this task #18666

Architecture / core:

  • adds AM62x support to arch/arm64
  • adds EL2-to-EL1 GICv3 handoff handling needed on this boot path

Drivers:

  • updates drivers/serial/uart_16550.c for AM62x-compatible FIFO setup
  • preserves bootloader-owned console state where required
  • fixes TX polling behavior needed for reliable console output

Boards:

  • adds BeaglePlay support
  • adds PocketBeagle2 support

Build / config:

  • adds new board defconfigs:
    • beagleplay:nsh
    • beagleplay:ostest
    • PocketBeagle2 configs

Testing

Ran Basic commands and OStest on beagleplay:
image

@github-actions github-actions Bot added Area: Build system Arch: arm64 Issues related to ARM64 (64-bit) architecture Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. Board: arm64 labels May 20, 2026
@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented May 20, 2026

@PiyushPatle26 Could you add "Signed-off-by" to your commits? And run nxstyle to fix the formatting errors below. Thanks :-)

https://github.com/apache/nuttx/actions/runs/26137295099/job/76875152946?pr=18907#step:3:91

❌ Missing Signed-off-by
Used config files:
    1: .codespellrc
Warning: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/include/board_memorymap.h:18:1: warning: #include outside of 'Included Files' section
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:91:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:91:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:95:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:95:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:99:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:99:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:103:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:103:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:108:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c:108:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/beagleplay/src/beagleplay_bringup.c:76:1: error: Too many blank lines
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:91:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:91:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:95:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:95:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:99:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:99:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:103:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:103:1: error: Missing blank line after comment
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:108:1: error: Missing blank line before comment found
Error: /home/runner/work/nuttx/nuttx/nuttx/boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c:108:1: error: Missing blank line after comment
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md

@PiyushPatle26 PiyushPatle26 force-pushed the am62x-beagleplay-bringup branch from d4dbf71 to 5e9c960 Compare May 20, 2026 02:33
@PiyushPatle26 PiyushPatle26 force-pushed the am62x-beagleplay-bringup branch 2 times, most recently from fca7ac8 to cc74e93 Compare May 20, 2026 09:14
jerpelea
jerpelea previously approved these changes May 20, 2026
@lupyuen
Copy link
Copy Markdown
Member

lupyuen commented May 20, 2026

@nuttxpr test avaota-a1:nsh

@nuttxpr
Copy link
Copy Markdown

nuttxpr commented May 20, 2026

[Experimental Bot, please feedback here]

Build and Test Successful (avaota-a1:nsh)
https://gitlab.com/lupyuen/nuttx-build-log/-/snippets/5994003

$ git clone https://github.com/PiyushPatle26/nuttx nuttx --branch am62x-beagleplay-bringup
$ git clone https://github.com/apache/nuttx-apps apps --branch master
$ pushd nuttx
$ git reset --hard HEAD
HEAD is now at cc74e93d17 boards/arm64/am62x: normalize defconfigs
$ popd
$ pushd apps
$ git reset --hard HEAD
HEAD is now at 173e19cde apps/examples: Add path option to SPI Slave test
$ popd
NuttX Source: https://github.com/apache/nuttx/tree/cc74e93d17090703f842a839654807c2c6f089c9
NuttX Apps: https://github.com/apache/nuttx-apps/tree/173e19cde118546c5d3180e1a4b5c3c53a765142
$ cd nuttx
$ tools/configure.sh avaota-a1:nsh
$ make -j
$ make -j export
$ pushd ../apps
$ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-0.0.0.tar.gz
$ make -j import
$ popd
$ genromfs -f initrd -d ../apps/bin -V NuttXBootVol
$ head -c 65536 /dev/zero
$ cat nuttx.bin /tmp/nuttx.pad initrd
$ scp Image thinkcentre:/tmp/Image
$ ssh thinkcentre sudo /home/user/copy-image.sh
$ sd-mux-ctrl --device-serial=sd-wire_02-09 --ts
$ mkdir -p /tmp/sda1
$ mount /dev/sda1 /tmp/sda1
$ cp /tmp/Image /tmp/sda1/
$ rm /tmp/Image
$ umount /tmp/sda1
$ sd-mux-ctrl --device-serial=sd-wire_02-09 --dut
$ cd /home/luppy/nuttx-build-farm
$ ssh thinkcentre
nsh> uname -a
NuttX 0.0.0 cc74e93d17 May 20 2026 19:06:55 arm64 avaota-a1
nsh> ostest
arena        a000    26000
ordblks         2        4
mxordblk     6ff8    1aff8
uordblks     27d8     66f0
fordblks     7828    1f910
user_main: Exiting
ostest_main: Exiting with status 0
nsh> Now running https://github.com/lupyuen/nuttx-build-farm/blob/main/avaota-power.sh off
----- Power off Avaota-A1
[]

lupyuen
lupyuen previously approved these changes May 20, 2026
Copy link
Copy Markdown
Member

@lupyuen lupyuen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Arm64 Changes tested OK with OSTest on Avaota-A1 Arm64 SBC (Allwinner A537) thanks :-)

acassis
acassis previously approved these changes May 20, 2026
Comment thread boards/arm64/am62x/beagleplay/src/beagleplay_appinit.c
Comment thread boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c Outdated
Comment thread boards/arm64/am62x/beagleplay/src/beagleplay_autoleds.c Outdated
Comment thread boards/arm64/am62x/pocketbeagle2/include/board.h Outdated
Comment thread boards/arm64/am62x/pocketbeagle2/src/pocketbeagle2_autoleds.c Outdated
Comment thread Documentation/platforms/arm64/am62x/boards/beagleplay/index.rst
Comment thread Documentation/platforms/arm64/am62x/boards/pocketbeagle2/index.rst
Comment thread drivers/serial/uart_16550.c
@linguini1
Copy link
Copy Markdown
Contributor

Do you also have tests from the pocketbeagle you could attach?

@PiyushPatle26
Copy link
Copy Markdown
Contributor Author

Do you also have tests from the pocketbeagle you could attach?

Yeah will do it today and attach

AM62x enters NuttX through EL2 before dropping to EL1. Enable the
GICv3 system register interface for lower exception levels during the
EL2 handoff so EL1 can use the CPU interface without depending on
firmware state.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
@PiyushPatle26 PiyushPatle26 dismissed stale reviews from acassis, lupyuen, and jerpelea via 1d96080 May 27, 2026 18:52
@PiyushPatle26 PiyushPatle26 force-pushed the am62x-beagleplay-bringup branch from cc74e93 to 1d96080 Compare May 27, 2026 18:52
@PiyushPatle26
Copy link
Copy Markdown
Contributor Author

I have also tested with running ostest on pocketbeagle2


End of test memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena    1dfb9000 1dfb9000
ordblks         4        4
mxordblk 1dfae040 1dfae040
uordblks     95e0     95e0
fordblks 1dfafa20 1dfafa20

user_main: vfork() test
vfork_test: Child 239 ran successfully

Final memory usage:
VARIABLE  BEFORE   AFTER
======== ======== ========
arena    1dfb9000 1dfb9000
ordblks         4        4
mxordblk 1dfae070 1dfae040
uordblks     9488     95e0
fordblks 1dfafb78 1dfafa20
user_main: Exiting
ostest_main: Exiting with status 0

@xiaoxiang781216
Copy link
Copy Markdown
Contributor

@PiyushPatle26 still need address style issue:

52ae08196d Docs/platforms/imxrt: Update chip support table.
../nuttx/tools/checkpatch.sh -c -u -m -g  fee3c3d3aa3c8608c3cb7adc8d8a096295a649ce..HEAD
❌ Missing git commit message
❌ Missing git commit message
❌ Missing Signed-off-by
❌ Missing Signed-off-by
❌ Missing git commit message
Used config files:
    1: .codespellrc
All done! ✨ 🍰 ✨
1 file would be left unchanged.
Some checks failed. For contributing guidelines, see:
  https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md

Comment thread boards/arm64/am62x/beagleplay/configs/nsh/defconfig
Comment thread drivers/serial/uart_16550.c
Adjust the generic 16550 driver for the AM62x console path. Preserve
the FIFO programming sequence needed by the TI UART, keep the bootloader
owned early console state when requested, and drain the transmit buffer
correctly when polling mode is enabled.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Add the AM62x architecture support needed to boot NuttX on TI K3
AM62x platforms. This includes the chip integration, memory map, IRQ
definitions, low-level console support, boot code, and the AM62x 16550
serial lower half.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Add initial board support for BeaglePlay and PocketBeagle2, including
defconfigs, linker scripts, board initialization, procfs bring-up, and
LED stubs. BeaglePlay provides the validated runtime target for this
bring-up series.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
Document the AM62x platform and add board guides for BeaglePlay and
PocketBeagle2. The BeaglePlay guide includes the validated manual
U-Boot boot flow used for hardware testing.

Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
@PiyushPatle26 PiyushPatle26 force-pushed the am62x-beagleplay-bringup branch from 1d96080 to f3ce813 Compare May 28, 2026 05:17
@acassis
Copy link
Copy Markdown
Contributor

acassis commented May 28, 2026

@linguini1 PTAL

Copy link
Copy Markdown
Contributor

@linguini1 linguini1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Nice work @PiyushPatle26

I am a little worried about regressions in the UART16650 driver with these changes to it, but I'm not familiar enough to know better 🤷‍♂️

@xiaoxiang781216 xiaoxiang781216 merged commit 90219df into apache:master May 28, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: arm64 Issues related to ARM64 (64-bit) architecture Area: Build system Board: arm64 Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants