1/*
2 * Copyright (c) 2024 Henrik Brix Andersen <henrik@brixandersen.dk>
3 *
4 *  SPDX-License-Identifier: Apache-2.0
5 */
6
7/dts-v1/;
8
9#include <st/f0/stm32f072Xb.dtsi>
10#include <st/f0/stm32f072c(8-b)tx-pinctrl.dtsi>
11
12/ {
13	model = "candleLight";
14	compatible = "candlelight";
15
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,code-partition = &slot0_partition;
20		zephyr,canbus = &can1;
21	};
22
23	aliases {
24		led0 = &led_rx;
25		led1 = &led_tx;
26	};
27
28	leds {
29		compatible = "gpio-leds";
30		led_rx: led_rx {
31			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
32			label = "LED RX";
33		};
34		led_tx: led_tx {
35			gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;
36			label = "LED TX";
37		};
38	};
39
40	transceiver0: can-phy0 {
41		compatible = "nxp,tja1051", "can-transceiver-gpio";
42		enable-gpios = <&gpioc 13 GPIO_ACTIVE_LOW>;
43		max-bitrate = <1000000>;
44		#phy-cells = <0>;
45	};
46};
47
48&clk_hsi {
49	status = "okay";
50	clock-frequency = <DT_FREQ_M(8)>;
51};
52
53&pll {
54	prediv = <1>;
55	mul = <6>;
56	clocks = <&clk_hsi>;
57	status = "okay";
58};
59
60&rcc {
61	clocks = <&pll>;
62	clock-frequency = <DT_FREQ_M(48)>;
63	ahb-prescaler = <1>;
64	apb1-prescaler = <1>;
65};
66
67zephyr_udc0: &usb {
68	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
69	pinctrl-names = "default";
70	status = "okay";
71};
72
73&can1 {
74	pinctrl-0 = <&can_rx_pb8 &can_tx_pb9>;
75	pinctrl-names = "default";
76	phys = <&transceiver0>;
77	status = "okay";
78};
79
80&flash0 {
81	partitions {
82		compatible = "fixed-partitions";
83		#address-cells = <1>;
84		#size-cells = <1>;
85
86		boot_partition: partition@0 {
87			label = "mcuboot";
88			reg = <0x00000000 DT_SIZE_K(48)>;
89			read-only;
90		};
91		slot0_partition: partition@c000 {
92			label = "image-0";
93			reg = <0x0000c000 DT_SIZE_K(80)>;
94		};
95	};
96};
97