summaryrefslogtreecommitdiff
path: root/zephyr/test/kingler/kingler.usbc.overlay
blob: b697edf79184f7097ec5e0728f3926a103cce6ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/* Copyright 2023 The ChromiumOS Authors
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#include <zephyr/dt-bindings/gpio/gpio.h>
#include <dt-bindings/usb_pd_tcpm.h>

#include "common.dtsi"
#include "../program/corsola/npcx_interrupts.dtsi"
#include "../program/corsola/npcx_gpio.dtsi"
#include "../program/corsola/usba.dtsi"

/ {
	usbc {
		port0@0 {
			bc12 = <&pi3usb9201_emul0>;
			tcpc = <&anx7447_emul0>;
			ppc = <&nx20p348x_emul0>;
			chg = <&charger_emul>;
			usb-mux-chain-0 {
				compatible = "cros-ec,usb-mux-chain";
				usb-muxes = <&virtual_mux_0>;
			};
		};

		port1@1 {
			/* We have rt1718s emulator, but use tcpci_emul instead
			 * for better test integration of the GPIO pin control.
			 */
			tcpc = <&rt1718s_emul1>;
			ppc = <&nx20p348x_emul1>;
			usb_mux_chain_1_hdmi_db: usb-mux-chain-1-hdmi-db {
				compatible = "cros-ec,usb-mux-chain";
				alternative-chain;
				usb-muxes = <&virtual_mux_1>;
			};
		};
	};

	batteries {
		default_battery: lgc_ac17a8m {
			compatible = "lgc,ac17a8m", "battery-smart";
			/**
			 * this has to be strictly lower than the desired
			 * voltage in smart battery emulator (5000mV).
			 */
			voltage_min = <4000>;
		};
	};
};

&i2c_ctrl0 {
	anx7447_emul0: anx7447_emul@2c {
		compatible = "cros,anx7447-tcpc-emul";
		status = "okay";
		reg = <0x2c>;
		tcpc-flags = <(
			TCPC_FLAGS_VBUS_MONITOR |
			TCPC_FLAGS_ALERT_OD |
			TCPC_FLAGS_CONTROL_VCONN |
			TCPC_FLAGS_CONTROL_FRS)>;
	};

	/* TODO: drop this node when the Kconfig dependency is fixed. */
	tcpci_emul0: tcpci_emul@82 {
		compatible = "cros,tcpci-generic-emul";
		status = "okay";
		reg = <0x82>;
	};

	nx20p348x_emul0: nx20p348x_emul@71 {
		compatible = "nxp,nx20p348x";
		status = "okay";
		reg = <0x71>;
		irq-gpios = < &gpio6 7 GPIO_ACTIVE_HIGH>;
	};

	pi3usb9201_emul0: pi3usb9201@5d {
		compatible = "pericom,pi3usb9201";
		reg = <0x5d>;
		irq = <&int_usb_c0_bc12>;
	};
};

&i2c_ctrl3 {
	status = "okay";

	charger_emul: isl923x@9 {
		compatible = "cros,isl923x-emul";
		status = "okay";
		reg = <0x9>;
		battery = <&battery>;
	};

	rt1718s_emul1: rt1718s_emul@2c {
		compatible = "cros,rt1718s-tcpc-emul", "richtek,rt1718s-tcpc";
		status = "okay";
		reg = <0x2c>;
		tcpc-flags = <(TCPC_FLAGS_ALERT_OD |
			TCPC_FLAGS_CONTROL_VCONN |
			TCPC_FLAGS_CONTROL_FRS)>;
	};

	/* TODO: drop this node when the Kconfig dependency is fixed. */
	tcpci_emul1: tcpci_emul@82 {
		compatible = "cros,tcpci-generic-emul";
		status = "okay";
		reg = <0x82>;
	};

	nx20p348x_emul1: nx20p348x_emul@71 {
	        compatible = "nxp,nx20p348x";
	        status = "okay";
	        reg = <0x71>;
		irq-gpios = < &gpiod 4 GPIO_ACTIVE_HIGH >;
	};
};