From patchwork Wed Jun 7 20:16:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 104699 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp456852vqr; Wed, 7 Jun 2023 13:19:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ701jIpFkpZ5dr+SgW9/qS64O+OoAutifd6KBZclXzDpGfsBR3w+f1cE+om4RTmDbX57i2L X-Received: by 2002:a17:90b:3e8e:b0:24e:3b69:a87f with SMTP id rj14-20020a17090b3e8e00b0024e3b69a87fmr6258805pjb.25.1686169177776; Wed, 07 Jun 2023 13:19:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686169177; cv=none; d=google.com; s=arc-20160816; b=XjeZSw55NFrlwMVkq83FrzNZR0EQltGoxHaj3rOM500YJrGyQ/vSINg7jGpVUeVI2i X1+mZ4fQhogVOtqQSw7eKTeOReOAQiNIYxscbwTaZlmsg1VymEvIKlQifhZjireqc+nN GkowuZTtJeaskUX88mguIAtQ5NAt/01lqGfB+T987ZW29mE9X+u/w5jWgklfiRpdYHzL UlRoe8CqKfEjl0XdyrrC4jSzGoxq72uCc7j/tA58/1WLft0jBr8V6fGUNq3QZA9CuvMh A1MKbqQtY602YEnwpY3x64bHRN8wWmA2kokAEcQ5mPnMoBRCuNRcVEYhBA5VI1iD8HOR CZFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=aVULGDkbH3q0MRhaTtQwMhlUPZrJDyZJyqx6P3oqF4c=; b=rFZYI8TbPDhpYx1J5n06T1XKh/Lt7QkuWa/sRnxifU8vqpnSGrlHbRmk4Tdg0dbQdU V9ObuvI6KsEA09NUMjCa5bBGLmtopMQws5bMtduxe54A4WTky0eTiaJCaNbP/oGmIypq u3Wf7SWpRpouHTvDeQzljq59VwRchpH1S3S4yIE+k6263odedgwuJFUyWkpoPNQvuKZt a/rU3YmhyEyuJHNCh9rQLzJOf8hBC5LS5MRVxLwMamfY53IMTULlh8AsWETH5+8IjP5e x6PGpJzRNL6dwljFQVlxhIxR5HT03trcw21zzOT8WKomTLl4mlkHqZJU9XZHXv+9fdD0 sNjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=K0HyCAg1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mz12-20020a17090b378c00b00256c16039efsi1557270pjb.163.2023.06.07.13.19.21; Wed, 07 Jun 2023 13:19:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=K0HyCAg1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232430AbjFGURL (ORCPT + 99 others); Wed, 7 Jun 2023 16:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjFGUQ5 (ORCPT ); Wed, 7 Jun 2023 16:16:57 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A02341BFA; Wed, 7 Jun 2023 13:16:54 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id EC9B25FD6F; Wed, 7 Jun 2023 23:16:52 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1686169013; bh=aVULGDkbH3q0MRhaTtQwMhlUPZrJDyZJyqx6P3oqF4c=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=K0HyCAg1ljPjyCCkwKOim+M6qI+ukGQvOo3jt3LzODIoNSUcqpyC8jyJNHROFylbn D59AyFYfmOtKUroE+WKnf4S9qvbOpvFiHDsZV6CHWiriHnIbRhlsC6ZQyk2AZElwKu ZQzAQv9gtsoAymBoKph0cr3rrr8Qvr2mpdTqFjf1xOgj8VstbmXxP9m9Dw2jMjEe8U CifSz68Prgp+eZUgRtt+KgQkmO+lkLq9NeKMGdFPoHx82BSog4bWeD2MshDD2z8CKi xklUqwfJid3g50sZZUX8UJyIv6FjFC6X512n5LtV/tXns3gOoC+AG5vmBKSei78TFZ KtcXjb3i5kpYA== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 7 Jun 2023 23:16:52 +0300 (MSK) From: Dmitry Rokosov To: , , , , , , , , CC: , , , , , , , , Dmitry Rokosov , Yue Wang , Hanjie Lin Subject: [PATCH v1 2/6] arm64: dts: meson: a1: support USB controller in OTG mode Date: Wed, 7 Jun 2023 23:16:37 +0300 Message-ID: <20230607201641.20982-3-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20230607201641.20982-1-ddrokosov@sberdevices.ru> References: <20230607201641.20982-1-ddrokosov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/06/07 16:55:00 #21454472 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1768076531898276460?= X-GMAIL-MSGID: =?utf-8?q?1768076531898276460?= 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 a24228808c9c..b2563c7d3842 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"; @@ -161,6 +163,17 @@ gpio_intc: interrupt-controller@0440 { amlogic,channel-interrupts = <49 50 51 52 53 54 55 56>; }; + + 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>; + }; }; gic: interrupt-controller@ff901000 { @@ -175,6 +188,52 @@ gic: interrupt-controller@ff901000 { #interrupt-cells = <3>; #address-cells = <0>; }; + + 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"; + + 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>; + }; + + 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; + }; + }; }; timer {