Skip to content

Commit a9857af

Browse files
committed
boards: arm: Add adafruit_kb2040 board
Add `adafruit_bk2040` board with `sparkfun,pro-micro` header. Signed-off-by: Peter Johanson <peter@peterjohanson.com>
1 parent 4e36e9c commit a9857af

File tree

10 files changed

+213
-0
lines changed

10 files changed

+213
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Copyright (c) 2021 Pete Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
config BOARD_ADAFRUIT_KB2040
5+
bool "Adafruit KB2040 Board"
6+
depends on SOC_RP2040
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Copyright (c) 2021 Pete Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
if BOARD_ADAFRUIT_KB2040
5+
6+
config BOARD
7+
default "adafruit_kb2040"
8+
9+
config RP2_FLASH_W25Q080
10+
default y
11+
12+
endif # BOARD_ADAFRUIT_KB2040
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
* Copyright (c) 2021, Yonatan Schachter
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
#include <dt-bindings/pinctrl/rp2040-pinctrl.h>
7+
8+
&pinctrl {
9+
uart1_default: uart1_default {
10+
group1 {
11+
pinmux = <UART1_TX_P20>;
12+
};
13+
group2 {
14+
pinmux = <UART1_RX_P5>;
15+
input-enable;
16+
};
17+
};
18+
};
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (c) 2021 Yonatan Schachter
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <raspberrypi/rp2040.dtsi>
10+
#include "adafruit_kb2040-pinctrl.dtsi"
11+
#include "sparkfun_pro_micro.dtsi"
12+
13+
/ {
14+
chosen {
15+
zephyr,sram = &sram0;
16+
zephyr,flash = &flash0;
17+
zephyr,console = &uart1;
18+
zephyr,code-partition = &code_partition;
19+
};
20+
};
21+
22+
&flash0 {
23+
/* 8MB of flash minus the 0x100 used for
24+
* the second stage bootloader
25+
*/
26+
reg = <0x10000100 (DT_SIZE_M(8) - 0x100)>;
27+
28+
partitions {
29+
compatible = "fixed-partitions";
30+
#address-cells = <1>;
31+
#size-cells = <1>;
32+
33+
/*
34+
* Start at the beginning of usable flash, 8MB minus the
35+
* second stage space and the 16 KiB reserved for settings
36+
*/
37+
code_partition: partition@0 {
38+
label = "code";
39+
reg = <0 ((DT_SIZE_M(8) - 0x100) - DT_SIZE_K(16))>;
40+
read-only;
41+
};
42+
43+
/*
44+
* The final 16 KiB is reserved for the application.
45+
* Storage partition may be used by FCB or LittleFS.
46+
*/
47+
storage_partition: partition@7fbe00 {
48+
label = "storage";
49+
reg = <0x007fbe00 DT_SIZE_K(16)>;
50+
};
51+
};
52+
};
53+
54+
&uart1 {
55+
current-speed = <115200>;
56+
status = "okay";
57+
pinctrl-0 = <&uart1_default>;
58+
pinctrl-names = "default";
59+
};
60+
61+
&gpio0 {
62+
status = "okay";
63+
};
64+
65+
&usbd {
66+
status = "okay";
67+
};
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
identifier: raspberrypi_pico
2+
name: RaspberryPi-Pico
3+
type: mcu
4+
arch: arm
5+
flash: 2048
6+
ram: 264
7+
toolchain:
8+
- zephyr
9+
- gnuarmemb
10+
- xtools
11+
supported:
12+
- serial
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_SOC_SERIES_RP2XXX=y
4+
CONFIG_SOC_RP2040=y
5+
CONFIG_BOARD_ADAFRUIT_KB2040=y
6+
7+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000
8+
9+
# Enable GPIO
10+
CONFIG_GPIO=y
11+
12+
# enable uart driver
13+
CONFIG_SERIAL=y
14+
15+
# enable console
16+
CONFIG_CONSOLE=y
17+
CONFIG_UART_CONSOLE=y
18+
19+
# Code partition needed to target the correct flash range
20+
CONFIG_USE_DT_CODE_PARTITION=y
21+
22+
# Output UF2 by default, native bootloader supports it.
23+
CONFIG_BUILD_OUTPUT_UF2=y

boards/arm/adafruit_kb2040/board.cmake

Whitespace-only changes.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* Copyright (c) 2020 Pete Johanson
3+
*
4+
* SPDX-License-Identifier: MIT
5+
*/
6+
7+
/ {
8+
pro_micro: connector {
9+
compatible = "sparkfun,pro-micro";
10+
#gpio-cells = <2>;
11+
gpio-map-mask = <0xffffffff 0xffffffc0>;
12+
gpio-map-pass-thru = <0 0x3f>;
13+
gpio-map
14+
= <0 0 &gpio0 0 0> /* D0 */
15+
, <1 0 &gpio0 1 0> /* D1 */
16+
, <2 0 &gpio0 2 0> /* D2 */
17+
, <3 0 &gpio0 3 0> /* D3 */
18+
, <4 0 &gpio0 4 0> /* D4/A6 */
19+
, <5 0 &gpio0 5 0> /* D5 */
20+
, <6 0 &gpio0 6 0> /* D6/A7 */
21+
, <7 0 &gpio0 7 0> /* D7 */
22+
, <8 0 &gpio0 8 0> /* D8/A8 */
23+
, <9 0 &gpio0 9 0> /* D9/A9 */
24+
, <10 0 &gpio0 10 0> /* D10/A10 */
25+
, <16 0 &gpio0 19 0> /* D16 */
26+
, <14 0 &gpio0 20 0> /* D14 */
27+
, <15 0 &gpio0 18 0> /* D15 */
28+
, <18 0 &gpio0 26 0> /* D18/A0 */
29+
, <19 0 &gpio0 27 0> /* D19/A1 */
30+
, <20 0 &gpio0 28 0> /* D20/A2 */
31+
, <21 0 &gpio0 29 0> /* D21/A3 */
32+
;
33+
};
34+
35+
};
36+
37+
// pro_micro_i2c: &i2c0 {};
38+
// pro_micro_spi: &spi0 {};
39+
pro_micro_serial: &uart0 {};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Copyright (C) 2021 Peter Johanson
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
description: |
5+
GPIO pins exposed on Sparkfun Pro Micro (and compatible devices) headers.
6+
7+
The Sparkfun Pro Micro layout provides two headers, along opposite
8+
edges of the board.
9+
10+
Proceeding counter-clockwise:
11+
* A 12-pin Power and Digital Input header. This has input signals
12+
labeled from 0 at the top through 9 at the bottom.
13+
* An 12-pin Power and Digital/Analog Input header. This
14+
has four power pins, followed by eight inputs, with a
15+
non-monotonically decreasing numbering.
16+
17+
This binding provides a nexus mapping for 18 pins, as depicted below:
18+
19+
0 TX0 RAW -
20+
1 RX1 GND -
21+
- GND RST -
22+
- GND VCC -
23+
2 D2 D21/A3 21
24+
3 D3 D20/A2 20
25+
4 A4 D19/A1 19
26+
5 D5 D18/A0 18
27+
6 D6 D15 15
28+
7 D7 D14 14
29+
8 D8 D16 16
30+
9 D9 D10 10
31+
32+
33+
compatible: "sparkfun,pro-micro-gpio"
34+
35+
include: [gpio-nexus.yaml, base.yaml]

dts/bindings/vendor-prefixes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,6 +558,7 @@ solidrun SolidRun
558558
solomon Solomon Systech Limited
559559
sony Sony Corporation
560560
spansion Spansion Inc.
561+
sparkfun SparkFun Electronics
561562
sprd Spreadtrum Communications Inc.
562563
sst Silicon Storage Technology, Inc.
563564
sstar Xiamen Xingchen(SigmaStar) Technology Co., Ltd. (formerly part of MStar Semiconductor, Inc.)

0 commit comments

Comments
 (0)