15def4c47SEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0 OR MIT)
25def4c47SEmmanuel Vadot/* Copyright (c) 2020 SiFive, Inc */
35def4c47SEmmanuel Vadot
45def4c47SEmmanuel Vadot#include "fu740-c000.dtsi"
58cc087a1SEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
65def4c47SEmmanuel Vadot#include <dt-bindings/interrupt-controller/irq.h>
7b97ee269SEmmanuel Vadot#include <dt-bindings/leds/common.h>
8b97ee269SEmmanuel Vadot#include <dt-bindings/pwm/pwm.h>
95def4c47SEmmanuel Vadot
105def4c47SEmmanuel Vadot/* Clock frequency (in Hz) of the PCB crystal for rtcclk */
115def4c47SEmmanuel Vadot#define RTCCLK_FREQ		1000000
125def4c47SEmmanuel Vadot
135def4c47SEmmanuel Vadot/ {
145def4c47SEmmanuel Vadot	model = "SiFive HiFive Unmatched A00";
155def4c47SEmmanuel Vadot	compatible = "sifive,hifive-unmatched-a00", "sifive,fu740-c000",
165def4c47SEmmanuel Vadot		     "sifive,fu740";
175def4c47SEmmanuel Vadot
185def4c47SEmmanuel Vadot	chosen {
195def4c47SEmmanuel Vadot		stdout-path = "serial0";
205def4c47SEmmanuel Vadot	};
215def4c47SEmmanuel Vadot
225def4c47SEmmanuel Vadot	cpus {
235def4c47SEmmanuel Vadot		timebase-frequency = <RTCCLK_FREQ>;
245def4c47SEmmanuel Vadot	};
255def4c47SEmmanuel Vadot
265def4c47SEmmanuel Vadot	memory@80000000 {
275def4c47SEmmanuel Vadot		device_type = "memory";
285956d97fSEmmanuel Vadot		reg = <0x0 0x80000000 0x4 0x00000000>;
295def4c47SEmmanuel Vadot	};
305def4c47SEmmanuel Vadot
315def4c47SEmmanuel Vadot	hfclk: hfclk {
325def4c47SEmmanuel Vadot		#clock-cells = <0>;
335def4c47SEmmanuel Vadot		compatible = "fixed-clock";
345def4c47SEmmanuel Vadot		clock-frequency = <26000000>;
355def4c47SEmmanuel Vadot		clock-output-names = "hfclk";
365def4c47SEmmanuel Vadot	};
375def4c47SEmmanuel Vadot
385def4c47SEmmanuel Vadot	rtcclk: rtcclk {
395def4c47SEmmanuel Vadot		#clock-cells = <0>;
405def4c47SEmmanuel Vadot		compatible = "fixed-clock";
415def4c47SEmmanuel Vadot		clock-frequency = <RTCCLK_FREQ>;
425def4c47SEmmanuel Vadot		clock-output-names = "rtcclk";
435def4c47SEmmanuel Vadot	};
44e67e8565SEmmanuel Vadot
45e67e8565SEmmanuel Vadot	gpio-poweroff {
46e67e8565SEmmanuel Vadot		compatible = "gpio-poweroff";
47e67e8565SEmmanuel Vadot		gpios = <&gpio 2 GPIO_ACTIVE_LOW>;
48e67e8565SEmmanuel Vadot	};
49b97ee269SEmmanuel Vadot
50b97ee269SEmmanuel Vadot	led-controller-1 {
51b97ee269SEmmanuel Vadot		compatible = "pwm-leds";
52b97ee269SEmmanuel Vadot
53b97ee269SEmmanuel Vadot		led-d12 {
54b97ee269SEmmanuel Vadot			pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>;
55b97ee269SEmmanuel Vadot			active-low;
56b97ee269SEmmanuel Vadot			color = <LED_COLOR_ID_GREEN>;
57b97ee269SEmmanuel Vadot			max-brightness = <255>;
58b97ee269SEmmanuel Vadot			label = "d12";
59b97ee269SEmmanuel Vadot		};
60b97ee269SEmmanuel Vadot	};
61b97ee269SEmmanuel Vadot
62b97ee269SEmmanuel Vadot	led-controller-2 {
63b97ee269SEmmanuel Vadot		compatible = "pwm-leds-multicolor";
64b97ee269SEmmanuel Vadot
65b97ee269SEmmanuel Vadot		multi-led {
66b97ee269SEmmanuel Vadot			color = <LED_COLOR_ID_RGB>;
67b97ee269SEmmanuel Vadot			max-brightness = <255>;
68b97ee269SEmmanuel Vadot			label = "d2";
69b97ee269SEmmanuel Vadot
70b97ee269SEmmanuel Vadot			led-red {
71b97ee269SEmmanuel Vadot				pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>;
72b97ee269SEmmanuel Vadot				active-low;
73b97ee269SEmmanuel Vadot				color = <LED_COLOR_ID_RED>;
74b97ee269SEmmanuel Vadot			};
75b97ee269SEmmanuel Vadot
76b97ee269SEmmanuel Vadot			led-green {
77b97ee269SEmmanuel Vadot				pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>;
78b97ee269SEmmanuel Vadot				active-low;
79b97ee269SEmmanuel Vadot				color = <LED_COLOR_ID_GREEN>;
80b97ee269SEmmanuel Vadot			};
81b97ee269SEmmanuel Vadot
82b97ee269SEmmanuel Vadot			led-blue {
83b97ee269SEmmanuel Vadot				pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>;
84b97ee269SEmmanuel Vadot				active-low;
85b97ee269SEmmanuel Vadot				color = <LED_COLOR_ID_BLUE>;
86b97ee269SEmmanuel Vadot			};
87b97ee269SEmmanuel Vadot		};
88b97ee269SEmmanuel Vadot	};
895def4c47SEmmanuel Vadot};
905def4c47SEmmanuel Vadot
915def4c47SEmmanuel Vadot&uart0 {
925def4c47SEmmanuel Vadot	status = "okay";
935def4c47SEmmanuel Vadot};
945def4c47SEmmanuel Vadot
955def4c47SEmmanuel Vadot&uart1 {
965def4c47SEmmanuel Vadot	status = "okay";
975def4c47SEmmanuel Vadot};
985def4c47SEmmanuel Vadot
995def4c47SEmmanuel Vadot&i2c0 {
1005def4c47SEmmanuel Vadot	status = "okay";
1015def4c47SEmmanuel Vadot
1025def4c47SEmmanuel Vadot	temperature-sensor@4c {
1035def4c47SEmmanuel Vadot		compatible = "ti,tmp451";
1045def4c47SEmmanuel Vadot		reg = <0x4c>;
1058cc087a1SEmmanuel Vadot		vcc-supply = <&vdd_bpro>;
1065def4c47SEmmanuel Vadot		interrupt-parent = <&gpio>;
1075def4c47SEmmanuel Vadot		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
1085def4c47SEmmanuel Vadot	};
1095def4c47SEmmanuel Vadot
1108cc087a1SEmmanuel Vadot	eeprom@54 {
1118cc087a1SEmmanuel Vadot		compatible = "microchip,24c02", "atmel,24c02";
1128cc087a1SEmmanuel Vadot		reg = <0x54>;
1138cc087a1SEmmanuel Vadot		vcc-supply = <&vdd_bpro>;
1148cc087a1SEmmanuel Vadot		label = "board-id";
1158cc087a1SEmmanuel Vadot		pagesize = <16>;
1168cc087a1SEmmanuel Vadot		read-only;
1178cc087a1SEmmanuel Vadot		size = <256>;
1188cc087a1SEmmanuel Vadot	};
1198cc087a1SEmmanuel Vadot
1205def4c47SEmmanuel Vadot	pmic@58 {
1215def4c47SEmmanuel Vadot		compatible = "dlg,da9063";
1225def4c47SEmmanuel Vadot		reg = <0x58>;
1235def4c47SEmmanuel Vadot		interrupt-parent = <&gpio>;
1245def4c47SEmmanuel Vadot		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
1255def4c47SEmmanuel Vadot		interrupt-controller;
126*8d13bc63SEmmanuel Vadot		#interrupt-cells = <2>;
1275def4c47SEmmanuel Vadot
1288cc087a1SEmmanuel Vadot		onkey {
1298cc087a1SEmmanuel Vadot			compatible = "dlg,da9063-onkey";
1305def4c47SEmmanuel Vadot		};
1315def4c47SEmmanuel Vadot
1328cc087a1SEmmanuel Vadot		rtc {
1338cc087a1SEmmanuel Vadot			compatible = "dlg,da9063-rtc";
1348cc087a1SEmmanuel Vadot		};
1358cc087a1SEmmanuel Vadot
136b97ee269SEmmanuel Vadot		watchdog {
1378cc087a1SEmmanuel Vadot			compatible = "dlg,da9063-watchdog";
1388cc087a1SEmmanuel Vadot		};
1398cc087a1SEmmanuel Vadot
1408cc087a1SEmmanuel Vadot		regulators {
1418cc087a1SEmmanuel Vadot			vdd_bcore: bcores-merged {
1428cc087a1SEmmanuel Vadot				regulator-min-microvolt = <1050000>;
1438cc087a1SEmmanuel Vadot				regulator-max-microvolt = <1050000>;
1448cc087a1SEmmanuel Vadot				regulator-min-microamp = <4800000>;
1458cc087a1SEmmanuel Vadot				regulator-max-microamp = <4800000>;
1465def4c47SEmmanuel Vadot				regulator-always-on;
1475def4c47SEmmanuel Vadot			};
1485def4c47SEmmanuel Vadot
1495def4c47SEmmanuel Vadot			vdd_bpro: bpro {
1505def4c47SEmmanuel Vadot				regulator-min-microvolt = <1800000>;
1515def4c47SEmmanuel Vadot				regulator-max-microvolt = <1800000>;
1528cc087a1SEmmanuel Vadot				regulator-min-microamp = <2400000>;
1538cc087a1SEmmanuel Vadot				regulator-max-microamp = <2400000>;
1545def4c47SEmmanuel Vadot				regulator-always-on;
1555def4c47SEmmanuel Vadot			};
1565def4c47SEmmanuel Vadot
1575def4c47SEmmanuel Vadot			vdd_bperi: bperi {
1588cc087a1SEmmanuel Vadot				regulator-min-microvolt = <1060000>;
1598cc087a1SEmmanuel Vadot				regulator-max-microvolt = <1060000>;
1605def4c47SEmmanuel Vadot				regulator-min-microamp = <1500000>;
1615def4c47SEmmanuel Vadot				regulator-max-microamp = <1500000>;
1625def4c47SEmmanuel Vadot				regulator-always-on;
1635def4c47SEmmanuel Vadot			};
1645def4c47SEmmanuel Vadot
1658cc087a1SEmmanuel Vadot			vdd_bmem_bio: bmem-bio-merged {
1665def4c47SEmmanuel Vadot				regulator-min-microvolt = <1200000>;
1675def4c47SEmmanuel Vadot				regulator-max-microvolt = <1200000>;
1685def4c47SEmmanuel Vadot				regulator-min-microamp = <3000000>;
1695def4c47SEmmanuel Vadot				regulator-max-microamp = <3000000>;
1705def4c47SEmmanuel Vadot				regulator-always-on;
1715def4c47SEmmanuel Vadot			};
1725def4c47SEmmanuel Vadot
1735def4c47SEmmanuel Vadot			vdd_ldo1: ldo1 {
1745def4c47SEmmanuel Vadot				regulator-min-microvolt = <1800000>;
1755def4c47SEmmanuel Vadot				regulator-max-microvolt = <1800000>;
1765def4c47SEmmanuel Vadot				regulator-always-on;
1775def4c47SEmmanuel Vadot			};
1785def4c47SEmmanuel Vadot
1795def4c47SEmmanuel Vadot			vdd_ldo2: ldo2 {
1805def4c47SEmmanuel Vadot				regulator-min-microvolt = <1800000>;
1815def4c47SEmmanuel Vadot				regulator-max-microvolt = <1800000>;
1825def4c47SEmmanuel Vadot				regulator-always-on;
1835def4c47SEmmanuel Vadot			};
1845def4c47SEmmanuel Vadot
1855def4c47SEmmanuel Vadot			vdd_ldo3: ldo3 {
1868cc087a1SEmmanuel Vadot				regulator-min-microvolt = <3300000>;
1878cc087a1SEmmanuel Vadot				regulator-max-microvolt = <3300000>;
1885def4c47SEmmanuel Vadot				regulator-always-on;
1895def4c47SEmmanuel Vadot			};
1905def4c47SEmmanuel Vadot
1915def4c47SEmmanuel Vadot			vdd_ldo4: ldo4 {
1928cc087a1SEmmanuel Vadot				regulator-min-microvolt = <2500000>;
1938cc087a1SEmmanuel Vadot				regulator-max-microvolt = <2500000>;
1945def4c47SEmmanuel Vadot				regulator-always-on;
1955def4c47SEmmanuel Vadot			};
1965def4c47SEmmanuel Vadot
1975def4c47SEmmanuel Vadot			vdd_ldo5: ldo5 {
1988cc087a1SEmmanuel Vadot				regulator-min-microvolt = <3300000>;
1998cc087a1SEmmanuel Vadot				regulator-max-microvolt = <3300000>;
2005def4c47SEmmanuel Vadot				regulator-always-on;
2015def4c47SEmmanuel Vadot			};
2025def4c47SEmmanuel Vadot
2035def4c47SEmmanuel Vadot			vdd_ldo6: ldo6 {
2048cc087a1SEmmanuel Vadot				regulator-min-microvolt = <1800000>;
2058cc087a1SEmmanuel Vadot				regulator-max-microvolt = <1800000>;
2065def4c47SEmmanuel Vadot				regulator-always-on;
2075def4c47SEmmanuel Vadot			};
2085def4c47SEmmanuel Vadot
2095def4c47SEmmanuel Vadot			vdd_ldo7: ldo7 {
2108cc087a1SEmmanuel Vadot				regulator-min-microvolt = <3300000>;
2118cc087a1SEmmanuel Vadot				regulator-max-microvolt = <3300000>;
2125def4c47SEmmanuel Vadot				regulator-always-on;
2135def4c47SEmmanuel Vadot			};
2145def4c47SEmmanuel Vadot
2155def4c47SEmmanuel Vadot			vdd_ldo8: ldo8 {
2168cc087a1SEmmanuel Vadot				regulator-min-microvolt = <3300000>;
2178cc087a1SEmmanuel Vadot				regulator-max-microvolt = <3300000>;
2185def4c47SEmmanuel Vadot				regulator-always-on;
2195def4c47SEmmanuel Vadot			};
2205def4c47SEmmanuel Vadot
2215def4c47SEmmanuel Vadot			vdd_ld09: ldo9 {
2225def4c47SEmmanuel Vadot				regulator-min-microvolt = <1050000>;
2235def4c47SEmmanuel Vadot				regulator-max-microvolt = <1050000>;
2248cc087a1SEmmanuel Vadot				regulator-always-on;
2255def4c47SEmmanuel Vadot			};
2265def4c47SEmmanuel Vadot
2275def4c47SEmmanuel Vadot			vdd_ldo10: ldo10 {
2285def4c47SEmmanuel Vadot				regulator-min-microvolt = <1000000>;
2295def4c47SEmmanuel Vadot				regulator-max-microvolt = <1000000>;
2308cc087a1SEmmanuel Vadot				regulator-always-on;
2315def4c47SEmmanuel Vadot			};
2325def4c47SEmmanuel Vadot
2335def4c47SEmmanuel Vadot			vdd_ldo11: ldo11 {
2345def4c47SEmmanuel Vadot				regulator-min-microvolt = <2500000>;
2355def4c47SEmmanuel Vadot				regulator-max-microvolt = <2500000>;
2365def4c47SEmmanuel Vadot				regulator-always-on;
2375def4c47SEmmanuel Vadot			};
2385def4c47SEmmanuel Vadot		};
2395def4c47SEmmanuel Vadot	};
2405def4c47SEmmanuel Vadot};
2415def4c47SEmmanuel Vadot
2425def4c47SEmmanuel Vadot&qspi0 {
2435def4c47SEmmanuel Vadot	status = "okay";
2445def4c47SEmmanuel Vadot	flash@0 {
2458cc087a1SEmmanuel Vadot		compatible = "jedec,spi-nor";
2465def4c47SEmmanuel Vadot		reg = <0>;
2475def4c47SEmmanuel Vadot		spi-max-frequency = <50000000>;
2485def4c47SEmmanuel Vadot		m25p,fast-read;
2495def4c47SEmmanuel Vadot		spi-tx-bus-width = <4>;
2505def4c47SEmmanuel Vadot		spi-rx-bus-width = <4>;
2515def4c47SEmmanuel Vadot	};
2525def4c47SEmmanuel Vadot};
2535def4c47SEmmanuel Vadot
2545def4c47SEmmanuel Vadot&spi0 {
2555def4c47SEmmanuel Vadot	status = "okay";
2565def4c47SEmmanuel Vadot	mmc@0 {
2575def4c47SEmmanuel Vadot		compatible = "mmc-spi-slot";
2585def4c47SEmmanuel Vadot		reg = <0>;
2595def4c47SEmmanuel Vadot		spi-max-frequency = <20000000>;
2605def4c47SEmmanuel Vadot		voltage-ranges = <3300 3300>;
2615def4c47SEmmanuel Vadot		disable-wp;
2628cc087a1SEmmanuel Vadot		gpios = <&gpio 15 GPIO_ACTIVE_LOW>;
2635def4c47SEmmanuel Vadot	};
2645def4c47SEmmanuel Vadot};
2655def4c47SEmmanuel Vadot
2665def4c47SEmmanuel Vadot&eth0 {
2675def4c47SEmmanuel Vadot	status = "okay";
2685def4c47SEmmanuel Vadot	phy-mode = "gmii";
2695def4c47SEmmanuel Vadot	phy-handle = <&phy0>;
2705def4c47SEmmanuel Vadot	phy0: ethernet-phy@0 {
2715def4c47SEmmanuel Vadot		reg = <0>;
2725def4c47SEmmanuel Vadot	};
2735def4c47SEmmanuel Vadot};
2745def4c47SEmmanuel Vadot
2755def4c47SEmmanuel Vadot&pwm0 {
2765def4c47SEmmanuel Vadot	status = "okay";
2775def4c47SEmmanuel Vadot};
2785def4c47SEmmanuel Vadot
2795def4c47SEmmanuel Vadot&pwm1 {
2805def4c47SEmmanuel Vadot	status = "okay";
2815def4c47SEmmanuel Vadot};
2825def4c47SEmmanuel Vadot
2835def4c47SEmmanuel Vadot&gpio {
2845def4c47SEmmanuel Vadot	status = "okay";
2858cc087a1SEmmanuel Vadot	gpio-line-names = "J29.1", "PMICNTB", "PMICSHDN", "J8.1", "J8.3",
2868cc087a1SEmmanuel Vadot		"PCIe_PWREN", "THERM", "UBRDG_RSTN", "PCIe_PERSTN",
2878cc087a1SEmmanuel Vadot		"ULPI_RSTN", "J8.2", "UHUB_RSTN", "GEMGXL_RST", "J8.4",
2888cc087a1SEmmanuel Vadot		"EN_VDD_SD", "SD_CD";
2895def4c47SEmmanuel Vadot};
290