From patchwork Thu Feb 1 12:03:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 195260 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2719:b0:106:209c:c626 with SMTP id hl25csp99420dyb; Thu, 1 Feb 2024 04:05:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IHmSzm/LAhvbUcigHoJ7LUSuVvspMIt939VURlCpC8koz+dFcuG+0AV4ZWxUZ9PAKcIRSxf X-Received: by 2002:a05:6512:2018:b0:510:109:475d with SMTP id a24-20020a056512201800b005100109475dmr1568244lfb.43.1706789150705; Thu, 01 Feb 2024 04:05:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706789150; cv=pass; d=google.com; s=arc-20160816; b=iOAAU/68obQ4SpE5c4pCTJ8JQyPLVu6BxI61qyPSRrmV6lfpNELO7OTz8z72MQa2b2 jSDvZvz6pSFJeLwGjrsxwjN9QxaQJ4E5He41Chc/Bl7GnMhA6GVhG6w4M+4MtFc82UdE GZwn/wplg5/cdkiwYiaQZaLIJRs1dvsUvHaNm5eeiP0O4Y7Iv8YkInasxN9rW9YLLiZP nokY+1lZpFXFR00eomgtbqpR36lOc9kgPpeNtKRTQEy73MOMOxn8zJQypV3/7WJTC/13 4Q6FZsP/isdQHrGLa1RS6bt+gt9WFbkqzByQChB0XPjLwJYDc1vSAK0fnUtRcY7hfQOC 5cSQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=7dHcADtDdV2g15I2ZFRzLONbzzmJiGNKx+/RTXzHfPA=; fh=i9lrth+SO7xzUHiP1gpkJKELq/UMGMiRqon+NOKVWQ0=; b=Vt3Hn2w1IhrLdy4LscCvxHLulDXdvCEClajWDEX36m75LN3g5afWQlQuCkrfMmXnAD eDXW/nFTiSkoQ3/bjOvidvXl0uN8IEFzcWuIe+uwEWggNi6t3vuwyM4qXNHz7DDNELNn 56bbB+VSKRVlP2GyUm6ikzoLCkPh0PU0Wb1s84u412bxM2b/nseUQWy+rGk1dw19eS2x AbS20KyArKVzxbzwXmX9ylkqPAsqu9LezdUDWMgzrenSrz6B68121TPMhyDSkzy1W5Jl B/n010oYhuMjm48ND5eXGkezuSqIMegSFeu/OXtKsc1KXHi08WzzBTj2HdcV5vixy/uQ UKxA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="k5oszq/V"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48068-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=1; AJvYcCWSzp06NO/EwYM9kfoAQyocjmp2q56pSl6m6aR1Rw5OD8Q9WVT6QZdsxE1rleo2ziVWwhUiD59ZaYHYpX50cmfSYJr+pg== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d19-20020a17090648d300b00a35d9e23ad3si3677110ejt.877.2024.02.01.04.05.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 04:05:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-48068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="k5oszq/V"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-48068-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-48068-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 2374E1F28D0C for ; Thu, 1 Feb 2024 12:05:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 58AE8161B73; Thu, 1 Feb 2024 12:03:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k5oszq/V" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BF2D161B4F; Thu, 1 Feb 2024 12:03:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706789031; cv=none; b=fZtQ4qel4OGflG/dOvkxlQpYumyYKrx+c70KRnti5azSfXuwguPiK5dgVXLJgzxHVK8HqYhvLNZ01MBQxouhXSZNh/4z14DfdD3zSBGOzyaY9w6RKOL1imWJAPl9im6s0AC4PLsZp66YENQpwr9qPpgykq6vQmbtfFRYQXIrWMw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706789031; c=relaxed/simple; bh=I4vLqsDfXG9pW/rrRlc221L7/vFRIUuAf5F/pe2wE+w=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=j8Kl/gbMNVsIKvHr+DxpfVv0QgiSAFnCdla7o4J8TFY+8ePkmmzpDLeNQ2qGhymzmee155T37B9+ljDjaEfusWssUunBusKHmbPpK8PwMkL5FvGoij0G1+I9WOD6d/mZm0Wt/QjzDqapQP3xWDLTimAadXKhxTbEi2vROz8YcSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=k5oszq/V; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DFC48C4167E; Thu, 1 Feb 2024 12:03:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706789031; bh=I4vLqsDfXG9pW/rrRlc221L7/vFRIUuAf5F/pe2wE+w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k5oszq/Vj1/v/angyQVmOvmusYIudzTsp0qI3wbSoQLTQh5XbQQdnA+5RT/H/9pom h4lQ4ayG30ZK42F5olRUZAdzFPc9ClMMrm9x0IGLNoKKTGeoxHkENeHDVS8WnMNN2s iK3ZBJmk/EK4pgza6UC8hi6hWag9FCz1utgfpBwPedHuU6H0pFallH+vblxkzvL9YM d2oCx9XP7dPdiY48DLdrWW+CJeidtGa9rz7j90SGA3Wm/+TqaJlSlBFpkuXp8rQaBx VF5e9AjY3QTSJI+dGIpApOjvMfA7mlMC8ukU2pG3i/KAu1S4u4xr049Hcs2N9qbCsO sNpnsbxGpMEJg== From: Roger Quadros To: nm@ti.com, vigneshr@ti.com Cc: afd@ti.com, kristo@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, srk@ti.com, r-gunasekaran@ti.com, b-liu@ti.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Roger Quadros Subject: [PATCH v3 3/5] arm64: dts: ti: k3-am62p: add the USB sub-system Date: Thu, 1 Feb 2024 14:03:30 +0200 Message-Id: <20240201120332.4811-4-rogerq@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240201120332.4811-1-rogerq@kernel.org> References: <20240201120332.4811-1-rogerq@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789698140468076613 X-GMAIL-MSGID: 1789698140468076613 There are two USB instances available on the am62p5 starter kit. Include and enable them for use on the board. Signed-off-by: Vignesh Raghavendra Signed-off-by: Roger Quadros --- Notes: Changelog: v3 - no change v2: - added USB PHY CTRL node changes here - changed USB wrapper node names to usb@ - changed Type-C chip node name to usb-power-control@ arch/arm64/boot/dts/ti/k3-am62p-main.dtsi | 46 ++++++++++++++ arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi | 10 +++ arch/arm64/boot/dts/ti/k3-am62p5-sk.dts | 67 +++++++++++++++++++++ 3 files changed, 123 insertions(+) diff --git a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi index 4c51bae06b57..17d28390d587 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-main.dtsi @@ -560,6 +560,52 @@ sdhci2: mmc@fa20000 { status = "disabled"; }; + usbss0: usb@f900000 { + compatible = "ti,am62-usb"; + reg = <0x00 0x0f900000 0x00 0x800>; + clocks = <&k3_clks 161 3>; + clock-names = "ref"; + ti,syscon-phy-pll-refclk = <&usb0_phy_ctrl 0x0>; + #address-cells = <2>; + #size-cells = <2>; + power-domains = <&k3_pds 178 TI_SCI_PD_EXCLUSIVE>; + ranges; + status = "disabled"; + + usb0: usb@31000000 { + compatible = "snps,dwc3"; + reg = <0x00 0x31000000 0x00 0x50000>; + interrupts = , /* irq.0 */ + ; /* irq.0 */ + interrupt-names = "host", "peripheral"; + maximum-speed = "high-speed"; + dr_mode = "otg"; + }; + }; + + usbss1: usb@f910000 { + compatible = "ti,am62-usb"; + reg = <0x00 0x0f910000 0x00 0x800>; + clocks = <&k3_clks 162 3>; + clock-names = "ref"; + ti,syscon-phy-pll-refclk = <&usb1_phy_ctrl 0x0>; + #address-cells = <2>; + #size-cells = <2>; + power-domains = <&k3_pds 179 TI_SCI_PD_EXCLUSIVE>; + ranges; + status = "disabled"; + + usb1: usb@31100000 { + compatible = "snps,dwc3"; + reg = <0x00 0x31100000 0x00 0x50000>; + interrupts = , /* irq.0 */ + ; /* irq.0 */ + interrupt-names = "host", "peripheral"; + maximum-speed = "high-speed"; + dr_mode = "otg"; + }; + }; + fss: bus@fc00000 { compatible = "simple-bus"; reg = <0x00 0x0fc00000 0x00 0x70000>; diff --git a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi index 19f42b39394e..00dd38b02a52 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi +++ b/arch/arm64/boot/dts/ti/k3-am62p-wakeup.dtsi @@ -18,6 +18,16 @@ chipid: chipid@14 { reg = <0x14 0x4>; bootph-all; }; + + usb0_phy_ctrl: syscon@4008 { + compatible = "ti,am62-usb-phy-ctrl", "syscon"; + reg = <0x4008 0x4>; + }; + + usb1_phy_ctrl: syscon@4018 { + compatible = "ti,am62-usb-phy-ctrl", "syscon"; + reg = <0x4018 0x4>; + }; }; wkup_uart0: serial@2b300000 { diff --git a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts index 1773c05f752c..80be56c0a4e0 100644 --- a/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts +++ b/arch/arm64/boot/dts/ti/k3-am62p5-sk.dts @@ -27,6 +27,8 @@ aliases { spi0 = &ospi0; ethernet0 = &cpsw_port1; ethernet1 = &cpsw_port2; + usb0 = &usb0; + usb1 = &usb1; }; chosen { @@ -297,6 +299,12 @@ AM62PX_IOPAD(0x01b0, PIN_OUTPUT, 2) /* (G20) MCASP0_ACLKR.UART1_TXD */ bootph-all; }; + main_usb1_pins_default: main-usb1-default-pins { + pinctrl-single,pins = < + AM62PX_IOPAD(0x0258, PIN_INPUT, 0) /* (G21) USB1_DRVVBUS */ + >; + }; + main_wlirq_pins_default: main-wlirq-default-pins { pinctrl-single,pins = < AM62PX_IOPAD(0x0128, PIN_INPUT, 7) /* (K25) MMC2_SDWP.GPIO0_72 */ @@ -340,6 +348,36 @@ AM62PX_IOPAD(0x0124, PIN_INPUT, 7) /* (J25) MMC2_SDCD.GPIO0_71 */ }; }; +&main_i2c0 { + status = "okay"; + pinctrl-names = "default"; + pinctrl-0 = <&main_i2c0_pins_default>; + clock-frequency = <400000>; + + typec_pd0: usb-power-controller@3f { + compatible = "ti,tps6598x"; + reg = <0x3f>; + + connector { + compatible = "usb-c-connector"; + label = "USB-C"; + self-powered; + data-role = "dual"; + power-role = "sink"; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@0 { + reg = <0>; + usb_con_hs: endpoint { + remote-endpoint = <&usb0_hs_ep>; + }; + }; + }; + }; + }; +}; + &main_i2c1 { status = "okay"; pinctrl-names = "default"; @@ -460,6 +498,35 @@ cpsw3g_phy1: ethernet-phy@1 { }; }; +&usbss0 { + status = "okay"; + ti,vbus-divider; +}; + +&usbss1 { + status = "okay"; + ti,vbus-divider; +}; + +&usb0 { + usb-role-switch; + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + usb0_hs_ep: endpoint { + remote-endpoint = <&usb_con_hs>; + }; + }; +}; + +&usb1 { + dr_mode = "host"; + pinctrl-names = "default"; + pinctrl-0 = <&main_usb1_pins_default>; +}; + &mcasp1 { status = "okay"; #sound-dai-cells = <0>;