CAINIAO CNIoT-CORE: switch USB 2.0 access from the Type-C port to the four contacts on the side of the host

This commit is contained in:
retro98boy
2025-06-09 21:45:59 +08:00
committed by Igor
parent 22b0414b91
commit c66fbec4e2
3 changed files with 56 additions and 5 deletions

View File

@@ -176,6 +176,23 @@
vin-supply = <&dc_in>;
};
/*
* The Type-C port on the host is switched with the four USB contacts on the side of the host via GPIOA_14.
* Since the Type-C port on the host is either used for power supply or blocked by the dock,
* switching USB 2.0 access to the four contacts on the side of the host is a better choice.
* To use the Type-C port for data transmission,
* you only need to set GPIOA_14 in the node below to a high level.
*/
usb_switch: regulator-usb-switch {
compatible = "regulator-fixed";
enable-active-low;
gpio = <&gpio GPIOA_14 GPIO_ACTIVE_LOW>;
regulator-name = "usb_switch";
regulator-always-on;
regulator-boot-on;
vin-supply = <&dc_in>;
};
vdd_amp: regulator-vdd-amp {
compatible = "regulator-fixed";
enable-active-high;
@@ -558,7 +575,7 @@
};
&usb2_phy1 {
phy-supply = <&amp_power>;
phy-supply = <&usb_switch>;
};
&usb3_pcie_phy {

View File

@@ -176,6 +176,23 @@
vin-supply = <&dc_in>;
};
/*
* The Type-C port on the host is switched with the four USB contacts on the side of the host via GPIOA_14.
* Since the Type-C port on the host is either used for power supply or blocked by the dock,
* switching USB 2.0 access to the four contacts on the side of the host is a better choice.
* To use the Type-C port for data transmission,
* you only need to set GPIOA_14 in the node below to a high level.
*/
usb_switch: regulator-usb-switch {
compatible = "regulator-fixed";
enable-active-low;
gpio = <&gpio GPIOA_14 GPIO_ACTIVE_LOW>;
regulator-name = "usb_switch";
regulator-always-on;
regulator-boot-on;
vin-supply = <&dc_in>;
};
vdd_amp: regulator-vdd-amp {
compatible = "regulator-fixed";
enable-active-high;
@@ -558,7 +575,7 @@
};
&usb2_phy1 {
phy-supply = <&amp_power>;
phy-supply = <&usb_switch>;
};
&usb3_pcie_phy {

View File

@@ -128,10 +128,10 @@ index 00000000..345d9b86
+CONFIG_ZSTD=y
diff --git a/dts/upstream/src/arm64/amlogic/meson-g12b-a311d-cainiao-cniot-core.dts b/dts/upstream/src/arm64/amlogic/meson-g12b-a311d-cainiao-cniot-core.dts
new file mode 100644
index 00000000..40b81e87
index 00000000..53318e9d
--- /dev/null
+++ b/dts/upstream/src/arm64/amlogic/meson-g12b-a311d-cainiao-cniot-core.dts
@@ -0,0 +1,571 @@
@@ -0,0 +1,588 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2019 BayLibre, SAS
@@ -310,6 +310,23 @@ index 00000000..40b81e87
+ vin-supply = <&dc_in>;
+ };
+
+ /*
+ * The Type-C port on the host is switched with the four USB contacts on the side of the host via GPIOA_14.
+ * Since the Type-C port on the host is either used for power supply or blocked by the dock,
+ * switching USB 2.0 access to the four contacts on the side of the host is a better choice.
+ * To use the Type-C port for data transmission,
+ * you only need to set GPIOA_14 in the node below to a high level.
+ */
+ usb_switch: regulator-usb-switch {
+ compatible = "regulator-fixed";
+ enable-active-low;
+ gpio = <&gpio GPIOA_14 GPIO_ACTIVE_LOW>;
+ regulator-name = "usb_switch";
+ regulator-always-on;
+ regulator-boot-on;
+ vin-supply = <&dc_in>;
+ };
+
+ vdd_amp: regulator-vdd-amp {
+ compatible = "regulator-fixed";
+ enable-active-high;
@@ -692,7 +709,7 @@ index 00000000..40b81e87
+};
+
+&usb2_phy1 {
+ phy-supply = <&amp_power>;
+ phy-supply = <&usb_switch>;
+};
+
+&usb3_pcie_phy {