From patchwork Thu May 7 16:43:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 6359461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1338D9F1C2 for ; Thu, 7 May 2015 16:47:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 597122034B for ; Thu, 7 May 2015 16:47:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10A04200F2 for ; Thu, 7 May 2015 16:47:12 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqOv0-0001fn-Ty; Thu, 07 May 2015 16:45:02 +0000 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YqOuY-0001NR-7t for linux-arm-kernel@lists.infradead.org; Thu, 07 May 2015 16:44:35 +0000 Received: from mirror2.csie.ntu.edu.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (Authenticated sender: b93043) by smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id 7E15D202BF; Fri, 8 May 2015 00:44:08 +0800 (CST) Received: by mirror2.csie.ntu.edu.tw (Postfix, from userid 1000) id 5D83A5F744; Fri, 8 May 2015 00:44:08 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard Subject: [PATCH 1/2] ARM: dts: sun9i: cubieboard4: Enable USB support Date: Fri, 8 May 2015 00:43:56 +0800 Message-Id: <1431017037-28331-2-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431017037-28331-1-git-send-email-wens@csie.org> References: <1431017037-28331-1-git-send-email-wens@csie.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150507_094434_505071_7130B915 X-CRM114-Status: UNSURE ( 9.19 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.3 (--) Cc: Chen-Yu Tsai , Tyler Baker , linux-sunxi@googlegroups.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Cubieboard4 has 4 USB ports. 3 of them are connected to a GL850G USB hub chip on usb1. The fourth one, the lower port of 2 ports next to the power barrel, is directly connected to usb3. 2 power enable GPIOs are used between the 2 port groups, 1 for each. This raises the possibility of having no power for hub-connected port next to the power barrel, if usb3 is not enabled. Signed-off-by: Chen-Yu Tsai --- arch/arm/boot/dts/sun9i-a80-cubieboard4.dts | 60 +++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts index 6484dcf69873..42ddc046213c 100644 --- a/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts +++ b/arch/arm/boot/dts/sun9i-a80-cubieboard4.dts @@ -62,6 +62,30 @@ stdout-path = "serial0:115200n8"; }; + reg_usb3_vbus: usb3-vbus { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&usb3_vbus_pin_cubieboard4>; + regulator-name = "usb3-vbus"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + enable-active-high; + gpio = <&pio 7 15 GPIO_ACTIVE_HIGH>; /* PH15 */ + }; +}; + +&ehci0 { + status = "okay"; +}; + +&ehci2 { + status = "okay"; +}; + +/* usb1 is connected to a GL850G USB hub chip, so no need to enable OHCI */ + +&ohci2 { + status = "okay"; }; &pio { @@ -71,6 +95,20 @@ allwinner,drive = ; allwinner,pull = ; }; + + usb1_vbus_pin_cubieboard4: usb1_vbus_pin@1 { + allwinner,pins = "PH14"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; + + usb3_vbus_pin_cubieboard4: usb3_vbus_pin@1 { + allwinner,pins = "PH15"; + allwinner,function = "gpio_out"; + allwinner,drive = ; + allwinner,pull = ; + }; }; &mmc0 { @@ -92,8 +130,30 @@ status = "okay"; }; +®_usb1_vbus { + pinctrl-0 = <&usb1_vbus_pin_cubieboard4>; + gpio = <&pio 7 14 GPIO_ACTIVE_HIGH>; /* PH14 */ + status = "okay"; +}; + &uart0 { pinctrl-names = "default"; pinctrl-0 = <&uart0_pins_a>; status = "okay"; }; + +&usbphy1 { + phy-supply = <®_usb1_vbus>; + status = "okay"; +}; + +/* + * Unfortunately reg_usb1_vbus also powers one of the ports from usb3's hub. + * One should always make sure both regulators are enabled and working for + * all USB ports to have power. + */ + +&usbphy3 { + phy-supply = <®_usb3_vbus>; + status = "okay"; +};