Skip to content

Commit 68a3cce

Browse files
dnltzcarlescufi
authored andcommitted
boards: arm: Add AM62x M4F phyBOARD-Lyra
This is a copy of the TI AM62x SK EVM board file to support the M4F on the phyBOARD-Lyra AM62x, which is PHYTEC's development kit for the phyCORE-AM62x SoM. Signed-off-by: Daniel Schultz <[email protected]>
1 parent 66a275d commit 68a3cce

9 files changed

+395
-115
lines changed

boards/arm/am62x_m4/Kconfig.board

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@
88
config BOARD_AM62X_M4_SK
99
bool "TI AM62x M4 Starter Kit (SK) Evaluation Module (EVM)"
1010
depends on SOC_SERIES_AM62X_M4
11+
12+
config BOARD_AM62X_M4_PHYBOARD_LYRA
13+
bool "PHYTEC AM62x M4 phyBOARD-Lyra"
14+
depends on SOC_SERIES_AM62X_M4

boards/arm/am62x_m4/Kconfig.defconfig

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,10 @@ config BOARD
1111
default "am62x_m4_sk"
1212

1313
endif # BOARD_AM62X_M4_SK
14+
15+
if BOARD_AM62X_M4_PHYBOARD_LYRA
16+
17+
config BOARD
18+
default "am62x_m4_phyboard_lyra"
19+
20+
endif # BOARD_AM62X_M4_PHYBOARD_LYRA
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (C) 2023 PHYTEC Messtechnik GmbH
3+
* Author: Daniel Schultz <[email protected]>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
/dts-v1/;
9+
10+
#include <ti/am62x_m4.dtsi>
11+
12+
/ {
13+
model = "PHYTEC AM62x M4 phyBOARD-Lyra";
14+
compatible = "phytec,am62x-m4-phyboard-lyra", "ti,am625";
15+
16+
chosen {
17+
zephyr,sram = &sram0;
18+
zephyr,console = &uart0;
19+
zephyr,shell-uart = &uart0;
20+
zephyr,sram1 = &ddr0;
21+
};
22+
23+
cpus {
24+
cpu@0 {
25+
status = "okay";
26+
clock-frequency = <400000000>;
27+
};
28+
};
29+
30+
ddr0:memory@9CC00000{
31+
compatible = "zephyr,memory-region", "mmio-sram";
32+
reg = <0x9CC00000 DT_SIZE_K(4)>;
33+
zephyr,memory-region = "DDR";
34+
};
35+
};
36+
37+
&pinctrl {
38+
mcu_uart0_rx_default: mcu_uart0_rx_default {
39+
pinmux = <K3_PINMUX(0x0014, PIN_INPUT, MUX_MODE_0)>;
40+
};
41+
mcu_uart0_tx_default: mcu_uart0_tx_default {
42+
pinmux = <K3_PINMUX(0x0018, PIN_OUTPUT, MUX_MODE_0)>;
43+
};
44+
};
45+
46+
&uart0 {
47+
current-speed = <115200>;
48+
pinctrl-0 = <&mcu_uart0_rx_default &mcu_uart0_tx_default>;
49+
pinctrl-names = "default";
50+
status = "okay";
51+
};
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
identifier: am62x_m4_phyboard_lyra
2+
name: PHYTEC AM62x M4 phyBOARD-Lyra
3+
type: mcu
4+
arch: arm
5+
toolchain:
6+
- zephyr
7+
ram: 192
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PHYTEC AM62x M4 phyBOARD-Lyra
2+
#
3+
# Copyright (C) 2023 PHYTEC Messtechnik GmbH
4+
# Author: Daniel Schultz <[email protected]>
5+
#
6+
# SPDX-License-Identifier: Apache-2.0
7+
8+
# Platform Configuration
9+
CONFIG_SOC_SERIES_AM62X_M4=y
10+
CONFIG_SOC_AM62x_M4=y
11+
CONFIG_BOARD_AM62X_M4_PHYBOARD_LYRA=y
12+
CONFIG_CORTEX_M_SYSTICK=y
13+
14+
# Zephyr Kernel Configuration
15+
CONFIG_XIP=n
16+
17+
# Enable Pinctrl
18+
CONFIG_PINCTRL=y
19+
20+
# Serial Driver
21+
CONFIG_SERIAL=y
22+
23+
# Enable Console
24+
CONFIG_CONSOLE=y
25+
CONFIG_UART_CONSOLE=y
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
.. _am62x_m4_phyboard_lyra:
2+
3+
AM62x phyBOARD-Lyra M4F Core
4+
############################
5+
6+
Overview
7+
********
8+
9+
The AM62x phyBOARD-Lyra board configuration is used by Zephyr applications
10+
that run on the TI AM62x platform. The board configuration provides support
11+
for the ARM Cortex-M4F MCU core and the following features:
12+
13+
- Nested Vector Interrupt Controller (NVIC)
14+
- System Tick System Clock (SYSTICK)
15+
16+
The board configuration also enables support for the semihosting debugging console.
17+
18+
See the `PHYTEC AM62x Product Page`_ for details.
19+
20+
.. figure:: img/phyCORE-AM62x_Lyra_frontside.webp
21+
:align: center
22+
:alt: AM62x phyBOARD-Lyra
23+
24+
PHYTEC phyBOARD-Lyra with the phyCORE-AM62x SoM
25+
26+
Hardware
27+
********
28+
The AM62x phyBOARD-Lyra kit features the AM62x SoC, which is composed of a
29+
quad Cortex-A53 cluster and a single Cortex-M4 core in the MCU domain. Zephyr
30+
is ported to run on the M4F core and the following listed hardware
31+
specifications are used:
32+
33+
- Low-power ARM Cortex-M4F
34+
- Memory
35+
36+
- 256KB of SRAM
37+
- 2GB of DDR4
38+
39+
- Debug
40+
41+
- XDS110 based JTAG
42+
43+
Supported Features
44+
==================
45+
46+
The am62x_m4_phyboard_lyra configuration supports the following hardware features:
47+
48+
+-----------+------------+-------------------------------------+
49+
| Interface | Controller | Driver/Component |
50+
+===========+============+=====================================+
51+
| NVIC | on-chip | nested vector interrupt controller |
52+
+-----------+------------+-------------------------------------+
53+
| SYSTICK | on-chip | systick |
54+
+-----------+------------+-------------------------------------+
55+
| PINCTRL | on-chip | pinctrl |
56+
+-----------+------------+-------------------------------------+
57+
| UART | on-chip | serial |
58+
+-----------+------------+-------------------------------------+
59+
60+
Other hardware features are not currently supported by the port.
61+
62+
Devices
63+
========
64+
System Clock
65+
------------
66+
67+
This board configuration uses a system clock frequency of 400 MHz.
68+
69+
DDR RAM
70+
-------
71+
72+
The board has 2GB of DDR RAM available. This board configuration
73+
allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400).
74+
75+
Serial Port
76+
-----------
77+
78+
This board configuration uses a single serial communication channel with the
79+
MCU domain UART (MCU_UART0).
80+
81+
SD Card
82+
*******
83+
84+
Download PHYTEC's official `WIC`_ as well as `BMAP`_ and flash the WIC file with
85+
an etching software onto an SD-card. This will boot Linux on the A53 application
86+
cores of the SoM. These cores will then load the zephyr binary on the M4 core
87+
using remoteproc.
88+
89+
The default configuration can be found in the defconfig file:
90+
91+
.. code-block:: console
92+
93+
boards/arm/am62x_m4/am62x_m4_phyboard_lyra_defconfig
94+
95+
Flashing
96+
********
97+
98+
The Linux running on the A53 uses the remoteproc framework to manage the M4F co-processor.
99+
Therefore, the testing requires the binary to be copied to the SD card to allow the A53 cores to
100+
load it while booting using remoteproc.
101+
102+
To test the M4F core, we build the `hello_world` sample with the following command.
103+
104+
.. code-block:: console
105+
106+
# From the root of the Zephyr repository
107+
west build -p -b am62x_m4_phyboard_lyra samples/hello_world
108+
109+
This builds the program and the binary is present in the `build/zephyr` directory as `zephyr.elf`.
110+
111+
We now copy this binary onto the SD card in the `/lib/firmware` directory and name it as `am62-mcu-m4f0_0-fw`.
112+
113+
.. code-block:: console
114+
115+
# Mount the SD card at sdcard for example
116+
sudo mount /dev/sdX sdcard
117+
# copy the elf to the /lib/firmware directory
118+
sudo cp --remove-destination zephyr.elf sdcard/lib/firmware/am62-mcu-m4f0_0-fw
119+
120+
The SD card can now be used for booting. The binary will now be loaded onto the M4F core on boot.
121+
122+
To allow the board to boot using the SD card, set the boot pins to the SD Card boot mode. Refer to `phyBOARD SD Card Booting Essentials`_.
123+
124+
After changing the boot mode, stop in U-Boot to enable the M4F co-processor.
125+
126+
.. code-block:: console
127+
128+
setenv overlays k3-am62-phyboard-lyra-rpmsg.dtbo
129+
# Save the overlays variable permanently
130+
saveenv
131+
boot
132+
133+
The board should boot into Linux and the binary will run and print Hello world to the MCU_UART0
134+
port.
135+
136+
137+
138+
.. _PHYTEC AM62x Product Page:
139+
https://www.phytec.com/product/phycore-am62x/
140+
141+
.. _WIC:
142+
https://download.phytec.de/Software/Linux/BSP-Yocto-AM62x/BSP-Yocto-AM62x-PD23.1.0/images/yogurt/phyboard-lyra-am62xx-2/phytec-qt5demo-image-phyboard-lyra-am62xx-2.wic.xz
143+
144+
.. _BMAP:
145+
https://download.phytec.de/Software/Linux/BSP-Yocto-AM62x/BSP-Yocto-AM62x-PD23.1.0/images/yogurt/phyboard-lyra-am62xx-2/phytec-qt5demo-image-phyboard-lyra-am62xx-2.wic.bmap
146+
147+
.. _phyBOARD SD Card Booting Essentials:
148+
https://docs.phytec.com/latest/phycore-am62x/bootingessentials/sdcard.html
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
.. _am62x_m4_sk:
2+
3+
AM62x-SK M4F Core
4+
#################
5+
6+
Overview
7+
********
8+
9+
The AM62x-SK board configuration is used by Zephyr applications that run on
10+
the TI AM62x platform. The board configuration provides support for the ARM
11+
Cortex-M4F MCU core and the following features:
12+
13+
- Nested Vector Interrupt Controller (NVIC)
14+
- System Tick System Clock (SYSTICK)
15+
16+
The board configuration also enables support for the semihosting debugging console.
17+
18+
See the `TI AM62X Product Page`_ for details.
19+
20+
.. figure:: img/sk_am62_angled.webp
21+
:align: center
22+
:alt: TI AM62x-SK EVM
23+
24+
Texas Instruments AM62x SK EVM
25+
26+
Hardware
27+
********
28+
The AM62x-SK EVM features the AM62x SoC, which is composed of a quad Cortex-A53
29+
cluster and a single Cortex-M4 core in the MCU domain. Zephyr is ported to run on
30+
the M4F core and the following listed hardware specifications are used:
31+
32+
- Low-power ARM Cortex-M4F
33+
- Memory
34+
35+
- 256KB of SRAM
36+
- 2GB of DDR4
37+
38+
- Debug
39+
40+
- XDS110 based JTAG
41+
42+
Supported Features
43+
==================
44+
45+
The am62x_m4_sk configuration supports the following hardware features:
46+
47+
+-----------+------------+-------------------------------------+
48+
| Interface | Controller | Driver/Component |
49+
+===========+============+=====================================+
50+
| NVIC | on-chip | nested vector interrupt controller |
51+
+-----------+------------+-------------------------------------+
52+
| SYSTICK | on-chip | systick |
53+
+-----------+------------+-------------------------------------+
54+
| PINCTRL | on-chip | pinctrl |
55+
+-----------+------------+-------------------------------------+
56+
| UART | on-chip | serial |
57+
+-----------+------------+-------------------------------------+
58+
59+
Other hardware features are not currently supported by the port.
60+
61+
Devices
62+
========
63+
System Clock
64+
------------
65+
66+
This board configuration uses a system clock frequency of 400 MHz.
67+
68+
DDR RAM
69+
-------
70+
71+
The board has 2GB of DDR RAM available. This board configuration
72+
allocates Zephyr 4kB of RAM (only for resource table: 0x9CC00000 to 0x9CC00400).
73+
74+
Serial Port
75+
-----------
76+
77+
This board configuration uses a single serial communication channel with the
78+
MCU domain UART (MCU_UART0).
79+
80+
SD Card
81+
*******
82+
83+
Download TI's official `WIC`_ and flash the WIC file with an etching software
84+
onto an SD-card. This will boot Linux on the A53 application cores of the EVM.
85+
These cores will then load the zephyr binary on the M4 core using remoteproc.
86+
87+
The default configuration can be found in the defconfig file:
88+
89+
.. code-block:: console
90+
91+
boards/arm/am62x_m4/am62x_m4_sk_defconfig
92+
93+
Flashing
94+
********
95+
96+
The board can using remoteproc, and uses the OpenAMP resource table to accomplish this.
97+
98+
The testing requires the binary to be copied to the SD card to allow the A53 cores to load it while booting using remoteproc.
99+
100+
To test the M4F core, we build the `hello_world` sample with the following command.
101+
102+
.. code-block:: console
103+
104+
# From the root of the Zephyr repository
105+
west build -p -b am62x_m4_sk samples/hello_world
106+
107+
This builds the program and the binary is present in the `build/zephyr` directory as `zephyr.elf`.
108+
109+
We now copy this binary onto the SD card in the `/lib/firmware` directory and name it as `am62-mcu-m4f0_0-fw`.
110+
111+
.. code-block:: console
112+
113+
# Mount the SD card at sdcard for example
114+
sudo mount /dev/sdX sdcard
115+
# copy the elf to the /lib/firmware directory
116+
sudo cp --remove-destination zephyr.elf sdcard/lib/firmware/am62-mcu-m4f0_0-fw
117+
118+
The SD card can now be used for booting. The binary will now be loaded onto the M4F core on boot.
119+
120+
To allow the board to boot using the SD card, set the boot pins to the SD Card boot mode. Refer to `EVM Setup Page`_.
121+
122+
After changing the boot mode, the board should go through the boot sequence on powering up.
123+
The binary will run and print Hello world to the MCU_UART0 port.
124+
125+
References
126+
**********
127+
128+
AM62x SK EVM TRM:
129+
https://www.ti.com/lit/ug/spruiv7/spruiv7.pdf
130+
131+
.. _TI AM62X Product Page:
132+
https://www.ti.com/product/AM625
133+
134+
.. _WIC:
135+
https://dr-download.ti.com/software-development/software-development-kit-sdk/MD-PvdSyIiioq/08.06.00.42/tisdk-default-image-am62xx-evm.wic.xz
136+
137+
.. _AM62x SK EVM TRM:
138+
https://www.ti.com/lit/ug/spruiv7/spruiv7.pdf
139+
140+
.. _EVM Setup Page:
141+
https://software-dl.ti.com/mcu-plus-sdk/esd/AM62X/08_06_00_18/exports/docs/api_guide_am62x/EVM_SETUP_PAGE.html
Binary file not shown.

0 commit comments

Comments
 (0)