Skip to content

Commit f9ce25f

Browse files
ozersakartben
authored andcommitted
soc: Add the MAX32657 SoC
MAX32657 is Cortex-M33 based Analog Devices MCU. It supports ARM TrustZone security model. There will be two boards of this MCU Secure and Non-Secure This commit defines Secure version of peripherals. Basic feature of MAX32657 device: - Core is Cortex-M33 - 50MHz IPO clock - There are 54 interrupt vectors - 1MB flash & 256 SRAM - MAX32657 has: - 1 x UART - 1 x I2C/I3C - 1 x SPI - 6 x TIMER - 1 x RTC - 1 x WDT - 1 x TRNG Signed-off-by: Sadik Ozer <[email protected]>
1 parent 57b4e61 commit f9ce25f

File tree

7 files changed

+322
-0
lines changed

7 files changed

+322
-0
lines changed
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
/*
2+
* Copyright (c) 2024-2025 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/max32-pinctrl.h>
8+
9+
&pinctrl {
10+
/omit-if-no-ref/ i3c_scl_p0_0: i3c_scl_p0_0 {
11+
pinmux = <MAX32_PINMUX(0, 0, AF1)>;
12+
};
13+
14+
/omit-if-no-ref/ i3c_sda_p0_1: i3c_sda_p0_1 {
15+
pinmux = <MAX32_PINMUX(0, 1, AF1)>;
16+
};
17+
18+
/omit-if-no-ref/ spi0_mosi_p0_2: spi0_mosi_p0_2 {
19+
pinmux = <MAX32_PINMUX(0, 2, AF1)>;
20+
};
21+
22+
/omit-if-no-ref/ spi0_ss0_p0_3: spi0_ss0_p0_3 {
23+
pinmux = <MAX32_PINMUX(0, 3, AF1)>;
24+
};
25+
26+
/omit-if-no-ref/ spi0_miso_p0_4: spi0_miso_p0_4 {
27+
pinmux = <MAX32_PINMUX(0, 4, AF1)>;
28+
};
29+
30+
/omit-if-no-ref/ uart0_rx_p0_5: uart0_rx_p0_5 {
31+
pinmux = <MAX32_PINMUX(0, 5, AF1)>;
32+
};
33+
34+
/omit-if-no-ref/ spi0_sck_p0_6: spi0_sck_p0_6 {
35+
pinmux = <MAX32_PINMUX(0, 6, AF1)>;
36+
};
37+
38+
/omit-if-no-ref/ spi0_ss1_p0_7: spi0_ss1_p0_7 {
39+
pinmux = <MAX32_PINMUX(0, 7, AF1)>;
40+
};
41+
42+
/omit-if-no-ref/ spi0_ss2_p0_8: spi0_ss2_p0_8 {
43+
pinmux = <MAX32_PINMUX(0, 8, AF1)>;
44+
};
45+
46+
/omit-if-no-ref/ uart0_tx_p0_9: uart0_tx_p0_9 {
47+
pinmux = <MAX32_PINMUX(0, 9, AF1)>;
48+
};
49+
50+
/omit-if-no-ref/ sqwout_p0_13: sqwout_p0_13 {
51+
pinmux = <MAX32_PINMUX(0, 13, AF1)>;
52+
};
53+
54+
/omit-if-no-ref/ tmr0a_p0_0: tmr0a_p0_0 {
55+
pinmux = <MAX32_PINMUX(0, 0, AF2)>;
56+
};
57+
58+
/omit-if-no-ref/ tmr1a_p0_1: tmr1a_p0_1 {
59+
pinmux = <MAX32_PINMUX(0, 1, AF2)>;
60+
};
61+
62+
/omit-if-no-ref/ tmr3a_p0_2: tmr3a_p0_2 {
63+
pinmux = <MAX32_PINMUX(0, 2, AF2)>;
64+
};
65+
66+
/omit-if-no-ref/ tmr4a_p0_3: tmr4a_p0_3 {
67+
pinmux = <MAX32_PINMUX(0, 3, AF2)>;
68+
};
69+
70+
/omit-if-no-ref/ tmr5a_p0_4: tmr5a_p0_4 {
71+
pinmux = <MAX32_PINMUX(0, 4, AF2)>;
72+
};
73+
74+
/omit-if-no-ref/ tmr0b_p0_5: tmr0b_p0_5 {
75+
pinmux = <MAX32_PINMUX(0, 5, AF2)>;
76+
};
77+
78+
/omit-if-no-ref/ tmr4b_p0_6: tmr4b_p0_6 {
79+
pinmux = <MAX32_PINMUX(0, 6, AF2)>;
80+
};
81+
82+
/omit-if-no-ref/ tmr3b_p0_7: tmr3b_p0_7 {
83+
pinmux = <MAX32_PINMUX(0, 7, AF2)>;
84+
};
85+
86+
/omit-if-no-ref/ i3c_pur_p0_8: i3c_pur_p0_8 {
87+
pinmux = <MAX32_PINMUX(0, 8, AF2)>;
88+
};
89+
90+
/omit-if-no-ref/ tmr1b_p0_9: tmr1b_p0_9 {
91+
pinmux = <MAX32_PINMUX(0, 9, AF2)>;
92+
};
93+
94+
/omit-if-no-ref/ tmr2a_p0_10: tmr2a_p0_10 {
95+
pinmux = <MAX32_PINMUX(0, 10, AF2)>;
96+
};
97+
98+
/omit-if-no-ref/ tmr5b_p0_11: tmr5b_p0_11 {
99+
pinmux = <MAX32_PINMUX(0, 11, AF2)>;
100+
};
101+
};

dts/arm/adi/max32/max32657.dtsi

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
* Copyright (c) 2024-2025 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <mem.h>
8+
#include <arm/armv8-m.dtsi>
9+
#include <zephyr/dt-bindings/clock/adi_max32_clock.h>
10+
11+
/ {
12+
soc {
13+
sram: sram@30000000 {
14+
ranges = <0x0 0x30000000 0x40000>;
15+
};
16+
17+
peripheral: peripheral@50000000 {
18+
ranges = <0x0 0x50000000 0x10000000>;
19+
20+
pinctrl: pin-controller@8000 {
21+
ranges = <0x8000 0x50008000 0x1000>;
22+
};
23+
24+
flc0: flash_controller@29000 {
25+
compatible = "adi,max32-flash-controller";
26+
reg = <0x29000 0x400>;
27+
28+
#address-cells = <1>;
29+
#size-cells = <1>;
30+
status = "okay";
31+
32+
flash0: flash@1000000 {
33+
compatible = "soc-nv-flash";
34+
reg = <0x01000000 DT_SIZE_K(1024)>;
35+
write-block-size = <16>;
36+
erase-block-size = <8192>;
37+
};
38+
};
39+
};
40+
};
41+
};
42+
43+
#include "max32657_common.dtsi"
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*
2+
* Copyright (c) 2024-2025 Analog Devices, Inc.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <arm/armv8-m.dtsi>
8+
#include <mem.h>
9+
#include <freq.h>
10+
11+
/ {
12+
chosen {
13+
zephyr,flash-controller = &flc0;
14+
};
15+
16+
cpus {
17+
#address-cells = <1>;
18+
#size-cells = <0>;
19+
20+
cpu@0 {
21+
compatible = "arm,cortex-m33";
22+
reg = <0>;
23+
#address-cells = <1>;
24+
#size-cells = <1>;
25+
26+
mpu: mpu@e000ed90 {
27+
compatible = "arm,armv8m-mpu";
28+
reg = <0xe000ed90 0x40>;
29+
};
30+
};
31+
};
32+
33+
clocks {
34+
clk_ipo: clk_ipo {
35+
compatible = "fixed-clock";
36+
#clock-cells = <0>;
37+
clock-frequency = <DT_FREQ_M(50)>;
38+
status = "disabled";
39+
};
40+
41+
clk_inro: clk_inro {
42+
compatible = "fixed-clock";
43+
#clock-cells = <0>;
44+
clock-frequency = < DT_FREQ_K(8) >;
45+
status = "disabled";
46+
};
47+
48+
clk_ibro: clk_ibro {
49+
compatible = "fixed-clock";
50+
#clock-cells = <0>;
51+
clock-frequency = < 7372800 >;
52+
status = "disabled";
53+
};
54+
55+
clk_ertco: clk_ertco {
56+
compatible = "fixed-clock";
57+
#clock-cells = <0>;
58+
clock-frequency = < 32768 >;
59+
status = "disabled";
60+
};
61+
62+
clk_erfo: clk_erfo {
63+
compatible = "fixed-clock";
64+
#clock-cells = <0>;
65+
clock-frequency = <DT_FREQ_M(32)>;
66+
status = "disabled";
67+
};
68+
};
69+
};
70+
71+
&sram {
72+
#address-cells = <1>;
73+
#size-cells = <1>;
74+
75+
sram0: memory@0 {
76+
compatible = "mmio-sram";
77+
reg = <0x0 DT_SIZE_K(32)>;
78+
};
79+
80+
sram1: memory@8000 {
81+
compatible = "mmio-sram";
82+
reg = <0x8000 DT_SIZE_K(32)>;
83+
};
84+
85+
sram2: memory@10000 {
86+
compatible = "mmio-sram";
87+
reg = <0x10000 DT_SIZE_K(64)>;
88+
};
89+
90+
sram3: memory@20000 {
91+
compatible = "mmio-sram";
92+
reg = <0x20000 DT_SIZE_K(64)>;
93+
};
94+
95+
sram4: memory@30000 {
96+
compatible = "mmio-sram";
97+
reg = <0x30000 DT_SIZE_K(64)>;
98+
};
99+
};
100+
101+
&peripheral {
102+
#address-cells = <1>;
103+
#size-cells = <1>;
104+
105+
gcr: clock-controller@0 {
106+
reg = <0x0 0x400>;
107+
compatible = "adi,max32-gcr";
108+
#clock-cells = <2>;
109+
clocks = <&clk_ipo>;
110+
sysclk-prescaler = <1>;
111+
status = "okay";
112+
};
113+
114+
pinctrl: pin-controller@8000 {
115+
compatible = "adi,max32-pinctrl";
116+
#address-cells = <1>;
117+
#size-cells = <1>;
118+
reg = <0x8000 0x1000>;
119+
120+
gpio0: gpio@8000 {
121+
reg = <0x8000 0x1000>;
122+
compatible = "adi,max32-gpio";
123+
gpio-controller;
124+
#gpio-cells = <2>;
125+
clocks = <&gcr ADI_MAX32_CLOCK_BUS0 0>;
126+
interrupts = <14 0>;
127+
status = "disabled";
128+
};
129+
};
130+
131+
uart0: serial@42000 {
132+
compatible = "adi,max32-uart";
133+
reg = <0x42000 0x1000>;
134+
clocks = <&gcr ADI_MAX32_CLOCK_BUS0 9>;
135+
clock-source = <ADI_MAX32_PRPH_CLK_SRC_PCLK>;
136+
interrupts = <11 0>;
137+
status = "disabled";
138+
};
139+
};
140+
141+
&nvic {
142+
arm,num-irq-priority-bits = <3>;
143+
};

soc/adi/max32/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,17 @@ config SOC_FAMILY_MAX32
99
select SOC_EARLY_INIT_HOOK
1010
select HAS_SEGGER_RTT if ZEPHYR_SEGGER_MODULE
1111

12+
config SOC_FAMILY_MAX32_M33
13+
select ARM
14+
select CPU_CORTEX_M_HAS_SYSTICK
15+
select CPU_HAS_ARM_MPU
16+
select CPU_HAS_FPU
17+
select CLOCK_CONTROL
18+
select CPU_CORTEX_M33
19+
select ARM_TRUSTZONE_M
20+
select CPU_HAS_ARM_SAU
21+
select ARMV8_M_DSP
22+
1223
config SOC_FAMILY_MAX32_M4
1324
select ARM
1425
select CPU_CORTEX_M4
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Analog Devices MAX32657 MCU
2+
3+
# Copyright (c) 2024-2025 Analog Devices, Inc.
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
if SOC_MAX32657
7+
8+
config SYS_CLOCK_HW_CYCLES_PER_SEC
9+
default $(dt_node_int_prop_int,/clocks/clk_ipo,clock-frequency)
10+
11+
config NUM_IRQS
12+
default 54
13+
14+
endif # SOC_MAX32657

soc/adi/max32/Kconfig.soc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
config SOC_FAMILY_MAX32
77
bool
88

9+
config SOC_FAMILY_MAX32_M33
10+
bool
11+
select SOC_FAMILY_MAX32
12+
913
config SOC_FAMILY_MAX32_M4
1014
bool
1115
select SOC_FAMILY_MAX32
@@ -25,6 +29,10 @@ config SOC_MAX32655_M4
2529
select SOC_MAX32655
2630
select SOC_FAMILY_MAX32_M4
2731

32+
config SOC_MAX32657
33+
bool
34+
select SOC_FAMILY_MAX32_M33
35+
2836
config SOC_MAX32660
2937
bool
3038
select SOC_FAMILY_MAX32_M4
@@ -88,6 +96,7 @@ config SOC_MAX78002_M4
8896
config SOC
8997
default "max32650" if SOC_MAX32650
9098
default "max32655" if SOC_MAX32655
99+
default "max32657" if SOC_MAX32657
91100
default "max32660" if SOC_MAX32660
92101
default "max32662" if SOC_MAX32662
93102
default "max32666" if SOC_MAX32666

soc/adi/max32/soc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ family:
88
- name: max32655
99
cpuclusters:
1010
- name: m4
11+
- name: max32657
1112
- name: max32660
1213
- name: max32662
1314
- name: max32666

0 commit comments

Comments
 (0)