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/g0/stm32g0b1Xb.dtsi>
10#include <st/g0/stm32g0b1c(b-c-e)tx-pinctrl.dtsi>
11
12/ {
13	model = "WeAct USB2CANFDV1 board";
14	compatible = "weact,usb2canfdv1";
15
16	chosen {
17		zephyr,sram = &sram0;
18		zephyr,flash = &flash0;
19		zephyr,code-partition = &slot0_partition;
20		zephyr,canbus = &fdcan1;
21	};
22
23	aliases {
24		led0 = &led_ready;
25		led1 = &led_rxd;
26		led2 = &led_txd;
27		mcuboot-led0 = &led_ready;
28	};
29
30	leds {
31		compatible = "gpio-leds";
32		led_ready: led_ready {
33			gpios = <&gpioa 2 GPIO_ACTIVE_LOW>;
34			label = "LED READY";
35		};
36		led_rxd: led_rxd {
37			gpios = <&gpioa 0 GPIO_ACTIVE_LOW>;
38			label = "LED RXD";
39		};
40		led_txd: led_txd {
41			gpios = <&gpioa 1 GPIO_ACTIVE_LOW>;
42			label = "LED TXD";
43		};
44	};
45};
46
47&clk_hse {
48	status = "okay";
49	clock-frequency = <DT_FREQ_M(16)>;
50};
51
52&clk_hsi48 {
53	status = "okay";
54	crs-usb-sof;
55};
56
57&pll {
58	div-m = <1>;
59	mul-n = <15>;
60	div-p = <2>;
61	div-q = <3>;
62	div-r = <4>;
63	clocks = <&clk_hse>;
64	status = "okay";
65};
66
67&rcc {
68	clocks = <&pll>;
69	clock-frequency = <DT_FREQ_M(60)>;
70	ahb-prescaler = <1>;
71	apb1-prescaler = <1>;
72};
73
74zephyr_udc0: &usb {
75	pinctrl-0 = <&usb_dm_pa11 &usb_dp_pa12>;
76	pinctrl-names = "default";
77	status = "okay";
78};
79
80&fdcan1 {
81	clocks = <&rcc STM32_CLOCK_BUS_APB1 0x00001000>,
82		 <&rcc STM32_SRC_PLL_Q FDCAN_SEL(1)>;
83	pinctrl-0 = <&fdcan1_rx_pb8 &fdcan1_tx_pb9>;
84	pinctrl-names = "default";
85	status = "okay";
86
87	can-transceiver {
88		max-bitrate = <5000000>;
89	};
90};
91
92&flash0 {
93	partitions {
94		compatible = "fixed-partitions";
95		#address-cells = <1>;
96		#size-cells = <1>;
97
98		boot_partition: partition@0 {
99			label = "mcuboot";
100			reg = <0x00000000 DT_SIZE_K(48)>;
101			read-only;
102		};
103		slot0_partition: partition@c000 {
104			label = "image-0";
105			reg = <0x0000c000 DT_SIZE_K(80)>;
106		};
107	};
108};
109