1/*
2 * SPDX-License-Identifier: Apache-2.0
3 * Copyright (c) 2020, Josep Puigdemont
4 */
5
6/dts-v1/;
7#include <st/f1/stm32f103Xb.dtsi>
8#include <st/f1/stm32f103r(8-b)tx-pinctrl.dtsi>
9#include <zephyr/dt-bindings/input/input-event-codes.h>
10
11/ {
12	model = "Olimex STM32-H103 board";
13	compatible = "olimex,stm32-h103";
14
15	chosen {
16		zephyr,console = &usart2;
17		zephyr,shell-uart = &usart2;
18		zephyr,sram = &sram0;
19		zephyr,flash = &flash0;
20	};
21
22	leds {
23		compatible = "gpio-leds";
24		green_led_2: led_2 {
25			gpios = <&gpioc 12 GPIO_ACTIVE_LOW>;
26			label = "User LD2";
27		};
28	};
29
30	gpio_keys {
31		compatible = "gpio-keys";
32		user_button: button {
33			label = "User";
34			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
35			zephyr,code = <INPUT_KEY_0>;
36		};
37	};
38
39	aliases {
40		led0 = &green_led_2;
41		sw0 = &user_button;
42		watchdog0 = &iwdg;
43	};
44};
45
46&clk_hse {
47	clock-frequency = <DT_FREQ_M(8)>;
48	status = "okay";
49};
50
51&pll {
52	mul = <9>;
53	clocks = <&clk_hse>;
54	status = "okay";
55};
56
57&rcc {
58	clocks = <&pll>;
59	clock-frequency = <DT_FREQ_M(72)>;
60	ahb-prescaler = <1>;
61	apb1-prescaler = <2>;
62	apb2-prescaler = <1>;
63	/* usbpre not set: USB clock = 72 / 1.5: 48MHz */
64};
65
66&usart1 {
67	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
68	pinctrl-names = "default";
69	current-speed = <115200>;
70	status = "disabled";
71};
72
73&usart2 {
74	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
75	pinctrl-names = "default";
76	current-speed = <115200>;
77	status = "okay";
78};
79
80&usart3 {
81	pinctrl-0 = <&usart3_tx_remap1_pc10 &usart3_rx_remap1_pc11>;
82	pinctrl-names = "default";
83	current-speed = <115200>;
84	status = "disabled";
85};
86
87&i2c1 {
88	pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
89	pinctrl-names = "default";
90	status = "disabled";
91	clock-frequency = <I2C_BITRATE_FAST>;
92};
93
94&i2c2 {
95	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
96	pinctrl-names = "default";
97	status = "disabled";
98	clock-frequency = <I2C_BITRATE_FAST>;
99};
100
101&spi1 {
102	pinctrl-0 = <&spi1_nss_master_pa4 &spi1_sck_master_pa5
103		      &spi1_miso_master_pa6 &spi1_mosi_master_pa7>;
104	pinctrl-names = "default";
105	status = "disabled";
106};
107
108&spi2 {
109	pinctrl-0 = <&spi2_nss_master_pb12 &spi2_sck_master_pb13
110		     &spi2_miso_master_pb14 &spi2_mosi_master_pb15>;
111	pinctrl-names = "default";
112	status = "disabled";
113};
114
115&iwdg {
116	status = "okay";
117};
118
119zephyr_udc0: &usb {
120	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
121	pinctrl-names = "default";
122	disconnect-gpios = <&gpioc 11 GPIO_ACTIVE_LOW>;
123};
124