1// SPDX-License-Identifier: GPL-2.0-only
2/*
3 * Oriole Device Tree
4 *
5 * Copyright 2021-2023 Google LLC
6 * Copyright 2023 Linaro Ltd - <[email protected]>
7 */
8
9/dts-v1/;
10
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/usb/pd.h>
14#include "gs101-pinctrl.h"
15#include "gs101.dtsi"
16
17/ {
18	model = "Oriole";
19	compatible = "google,gs101-oriole", "google,gs101";
20
21	aliases {
22		serial0 = &serial_0;
23	};
24
25	chosen {
26		/* Bootloader expects bootargs specified otherwise it crashes */
27		bootargs = "";
28		stdout-path = &serial_0;
29	};
30
31	gpio-keys {
32		compatible = "gpio-keys";
33		pinctrl-0 = <&key_voldown>, <&key_volup>, <&key_power>;
34		pinctrl-names = "default";
35
36		button-vol-down {
37			label = "KEY_VOLUMEDOWN";
38			linux,code = <KEY_VOLUMEDOWN>;
39			gpios = <&gpa7 3 GPIO_ACTIVE_LOW>;
40			wakeup-source;
41		};
42
43		button-vol-up {
44			label = "KEY_VOLUMEUP";
45			linux,code = <KEY_VOLUMEUP>;
46			gpios = <&gpa8 1 GPIO_ACTIVE_LOW>;
47			wakeup-source;
48		};
49
50		button-power {
51			label = "KEY_POWER";
52			linux,code = <KEY_POWER>;
53			gpios = <&gpa10 1 GPIO_ACTIVE_LOW>;
54			wakeup-source;
55		};
56	};
57
58	/* TODO: Remove this once PMIC is implemented  */
59	reg_placeholder: regulator-0 {
60		compatible = "regulator-fixed";
61		regulator-name = "placeholder_reg";
62	};
63
64	/* TODO: Remove this once S2MPG11 slave PMIC is implemented  */
65	ufs_0_fixed_vcc_reg: regulator-1 {
66		compatible = "regulator-fixed";
67		regulator-name = "ufs-vcc";
68		gpio = <&gpp0 1 GPIO_ACTIVE_HIGH>;
69		regulator-boot-on;
70		enable-active-high;
71	};
72};
73
74&ext_24_5m {
75	clock-frequency = <24576000>;
76};
77
78&ext_200m {
79	clock-frequency = <200000000>;
80};
81
82&hsi2c_8 {
83	status = "okay";
84
85	eeprom: eeprom@50 {
86		compatible = "atmel,24c08";
87		reg = <0x50>;
88	};
89};
90
91&hsi2c_12 {
92	status = "okay";
93	/* TODO: add the devices once drivers exist */
94
95	usb-typec@25 {
96		compatible = "maxim,max77759-tcpci", "maxim,max33359";
97		reg = <0x25>;
98		interrupts-extended = <&gpa8 2 IRQ_TYPE_LEVEL_LOW>;
99		pinctrl-0 = <&typec_int>;
100		pinctrl-names = "default";
101
102		connector {
103			compatible = "usb-c-connector";
104			label = "USB-C";
105			data-role = "dual";
106			power-role = "dual";
107			self-powered;
108			try-power-role = "sink";
109			op-sink-microwatt = <2600000>;
110			slow-charger-loop;
111			/*
112			 * max77759 operating in reverse boost mode (0xA) can
113			 * source up to 1.5A while extboost can only do ~1A.
114			 * Since extboost is the primary path, advertise 900mA.
115			 */
116			source-pdos = <PDO_FIXED(5000, 900,
117						 (PDO_FIXED_SUSPEND
118						  | PDO_FIXED_USB_COMM
119						  | PDO_FIXED_DATA_SWAP
120						  | PDO_FIXED_DUAL_ROLE))>;
121			sink-pdos = <PDO_FIXED(5000, 3000,
122					       (PDO_FIXED_DATA_SWAP
123						| PDO_FIXED_USB_COMM
124						| PDO_FIXED_HIGHER_CAP
125						| PDO_FIXED_DUAL_ROLE))
126				     PDO_FIXED(9000, 2200, 0)
127				     PDO_PPS_APDO(5000, 11000, 3000)>;
128			sink-vdos = <VDO_IDH(1, 1, IDH_PTYPE_PERIPH, 0,
129					     IDH_PTYPE_DFP_HOST, 2, 0x18d1)
130				     VDO_CERT(0x0)
131				     VDO_PRODUCT(0x4ee1, 0x0)
132				     VDO_UFP(UFP_VDO_VER1_2,
133					     (DEV_USB2_CAPABLE
134					      | DEV_USB3_CAPABLE),
135					     UFP_RECEPTACLE, 0,
136					     AMA_VCONN_NOT_REQ, 0,
137					     UFP_ALTMODE_NOT_SUPP,
138					     UFP_USB32_GEN1)
139				     /* padding */ 0
140				     VDO_DFP(DFP_VDO_VER1_1,
141					     (HOST_USB2_CAPABLE
142					      | HOST_USB3_CAPABLE),
143					     DFP_RECEPTACLE, 0)>;
144			sink-vdos-v1 = <VDO_IDH(1, 1, IDH_PTYPE_PERIPH, 0,
145						0, 0, 0x18d1)
146					VDO_CERT(0x0)
147					VDO_PRODUCT(0x4ee1, 0x0)>;
148			/*
149			 * Until bootloader is updated to set those two when
150			 * console is enabled, we disable PD here.
151			 */
152			pd-disable;
153			typec-power-opmode = "default";
154
155			ports {
156				#address-cells = <1>;
157				#size-cells = <0>;
158
159				port@0 {
160					reg = <0>;
161
162					usbc0_orien_sw: endpoint {
163						remote-endpoint = <&usbdrd31_phy_orien_switch>;
164					};
165				};
166
167				port@1 {
168					reg = <1>;
169
170					usbc0_role_sw: endpoint {
171						remote-endpoint = <&usbdrd31_dwc3_role_switch>;
172					};
173				};
174			};
175		};
176	};
177};
178
179&pinctrl_far_alive {
180	key_voldown: key-voldown-pins {
181		samsung,pins = "gpa7-3";
182		samsung,pin-function = <GS101_PIN_FUNC_EINT>;
183		samsung,pin-pud = <GS101_PIN_PULL_NONE>;
184		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
185	};
186
187	key_volup: key-volup-pins {
188		samsung,pins = "gpa8-1";
189		samsung,pin-function = <GS101_PIN_FUNC_EINT>;
190		samsung,pin-pud = <GS101_PIN_PULL_NONE>;
191		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
192	};
193
194	typec_int: typec-int-pins {
195		samsung,pins = "gpa8-2";
196		samsung,pin-function = <GS101_PIN_FUNC_EINT>;
197		samsung,pin-pud = <GS101_PIN_PULL_UP>;
198		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
199	};
200};
201
202&pinctrl_gpio_alive {
203	key_power: key-power-pins {
204		samsung,pins = "gpa10-1";
205		samsung,pin-function = <GS101_PIN_FUNC_EINT>;
206		samsung,pin-pud = <GS101_PIN_PULL_NONE>;
207		samsung,pin-drv = <GS101_PIN_DRV_2_5_MA>;
208	};
209};
210
211&serial_0 {
212	status = "okay";
213};
214
215&ufs_0 {
216	status = "okay";
217	vcc-supply = <&ufs_0_fixed_vcc_reg>;
218};
219
220&ufs_0_phy {
221	status = "okay";
222};
223
224&usbdrd31 {
225	vdd10-supply = <&reg_placeholder>;
226	vdd33-supply = <&reg_placeholder>;
227	status = "okay";
228};
229
230&usbdrd31_dwc3 {
231	dr_mode = "otg";
232	usb-role-switch;
233	role-switch-default-mode = "peripheral";
234	maximum-speed = "super-speed-plus";
235	status = "okay";
236
237	port {
238		usbdrd31_dwc3_role_switch: endpoint {
239			remote-endpoint = <&usbc0_role_sw>;
240		};
241	};
242};
243
244&usbdrd31_phy {
245	orientation-switch;
246	/* TODO: Update these once PMIC is implemented */
247	pll-supply = <&reg_placeholder>;
248	dvdd-usb20-supply = <&reg_placeholder>;
249	vddh-usb20-supply = <&reg_placeholder>;
250	vdd33-usb20-supply = <&reg_placeholder>;
251	vdda-usbdp-supply = <&reg_placeholder>;
252	vddh-usbdp-supply = <&reg_placeholder>;
253	status = "okay";
254
255	port {
256		usbdrd31_phy_orien_switch: endpoint {
257			remote-endpoint = <&usbc0_orien_sw>;
258		};
259	};
260};
261
262&usi_uart {
263	samsung,clkreq-on; /* needed for UART mode */
264	status = "okay";
265};
266
267&usi8 {
268	samsung,mode = <USI_V2_I2C>;
269	status = "okay";
270};
271
272&usi12 {
273	samsung,mode = <USI_V2_I2C>;
274	status = "okay";
275};
276
277&watchdog_cl0 {
278	timeout-sec = <30>;
279	status = "okay";
280};
281