Skip to content

Commit 9625f00

Browse files
ttmutcfriedt
authored andcommitted
boards: adi: Add MAX32658EVKIT secure and nonsecure boards
Adds MAX32658EVKIT board with secure and nonsecure variants. Signed-off-by: Tahsin Mutlugun <[email protected]>
1 parent a97b200 commit 9625f00

15 files changed

+960
-2
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (c) 2024-2025 Analog Devices, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_MAX32658EVKIT
5+
6+
# Code Partition:
7+
#
8+
# For the secure version of the board the firmware is linked at the beginning
9+
# of the flash, or into the code-partition defined in DT if it is intended to
10+
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
11+
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
12+
# be restricted to the size of its code partition.
13+
#
14+
# For the non-secure version of the board, the firmware
15+
# must be linked into the code-partition (non-secure) defined in DT, regardless.
16+
# Apply this configuration below by setting the Kconfig symbols used by
17+
# the linker according to the information extracted from DT partitions.
18+
19+
# Workaround for not being able to have commas in macro arguments
20+
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
21+
22+
config FLASH_LOAD_SIZE
23+
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
24+
25+
if BOARD_MAX32658EVKIT_MAX32658_NS
26+
27+
config FLASH_LOAD_OFFSET
28+
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
29+
30+
# MAX32658 has one UART interface,
31+
# It can be used either on TFM or Zephyr
32+
# Enabling debug (TFM_SPM_LOG_LEVEL || TFM_PARTITION_LOG_LEVEL) will transfer it to the TFM side
33+
# Disabling TFM debug will transfer it to the Zephyr side.
34+
35+
choice TFM_SPM_LOG_LEVEL
36+
default TFM_SPM_LOG_LEVEL_SILENCE
37+
endchoice
38+
39+
choice TFM_PARTITION_LOG_LEVEL
40+
default TFM_PARTITION_LOG_LEVEL_SILENCE
41+
endchoice
42+
43+
endif # BOARD_MAX32658EVKIT_MAX32658_NS
44+
45+
config I3C
46+
default y if ADXL367
47+
48+
endif # BOARD_MAX32658EVKIT
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2024-2025 Analog Devices, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_MAX32658EVKIT
5+
select SOC_MAX32658 if BOARD_MAX32658EVKIT_MAX32658 || \
6+
BOARD_MAX32658EVKIT_MAX32658_NS
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2024-2025 Analog Devices, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if(CONFIG_BOARD_MAX32658EVKIT_MAX32658_NS)
5+
set_property(TARGET runners_yaml_props_target PROPERTY hex_file tfm_merged.hex)
6+
endif()
7+
8+
board_runner_args(jlink "--device=MAX32658" "--reset-after-load")
9+
10+
include(${ZEPHYR_BASE}/boards/common/openocd-adi-max32.boards.cmake)
11+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
12+
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

boards/adi/max32658evkit/board.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Copyright (c) 2024-2025 Analog Devices, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
board:
5+
name: max32658evkit
6+
vendor: adi
7+
socs:
8+
- name: max32658
9+
variants:
10+
- name: "ns"
74.7 KB
Loading

boards/adi/max32658evkit/doc/index.rst

Lines changed: 571 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
/*
2+
* Copyright (c) 2024-2025 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <adi/max32/max32657.dtsi>
10+
#include "max32658evkit_max32658_common.dtsi"
11+
12+
/ {
13+
chosen {
14+
zephyr,sram = &secure_ram;
15+
zephyr,flash = &flash0;
16+
zephyr,code-partition = &slot0_partition;
17+
};
18+
19+
reserved-memory {
20+
#address-cells = <1>;
21+
#size-cells = <1>;
22+
ranges;
23+
24+
secure_ram: partition@30000000 {
25+
label = "secure-memory";
26+
reg = <0x30000000 DT_SIZE_K(256)>;
27+
};
28+
};
29+
};
30+
31+
&flash0 {
32+
partitions {
33+
compatible = "fixed-partitions";
34+
#address-cells = <1>;
35+
#size-cells = <1>;
36+
37+
slot0_partition: partition@0 {
38+
label = "image-0";
39+
reg = <0x0 DT_SIZE_K(960)>;
40+
read-only;
41+
};
42+
43+
storage_partition: partition@f0000 {
44+
label = "storage";
45+
reg = <0xf0000 DT_SIZE_K(64)>;
46+
};
47+
};
48+
};
49+
50+
&trng {
51+
status = "okay";
52+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
identifier: max32658evkit/max32658
2+
name: max32658evkit-max32658
3+
vendor: adi
4+
type: mcu
5+
arch: arm
6+
toolchain:
7+
- zephyr
8+
- gnuarmemb
9+
supported:
10+
- serial
11+
- gpio
12+
- trng
13+
- watchdog
14+
- dma
15+
- counter
16+
- pwm
17+
- rtc_counter
18+
- spi
19+
- i3c
20+
ram: 256
21+
flash: 960
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
/*
2+
* Copyright (c) 2024-2025 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <adi/max32/max32657-pinctrl.dtsi>
8+
#include <zephyr/dt-bindings/gpio/gpio.h>
9+
#include <zephyr/dt-bindings/gpio/adi-max32-gpio.h>
10+
#include <zephyr/dt-bindings/input/input-event-codes.h>
11+
12+
/ {
13+
model = "Analog Devices MAX32658EVKIT";
14+
compatible = "adi,max32658evkit";
15+
16+
chosen {
17+
zephyr,console = &uart0;
18+
zephyr,cortex-m-idle-timer = &counter_wut1;
19+
zephyr,shell-uart = &uart0;
20+
};
21+
22+
leds {
23+
compatible = "gpio-leds";
24+
25+
led1: led_1 {
26+
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
27+
label = "Green LED";
28+
};
29+
};
30+
31+
buttons {
32+
compatible = "gpio-keys";
33+
34+
pb1: pb1 {
35+
gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
36+
label = "SW2";
37+
zephyr,code = <INPUT_KEY_0>;
38+
};
39+
};
40+
41+
/* These aliases are provided for compatibility with samples */
42+
aliases {
43+
accel0 = &adxl367;
44+
led0 = &led1;
45+
sw0 = &pb1;
46+
watchdog0 = &wdt0;
47+
};
48+
};
49+
50+
&uart0 {
51+
pinctrl-0 = <&uart0_tx_p0_9 &uart0_rx_p0_5>;
52+
pinctrl-names = "default";
53+
current-speed = <115200>;
54+
data-bits = <8>;
55+
parity = "none";
56+
status = "okay";
57+
};
58+
59+
&clk_ipo {
60+
status = "okay";
61+
};
62+
63+
&gpio0 {
64+
status = "okay";
65+
};
66+
67+
&wdt0 {
68+
status = "okay";
69+
};
70+
71+
&spi0 {
72+
status = "okay";
73+
pinctrl-0 = <&spi0_mosi_p0_2 &spi0_miso_p0_4 &spi0_sck_p0_6 &spi0_ss0_p0_3>;
74+
pinctrl-names = "default";
75+
};
76+
77+
&rtc_counter {
78+
status = "okay";
79+
clock-source = <ADI_MAX32_PRPH_CLK_SRC_INRO>;
80+
};
81+
82+
&i3c0 {
83+
status = "okay";
84+
pinctrl-0 = <&i3c_scl_p0_0 &i3c_sda_p0_1>;
85+
pinctrl-names = "default";
86+
i2c-scl-hz = <DT_FREQ_K(200)>;
87+
i3c-scl-hz = <DT_FREQ_K(800)>;
88+
i3c-od-scl-hz = <DT_FREQ_K(400)>;
89+
90+
adxl367: adxl367@530000000000000000 {
91+
compatible = "adi,adxl367";
92+
reg = <0x53 0x00 0x00>;
93+
status = "okay";
94+
};
95+
};
96+
97+
&wut0 {
98+
clock-source = <ADI_MAX32_PRPH_CLK_SRC_INRO>;
99+
};
100+
101+
&wut1 {
102+
status = "okay";
103+
clock-source = <ADI_MAX32_PRPH_CLK_SRC_INRO>;
104+
wakeup-source;
105+
counter_wut1: counter {
106+
status = "okay";
107+
};
108+
};
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright (c) 2024-2025 Analog Devices, Inc.
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
# Enable GPIO
5+
CONFIG_GPIO=y
6+
7+
# Console
8+
CONFIG_CONSOLE=y
9+
CONFIG_UART_CONSOLE=y
10+
11+
# Enable UART
12+
CONFIG_SERIAL=y
13+
CONFIG_UART_INTERRUPT_DRIVEN=y
14+
15+
# It is secure fw, enable flags
16+
CONFIG_TRUSTED_EXECUTION_SECURE=y

0 commit comments

Comments
 (0)