-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Add Initial PocketBeagle 2 rev A0 A53 support #89130
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,9 +17,11 @@ cluster with an Arm Cortex-M4F microcontroller, Imagination Technologies AXE-1-1 | |
| graphics processor (from revision A1) and TI programmable real-time unit subsystem | ||
| microcontroller cluster coprocessors. | ||
|
|
||
| Zephyr is ported to run on the M4F core and the following listed hardware | ||
| specifications are used: | ||
| Zephyr is ported to run on the both A53 cores and/or M4F core. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 4 now. Only rev A0 has a dual core.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Well, the both here refers to the A53 cores group and M4F core group. Not 2 A53 cores.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do note, that you can specify the board version while building |
||
|
|
||
| The following listed hardware specifications are used: | ||
|
|
||
| - Dual ARM Cortex-A53 cores | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use the current specification, which is Quad Arm Cortex-A53 cores.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi, zephyr support for the quad core variant does not exist yet. As you will see in the generated docs and code, only rev A0 is supported right now. |
||
| - Low-power ARM Cortex-M4F | ||
| - Memory | ||
|
|
||
|
|
@@ -51,19 +53,67 @@ allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400). | |
| Serial Port | ||
| ----------- | ||
|
|
||
| A53 Cores | ||
| ^^^^^^^^^ | ||
|
|
||
| This board configuration uses single serial communication channel with the MAIN domain UART | ||
| (MAIN_UART6, i.e. debug port). | ||
|
|
||
| M4F Core | ||
| ^^^^^^^^ | ||
|
|
||
| This board configuration uses a single serial communication channel with the | ||
| MCU domain UART (MCU_UART0, i.e. P2.05 as RX and P2.07 as TX). | ||
|
|
||
| SD Card | ||
| ******* | ||
|
|
||
| A53 Cores | ||
| ========= | ||
|
|
||
| Download BeagleBoard.org's official `BeagleBoard Imaging Utility`_ to create bootable | ||
| SD-card with the Zephyr image. Optionally, the Zephyr SD Card images can be downloaded from | ||
| `bb-zephyr-images`_. | ||
|
|
||
| M4F Core | ||
| ======== | ||
|
|
||
| Download BeagleBoard.org's official `BeagleBoard Imaging Utility`_ to create bootable | ||
| SD-card with the Linux distro image. This will boot Linux on the A53 application | ||
| cores. These cores will then load the Zephyr binary on the M4 core using remoteproc. | ||
|
|
||
| Flashing | ||
| ******** | ||
|
|
||
| A53 Core | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check out the latest template: https://github.com/zephyrproject-rtos/zephyr/blob/main/doc/templates/board.tmpl It seems necessary to discuss the various boot modes. The primary modes available by default on PocketBeagle 2 include the microSD card and USB DFU. There should be a runner for using USB DFU.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, but same as debugging, this is a minimal PR. I cannot add something I have not gotten to reliably work myself. |
||
| ======== | ||
|
|
||
| The testing requires the binary to be copied to the BOOT partition in SD card. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Testing does not require the binary to be copied to a microSD card, but this is the only option for flashing.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
|
|
||
| To test the A53 core, we build the :zephyr:code-sample:`hello_world` sample with the following command. | ||
|
|
||
| .. zephyr-app-commands:: | ||
| :board: pocketbeagle_2/am6232/a53 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. am6254
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, only A0 is supported right now. |
||
| :zephyr-app: samples/hello_world | ||
| :goals: build | ||
|
|
||
| We now copy this binary onto the SD card in the :file:`/boot/` directory and name it as | ||
| :file:`zephyr.bin`. | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| # Mount the SD card at sdcard for example | ||
| sudo mount /dev/sdX sdcard | ||
| # copy the bin to the /boot/ | ||
| sudo cp --remove-destination zephyr.bin sdcard/boot/zephyr.bin | ||
|
|
||
| The SD card can now be used for booting. | ||
|
|
||
| The binary will run and print Hello world to the debug port. | ||
|
|
||
| M4F Core | ||
| ======== | ||
|
|
||
| The board supports remoteproc using the OpenAMP resource table. | ||
|
|
||
| The testing requires the binary to be copied to the SD card to allow the A53 cores to load it while booting using remoteproc. | ||
|
|
@@ -95,6 +145,9 @@ The binary will run and print Hello world to the MCU_UART0 port. | |
| Debugging | ||
| ********* | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A53 can be debugged via JTAG.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could not get it to work myself, so I have not added it in this PR. |
||
| M4F Core | ||
| ======== | ||
|
|
||
| The board supports debugging M4 core from the A53 cores running Linux. Since the target needs | ||
| superuser privilege, openocd needs to be launched seperately for now: | ||
|
|
||
|
|
@@ -119,3 +172,6 @@ References | |
|
|
||
| .. _BeagleBoard Imaging Utility: | ||
| https://github.com/beagleboard/bb-imager-rs/releases | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's try to get a more official home for this. Let's replace the information at https://www.beagleboard.org/bb-imager.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I do not have access to change that page, so sure, we can update the link once that happens. |
||
|
|
||
| .. _bb-zephyr-images: | ||
| https://github.com/beagleboard/bb-zephyr-images/releases | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| /* | ||
| * Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <zephyr/dt-bindings/pinctrl/ti-k3-pinctrl.h> | ||
|
|
||
| &pinctrl { | ||
| main_uart6_rx_default: main_uart6_rx_default { | ||
| pinmux = <K3_PINMUX(0x001c, PIN_INPUT, MUX_MODE_3)>; | ||
dnltz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
|
|
||
| main_uart6_tx_default: main_uart6_tx_default { | ||
| pinmux = <K3_PINMUX(0x0020, PIN_OUTPUT, MUX_MODE_3)>; | ||
dnltz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| /* | ||
| * Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| /dts-v1/; | ||
|
|
||
| #include <ti/ti_am6232_a53.dtsi> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/am6232/am6254/
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
| #include "pocketbeagle_2_am6232_a53-pinctrl.dtsi" | ||
|
|
||
| / { | ||
| model = "BeagleBoard.org PocketBeagle 2"; | ||
| compatible = "beagle,pocketbeagle_2_a53"; | ||
|
|
||
| chosen { | ||
| zephyr,console = &uart6; | ||
| zephyr,shell-uart = &uart6; | ||
| zephyr,sram = &ddr0; | ||
| }; | ||
|
|
||
| cpus { | ||
| cpu@0 { | ||
| status = "okay"; | ||
| }; | ||
|
|
||
| cpu@1 { | ||
| status = "okay"; | ||
| }; | ||
|
Comment on lines
+27
to
+29
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The idea behind A53 support on the phyBOARD-Lyra was to have something like jail-house based on Zephyr. So, Zephyr would run on core 0 and Linux on core 1+. In case Linux doesn't response, Zephyr is able to restart Linux or do something else. In my option, the K3 architecture was designed to out-source hard real-time tasks to all the co-processors. So, Zephyr should run only run on M4/R5 cores while Linux runs on all A cores. The only reason I haven't deleted A53 support for the phyBOARD-Lyra is because it already exists and might be used for that jail-house use-case. This shouldn't block this PR but I would appreciate if Texas Instruments and/or BeagleBoard stick to Zephyr's core idea.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Well, the main supported way is still Linux + Zephyr on M4, MSP0, etc. However, I am not sure I agree about not supporting an alternative to Linux. TI supports baremetal and FreeRTOS programming for A53s. While the official FreeRTOS support seems to be limited to single A53 core, with inclusion of SMP in FreeRTOS 11, I have seen stuff floating around for full FreeRTOS setups (like here). Zephyr already has SMP, POSIX API support, userspace, LLEXT, etc. So for specialized workflows, it can make a lot of sense to go all Zephyr. Additionally, the form factor and IO of PocketBeagle 2 make it quite attractive for high performance specialized usecases. As for single a53 target, I was planning to add a53_0 target at some point. However, I have not figured out how to Linux + Zephyr yet. cc @jadonk
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not aware of TI supporting baremetal or FreeRTOS for A53s. All Zephyr has a real use case as a near-baremetal environment like a "super microcontroller". Running the Arduino stack, for example, provides a fairly rich ecosystem of usage and the ability to do more math (DSP) in real-time with the high-performance cores is real. A most interesting case is with a single locked core for Zephyr. While Linux can provide real-time, the latency is still longer than what can be provided by Zephyr. For the original PocketBeagle, XENOMAI was used on the same kernel to provide a real-time executive for DSP functions. Locking a single core vs. having a supervisor core has many advantages in performance. So, while low-math real-time works well on M4 cores, higher-performance DSP greatly benefits from running on A53 cores without Linux. |
||
| }; | ||
|
|
||
| ddr0: memory@80000000 { | ||
| reg = <0x80000000 DT_SIZE_M(512)>; | ||
| }; | ||
| }; | ||
|
|
||
| &uart6 { | ||
| pinctrl-0 = <&main_uart6_rx_default &main_uart6_tx_default>; | ||
| pinctrl-names = "default"; | ||
| status = "okay"; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| identifier: pocketbeagle_2/am6232/a53 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/am6232/am6254/
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
| name: BeagleBoard.org PocketBeagle 2 | ||
| type: mcu | ||
| arch: arm64 | ||
| toolchain: | ||
| - zephyr | ||
| - cross-compile | ||
| ram: 524288 | ||
| vendor: beagle | ||
| supported: | ||
| - uart | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # BeagleBoard.org PocketBeagle 2 | ||
| # | ||
| # Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation | ||
| # | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| # ARM Options | ||
| CONFIG_AARCH64_IMAGE_HEADER=y | ||
| CONFIG_ARMV8_A_NS=y | ||
| CONFIG_ARM64_VA_BITS_36=y | ||
| CONFIG_ARM64_PA_BITS_36=y | ||
|
|
||
| # Cache Options | ||
| CONFIG_CACHE_MANAGEMENT=y | ||
| CONFIG_DCACHE_LINE_SIZE_DETECT=y | ||
| CONFIG_ICACHE_LINE_SIZE_DETECT=y | ||
|
|
||
| # Platform Configuration | ||
|
|
||
| # Zephyr Kernel Configuration | ||
| CONFIG_XIP=n | ||
|
|
||
| # Serial Drivers | ||
| CONFIG_SERIAL=y | ||
| CONFIG_UART_INTERRUPT_DRIVEN=y | ||
|
|
||
| # Enable Console | ||
| CONFIG_CONSOLE=y | ||
| CONFIG_UART_CONSOLE=y | ||
|
|
||
| # Multicore Support | ||
| CONFIG_SMP=y |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| /* | ||
| * Copyright (c) 2023 Enphase Energy | ||
| * Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation | ||
| * | ||
| * SPDX-License-Identifier: Apache-2.0 | ||
| */ | ||
|
|
||
| #include <arm64/ti/ti_am62x_a53.dtsi> | ||
|
|
||
| / { | ||
| cpus { | ||
| #address-cells = <1>; | ||
| #size-cells = <0>; | ||
|
|
||
| cpu@1 { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about we add all four cores to |
||
| device_type = "cpu"; | ||
| compatible = "arm,cortex-a53"; | ||
| reg = <1>; | ||
| }; | ||
| }; | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,7 +4,7 @@ | |
| zephyr_include_directories(.) | ||
| zephyr_sources(common/ctrl_partitions.c) | ||
|
|
||
| if(CONFIG_SOC_AM6234_A53) | ||
| if(CONFIG_SOC_AM6234_A53 OR CONFIG_SOC_AM6232_A53) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/AM6232/AM6254/
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
| zephyr_sources_ifdef(CONFIG_ARM_MMU a53/mmu_regions.c) | ||
|
|
||
| set(SOC_LINKER_SCRIPT ${ZEPHYR_BASE}/include/zephyr/arch/arm64/scripts/linker.ld CACHE INTERNAL "") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ config SOC_SERIES_AM6X_R5 | |
| select SOC_EARLY_INIT_HOOK | ||
|
|
||
| config SOC_PART_NUMBER | ||
| default "AM6232" if SOC_AM6232_A53 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/AM6232/AM6254/ (going with 4 cores with 3 disabled seems ideal) |
||
| default "AM6232" if SOC_AM6232_M4 | ||
| default "AM6234" if SOC_AM6234_A53 | ||
| default "AM6234" if SOC_AM6234_M4 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,6 +31,10 @@ config SOC_AM6234_M4 | |
| bool | ||
| select SOC_SERIES_AM6X_M4 | ||
|
|
||
| config SOC_AM6232_A53 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/AM6232/AM6254/
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See above |
||
| bool | ||
| select SOC_SERIES_AM6X_A53 | ||
|
|
||
| config SOC_AM6232_M4 | ||
| bool | ||
| select SOC_SERIES_AM6X_M4 | ||
|
|
@@ -55,7 +59,7 @@ config SOC_SERIES | |
| default "am6x" if SOC_SERIES_AM6X | ||
|
|
||
| config SOC | ||
| default "am6232" if SOC_AM6232_M4 | ||
| default "am6232" if SOC_AM6232_M4 || SOC_AM6232_A53 | ||
| default "am6234" if SOC_AM6234_M4 || SOC_AM6234_A53 | ||
| default "am6442" if SOC_AM6442_M4 | ||
| default "j721e" if SOC_J721E_MAIN_R5F0_0 | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ family: | |
| - name: am6232 | ||
| cpuclusters: | ||
| - name: m4 | ||
| - name: a53 | ||
| - name: am6234 | ||
| cpuclusters: | ||
| - name: m4 | ||
|
|
||
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.
We are now using AM6254. Only A0 had AM6232. A0 should be the special case, not what is currently available (A1).
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.
Again, only A0 is supported in this PR.