From patchwork Wed Aug 23 21:36:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 13363175 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 20944C727B0 for ; Wed, 23 Aug 2023 21:37:30 +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=SRWT+xLRDZBLNhXo429msrSq/Avjf2v/zT1VkKDT85A=; b=pC1kSg1C4AQ+u0 59dz5H6RwLTnIdkJ7vCgNlK7C5UNytdNd4ZHvyaOPRbYVCFebWMldi/NOYu6Ju1QOwt9lwtmh14Kl i504N9lMdmv5BZ8SjwU+jhPZd/Kpuq5NsfPRi280bUvi8VT60woNiAkF0shoCYCt3XC/0TUc6XD3Z nJT1Z5BqVM0sbzkPoLpVwf6jE2PvwIy9PjUwGA3oBxDtLx6Idl4obuz3qeuc1pAYiCmOsFykmHVqz 0ZGviDHWtqxg4/vvXV/+zUkCSinJsqtGJWGh0fIzdbWvKOZ/wkDsg4N95jwyhLnxJOhdheGZxF1TS NXfeDXi+3u/+nNt8t+Kw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYvXI-001aHo-1m; Wed, 23 Aug 2023 21:37:08 +0000 Received: from mx1.sberdevices.ru ([37.18.73.165]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYvWv-001a6X-2x; Wed, 23 Aug 2023 21:36:50 +0000 Received: from p-infra-ksmg-sc-msk01 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id E6ABA10000D; Thu, 24 Aug 2023 00:36:42 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru E6ABA10000D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1692826602; bh=MsqftKOIycFu9ffQQowxWMyaH/kKjUWsNUQo5VRcUOk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=lM400aCJNhcp3bTIkexFNHUHUKYAgg+2bnVseMACDBNg73ZVGTRNW+DJOU5OYk6EP V5TkpFROhKA0Wd74e1m0MBRPUzgPXRbADrecrV8plu0dsUSJ3RCGHsuQmKnjqFHJ7o PLu09oaoA6jYQLoY02TE9OZXnrRZIBhYeDyy9odWzARS5kyunj5RgrWxij6xCKtY+z xGX3XKgy9yGp6jaS0Ttuuf2eDUORQL0XXcveVWhi5im9zIZhbuvQ8/TufvmU92rrNK KkIxaId7W/L/Fx09NpGgaKmLbks2ntfyXFAvW+9vDEG+iRQzRDouYWB7/HLkLZ+jck D9vQiYzaWGCMA== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Thu, 24 Aug 2023 00:36:42 +0300 (MSK) Received: from localhost.localdomain (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 24 Aug 2023 00:36:38 +0300 From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , Dmitry Rokosov , Yue Wang , Hanjie Lin Subject: [PATCH v2 06/15] arm64: dts: meson: a1: support USB controller in OTG mode Date: Thu, 24 Aug 2023 00:36:21 +0300 Message-ID: <20230823213630.12936-7-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230823213630.12936-1-ddrokosov@sberdevices.ru> References: <20230823213630.12936-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [100.64.160.123] X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 179413 [Aug 23 2023] X-KSMG-AntiSpam-Version: 5.9.59.0 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 527 527 5bb611be2ca2baa31d984ccbf4ef4415504fc308, {Tracking_smtp_not_equal_from}, {Tracking_from_domain_doesnt_match_to}, salutedevices.com:7.1.1;sberdevices.ru:7.1.1,5.0.1;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;p-i-exch-sc-m01.sberdevices.ru:7.1.1,5.0.1;100.64.160.123:7.1.2, FromAlignment: n, {Tracking_smtp_domain_mismatch}, {Tracking_smtp_domain_2level_mismatch}, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2023/08/23 18:49:00 #21688451 X-KSMG-AntiVirus-Status: Clean, skipped X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230823_143646_700393_D2185E70 X-CRM114-Status: GOOD ( 11.91 ) X-BeenThere: linux-amlogic@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-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org Amlogic A1 SoC family has USB2.0 controller based on dwc2 and dwc3 heads. It supports otg/host/peripheral modes. Signed-off-by: Yue Wang Signed-off-by: Hanjie Lin Signed-off-by: Dmitry Rokosov Reviewed-by: Martin Blumenstingl --- arch/arm64/boot/dts/amlogic/meson-a1.dtsi | 59 +++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi index a8a39eeb2581..04df5a5b563e 100644 --- a/arch/arm64/boot/dts/amlogic/meson-a1.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-a1.dtsi @@ -8,6 +8,8 @@ #include #include #include +#include +#include / { compatible = "amlogic,a1"; @@ -152,6 +154,17 @@ uart_AO_B: serial@2000 { status = "disabled"; }; + usb2_phy1: phy@4000 { + compatible = "amlogic,a1-usb2-phy"; + clocks = <&clkc_periphs CLKID_USB_PHY_IN>; + clock-names = "xtal"; + reg = <0x0 0x4000 0x0 0x60>; + resets = <&reset RESET_USBPHY>; + reset-names = "phy"; + #phy-cells = <0>; + power-domains = <&pwrc PWRC_USB_ID>; + }; + clkc_pll: pll-clock-controller@7c80 { compatible = "amlogic,a1-pll-clkc"; reg = <0 0x7c80 0 0x18c>; @@ -162,6 +175,52 @@ clkc_pll: pll-clock-controller@7c80 { }; }; + usb: usb@fe004400 { + status = "disabled"; + compatible = "amlogic,meson-a1-usb-ctrl"; + reg = <0x0 0xfe004400 0x0 0xa0>; + interrupts = ; + #address-cells = <2>; + #size-cells = <2>; + ranges; + + clocks = <&clkc_periphs CLKID_USB_CTRL>, + <&clkc_periphs CLKID_USB_BUS>, + <&clkc_periphs CLKID_USB_CTRL_IN>; + clock-names = "usb_ctrl", "usb_bus", "xtal_usb_ctrl"; + resets = <&reset RESET_USBCTRL>; + reset-name = "usb_ctrl"; + + dr_mode = "otg"; + + phys = <&usb2_phy1>; + phy-names = "usb2-phy1"; + + dwc3: usb@ff400000 { + compatible = "snps,dwc3"; + reg = <0x0 0xff400000 0x0 0x100000>; + interrupts = ; + dr_mode = "host"; + snps,dis_u2_susphy_quirk; + snps,quirk-frame-length-adjustment = <0x20>; + snps,parkmode-disable-ss-quirk; + }; + + dwc2: usb@ff500000 { + compatible = "amlogic,meson-a1-usb", "snps,dwc2"; + reg = <0x0 0xff500000 0x0 0x40000>; + interrupts = ; + phys = <&usb2_phy1>; + phy-names = "usb2-phy"; + clocks = <&clkc_periphs CLKID_USB_PHY>; + clock-names = "otg"; + dr_mode = "peripheral"; + g-rx-fifo-size = <192>; + g-np-tx-fifo-size = <128>; + g-tx-fifo-size = <128 128 16 16 16>; + }; + }; + gic: interrupt-controller@ff901000 { compatible = "arm,gic-400"; reg = <0x0 0xff901000 0x0 0x1000>,