From patchwork Fri Sep 22 07:26:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817346 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4r71Tx8z9sNc for ; Fri, 22 Sep 2017 17:29:59 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id F22F8C21FC5; Fri, 22 Sep 2017 07:27:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2697AC21F69; Fri, 22 Sep 2017 07:26:48 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 97762C21C29; Fri, 22 Sep 2017 07:26:44 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 24CC1C21D55 for ; Fri, 22 Sep 2017 07:26:43 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id B26CD5F989; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:27 +0800 Message-Id: <20170922072635.32105-2-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 1/9] sunxi: rename Bananapi M3 dts file name X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The upstream (Linux) device tree file for the Bananapi M3 follows the convention of using the well known brand name, instead of the vendor name, for naming. The file was recently added to upstream in commit 359b5a1e1c2d ("ARM: sun8i: a83t: Add device tree for Sinovoip Bananapi BPI-M3") Rename the device tree file in U-boot to match. Signed-off-by: Chen-Yu Tsai --- arch/arm/dts/Makefile | 4 ++-- .../{sun8i-a83t-sinovoip-bpi-m3.dts => sun8i-a83t-bananapi-m3.dts} | 0 configs/Sinovoip_BPI_M3_defconfig | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename arch/arm/dts/{sun8i-a83t-sinovoip-bpi-m3.dts => sun8i-a83t-bananapi-m3.dts} (100%) diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 762429c463d1..b7550104c340 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -307,8 +307,8 @@ dtb-$(CONFIG_MACH_SUN8I_A33) += \ sun8i-r16-parrot.dtb dtb-$(CONFIG_MACH_SUN8I_A83T) += \ sun8i-a83t-allwinner-h8homlet-v2.dtb \ - sun8i-a83t-cubietruck-plus.dtb \ - sun8i-a83t-sinovoip-bpi-m3.dtb + sun8i-a83t-bananapi-m3.dtb \ + sun8i-a83t-cubietruck-plus.dtb dtb-$(CONFIG_MACH_SUN8I_H3) += \ sun8i-h2-plus-orangepi-zero.dtb \ sun8i-h3-bananapi-m2-plus.dtb \ diff --git a/arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts b/arch/arm/dts/sun8i-a83t-bananapi-m3.dts similarity index 100% rename from arch/arm/dts/sun8i-a83t-sinovoip-bpi-m3.dts rename to arch/arm/dts/sun8i-a83t-bananapi-m3.dts diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig index 04d81693ebd8..f321d94e04eb 100644 --- a/configs/Sinovoip_BPI_M3_defconfig +++ b/configs/Sinovoip_BPI_M3_defconfig @@ -13,7 +13,7 @@ CONFIG_USB0_ID_DET="PH11" CONFIG_USB1_VBUS_PIN="PD24" CONFIG_AXP_GPIO=y CONFIG_SATAPWR="PD25" -CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-sinovoip-bpi-m3" +CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-bananapi-m3" # CONFIG_SYS_MALLOC_CLEAR_ON_INIT is not set CONFIG_CONSOLE_MUX=y CONFIG_SPL=y From patchwork Fri Sep 22 07:26:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817342 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4nX3vJXz9sNc for ; Fri, 22 Sep 2017 17:27:44 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 3DFBCC21F90; Fri, 22 Sep 2017 07:27:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 2A8A4C21F49; Fri, 22 Sep 2017 07:26:47 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 828DFC21C26; Fri, 22 Sep 2017 07:26:44 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 19B24C21C29 for ; Fri, 22 Sep 2017 07:26:43 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id B3E4B5FF3B; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:28 +0800 Message-Id: <20170922072635.32105-3-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 2/9] sunxi: Enable eMMC on Cubietruck Plus X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Set CONFIG_MMC_SUNXI_SLOT_EXTRA=2 to enable the eMMC controller to access eMMC on the board. Signed-off-by: Chen-Yu Tsai --- configs/Cubietruck_plus_defconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig index 34444ec0bd09..3d999192cbc1 100644 --- a/configs/Cubietruck_plus_defconfig +++ b/configs/Cubietruck_plus_defconfig @@ -4,6 +4,7 @@ CONFIG_MACH_SUN8I_A83T=y CONFIG_DRAM_CLK=672 CONFIG_DRAM_ZQ=15355 CONFIG_DRAM_ODT_EN=y +CONFIG_MMC_SUNXI_SLOT_EXTRA=2 CONFIG_USB0_VBUS_PIN="AXP0-VBUS-ENABLE" CONFIG_USB0_VBUS_DET="AXP0-VBUS-DETECT" CONFIG_USB0_ID_DET="PH11" From patchwork Fri Sep 22 07:26:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817341 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4mh1Zmlz9sNc for ; Fri, 22 Sep 2017 17:26:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id DB50EC21FA6; Fri, 22 Sep 2017 07:26:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 77B04C21C29; Fri, 22 Sep 2017 07:26:46 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6116FC21E0E; Fri, 22 Sep 2017 07:26:44 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 0545BC21C26 for ; Fri, 22 Sep 2017 07:26:43 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id B89B96002E; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:29 +0800 Message-Id: <20170922072635.32105-4-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 3/9] sunxi: Fix USB PHY control register offset for A83T X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" It was recently discovered that the USB PHY control register offset on the A83T is 0x410 like on the A33, not 0x404. Fix it. Fixes: 0c935acb9e5d ("sunxi: usb_phy: Add support for A83T USB PHYs") Signed-off-by: Chen-Yu Tsai --- arch/arm/mach-sunxi/usb_phy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-sunxi/usb_phy.c b/arch/arm/mach-sunxi/usb_phy.c index 9bf0b5633d4a..3fbef0050e3f 100644 --- a/arch/arm/mach-sunxi/usb_phy.c +++ b/arch/arm/mach-sunxi/usb_phy.c @@ -19,7 +19,7 @@ #include #define SUNXI_USB_PMU_IRQ_ENABLE 0x800 -#ifdef CONFIG_MACH_SUN8I_A33 +#if defined CONFIG_MACH_SUN8I_A33 || defined CONFIG_MACH_SUN8I_A83T #define SUNXI_USB_CSR 0x410 #else #define SUNXI_USB_CSR 0x404 From patchwork Fri Sep 22 07:26:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817348 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4rk4Tvjz9sNw for ; Fri, 22 Sep 2017 17:30:30 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 6178BC21FA9; Fri, 22 Sep 2017 07:27:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0D3C4C21F9F; Fri, 22 Sep 2017 07:26:50 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4690C21C26; Fri, 22 Sep 2017 07:26:44 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 2DC7FC21DEF for ; Fri, 22 Sep 2017 07:26:43 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id BDB7260057; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:30 +0800 Message-Id: <20170922072635.32105-5-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 4/9] sunxi: Switch MUSB to gadget mode on the Bananapi M3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The Bananapi M3 has a micro-USB OTG port. It supports both host and gadget mode. Having the OTG port operate in gadget mode is more useful, as we can use it for fastboot or Ethernet over USB. The board has 2 other USB host ports that are supported. These can be used for connecting peripherals. Signed-off-by: Chen-Yu Tsai --- configs/Sinovoip_BPI_M3_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig index f321d94e04eb..e48983fc3310 100644 --- a/configs/Sinovoip_BPI_M3_defconfig +++ b/configs/Sinovoip_BPI_M3_defconfig @@ -27,5 +27,5 @@ CONFIG_AXP_DCDC5_VOLT=1200 CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_SW_ON=y CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y From patchwork Fri Sep 22 07:26:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817344 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4qc1W0Pz9sNc for ; Fri, 22 Sep 2017 17:29:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id E456BC21FB0; Fri, 22 Sep 2017 07:28:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 0362EC21FA9; Fri, 22 Sep 2017 07:26:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 69C20C21F53; Fri, 22 Sep 2017 07:26:51 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 10AD9C21EC5 for ; Fri, 22 Sep 2017 07:26:47 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id C263360076; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:31 +0800 Message-Id: <20170922072635.32105-6-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 5/9] sunxi: Switch MUSB to gadget mode on the Cubietruck Plus X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The Cubietruck Plus has a micro-USB OTG port. It supports both host and gadget mode. Having the OTG port operate in gadget mode is more useful, as we can use it for fastboot or Ethernet over USB. The board has 2 other USB host ports that are supported. These can be used for connecting peripherals. Signed-off-by: Chen-Yu Tsai --- configs/Cubietruck_plus_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig index 3d999192cbc1..3aefcc58413c 100644 --- a/configs/Cubietruck_plus_defconfig +++ b/configs/Cubietruck_plus_defconfig @@ -26,5 +26,5 @@ CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_DLDO4_VOLT=3300 CONFIG_AXP_FLDO1_VOLT=1200 CONFIG_USB_EHCI_HCD=y -CONFIG_USB_MUSB_HOST=y +CONFIG_USB_MUSB_GADGET=y CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y From patchwork Fri Sep 22 07:26:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817350 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4tQ3clcz9sNc for ; Fri, 22 Sep 2017 17:31:58 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 47D5DC21E4A; Fri, 22 Sep 2017 07:28:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id C5B85C21F7B; Fri, 22 Sep 2017 07:26:59 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 75F13C21E13; Fri, 22 Sep 2017 07:26:51 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id E1C9AC21C26 for ; Fri, 22 Sep 2017 07:26:46 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id C731260097; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:32 +0800 Message-Id: <20170922072635.32105-7-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 6/9] net: sun8i_emac: Support RX/TX delay chains X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The EMAC syscon has configurable RX/TX delay chains for use with RGMII PHYs. This adds support for configuring them via device tree properties. The property names and format were defined in Linux's dwmac-sun8i binding that was merged at one point. Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard --- drivers/net/sun8i_emac.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 09bbb2cdb5ca..5fa1b4c170d7 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -56,6 +56,10 @@ #define H3_EPHY_SELECT BIT(15) /* 1: internal PHY, 0: external PHY */ #define SC_RMII_EN BIT(13) +#define SC_TXDC_SHIFT 10 +#define SC_TXDC_MASK GENMASK(2, 0) +#define SC_RXDC_SHIFT 5 +#define SC_RXDC_MASK GENMASK(4, 0) #define SC_EPIT BIT(2) /* 1: RGMII, 0: MII */ #define SC_ETCS_MASK GENMASK(1, 0) #define SC_ETCS_EXT_GMII 0x1 @@ -125,6 +129,8 @@ struct emac_eth_dev { u32 addr; u32 tx_slot; bool use_internal_phy; + u32 tx_delay; + u32 rx_delay; enum emac_variant variant; void *mac_reg; @@ -290,6 +296,12 @@ static int sun8i_emac_set_syscon(struct emac_eth_dev *priv) if (priv->variant == H3_EMAC || priv->variant == A64_EMAC) reg &= ~SC_RMII_EN; + /* Configure RX/TX delay chains */ + reg &= ~(SC_RXDC_MASK << SC_RXDC_SHIFT); + reg &= ~(SC_TXDC_MASK << SC_TXDC_SHIFT); + reg |= (priv->rx_delay & SC_RXDC_MASK) << SC_RXDC_SHIFT; + reg |= (priv->tx_delay & SC_TXDC_MASK) << SC_TXDC_SHIFT; + switch (priv->interface) { case PHY_INTERFACE_MODE_MII: /* default */ @@ -836,6 +848,19 @@ static int sun8i_emac_eth_ofdata_to_platdata(struct udevice *dev) } #endif + /* Get RX/TX delays for RGMII */ + priv->rx_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), + "allwinner,rx-delay-ps", 0); + if (priv->rx_delay % 100 || priv->rx_delay > 3100) + debug("%s: invalid rx delay value\n", __func__); + priv->rx_delay /= 100; + + priv->tx_delay = fdtdec_get_uint(gd->fdt_blob, dev_of_offset(dev), + "allwinner,tx-delay-ps", 0); + if (priv->tx_delay % 100 || priv->tx_delay > 800) + debug("%s: invalid tx delay value\n", __func__); + priv->tx_delay /= 100; + return 0; } From patchwork Fri Sep 22 07:26:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817349 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4sK5bs3z9sNc for ; Fri, 22 Sep 2017 17:31:01 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 75E51C21E0E; Fri, 22 Sep 2017 07:28:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id A50AFC21FBB; Fri, 22 Sep 2017 07:27:04 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C4F59C21F4B; Fri, 22 Sep 2017 07:26:51 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id E227FC21E3C for ; Fri, 22 Sep 2017 07:26:46 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id CBFDA600A3; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:33 +0800 Message-Id: <20170922072635.32105-8-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 7/9] net: sun8i_emac: Fix build for non-H3/H5 SoCs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Only the H3/H5 SoCs have an internal PHY and its related clock and reset controls. Use an #ifdef to guard the internal PHY control code block so it can be built for other SoCs, such as the A83T or A64. Signed-off-by: Chen-Yu Tsai Acked-by: Maxime Ripard Reviewed-by: Joe Hershberger --- drivers/net/sun8i_emac.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/sun8i_emac.c b/drivers/net/sun8i_emac.c index 5fa1b4c170d7..0a98a04967da 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -616,6 +616,8 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv) { struct sunxi_ccm_reg *ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; +#ifdef CONFIG_MACH_SUNXI_H3_H5 + /* Only H3/H5 have clock controls for internal EPHY */ if (priv->use_internal_phy) { /* Set clock gating for ephy */ setbits_le32(&ccm->bus_gate4, BIT(AHB_GATE_OFFSET_EPHY)); @@ -623,6 +625,7 @@ static void sun8i_emac_board_setup(struct emac_eth_dev *priv) /* Deassert EPHY */ setbits_le32(&ccm->ahb_reset2_cfg, BIT(AHB_RESET_OFFSET_EPHY)); } +#endif /* Set clock gating for emac */ setbits_le32(&ccm->ahb_gate0, BIT(AHB_GATE_OFFSET_GMAC)); From patchwork Fri Sep 22 07:26:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817345 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4r327Glz9sNc for ; Fri, 22 Sep 2017 17:29:55 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 15121C21FAA; Fri, 22 Sep 2017 07:29:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id BC074C21FC6; Fri, 22 Sep 2017 07:27:05 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 45807C21FAB; Fri, 22 Sep 2017 07:26:52 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 3834DC21F4B for ; Fri, 22 Sep 2017 07:26:47 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id D0FEB600A9; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:34 +0800 Message-Id: <20170922072635.32105-9-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 8/9] sunxi: Enable EMAC on the Cubietruck Plus X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The Cubietruck Plus has an RTL8211E PHY connected to the EMAC using RGMII. The PHY is powered by DLDO4 @ 3.3V, while the I/O pins are powered by DLDO3 @ 2.5V. This patch adds a U-boot specific dtsi file for the board adding an enabled EMAC node, and enables the EMAC driver in the defconfig. The binding used here is the old revision currently supported in U-boot. There is no stable binding nor support in upstream Linux at this time. Signed-off-by: Chen-Yu Tsai --- .../arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi | 39 ++++++++++++++++++++++ configs/Cubietruck_plus_defconfig | 1 + 2 files changed, 40 insertions(+) create mode 100644 arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi diff --git a/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi new file mode 100644 index 000000000000..b4e216c14264 --- /dev/null +++ b/arch/arm/dts/sun8i-a83t-cubietruck-plus-u-boot.dtsi @@ -0,0 +1,39 @@ +#include "sunxi-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &emac; + }; + + soc { + emac: ethernet@01c30000 { + compatible = "allwinner,sun8i-a83t-emac"; + reg = <0x01c30000 0x2000>, <0x01c00030 0x4>; + reg-names = "emac", "syscon"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy = <&phy1>; + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + }; +}; + +&pio { + rgmii_pins: rgmii_pins { + allwinner,pins = "PD8", "PD9", "PD10", "PD11", + "PD12", "PD13", "PD15", + "PD16", "PD17", "PD18", "PD19", + "PD20", "PD21", "PD22", "PD23"; + allwinner,function = "emac"; + allwinner,drive = <3>; + allwinner,pull = <0>; + }; +}; diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig index 3aefcc58413c..ee8b901d0d08 100644 --- a/configs/Cubietruck_plus_defconfig +++ b/configs/Cubietruck_plus_defconfig @@ -22,6 +22,7 @@ CONFIG_SPL=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_ISO_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_SUN8I_EMAC=y CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_DLDO4_VOLT=3300 CONFIG_AXP_FLDO1_VOLT=1200 From patchwork Fri Sep 22 07:26:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 817347 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xz4rG2h8hz9sNc for ; Fri, 22 Sep 2017 17:30:06 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 1FD83C21FB2; Fri, 22 Sep 2017 07:28:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id E7638C21FB9; Fri, 22 Sep 2017 07:26:56 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 99125C21F9E; Fri, 22 Sep 2017 07:26:52 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 29E1FC21F37 for ; Fri, 22 Sep 2017 07:26:47 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id D5D41600AF; Fri, 22 Sep 2017 15:26:36 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 22 Sep 2017 15:26:35 +0800 Message-Id: <20170922072635.32105-10-wens@csie.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170922072635.32105-1-wens@csie.org> References: <20170922072635.32105-1-wens@csie.org> Cc: Joe Hershberger , Jagan Teki , Maxime Ripard Subject: [U-Boot] [PATCH 9/9] sunxi: Enable EMAC on the Bananapi M3 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" The Bananapi M3 has an RTL8211E PHY connected to the EMAC using RGMII. The PHY is powered by DCDC1 through SW @ 3.3V. This patch adds a U-boot specific dtsi file for the board adding an enabled EMAC node, and enables the EMAC driver in the defconfig. The binding used here is the old revision currently supported in U-boot. There is no stable binding nor support in upstream Linux at this time. Signed-off-by: Chen-Yu Tsai --- arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi | 41 +++++++++++++++++++++++++ configs/Sinovoip_BPI_M3_defconfig | 1 + 2 files changed, 42 insertions(+) create mode 100644 arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi diff --git a/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi b/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi new file mode 100644 index 000000000000..9c7977e67b92 --- /dev/null +++ b/arch/arm/dts/sun8i-a83t-bananapi-m3-u-boot.dtsi @@ -0,0 +1,41 @@ +#include "sunxi-u-boot.dtsi" + +/ { + aliases { + ethernet0 = &emac; + }; + + soc { + emac: ethernet@01c30000 { + compatible = "allwinner,sun8i-a83t-emac"; + reg = <0x01c30000 0x2000>, <0x01c00030 0x4>; + reg-names = "emac", "syscon"; + interrupts = ; + #address-cells = <1>; + #size-cells = <0>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + phy-mode = "rgmii"; + phy = <&phy1>; + allwinner,rx-delay-ps = <700>; + allwinner,tx-delay-ps = <700>; + status = "okay"; + + phy1: ethernet-phy@1 { + reg = <1>; + }; + }; + }; +}; + +&pio { + rgmii_pins: rgmii_pins { + allwinner,pins = "PD8", "PD9", "PD10", "PD11", + "PD12", "PD13", "PD15", + "PD16", "PD17", "PD18", "PD19", + "PD20", "PD21", "PD22", "PD23"; + allwinner,function = "emac"; + allwinner,drive = <3>; + allwinner,pull = <0>; + }; +}; diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig index e48983fc3310..efdf3c7396fd 100644 --- a/configs/Sinovoip_BPI_M3_defconfig +++ b/configs/Sinovoip_BPI_M3_defconfig @@ -23,6 +23,7 @@ CONFIG_SPL=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_ISO_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set +CONFIG_SUN8I_EMAC=y CONFIG_AXP_DCDC5_VOLT=1200 CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_SW_ON=y