diff options
Diffstat (limited to 'zephyr/test/kingler/kingler.usbc.overlay')
-rw-r--r-- | zephyr/test/kingler/kingler.usbc.overlay | 118 |
1 files changed, 118 insertions, 0 deletions
diff --git a/zephyr/test/kingler/kingler.usbc.overlay b/zephyr/test/kingler/kingler.usbc.overlay new file mode 100644 index 0000000000..b697edf791 --- /dev/null +++ b/zephyr/test/kingler/kingler.usbc.overlay @@ -0,0 +1,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 >; + }; +}; |