summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Schenker <philippe.schenker@toradex.com>2022-11-02 16:58:01 +0100
committerPhilippe Schenker <philippe.schenker@toradex.com>2022-11-02 16:59:53 +0100
commita9d1419f9cca3f3d86590cfca49db5be990b3b81 (patch)
treef510ca102da88a403d64f68ca1ac293d0179b59c
parentbe8cf57e1bf2ccb049923a62787a6a90efd58a4c (diff)
linux-toradex-mainline: Support usb otg on colibri-imx6ull
This commit adds two patches to our upstream kernel that solves the reset loop and the OTG device-host dual-role switching Related-to: ELB-4790, ELB-4610 Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-git/0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch50
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch39
-rw-r--r--recipes-kernel/linux/linux-toradex-mainline_git.bb2
3 files changed, 91 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch
new file mode 100644
index 0000000..4582f07
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-mainline-git/0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch
@@ -0,0 +1,50 @@
+From 35f50699d4d17dbd3b116ea4d3c9f349567d3805 Mon Sep 17 00:00:00 2001
+From: Philippe Schenker <philippe.schenker@toradex.com>
+Date: Wed, 19 Oct 2022 17:59:13 +0200
+Subject: [PATCH 1/2] ARM: dts: colibri-imx6ull: Enable dual-role switching
+
+The Colibri standard provides a GPIO called USBC_DET to switch from
+USB Host to USB Device and back. The Colibri iMX6ULL does have the SoC
+ball USB_OTG1_VBUS connected in series with a capacitor to ground.
+
+This means that we need to provide to the extcon framework VBUS and ID
+events using the single GPIO we have. The Extcon USB GPIO driver does
+use id-gpio also for VBUS event, as in our case where vbus-gpio is
+absent.
+
+Upstream-Status: Submitted [https://lore.kernel.org/linux-devicetree/20221102155226.51587-1-dev@pschenker.ch]
+
+Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
+---
+ arch/arm/boot/dts/imx6ull-colibri.dtsi | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
+index 577a424b0e1d..feb1fcd9a684 100644
+--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
++++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
+@@ -24,6 +24,13 @@ backlight: backlight {
+ status = "okay";
+ };
+
++ extcon_usbc_det: usbc-det {
++ compatible = "linux,extcon-usb-gpio";
++ id-gpio = <&gpio5 2 GPIO_ACTIVE_HIGH>; /* SODIMM 137 / USBC_DET */
++ pinctrl-names = "default";
++ pinctrl-0 = <&pinctrl_snvs_usbc_det>;
++ };
++
+ gpio-keys {
+ compatible = "gpio-keys";
+ pinctrl-names = "default";
+@@ -275,6 +282,7 @@ &uart5 {
+ /* Colibri USBC */
+ &usbotg1 {
+ dr_mode = "otg";
++ extcon = <&extcon_usbc_det>, <&extcon_usbc_det>;
+ srp-disable;
+ hnp-disable;
+ adp-disable;
+--
+2.38.0
+
diff --git a/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch b/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch
new file mode 100644
index 0000000..9286c47
--- /dev/null
+++ b/recipes-kernel/linux/linux-toradex-mainline-git/0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch
@@ -0,0 +1,39 @@
+From 4fe56e7be311f93b67411ae092754af908c57d73 Mon Sep 17 00:00:00 2001
+From: Philippe Schenker <philippe.schenker@toradex.com>
+Date: Wed, 2 Nov 2022 14:25:56 +0100
+Subject: [PATCH 2/2] drivers: chipidea: disable runtime-pm for imx6ul
+
+Colibri iMX6ULL does not properly work with runtime-pm enabled. We see
+two issues with that enabled:
+
+1. Runtime PM disconnects the line as it thinks there is no VBUS -
+ because this signal is not hooked up in hardware. The driver gets a
+ wakeup signal from the attached hub after about 2s which leads to a
+ reset loop.
+2. In Dual-Role switching mode usb-device is not detected when plugged
+ in. The reason was never fully understood.
+
+Upstream-Status: Inappropriate [Configuration for colibri-imx6ull]
+
+Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
+---
+ drivers/usb/chipidea/ci_hdrc_imx.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/drivers/usb/chipidea/ci_hdrc_imx.c b/drivers/usb/chipidea/ci_hdrc_imx.c
+index 9ffcecd3058c..de6de10dbd1b 100644
+--- a/drivers/usb/chipidea/ci_hdrc_imx.c
++++ b/drivers/usb/chipidea/ci_hdrc_imx.c
+@@ -56,8 +56,7 @@ static const struct ci_hdrc_imx_platform_flag imx6sx_usb_data = {
+ };
+
+ static const struct ci_hdrc_imx_platform_flag imx6ul_usb_data = {
+- .flags = CI_HDRC_SUPPORTS_RUNTIME_PM |
+- CI_HDRC_TURN_VBUS_EARLY_ON |
++ .flags = CI_HDRC_TURN_VBUS_EARLY_ON |
+ CI_HDRC_DISABLE_DEVICE_STREAMING,
+ };
+
+--
+2.38.0
+
diff --git a/recipes-kernel/linux/linux-toradex-mainline_git.bb b/recipes-kernel/linux/linux-toradex-mainline_git.bb
index f230721..1af4924 100644
--- a/recipes-kernel/linux/linux-toradex-mainline_git.bb
+++ b/recipes-kernel/linux/linux-toradex-mainline_git.bb
@@ -34,6 +34,8 @@ SRC_URI:append = " \
file://0003-arm-dts-colibri-imx6-specify-usbh_pen-gpio-being-act.patch \
file://0001-arm-dts-colibri-imx6ull-keep-peripherals-disabled.patch \
file://0002-arm-dts-colibri-imx6ull-enable-default-peripherals.patch \
+ file://0001-ARM-dts-colibri-imx6ull-Enable-dual-role-switching.patch \
+ file://0002-drivers-chipidea-disable-runtime-pm-for-imx6ul.patch \
"
LINUX_VERSION ?= "6.0.6"