arm64/am62x: add initial BeaglePlay and PocketBeagle2 bring-up#18907
arm64/am62x: add initial BeaglePlay and PocketBeagle2 bring-up#18907PiyushPatle26 wants to merge 6 commits into
Conversation
|
@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 |
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>
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>
d4dbf71 to
5e9c960
Compare
308e466 to
fca7ac8
Compare
Regenerate the BeaglePlay and PocketBeagle2 nsh and ostest defconfigs with savedefconfig so the checked-in files match the CI refresh output. This fixes the CI failure where refresh.sh rewrote the four AM62x configs during the build. Signed-off-by: Piyush Patle <piyushpatle228@gmail.com>
fca7ac8 to
cc74e93
Compare
|
@nuttxpr test avaota-a1:nsh |
|
[Experimental Bot, please feedback here] Build and Test Successful (avaota-a1:nsh) |
lupyuen
left a comment
There was a problem hiding this comment.
Arm64 Changes tested OK with OSTest on Avaota-A1 Arm64 SBC (Allwinner A537) thanks :-)
| /**************************************************************************** | ||
| * Name: board_app_initialize | ||
| * | ||
| * Description: | ||
| * Called indirectly through boardctl(BOARDIOC_INIT) from the NSH start-up | ||
| * code. This is the application-level initialisation hook — it runs in | ||
| * task context (not interrupt context) with the scheduler fully running. | ||
| * | ||
| * When CONFIG_BOARD_LATE_INITIALIZE is set, beagleplay_bringup() has | ||
| * already been called from board_late_initialize() so we return OK | ||
| * immediately. Otherwise we call it here. | ||
| * | ||
| * Input Parameters: | ||
| * arg - boardctl() argument (unused for BOARDIOC_INIT) | ||
| * | ||
| * Returned Value: | ||
| * Zero (OK) on success; a negated errno on failure. | ||
| * | ||
| ****************************************************************************/ | ||
|
|
||
| int board_app_initialize(uintptr_t arg) | ||
| { | ||
| UNUSED(arg); | ||
|
|
||
| #ifndef CONFIG_BOARD_LATE_INITIALIZE | ||
| return beagleplay_bringup(); | ||
| #else | ||
| return OK; | ||
| #endif | ||
| } | ||
|
|
There was a problem hiding this comment.
This interface is deprecated; please test this on the latest main using board_late_initialize.
There was a problem hiding this comment.
Removed this deprecated interface. I switched the AM62x boards to use board_late_initialize() only and validated the updated branch on current main with local builds for beagleplay:{nsh,ostest} and pocketbeagle2:{nsh,ostest}. Will perform boot test and update the PR soon
| break; | ||
|
|
||
| case LED_PANIC: | ||
| g_panic = true; |
There was a problem hiding this comment.
You don't need global variables for this.
There was a problem hiding this comment.
it did not need to be global. I had originally introduced g_panic to preserve a panic/blink state across board_autoled_on() and board_autoled_off(), but in this stub implementation there was no actual GPIO toggle logic behind it, so the state was unnecessary. I removed it and simplified the LED hooks to stateless no-ops until real GPIO-backed LED support is added.
| if (g_panic) | ||
| { | ||
| } |
There was a problem hiding this comment.
This condition does nothing.
| typedef enum | ||
| { | ||
| BOARD_LED_USR0 = 0, | ||
| BOARD_LED_USR1 = 1, | ||
| BOARD_LED_USR2 = 2, | ||
| BOARD_NLEDS, | ||
| } led_typedef_enum; |
There was a problem hiding this comment.
Actually no strong reason , we can use plain enum too
| if (g_panic) | ||
| { | ||
| } | ||
| break; |
There was a problem hiding this comment.
Please follow the template in Documentation/contributing/doc_templates/board.rst
There was a problem hiding this comment.
Reworked the page to follow the board documentation template more closely: features, buttons/LEDs, serial console, pin mapping, power, installation, build, flashing, and configurations.
There was a problem hiding this comment.
Please follow the template in Documentation/contributing/doc_templates/board.rst
There was a problem hiding this comment.
Have done the same for pocket beagle 2 as well
| return -EPERM; | ||
| } | ||
|
|
||
| /* Clear fifos */ |
There was a problem hiding this comment.
Why is it necessary to delete this? Could you explain what the issues were with the 16550 driver?
There was a problem hiding this comment.
The issue was AM62x-specific bring-up rather than a generic 16550 functional bug. The AM62x UART required the FIFO setup to be programmed as separate writes, so the old standalone ‘Clear fifos’ comment no longer matched the actual sequence. I added a comment beside the new FIFO configuration block to explain why the setup is done that way.
|
Do you also have tests from the pocketbeagle you could attach? |
Yeah will do it today and attach |
Note: Please adhere to Contributing Guidelines.
Summary
This PR adds initial NuttX bring-up support for TI AM62x boards and introduces board support for:
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:
arch/arm64beagleplay:nshbeagleplay:ostestThe 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:
ostest was also validated on hardware using:
Impact
Is a part towards completing this task #18666
Architecture / core:
Drivers:
Boards:
Build / config:
Testing
Ran Basic commands and OStest on beagleplay:
