Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4365564pxb; Sat, 12 Feb 2022 02:40:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJzhVbnaWDw3Jp+Vsmjh78sgloDjFdbczf5yr9Ll1TDWJtqMQ3KXU06YD4WyUM1Fnag3rfla X-Received: by 2002:a17:906:1012:: with SMTP id 18mr4532854ejm.300.1644662447731; Sat, 12 Feb 2022 02:40:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644662447; cv=none; d=google.com; s=arc-20160816; b=f7I0N30tDTojFiO121b/hbSAId05DndQ0BtjQ2KYaaZeXxnhhJxoWXWehII+9HZuzL JL7T7G4PFaRJjNqeM+en3DBFI0P1z/2RiPhDq8mThI4dwvzomZQHXvEWFxvVK++veu/H M/yZPcQJ8Geh71dTRUvfjNot2vgMKNWAXop5tmY31RPplYlv3fhJ/mpkYu41HurvXflL BqnOccHkO/YJzqnBTNVFwhrKnYE3qJEoCtwYV04+oFVDiCtSD92OqAfgRhNtYUwjmXiv fhhXSCQ5Svr4jGTTPlAhWb+YDSfKUBmihzkeOSMLxOD6atcQENuZvFJ5wGBIGvgRVWC+ xXpg== 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; bh=74OzM3f526yiv3Dt8X4dhW2VonYEj97a4RTxSzsWh7M=; b=oQm27cBkrsIVodk4u4gNLGOTcRHsytvRq1AJA+LBDwDICnt5WkTXRwOz47FvT+78pk TwRXV8nqXHySLQPMcWftDNmOqqaDRx5UsAuB+8y2sH4fqecOIohjuQWo7Uh9DsrwfufD 4GsfNNz3D35mTF6LxIZLADf6W1EK17XIbezHBA6kBvMJ/LDvyfFcrws/D/7aouD1woRu +zWdNtFQMFVzGGbuXuHJSfDV57Te8KVivNS4xvVfkn+F1N8ZEhpnWxbpODGKjnhBI2VG Xk5E4uRH4SmwDWtDUCYZCyAUHVAoJ9R4lXdontq77mzXFV4LhMo2WeJMOl4yOZJ/ha4Y kj3g== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19si11836478eds.624.2022.02.12.02.40.24; Sat, 12 Feb 2022 02:40:47 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350222AbiBKM1x (ORCPT + 93 others); Fri, 11 Feb 2022 07:27:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:34746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244887AbiBKM1Z (ORCPT ); Fri, 11 Feb 2022 07:27:25 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 21839FC1; Fri, 11 Feb 2022 04:27:21 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E50CC1509; Fri, 11 Feb 2022 04:27:20 -0800 (PST) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.196.172]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 69A6F3F70D; Fri, 11 Feb 2022 04:27:19 -0800 (PST) From: Andre Przywara To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec Cc: Rob Herring , Ondrej Jirman , Icenowy Zheng , Samuel Holland , linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [PATCH v10 17/18] arm64: dts: allwinner: h616: OrangePi Zero 2: Add USB nodes Date: Fri, 11 Feb 2022 12:26:42 +0000 Message-Id: <20220211122643.1343315-18-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220211122643.1343315-1-andre.przywara@arm.com> References: <20220211122643.1343315-1-andre.przywara@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 The OrangePi Zero 2 has one USB-A host port, VBUS is provided by a GPIO controlled regulator. The USB-C port is meant to power the board, but is also connected to the USB 0 port, which we configure as an MUSB peripheral. Signed-off-by: Andre Przywara --- .../allwinner/sun50i-h616-orangepi-zero2.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts index ca07cae698ce..a26201288872 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero2.dts @@ -49,8 +49,25 @@ reg_vcc5v: vcc5v { regulator-max-microvolt = <5000000>; regulator-always-on; }; + + reg_usb1_vbus: usb1-vbus { + compatible = "regulator-fixed"; + regulator-name = "usb1-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <®_vcc5v>; + enable-active-high; + gpio = <&pio 2 16 GPIO_ACTIVE_HIGH>; /* PC16 */ + status = "okay"; + }; }; +&ehci1 { + status = "okay"; +}; + +/* USB 2 & 3 are on headers only. */ + &emac0 { pinctrl-names = "default"; pinctrl-0 = <&ext_rgmii_pins>; @@ -76,6 +93,10 @@ &mmc0 { status = "okay"; }; +&ohci1 { + status = "okay"; +}; + &r_rsb { status = "okay"; @@ -201,3 +222,24 @@ &uart0 { pinctrl-0 = <&uart0_ph_pins>; status = "okay"; }; + +&usbotg { + /* + * PHY0 pins are connected to a USB-C socket, but a role switch + * is not implemented: both CC pins are pulled to GND. + * The VBUS pins power the device, so a fixed peripheral mode + * is the best choice. + * The board can be powered via GPIOs, in this case port0 *can* + * act as a host (with a cable/adapter ignoring CC), as VBUS is + * then provided by the GPIOs. Any user of this setup would + * need to adjust the DT accordingly: dr_mode set to "host", + * enabling OHCI0 and EHCI0. + */ + dr_mode = "peripheral"; + status = "okay"; +}; + +&usbphy { + usb1_vbus-supply = <®_usb1_vbus>; + status = "okay"; +}; -- 2.25.1