1/*
2 * Copyright (c) 2019 eTactica ehf
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8#include <st/l1/stm32l151Xb.dtsi>
9#include <st/l1/stm32l152r(6-8-b)tx-pinctrl.dtsi>
10#include <zephyr/dt-bindings/input/input-event-codes.h>
11
12/ {
13	model = "STMicroelectronics STM32L1DISCOVERY board";
14	compatible = "st,stm32l1discovery";
15
16	chosen {
17		zephyr,console = &usart1;
18		zephyr,shell-uart = &usart1;
19		zephyr,sram = &sram0;
20		zephyr,flash = &flash0;
21	};
22
23	leds {
24		compatible = "gpio-leds";
25		green_led: ld3 {
26			gpios = <&gpiob 7 GPIO_ACTIVE_HIGH>;
27			label = "User LD3";
28		};
29		blue_led: ld4 {
30			gpios = <&gpiob 6 GPIO_ACTIVE_HIGH>;
31			label = "User LD4";
32		};
33	};
34
35	gpio_keys {
36		compatible = "gpio-keys";
37		user_button: button {
38			label = "User";
39			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
40			zephyr,code = <INPUT_KEY_0>;
41		};
42	};
43
44	aliases {
45		led0 = &green_led;
46		led1 = &blue_led;
47		sw0 = &user_button;
48		eeprom-0 = &eeprom;
49		watchdog0 = &iwdg;
50	};
51};
52
53&clk_lsi {
54	status = "okay";
55};
56
57&clk_hsi {
58	status = "okay";
59};
60
61&pll {
62	div = <4>;
63	mul = <8>;
64	/* out of the box, MCO from stlink is not enabled, unlike later discos */
65	clocks = <&clk_hsi>;
66	status = "okay";
67};
68
69&rcc {
70	clocks = <&pll>;
71	clock-frequency = <DT_FREQ_M(32)>;
72	ahb-prescaler = <1>;
73	apb1-prescaler = <1>;
74	apb2-prescaler = <1>;
75};
76
77&usart1 {
78	pinctrl-0 = <&usart1_tx_pa9 &usart1_rx_pa10>;
79	pinctrl-names = "default";
80	current-speed = <115200>;
81	status = "okay";
82};
83
84&usart2 {
85	pinctrl-0 = <&usart2_tx_pa2 &usart2_rx_pa3>;
86	pinctrl-names = "default";
87	current-speed = <115200>;
88	status = "okay";
89};
90
91&usart3 {
92	pinctrl-0 = <&usart3_tx_pb10 &usart3_rx_pb11>;
93	pinctrl-names = "default";
94	current-speed = <115200>;
95	status = "okay";
96};
97
98&i2c1 {
99	pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
100	pinctrl-names = "default";
101	status = "okay";
102	clock-frequency = <I2C_BITRATE_FAST>;
103};
104
105&i2c2 {
106	pinctrl-0 = <&i2c2_scl_pb10 &i2c2_sda_pb11>;
107	pinctrl-names = "default";
108	status = "okay";
109	clock-frequency = <I2C_BITRATE_FAST>;
110};
111
112&spi1 {
113	pinctrl-0 = <&spi1_nss_pa4 &spi1_sck_pa5
114		     &spi1_miso_pa6 &spi1_mosi_pa7>;
115	pinctrl-names = "default";
116	status = "okay";
117};
118
119&spi2 {
120	pinctrl-0 = <&spi2_nss_pb12 &spi2_sck_pb13
121		     &spi2_miso_pb14 &spi2_mosi_pb15>;
122	pinctrl-names = "default";
123	status = "okay";
124};
125
126&rtc {
127	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
128		 <&rcc STM32_SRC_LSI RTC_SEL(2)>;
129	status = "okay";
130
131	backup_regs {
132		status = "okay";
133	};
134};
135
136&eeprom {
137		status = "okay";
138};
139
140&iwdg {
141		status = "okay";
142};
143