Skip to content

Commit bda0459

Browse files
KwsBaerkartben
authored andcommitted
boards: kws: Add support for KWS Pico-SPE Boards
Add support for KWS Pico-SPE based on Raspberry Pi RP2040 Add support for KWS Pico2-SPE based on Raspberry Pi RP2350 Signed-off-by: Frank Bintakies <fbintakies@kws-computer.de>
1 parent 643a76a commit bda0459

29 files changed

+1075
-0
lines changed
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
/*
2+
* Copyright (c) 2025 KWS Computersysteme Gmbh
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
&pinctrl {
7+
uart0_default: uart0_default {
8+
group1 {
9+
pinmux = <UART0_TX_P0>;
10+
};
11+
12+
group2 {
13+
pinmux = <UART0_RX_P1>;
14+
input-enable;
15+
};
16+
};
17+
18+
i2c0_default: i2c0_default {
19+
group1 {
20+
pinmux = <I2C0_SDA_P4>, <I2C0_SCL_P5>;
21+
input-enable;
22+
input-schmitt-enable;
23+
};
24+
};
25+
26+
i2c1_default: i2c1_default {
27+
group1 {
28+
pinmux = <I2C1_SDA_P6>, <I2C1_SCL_P7>;
29+
input-enable;
30+
input-schmitt-enable;
31+
};
32+
};
33+
34+
spi0_default: spi0_default {
35+
group1 {
36+
pinmux = <SPI0_CSN_P17>, <SPI0_SCK_P18>, <SPI0_TX_P19>;
37+
};
38+
39+
group2 {
40+
pinmux = <SPI0_RX_P16>;
41+
input-enable;
42+
};
43+
};
44+
45+
spi1_default: spi1_default {
46+
group1 {
47+
pinmux = <SPI1_CSN_P13>, <SPI1_SCK_P10>, <SPI1_TX_P11>;
48+
};
49+
50+
group2 {
51+
pinmux = <SPI1_RX_P12>;
52+
input-enable;
53+
};
54+
};
55+
56+
pwm_ch4b_default: pwm_ch4b_default {
57+
group1 {
58+
pinmux = <PWM_4B_P25>;
59+
};
60+
};
61+
62+
adc_default: adc_default {
63+
group1 {
64+
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
65+
input-enable;
66+
};
67+
};
68+
};

boards/kws/index.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. _boards-kws:
2+
3+
KWS Computersysteme Gmbh
4+
########################
5+
6+
.. toctree::
7+
:maxdepth: 1
8+
:glob:
9+
10+
**/*
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright (c) 2025 KWS Computersysteme Gmbh
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_PICO2_SPE
5+
6+
if I2C_DW
7+
8+
config I2C_DW_CLOCK_SPEED
9+
default 125
10+
11+
endif # I2C_DW
12+
13+
config USB_SELF_POWERED
14+
default n
15+
16+
config PHY_INIT_PRIORITY
17+
default 82
18+
depends on NET_L2_ETHERNET && ETH_DRIVER
19+
20+
if NETWORKING
21+
22+
config NET_L2_ETHERNET
23+
default y
24+
25+
if ETH_LAN865X
26+
27+
config NET_IF_MAX_IPV4_COUNT
28+
default 2
29+
30+
endif # ETH_LAN865X
31+
32+
endif # NETWORKING
33+
34+
endif # BOARD_PICO2_SPE
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Copyright (c) 2025 KWS Computersysteme Gmbh
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_PICO2_SPE
5+
select SOC_RP2350A_M33 if BOARD_PICO2_SPE_RP2350A_M33

boards/kws/pico2_spe/board.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
4+
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
5+
endif()
6+
7+
board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
8+
board_runner_args(openocd --cmd-pre-init "source [find target/rp2350.cfg]")
9+
10+
# The adapter speed is expected to be set by interface configuration.
11+
# The Raspberry Pi's OpenOCD fork doesn't, so match their documentation at
12+
# https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html#debugging-with-swd
13+
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 5000")
14+
15+
board_runner_args(uf2 "--board-id=RP2350")
16+
17+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
18+
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)

boards/kws/pico2_spe/board.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
board:
2+
name: pico2_spe
3+
full_name: Pico2-SPE
4+
vendor: kws
5+
socs:
6+
- name: rp2350a
19.6 KB
Binary file not shown.

boards/kws/pico2_spe/doc/index.rst

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.. zephyr:board:: pico2_spe
2+
3+
Overview
4+
********
5+
6+
The Pico2-SPE is a small, low-cost, versatile boards from
7+
KWS Computersysteme Gmbh. They are equipped with an RP2350a SoC, an on-board LED,
8+
a USB connector, an SWD interface. The Pico2-SPE additionally contains an
9+
Microchip LAN8651 10Base-T1S module. The USB bootloader allows the
10+
ability to flash without any adapter, in a drag-and-drop manner.
11+
It is also possible to flash and debug the boards with their SWD interface,
12+
using an external adapter.
13+
14+
Hardware
15+
********
16+
17+
- Dual Cortex-M33 or Hazard3 processors at up to 150MHz
18+
- 520KB of SRAM, and 4MB of on-board flash memory
19+
- USB 1.1 with device and host support
20+
- Low-power sleep and dormant modes
21+
- Drag-and-drop programming using mass storage over USB
22+
- 26 multi-function GPIO pins including 3 that can be used for ADC
23+
- 1 SPI, 2 I2C, 2 UART, 3 12-bit 500ksps Analogue to Digital - Converter (ADC), 24 controllable PWM channels
24+
- 2 Timer with 4 alarms, 1 AON Timer
25+
- Temperature sensor
26+
- Microchip LAN8651 10Base-T1S
27+
- 3 Programmable IO (PIO) blocks, 12 state machines total for custom peripheral support
28+
29+
- Flexible, user-programmable high-speed IO
30+
- Can emulate interfaces such as SD Card and VGA
31+
32+
Supported Features
33+
==================
34+
35+
.. zephyr:board-supported-hw::
36+
37+
Connections and IOs
38+
===================
39+
40+
The default pin mapping is unchanged from the Pico-SPE.
41+
42+
Programming and Debugging
43+
*************************
44+
45+
As with the Pico-SPE, the SWD interface can be used to program and debug the
46+
device, e.g. using OpenOCD with the `Raspberry Pi Debug Probe <https://www.raspberrypi.com/documentation/microcontrollers/debug-probe.html>`_ .
47+
48+
References
49+
**********
50+
51+
.. _Getting Started with Pico-SPE-Series:
52+
https://kws-computer.de/go/pico-spe-getting-started
53+
54+
.. _Pico2-SPE Documentation:
55+
https://kws-computer.de/go/pico2-spe-datasheet
56+
57+
.. target-notes::
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/*
2+
* Copyright (c) 2025 KWS Computersysteme Gmbh
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <zephyr/dt-bindings/pinctrl/rpi-pico-rp2350a-pinctrl.h>
7+
8+
#include "../common/pico_spe-pinctrl-common.dtsi"

boards/kws/pico2_spe/pico2_spe.dtsi

Lines changed: 173 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,173 @@
1+
/*
2+
* Copyright (c) 2025 KWS Computersysteme Gmbh
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <freq.h>
8+
#include <zephyr/dt-bindings/i2c/i2c.h>
9+
#include <zephyr/dt-bindings/pwm/pwm.h>
10+
11+
#include "pico2_spe-pinctrl.dtsi"
12+
13+
/ {
14+
chosen {
15+
zephyr,sram = &sram0;
16+
zephyr,flash = &flash0;
17+
zephyr,console = &uart0;
18+
zephyr,shell-uart = &uart0;
19+
zephyr,code-partition = &code_partition;
20+
};
21+
22+
aliases {
23+
watchdog0 = &wdt0;
24+
};
25+
26+
pico_header: connector {
27+
compatible = "raspberrypi,pico-header";
28+
#gpio-cells = <2>;
29+
gpio-map-mask = <0xffffffff 0xffffffc0>;
30+
gpio-map-pass-thru = <0 0x3f>;
31+
gpio-map = <0 0 &gpio0 0 0>, /* GP0 */
32+
<1 0 &gpio0 1 0>, /* GP1 */
33+
<2 0 &gpio0 2 0>, /* GP2 */
34+
<3 0 &gpio0 3 0>, /* GP3 */
35+
<4 0 &gpio0 4 0>, /* GP4 */
36+
<5 0 &gpio0 5 0>, /* GP5 */
37+
<6 0 &gpio0 6 0>, /* GP6 */
38+
<7 0 &gpio0 7 0>, /* GP7 */
39+
<8 0 &gpio0 8 0>, /* GP8 */
40+
<9 0 &gpio0 9 0>, /* GP9 */
41+
<10 0 &gpio0 10 0>, /* GP10 */
42+
<11 0 &gpio0 11 0>, /* GP11 */
43+
<12 0 &gpio0 12 0>, /* GP12 */
44+
<13 0 &gpio0 13 0>, /* GP13 */
45+
<14 0 &gpio0 14 0>, /* GP14 */
46+
<15 0 &gpio0 15 0>, /* GP15 */
47+
<16 0 &gpio0 16 0>, /* GP16 */
48+
<17 0 &gpio0 17 0>, /* GP17 */
49+
<18 0 &gpio0 18 0>, /* GP18 */
50+
<19 0 &gpio0 19 0>, /* GP19 */
51+
<20 0 &gpio0 20 0>, /* GP20 */
52+
<21 0 &gpio0 21 0>, /* GP21 */
53+
<22 0 &gpio0 22 0>, /* GP22 */
54+
<26 0 &gpio0 26 0>, /* GP26 */
55+
<27 0 &gpio0 27 0>, /* GP27 */
56+
<28 0 &gpio0 28 0>; /* GP28 */
57+
};
58+
};
59+
60+
&flash0 {
61+
reg = <0x10000000 DT_SIZE_M(4)>;
62+
63+
partitions {
64+
compatible = "fixed-partitions";
65+
#address-cells = <1>;
66+
#size-cells = <1>;
67+
68+
/* Reserved memory for an image definition block. The block is much
69+
* smaller than 256 bytes, but in practice the linker places the vector
70+
* table at a much larger alignment offset.
71+
*/
72+
image_def: partition@0 {
73+
label = "image_def";
74+
reg = <0x00000000 0x100>;
75+
read-only;
76+
};
77+
78+
/*
79+
* Usable flash. Starts at 0x100, after the image definition block.
80+
* The partition size is 4MB minus the 0x100 bytes taken by the
81+
* image definition.
82+
*/
83+
code_partition: partition@100 {
84+
label = "code-partition";
85+
reg = <0x100 (DT_SIZE_M(4) - 0x100)>;
86+
read-only;
87+
};
88+
};
89+
};
90+
91+
&uart0 {
92+
current-speed = <115200>;
93+
status = "okay";
94+
pinctrl-0 = <&uart0_default>;
95+
pinctrl-names = "default";
96+
};
97+
98+
&gpio0 {
99+
status = "okay";
100+
};
101+
102+
&spi1 {
103+
clock-frequency = <DT_FREQ_M(25)>;
104+
status = "okay";
105+
pinctrl-0 = <&spi1_default>;
106+
pinctrl-names = "default";
107+
cs-gpios = <&pico_header 13 GPIO_ACTIVE_LOW>;
108+
109+
lan8651: lan865x@0 {
110+
compatible = "microchip,lan865x";
111+
reg = <0x0>;
112+
spi-max-frequency = <DT_FREQ_M(25)>;
113+
int-gpios = <&gpio0 21 (GPIO_ACTIVE_LOW)>;
114+
rst-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
115+
status = "okay";
116+
117+
local-mac-address = [ CA 2F B7 10 23 79];
118+
119+
lan865x_mdio: lan865x_mdio {
120+
compatible = "microchip,lan865x-mdio";
121+
status = "okay";
122+
#address-cells = <1>;
123+
#size-cells = <0>;
124+
ethernet-phy@0 {
125+
compatible = "microchip,t1s-phy";
126+
reg = <0x0>;
127+
plca-enable;
128+
plca-node-id = <0>;
129+
plca-node-count = <8>;
130+
plca-burst-count = <0>;
131+
plca-burst-timer = <0x80>;
132+
plca-to-timer = <0x20>;
133+
status = "okay";
134+
};
135+
};
136+
};
137+
};
138+
139+
&i2c0 {
140+
clock-frequency = <I2C_BITRATE_STANDARD>;
141+
pinctrl-0 = <&i2c0_default>;
142+
pinctrl-names = "default";
143+
status = "okay";
144+
};
145+
146+
&i2c1 {
147+
clock-frequency = <I2C_BITRATE_STANDARD>;
148+
pinctrl-0 = <&i2c1_default>;
149+
pinctrl-names = "default";
150+
status = "okay";
151+
};
152+
153+
&adc {
154+
pinctrl-0 = <&adc_default>;
155+
pinctrl-names = "default";
156+
status = "okay";
157+
};
158+
159+
&pwm {
160+
pinctrl-0 = <&pwm_ch4b_default>;
161+
pinctrl-names = "default";
162+
divider-int-0 = <255>;
163+
};
164+
165+
&timer0 {
166+
status = "okay";
167+
};
168+
169+
zephyr_udc0: &usbd {
170+
status = "okay";
171+
};
172+
173+
pico_serial: &uart0 {};

0 commit comments

Comments
 (0)