Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
# SPDX-License-Identifier: Apache-2.0

config BOARD_POCKETBEAGLE_2
select SOC_AM6232_A53 if BOARD_POCKETBEAGLE_2_AM6232_A53
Copy link
Member

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).

Copy link
Member Author

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.

select SOC_AM6232_M4 if BOARD_POCKETBEAGLE_2_AM6232_M4
60 changes: 58 additions & 2 deletions boards/beagle/pocketbeagle_2/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member

Choose a reason for hiding this comment

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

There are 4 now. Only rev A0 has a dual core.

Copy link
Member Author

@Ayush1325 Ayush1325 May 22, 2025

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Do note, that you can specify the board version while building pocketbeagle_2/am6232/a53@A0 or pocketbeagle_2/am6254/a53@A1. So it does not mean that we cannot merge A1 support after A0.


The following listed hardware specifications are used:

- Dual ARM Cortex-A53 cores
Copy link
Member

Choose a reason for hiding this comment

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

Please use the current specification, which is Quad Arm Cortex-A53 cores.

Copy link
Member Author

Choose a reason for hiding this comment

The 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

Expand Down Expand Up @@ -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
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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.
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Member

Choose a reason for hiding this comment

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

am6254

Copy link
Member Author

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 right now.
Any changes for A1 will be a separate PR.

: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.
Expand Down Expand Up @@ -95,6 +145,9 @@ The binary will run and print Hello world to the MCU_UART0 port.
Debugging
*********

Copy link
Member

Choose a reason for hiding this comment

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

A53 can be debugged via JTAG.

Copy link
Member Author

Choose a reason for hiding this comment

The 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:

Expand All @@ -119,3 +172,6 @@ References

.. _BeagleBoard Imaging Utility:
https://github.com/beagleboard/bb-imager-rs/releases
Copy link
Member

Choose a reason for hiding this comment

The 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.

Copy link
Member Author

Choose a reason for hiding this comment

The 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)>;
};

main_uart6_tx_default: main_uart6_tx_default {
pinmux = <K3_PINMUX(0x0020, PIN_OUTPUT, MUX_MODE_3)>;
};
};
41 changes: 41 additions & 0 deletions boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_a53.dts
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>
Copy link
Member

Choose a reason for hiding this comment

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

s/am6232/am6254/

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
The last thing we need is an alternative of Linux (which by the way has support for all interfaces in the MAIN domain), while basic stuff is missing in the MCU domains.

This shouldn't block this PR but I would appreciate if Texas Instruments and/or BeagleBoard stick to Zephyr's core idea.

Copy link
Member Author

@Ayush1325 Ayush1325 Apr 28, 2025

Choose a reason for hiding this comment

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

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.
The last thing we need is an alternative of Linux (which by the way has support for all interfaces in the MAIN domain), while basic stuff is missing in the MCU domains.

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

Copy link
Member

Choose a reason for hiding this comment

The 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";
};
11 changes: 11 additions & 0 deletions boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_a53.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
identifier: pocketbeagle_2/am6232/a53
Copy link
Member

Choose a reason for hiding this comment

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

s/am6232/am6254/

Copy link
Member Author

Choose a reason for hiding this comment

The 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
32 changes: 32 additions & 0 deletions boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_a53_defconfig
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
21 changes: 21 additions & 0 deletions dts/arm64/ti/ti_am6232_a53.dtsi
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 {
Copy link
Contributor

@dnltz dnltz Apr 28, 2025

Choose a reason for hiding this comment

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

How about we add all four cores to ti_am62x_a53 and set them to disabled? This would make this and the am6234 file obsolete and each board can decide which core to enable.

device_type = "cpu";
compatible = "arm,cortex-a53";
reg = <1>;
};
};
};
2 changes: 1 addition & 1 deletion soc/ti/k3/am6x/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

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

s/AM6232/AM6254/

Copy link
Member Author

Choose a reason for hiding this comment

The 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 "")
Expand Down
1 change: 1 addition & 0 deletions soc/ti/k3/am6x/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ config SOC_SERIES_AM6X_R5
select SOC_EARLY_INIT_HOOK

config SOC_PART_NUMBER
default "AM6232" if SOC_AM6232_A53
Copy link
Member

Choose a reason for hiding this comment

The 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
Expand Down
6 changes: 5 additions & 1 deletion soc/ti/k3/am6x/Kconfig.soc
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ config SOC_AM6234_M4
bool
select SOC_SERIES_AM6X_M4

config SOC_AM6232_A53
Copy link
Member

Choose a reason for hiding this comment

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

s/AM6232/AM6254/

Copy link
Member Author

Choose a reason for hiding this comment

The 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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions soc/ti/k3/soc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ family:
- name: am6232
cpuclusters:
- name: m4
- name: a53
- name: am6234
cpuclusters:
- name: m4
Expand Down