boards: beagle: Add PocketBeagle 2 M4 support
Add initial support for the PocketBeagle 2 MCU domain Cortex-M4F core. This only adds support for A0 revision (i.e. the version with AM6232). PocketBeagle 2: https://www.beagleboard.org/boards/pocketbeagle-2 Signed-off-by: Ayush Singh <ayush@beagleboard.org>
This commit is contained in:
parent
e443fbd6db
commit
b2b7a468ea
11 changed files with 274 additions and 0 deletions
8
boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2
Normal file
8
boards/beagle/pocketbeagle_2/Kconfig.pocketbeagle_2
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
# BeagleBoard.org PocketBeagle 2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
config BOARD_POCKETBEAGLE_2
|
||||||
|
select SOC_AM6232_M4 if BOARD_POCKETBEAGLE_2_AM6232_M4
|
10
boards/beagle/pocketbeagle_2/board.cmake
Normal file
10
boards/beagle/pocketbeagle_2/board.cmake
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# BeagleBoard.org PocketBeagle 2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
if(CONFIG_SOC_AM6232_M4)
|
||||||
|
board_runner_args(openocd "--no-init" "--no-halt" "--no-targets" "--gdb-client-port=3339")
|
||||||
|
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
||||||
|
endif()
|
12
boards/beagle/pocketbeagle_2/board.yml
Normal file
12
boards/beagle/pocketbeagle_2/board.yml
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
board:
|
||||||
|
name: pocketbeagle_2
|
||||||
|
full_name: PocketBeagle 2
|
||||||
|
vendor: beagle
|
||||||
|
socs:
|
||||||
|
- name: am6232
|
||||||
|
revision:
|
||||||
|
format: custom
|
||||||
|
exact: true
|
||||||
|
default: "A0"
|
||||||
|
revisions:
|
||||||
|
- name: "A0"
|
BIN
boards/beagle/pocketbeagle_2/doc/img/pocketbeagle_2.webp
Normal file
BIN
boards/beagle/pocketbeagle_2/doc/img/pocketbeagle_2.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 26 KiB |
121
boards/beagle/pocketbeagle_2/doc/index.rst
Normal file
121
boards/beagle/pocketbeagle_2/doc/index.rst
Normal file
|
@ -0,0 +1,121 @@
|
||||||
|
.. zephyr:board:: pocketbeagle_2
|
||||||
|
|
||||||
|
Overview
|
||||||
|
********
|
||||||
|
|
||||||
|
PocketBeagle 2 is a computational platform powered by TI AM62x SoC (there are two
|
||||||
|
revisions, AM6232 and AM6254).
|
||||||
|
|
||||||
|
The board configuration provides support for the ARM Cortex-M4F MCU core.
|
||||||
|
|
||||||
|
See the `PocketBeagle 2 Product Page`_ for details.
|
||||||
|
|
||||||
|
Hardware
|
||||||
|
********
|
||||||
|
PocketBeagle 2 features the TI AM62x SoC based around an Arm Cortex-A53 multicore
|
||||||
|
cluster with an Arm Cortex-M4F microcontroller, Imagination Technologies AXE-1-16
|
||||||
|
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:
|
||||||
|
|
||||||
|
- Low-power ARM Cortex-M4F
|
||||||
|
- Memory
|
||||||
|
|
||||||
|
- 256KB of SRAM
|
||||||
|
- 512MB of DDR4
|
||||||
|
|
||||||
|
Currently supported PocketBeagle 2 revisions:
|
||||||
|
|
||||||
|
- A0: Comes wth SOC AM6232
|
||||||
|
|
||||||
|
Supported Features
|
||||||
|
==================
|
||||||
|
|
||||||
|
.. zephyr:board-supported-hw::
|
||||||
|
|
||||||
|
Devices
|
||||||
|
========
|
||||||
|
System Clock
|
||||||
|
------------
|
||||||
|
|
||||||
|
This board configuration uses a system clock frequency of 400 MHz.
|
||||||
|
|
||||||
|
DDR RAM
|
||||||
|
-------
|
||||||
|
|
||||||
|
The board has 512MB of DDR RAM available. This board configuration
|
||||||
|
allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400).
|
||||||
|
|
||||||
|
Serial Port
|
||||||
|
-----------
|
||||||
|
|
||||||
|
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
|
||||||
|
*******
|
||||||
|
|
||||||
|
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
|
||||||
|
********
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
To test the M4F core, we build the :zephyr:code-sample:`hello_world` sample with the following command.
|
||||||
|
|
||||||
|
.. zephyr-app-commands::
|
||||||
|
:board: pocketbeagle_2/am6232/m4
|
||||||
|
:zephyr-app: samples/hello_world
|
||||||
|
:goals: build
|
||||||
|
|
||||||
|
This builds the program and the binary is present in the :file:`build/zephyr` directory as
|
||||||
|
:file:`zephyr.elf`.
|
||||||
|
|
||||||
|
We now copy this binary onto the SD card in the :file:`/lib/firmware` directory and name it as
|
||||||
|
:file:`am62-mcu-m4f0_0-fw`.
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
# Mount the SD card at sdcard for example
|
||||||
|
sudo mount /dev/sdX sdcard
|
||||||
|
# copy the elf to the /lib/firmware directory
|
||||||
|
sudo cp --remove-destination zephyr.elf sdcard/lib/firmware/am62-mcu-m4f0_0-fw
|
||||||
|
|
||||||
|
The SD card can now be used for booting. The binary will now be loaded onto the M4F core on boot.
|
||||||
|
|
||||||
|
The binary will run and print Hello world to the MCU_UART0 port.
|
||||||
|
|
||||||
|
Debugging
|
||||||
|
*********
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
.. code-block:: console
|
||||||
|
|
||||||
|
sudo openocd -f board/ti_am625_swd_native.cfg
|
||||||
|
|
||||||
|
|
||||||
|
Start debugging
|
||||||
|
|
||||||
|
.. zephyr-app-commands::
|
||||||
|
:goals: debug
|
||||||
|
|
||||||
|
References
|
||||||
|
**********
|
||||||
|
|
||||||
|
* `PocketBeagle 2 Product Page`_
|
||||||
|
* `Documentation <https://docs.beagleboard.org/boards/pocketbeagle-2/index.html>`_
|
||||||
|
|
||||||
|
.. _PocketBeagle 2 Product Page:
|
||||||
|
https://www.beagleboard.org/boards/pocketbeagle-2
|
||||||
|
|
||||||
|
.. _BeagleBoard Imaging Utility:
|
||||||
|
https://github.com/beagleboard/bb-imager-rs/releases
|
|
@ -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 {
|
||||||
|
mcu_uart0_rx_default: mcu_uart0_rx_default {
|
||||||
|
pinmux = <K3_PINMUX(0x0014, PIN_INPUT, MUX_MODE_0)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
mcu_uart0_tx_default: mcu_uart0_tx_default {
|
||||||
|
pinmux = <K3_PINMUX(0x0018, PIN_OUTPUT, MUX_MODE_0)>;
|
||||||
|
};
|
||||||
|
};
|
61
boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.dts
Normal file
61
boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.dts
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*/
|
||||||
|
|
||||||
|
/dts-v1/;
|
||||||
|
|
||||||
|
#include <ti/am62x_m4.dtsi>
|
||||||
|
#include "pocketbeagle_2_am6232_m4-pinctrl.dtsi"
|
||||||
|
|
||||||
|
/ {
|
||||||
|
model = "BeagleBoard.org PocketBeagle 2";
|
||||||
|
compatible = "beagle,pocketbeagle_2_m4";
|
||||||
|
|
||||||
|
chosen {
|
||||||
|
zephyr,sram = &sram0;
|
||||||
|
zephyr,console = &uart0;
|
||||||
|
zephyr,shell-uart = &uart0;
|
||||||
|
zephyr,ipc = &ipc0;
|
||||||
|
zephyr,ipc_shm = &ddr0;
|
||||||
|
zephyr,sram1 = &ddr1;
|
||||||
|
};
|
||||||
|
|
||||||
|
cpus {
|
||||||
|
cpu@0 {
|
||||||
|
status = "okay";
|
||||||
|
clock-frequency = <400000000>;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
ddr0: memory@9cb00000 {
|
||||||
|
compatible = "mmio-sram";
|
||||||
|
reg = <0x9cb00000 DT_SIZE_M(1)>;
|
||||||
|
};
|
||||||
|
|
||||||
|
rsc_table: memory@9cc00000 {
|
||||||
|
compatible = "zephyr,memory-region", "mmio-sram";
|
||||||
|
reg = <0x9cc00000 DT_SIZE_K(4)>;
|
||||||
|
zephyr,memory-region = "RSC_TABLE";
|
||||||
|
};
|
||||||
|
|
||||||
|
ddr1: memory@9cc01000 {
|
||||||
|
compatible = "zephyr,memory-region", "mmio-sram";
|
||||||
|
reg = <0x9cc01000 (DT_SIZE_M(15) - DT_SIZE_K(4))>;
|
||||||
|
zephyr,memory-region = "DDR";
|
||||||
|
};
|
||||||
|
|
||||||
|
ipc0: ipc {
|
||||||
|
compatible = "zephyr,mbox-ipm";
|
||||||
|
mboxes = <&mbox0 0>, <&mbox0 1>;
|
||||||
|
mbox-names = "tx", "rx";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
&uart0 {
|
||||||
|
current-speed = <115200>;
|
||||||
|
pinctrl-0 = <&mcu_uart0_rx_default &mcu_uart0_tx_default>;
|
||||||
|
pinctrl-names = "default";
|
||||||
|
status = "okay";
|
||||||
|
};
|
10
boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.yaml
Normal file
10
boards/beagle/pocketbeagle_2/pocketbeagle_2_am6232_m4.yaml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
identifier: pocketbeagle_2/am6232/m4
|
||||||
|
name: BeagleBoard.org PocketBeagle 2
|
||||||
|
type: mcu
|
||||||
|
arch: arm
|
||||||
|
toolchain:
|
||||||
|
- zephyr
|
||||||
|
ram: 192
|
||||||
|
vendor: beagle
|
||||||
|
supported:
|
||||||
|
- uart
|
|
@ -0,0 +1,18 @@
|
||||||
|
# BeagleBoard.org PocketBeagle 2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
# Platform Configuration
|
||||||
|
CONFIG_CORTEX_M_SYSTICK=y
|
||||||
|
|
||||||
|
# Zephyr Kernel Configuration
|
||||||
|
CONFIG_XIP=n
|
||||||
|
|
||||||
|
# Serial Driver
|
||||||
|
CONFIG_SERIAL=y
|
||||||
|
|
||||||
|
# Enable Console
|
||||||
|
CONFIG_CONSOLE=y
|
||||||
|
CONFIG_UART_CONSOLE=y
|
10
boards/beagle/pocketbeagle_2/revision.cmake
Normal file
10
boards/beagle/pocketbeagle_2/revision.cmake
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
set(BOARD_REVISIONS "A0")
|
||||||
|
|
||||||
|
# If BOARD_REVISION not set, use the default revision
|
||||||
|
if(NOT DEFINED BOARD_REVISION)
|
||||||
|
set(BOARD_REVISION ${LIST_BOARD_REVISION_DEFAULT})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(NOT BOARD_REVISION IN_LIST BOARD_REVISIONS)
|
||||||
|
message(FATAL_ERROR "${BOARD_REVISION} is not a valid revision for PocketBeagle 2. Accepted revisions: ${BOARD_REVISIONS}")
|
||||||
|
endif()
|
7
boards/beagle/pocketbeagle_2/support/openocd.cfg
Normal file
7
boards/beagle/pocketbeagle_2/support/openocd.cfg
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# BeagleBoard.org PocketBeagle 2
|
||||||
|
#
|
||||||
|
# Copyright (c) 2025 Ayush Singh, BeagleBoard.org Foundation
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
|
||||||
|
source [find board/ti_am625_swd_native.cfg]
|
Loading…
Add table
Add a link
Reference in a new issue