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