From patchwork Fri Feb 9 11:05:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrejs Cainikovs X-Patchwork-Id: 13551084 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44C98C48297 for ; Fri, 9 Feb 2024 11:06:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=nutMASDHhGMdRcsVkuF74XPFlEsO/pPMp2g1199CO70=; b=IwRryaRxQJyBr9 eHBqrN2717RvUnRWfW0/pBU7HfzFQO6i6JP/sq7nAeUQFL6zZnMOTmodZOULG+JYrIwEI7cMNgNU3 MrAgdSP+WvvGWkekXcVb9IX4pOAKS/d/cC/XlvryDNjMD/vi1Ic8iJ+TvuQKDvcGFNuty/PrjHykU 5wS3/IbHlOO1NKD65XQGIbgwzoJQhi+NUZfsgY181nE3+I3x7vmZOYBJtJOnB4xGULW86lGB2CP6i 8mjh2TXyrxrt9dDzg680fGVyFTE9mBTr3sobiOMCDoBtMimwav5fqMNqzhIW0N1QW+SOo+MmXcLY6 NmniPIUmedzHhNEc1hIw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYOhZ-0000000GngJ-1jsE; Fri, 09 Feb 2024 11:05:49 +0000 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rYOhW-0000000Gnfa-4AzJ for linux-arm-kernel@lists.infradead.org; Fri, 09 Feb 2024 11:05:48 +0000 Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-a389ea940f1so92794866b.3 for ; Fri, 09 Feb 2024 03:05:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707476745; x=1708081545; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xbaeKdjw60cNsDBZcRkItqfkpOC+hAL3qmMor2xymZ0=; b=a+be9jK2IsNTRNws3WeIOfdb+y/7rOMO+M5B40mgfnB84xCQbiu2r7UYRI3sQTh1W1 deSbrzlTlUDSzCHUciVP95z7z0ygUiIx2X/jSsPob9OuG/oI37TvP1wOkIE6BEeF0BN7 zAOuwjtyj+3cbgSZfhyYRzOUhX7lK2+m1LeVRcPtkJqrXTKaiHeBNIwTGHtGO94CQQkX gKO3PbPQenAwPh1c7IDXk2z8rNFLjVMPZlTxuOKQn5H3hEaG1XX6x3CgPVDymfknYk2A SuaMqxH3sp9pMBmJuSahiLJytk6mWlEumpMQp6p2g8HPcQeUNqJRex4o/1RJM3h+T3dE 1BdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707476745; x=1708081545; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xbaeKdjw60cNsDBZcRkItqfkpOC+hAL3qmMor2xymZ0=; b=GPIrHwD+9wvY6PYC8Wg46slfWyTKgu1hk3SJ2y3cyv/OvQyMNCAyVGrsmRym/4Vipp 10hQgWYNLVNrg8WByvvwtLuPeAvTuDFeGlGSTYrjsgpuPQZXwsOYluWbIYp/ib8khGVv 2L6aXjPiKKsVPmz7NxuOaOi4zjRYg4Hj+wwj5heQhS+3iNBMH390m+USfLNH63d/VRMb TnR/wsUU18/aeYG3Vaa2MM9XXP8NsVNt/1VHdI0O3yJNNLPYyLGwMm+BWJVLagkITQye N19olVe6nByG9P11LLaEoLVEzhlq6tcVJhiXimzh9lh/mijOUeDbzt1V14VZveL++SFZ 921Q== X-Gm-Message-State: AOJu0Yy0HKasEtXkQm+zkOx/q9/ztPMHqbpwmuTk7Ge1k8wiGD8pVu9N ntW35M54F0qYt6+uTk2wnmRByWTcoXky41A4dY5FNl92MfGDr7Vp X-Google-Smtp-Source: AGHT+IF1K8ViNAW3P+fefZz4G5jK2tN/Sn4NqbfifXPw2j4rGzGbZ3qD3nbaSf+I5j4uU3afSLWW3Q== X-Received: by 2002:a17:906:2dc6:b0:a38:42f4:dfb6 with SMTP id h6-20020a1709062dc600b00a3842f4dfb6mr958758eji.63.1707476744531; Fri, 09 Feb 2024 03:05:44 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCU8H9Oqo/86n65sM39xyh0B3MD99Tc97Z87eRmLSOIKEQOZIhRAIBKUqlG3ky3zVbtYSeUy4MFPnGhr502vVr1VxSSzk6MeGqFCMbBrKkC7ch/5K+p7MhoD3I2HV+/rrhoUkWDLzTKTyl1oZ481k3BVQn4qhwft7Lk/peodlBjH0kRmHN9dgFaTjX7kinuKBKENYrj1BonzTLa1EMGbsiMDIG9tT9DQU8FgrjYxYQDgfbdzhNNZpHBpT03RoVo2OWTC+SXl5GoSyaRhDJyJYCuLfGGZUqX3YMYHNjlevSCeUxbC/e643moYXTCxFz7Uj+vGzLQPyIlptoubOH7EUw== Received: from andrejs-nb.int.toradex.com (77-59-154-235.dclient.hispeed.ch. [77.59.154.235]) by smtp.gmail.com with ESMTPSA id kh20-20020a170906f81400b00a35cd148c7esm637832ejb.212.2024.02.09.03.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 03:05:43 -0800 (PST) From: Andrejs Cainikovs To: Nishanth Menon , Vignesh Raghavendra , Tero Kristo , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: Andrejs Cainikovs , linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] arm64: dts: ti: verdin-am62: add support for Verdin USB1 interface Date: Fri, 9 Feb 2024 12:05:00 +0100 Message-Id: <20240209110500.22193-1-andrejs.cainikovs@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240209_030547_062580_F57A44B3 X-CRM114-Status: GOOD ( 13.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Andrejs Cainikovs Add support for Verdin USB1 interface, implements role switch functionality using "gpio-usb-b-connector", VBUS is also now controlled with "regulator-fixed" using a standard GPIO. Signed-off-by: Andrejs Cainikovs Reviewed-by: Francesco Dolcini --- arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi | 55 +++++++++++++++++----- 1 file changed, 44 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi index 6a06724b6d16..bfd44f4a15cf 100644 --- a/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62-verdin.dtsi @@ -42,6 +42,22 @@ aliases { usb1 = &usb1; }; + connector { + compatible = "gpio-usb-b-connector", "usb-b-connector"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_id>; + id-gpios = <&main_gpio1 19 GPIO_ACTIVE_HIGH>; + label = "USB_1"; + self-powered; + vbus-supply = <®_usb0_vbus>; + + port { + usb_dr_connector: endpoint { + remote-endpoint = <&usb0_ep>; + }; + }; + }; + verdin_gpio_keys: gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -151,6 +167,18 @@ reg_sdhc1_vqmmc: regulator-sdhci1-vqmmc { vin-supply = <®_sd_3v3_1v8>; }; + reg_usb0_vbus: regulator-usb0-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_usb0_en>; + enable-active-high; + /* Verdin USB_1_EN (SODIMM 155) */ + gpio = <&main_gpio1 50 GPIO_ACTIVE_HIGH>; + regulator-max-microvolt = <5000000>; + regulator-min-microvolt = <5000000>; + regulator-name = "USB_1_EN"; + }; + reserved-memory { #address-cells = <2>; #size-cells = <2>; @@ -436,6 +464,13 @@ AM62X_IOPAD(0x0244, PIN_INPUT_PULLUP, 7) /* (C17) MMC1_SDWP.GPIO1_49 */ /* SODIM >; }; + /* Verdin USB_1_EN */ + pinctrl_usb0_en: main-gpio1-50-default-pins { + pinctrl-single,pins = < + AM62X_IOPAD(0x0254, PIN_INPUT, 7) /* (C20) USB0_DRVVBUS.GPIO1_50 */ /* SODIMM 155 */ + >; + }; + /* On-module I2C - PMIC_I2C */ pinctrl_i2c0: main-i2c0-default-pins { pinctrl-single,pins = < @@ -660,13 +695,6 @@ AM62X_IOPAD(0x0038, PIN_OUTPUT, 5) /* (E24) OSPI0_CSn3.UART5_TXD */ /* >; }; - /* Verdin USB_1 */ - pinctrl_usb0: main-usb0-default-pins { - pinctrl-single,pins = < - AM62X_IOPAD(0x0254, PIN_OUTPUT, 0) /* (C20) USB0_DRVVBUS */ /* SODIMM 155 */ - >; - }; - /* Verdin USB_2 */ pinctrl_usb1: main-usb1-default-pins { pinctrl-single,pins = < @@ -1013,7 +1041,7 @@ &main_gpio1 { "", "", "SODIMM_17", - "", /* 50 */ + "SODIMM 155", /* 50 */ "", "", "", @@ -1428,11 +1456,16 @@ &usbss0 { status = "disabled"; }; -/* TODO: role swich using ID pin */ &usb0 { - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_usb0>, <&pinctrl_usb0_id>; + adp-disable; + usb-role-switch; status = "disabled"; + + port { + usb0_ep: endpoint { + remote-endpoint = <&usb_dr_connector>; + }; + }; }; /* Verdin USB_2 */