From patchwork Thu Jan 12 16:28:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sjoerd Simons X-Patchwork-Id: 13098319 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 2D42AC54EBD for ; Thu, 12 Jan 2023 16:30:37 +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:References:In-Reply-To: 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: List-Owner; bh=Nhx57BSYzLBZtJJrqeA4TFPuS9yVdE1aWnYzrex7PDA=; b=Mr6OSWBm3vCAlj fZQoW/kV7IApMU13HHC0A6qYCzlylNXmBusiA2xSj/Qi1W/ho19DgH3Mkbiy12YTyFgByY3AbzWz9 lLUSa8FT1K6lv1RlcfrOkn0elCnK9B82gANQ3S2JnkKIBnFH2bbsTBxE5PbiijSORzKHW4YqDBhMI hST/VHqlqGGpqw8KPP2IcU0EFKCgOytWExSrEz05Rg6RkpYQ7QqXvycVEeTt441MTV3hBnm9eoT0q Gp7x1sYDVHPt55Xx5CoH/JIVHVpTNCzywT/88mYCZ4ZEcyXTBRxwpoFjcE0X+6T4Y3XNTklsRoMLv YxLy02J2MkwyuS0JZVEw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG0SN-00FqI4-0R; Thu, 12 Jan 2023 16:29:35 +0000 Received: from madras.collabora.co.uk ([2a00:1098:0:82:1000:25:2eeb:e5ab]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pG0Rk-00Fq9g-Ia for linux-arm-kernel@lists.infradead.org; Thu, 12 Jan 2023 16:29:09 +0000 Received: from beast.luon.net (simons.connected.by.freedominter.net [45.83.240.172]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: sjoerd) by madras.collabora.co.uk (Postfix) with ESMTPSA id CC3896602DCD; Thu, 12 Jan 2023 16:28:52 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673540932; bh=mb1FOmjwtW1XJfBII8bu1T9OEKm0ryg8UdzWb6jiwz8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GDj+66P6Jq6nxjfTsAUXbid+fH+RXws6EFwipMscRCCT65IRouCT8Pee58MZxwBS2 oQpOjfq1b1ajNuiZhcspvuJ346KCt3/USKbcmya6JjllrlWSI4t+DKEK735UEdf7qz yJzgfSY6usRCaGrmg11sLObv+LdLPgw4OGA8ykZKjZ3WGtyHnd6mSkN4SaJqdPkO7K x2oEgTXf/oZtJ0GySo9KUsRzDIlXtviFYGaX2UDPKAYgdB92UvxpBwJcMMdAh9p/ZJ gEMkGZ3QdzBXlNnm/zdWvS1BVJANBumIZ0u4uIVMT2VZoyb+KfOEJpPJvDp+qg6d4s VWNgCbYzeIY/Q== Received: by beast.luon.net (Postfix, from userid 1000) id 656A360E4F23; Thu, 12 Jan 2023 17:28:50 +0100 (CET) From: Sjoerd Simons To: Nishanth Menon Cc: kernel@collabora.com, Nitin Yadav , martyn.welch@collabora.com, Aswath Govindraju , Vignesh Raghavendra , Krzysztof Kozlowski , Rob Herring , Tero Kristo , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 3/3] arm64: dts: ti: k3-am625-sk: Add support for USB Date: Thu, 12 Jan 2023 17:28:46 +0100 Message-Id: <20230112162847.973869-4-sjoerd@collabora.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112162847.973869-1-sjoerd@collabora.com> References: <20230112162847.973869-1-sjoerd@collabora.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230112_082906_323335_EB408895 X-CRM114-Status: GOOD ( 16.71 ) 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: Aswath Govindraju AM62 SoC has two instances of USB and they are brought on to the board in the following way, -> USB0 instance - This is brought out to a USB TypeC connector on board through TPS6598 PD controller. The PD controller should decide the role based on CC pin in the connector. Unfortunately the irq line for the TPS isn't hooked up which is a mode not yet support by the driver (some patches were submitted earlier this year[0]). So for now the PD controller is left out and peripheral mode chosen. -> USB1 instance - This is brought out to a USB TypeA connector on board. Therefore, add the required device tree support for the above in the board dts file. 0: https://lore.kernel.org/lkml/f714ee55-ef47-317d-81b9-57020dda064b@ti.com/T/ Signed-off-by: Aswath Govindraju Signed-off-by: Vignesh Raghavendra [merge from vendor bsp, drop TPS6598 support, drop unneeded nodes, reword commit message] Signed-off-by: Sjoerd Simons Tested-by: Martyn Welch --- Changes in v4: - Disable new usbss nodes by default in the dtsi and enable in the dts - Drop unneeded disabled nodes in board dts - Drop unneeded nodes - Enable usbss nodes - Small typo fix Changes in v3: - Rebased against current ti-next aka 6.2-rc1 - Add Martyn's tested-by Changes in v2: - Rebase against linux-next 20221220 arch/arm64/boot/dts/ti/k3-am625-sk.dts | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am625-sk.dts b/arch/arm64/boot/dts/ti/k3-am625-sk.dts index 4f179b146cab..6bc7d63cf52f 100644 --- a/arch/arm64/boot/dts/ti/k3-am625-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am625-sk.dts @@ -24,6 +24,8 @@ aliases { spi0 = &ospi0; ethernet0 = &cpsw_port1; ethernet1 = &cpsw_port2; + usb0 = &usb0; + usb1 = &usb1; }; chosen { @@ -284,6 +286,12 @@ main_gpio1_ioexp_intr_pins_default: main-gpio1-ioexp-intr-pins-default { AM62X_IOPAD(0x01d4, PIN_INPUT, 7) /* (B15) UART0_RTSn.GPIO1_23 */ >; }; + + main_usb1_pins_default: main-usb1-pins-default { + pinctrl-single,pins = < + AM62X_IOPAD(0x0258, PIN_OUTPUT, 0) /* (F18) USB1_DRVVBUS */ + >; + }; }; &wkup_uart0 { @@ -464,3 +472,22 @@ partition@3fc0000 { }; }; }; + +&usbss0 { + status = "okay"; + ti,vbus-divider; +}; + +&usbss1 { + status = "okay"; +}; + +&usb0 { + dr_mode = "peripheral"; +}; + +&usb1 { + dr_mode = "host"; + pinctrl-names = "default"; + pinctrl-0 = <&main_usb1_pins_default>; +};