1/*
2 * Copyright (c) 2017 I-SENSE group of ICCS
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/f1/stm32f103Xb.dtsi>
9#include <st/f1/stm32f103r(8-b)tx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "Olimex OLIMEXINO-STM32 board";
14	compatible = "olimex,olimexino_stm32", "st,stm32f103rb";
15
16	chosen {
17		zephyr,console = &usart1;
18		zephyr,shell-uart = &usart1;
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21		zephyr,canbus = &can1;
22	};
23
24	leds {
25		compatible = "gpio-leds";
26		green_led_1: led_1 {
27			gpios = <&gpioa 5 GPIO_ACTIVE_HIGH>;
28			label = "LED1";
29		};
30		yellow_led_2: led_2 {
31			gpios = <&gpioa 1 GPIO_ACTIVE_HIGH>;
32			label = "LED2";
33		};
34	};
35
36	gpio_keys {
37		compatible = "gpio-keys";
38		user_button: button {
39			label = "Key";
40			gpios = <&gpioc 9 GPIO_ACTIVE_LOW>;
41			zephyr,code = <INPUT_KEY_0>;
42		};
43	};
44
45	transceiver0: can-phy0 {
46		compatible = "microchip,mcp2551", "can-transceiver-gpio";
47		max-bitrate = <1000000>;
48		standby-gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
49		#phy-cells = <0>;
50	};
51
52	aliases {
53		led0 = &green_led_1;
54		led1 = &yellow_led_2;
55		sw0 = &user_button;
56		sdhc0 = &sdhc0;
57		watchdog0 = &iwdg;
58	};
59};
60
61&clk_hse {
62	clock-frequency = <DT_FREQ_M(8)>;
63	status = "okay";
64};
65
66&pll {
67	mul = <9>;
68	clocks = <&clk_hse>;
69	status = "okay";
70};
71
72&rcc {
73	clocks = <&pll>;
74	clock-frequency = <DT_FREQ_M(72)>;
75	ahb-prescaler = <1>;
76	apb1-prescaler = <2>;
77	apb2-prescaler = <1>;
78	/* usbpre not set: USB clock = 72 / 1.5: 48MHz */
79};
80
81uext_i2c: &i2c2 {};
82uext_spi: &spi1 {};
83uext_serial: &usart1 {};
84
85&usart1 {
86	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
87	pinctrl-names = "default";
88	current-speed = <115200>;
89	status = "okay";
90};
91
92&usart2 {
93	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
94	pinctrl-names = "default";
95	current-speed = <115200>;
96};
97
98&usart3 {
99	pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
100	pinctrl-names = "default";
101	current-speed = <115200>;
102};
103
104&i2c1 {
105	pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
106	pinctrl-names = "default";
107	status = "okay";
108	clock-frequency = <I2C_BITRATE_FAST>;
109};
110
111&i2c2 {
112	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
113	pinctrl-names = "default";
114	status = "okay";
115	clock-frequency = <I2C_BITRATE_FAST>;
116};
117
118&spi1 {
119	pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5
120		      &spi1_miso_master_pa6 &spi1_mosi_master_pa7>;
121	pinctrl-names = "default";
122	status = "okay";
123};
124
125&spi2 {
126	pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13
127		      &spi2_miso_master_pb14 &spi2_mosi_master_pb15>;
128	pinctrl-names = "default";
129	status = "okay";
130	cs-gpios = <&gpiod 2 GPIO_ACTIVE_HIGH>;
131
132	sdhc0: sdhc@0 {
133		compatible = "zephyr,sdhc-spi-slot";
134		reg = <0>;
135		status = "okay";
136		spi-max-frequency = <24000000>;
137		mmc {
138			compatible = "zephyr,sdmmc-disk";
139			status = "okay";
140		};
141	};
142};
143
144zephyr_udc0: &usb {
145	status = "okay";
146	disconnect-gpios = <&gpioc 12 GPIO_ACTIVE_LOW>;
147	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
148	pinctrl-names = "default";
149};
150
151&timers1 {
152	st,prescaler = <10000>;
153	status = "okay";
154
155	pwm1: pwm {
156		status = "okay";
157		pinctrl-0 = <&tim1_ch1_pwm_out_pa8>;
158		pinctrl-names = "default";
159	};
160};
161
162&iwdg {
163	status = "okay";
164};
165
166&can1 {
167	pinctrl-0 = <&can_rx_remap1_pb8 &can_tx_remap1_pb9>;
168	pinctrl-names = "default";
169	bus-speed = <125000>;
170	phys = <&transceiver0>;
171	status = "okay";
172};
173