From patchwork Fri Apr 12 03:37:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 1084609 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44gZ196Yz9z9s9y for ; Fri, 12 Apr 2019 20:30:51 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 22A86C21E96; Fri, 12 Apr 2019 10:30:45 +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 A44EAC21CB6; Fri, 12 Apr 2019 10:30:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 3B3C4C21DED; Fri, 12 Apr 2019 03:38:10 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 99554C21CB6 for ; Fri, 12 Apr 2019 03:38:09 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id 518FC60644; Fri, 12 Apr 2019 11:38:07 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 12 Apr 2019 11:37:44 +0800 Message-Id: <20190412033747.16437-2-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190412033747.16437-1-wens@kernel.org> References: <20190412033747.16437-1-wens@kernel.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 12 Apr 2019 10:30:40 +0000 Cc: Maxime Ripard , Joe Hershberger , Chen-Yu Tsai , Jagan Teki Subject: [U-Boot] [RESEND PATCH 1/4] sunxi: Fix compilation of sun8i-emac 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Chen-Yu Tsai The A83T has its own clock header file and clock control module structure, unlike H3/A64/R40 which share a common one. As such some of the SoC specific fields or macros are undefined when building U-boot for A83T. Add dummy entries to the clock control module structure to make the compiler happy. The code path using these fields is unused for A83T in the driver. Signed-off-by: Chen-Yu Tsai --- arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h b/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h index 14df3cc8f46b..15c1d6fe820a 100644 --- a/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h +++ b/arch/arm/include/asm/arch-sunxi/clock_sun8i_a83t.h @@ -124,6 +124,10 @@ struct sunxi_ccm_reg { u32 ahb_reset3_cfg; /* 0x2d0 AHB1 Reset 3 config */ u32 reserved32; /* 0x2d4 */ u32 apb2_reset_cfg; /* 0x2d8 BUS Reset 4 config */ + + /* the following exist only to make sun8i-emac happy */ + u32 gmac_clk_cfg; + u32 bus_gate4; }; /* apb2 bit field */ From patchwork Fri Apr 12 03:37:45 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 1084611 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44gZ2Q0kh6z9s47 for ; Fri, 12 Apr 2019 20:31:57 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id AC106C21E31; Fri, 12 Apr 2019 10:31:00 +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 ED624C21DE8; Fri, 12 Apr 2019 10:30:42 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 622DFC21DF8; Fri, 12 Apr 2019 03:38:10 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id CA152C21D72 for ; Fri, 12 Apr 2019 03:38:09 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id 63F9460AF4; Fri, 12 Apr 2019 11:38:07 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 12 Apr 2019 11:37:45 +0800 Message-Id: <20190412033747.16437-3-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190412033747.16437-1-wens@kernel.org> References: <20190412033747.16437-1-wens@kernel.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 12 Apr 2019 10:30:40 +0000 Cc: Maxime Ripard , Joe Hershberger , Chen-Yu Tsai , Jagan Teki Subject: [U-Boot] [RESEND PATCH 2/4] net: sun8i-emac: Fix compilation 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Chen-Yu Tsai The A83T has its own clock header file and clock control module structure, unlike H3/A64/R40 which share a common one. As such some of the SoC specific fields or macros are undefined when building U-boot for A83T. Define the AHB_RESET_OFFSET_EPHY macro if it isn't already defined to make the compiler happy. The code path including this macro is unused in the driver for A83T. Signed-off-by: Chen-Yu Tsai --- This patch should go in with the others through the sunxi tree, not independently through the net tree. 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 c9798445c7dd..b6b4b1030153 100644 --- a/drivers/net/sun8i_emac.c +++ b/drivers/net/sun8i_emac.c @@ -68,6 +68,9 @@ #define CONFIG_MDIO_TIMEOUT (3 * CONFIG_SYS_HZ) #define AHB_GATE_OFFSET_EPHY 0 +#ifndef AHB_RESET_OFFSET_EPHY +#define AHB_RESET_OFFSET_EPHY 2 +#endif /* IO mux settings */ #define SUN8I_IOMUX_H3 2 From patchwork Fri Apr 12 03:37:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 1084614 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44gZ3g1Bwfz9s47 for ; Fri, 12 Apr 2019 20:33:02 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 89551C21E1A; Fri, 12 Apr 2019 10:31:27 +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 B6DB1C21E1E; Fri, 12 Apr 2019 10:30:43 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7DF28C21DAF; Fri, 12 Apr 2019 03:38:10 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id DEAA3C21DB5 for ; Fri, 12 Apr 2019 03:38:09 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id 7793B60B02; Fri, 12 Apr 2019 11:38:07 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 12 Apr 2019 11:37:46 +0800 Message-Id: <20190412033747.16437-4-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190412033747.16437-1-wens@kernel.org> References: <20190412033747.16437-1-wens@kernel.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 12 Apr 2019 10:30:40 +0000 Cc: Maxime Ripard , Joe Hershberger , Chen-Yu Tsai , Jagan Teki Subject: [U-Boot] [RESEND PATCH 3/4] 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Chen-Yu Tsai 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 enables the EMAC and Realtek PHY drivers in the defconfig. The device tree file already has the EMAC enabled. Signed-off-by: Chen-Yu Tsai --- configs/Cubietruck_plus_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/Cubietruck_plus_defconfig b/configs/Cubietruck_plus_defconfig index 869bffcfca0c..044af12779c6 100644 --- a/configs/Cubietruck_plus_defconfig +++ b/configs/Cubietruck_plus_defconfig @@ -20,6 +20,8 @@ CONFIG_CONSOLE_MUX=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-cubietruck-plus" +CONFIG_PHY_REALTEK=y +CONFIG_SUN8I_EMAC=y CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_DLDO4_VOLT=3300 CONFIG_AXP_FLDO1_VOLT=1200 From patchwork Fri Apr 12 03:37:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 1084612 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=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=kernel.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 44gZ2n0qXnz9s47 for ; Fri, 12 Apr 2019 20:32:17 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id BE540C21E13; Fri, 12 Apr 2019 10:31:39 +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 32CDBC21E3A; Fri, 12 Apr 2019 10:30:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id C9B5EC21D72; Fri, 12 Apr 2019 03:38:10 +0000 (UTC) Received: from wens.csie.org (mirror2.csie.ntu.edu.tw [140.112.30.76]) by lists.denx.de (Postfix) with ESMTPS id 3D2DDC21CB6 for ; Fri, 12 Apr 2019 03:38:10 +0000 (UTC) Received: by wens.csie.org (Postfix, from userid 1000) id 8A91B60B0F; Fri, 12 Apr 2019 11:38:07 +0800 (CST) From: Chen-Yu Tsai To: u-boot@lists.denx.de Date: Fri, 12 Apr 2019 11:37:47 +0800 Message-Id: <20190412033747.16437-5-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190412033747.16437-1-wens@kernel.org> References: <20190412033747.16437-1-wens@kernel.org> MIME-Version: 1.0 X-Mailman-Approved-At: Fri, 12 Apr 2019 10:30:41 +0000 Cc: Maxime Ripard , Joe Hershberger , Chen-Yu Tsai , Jagan Teki Subject: [U-Boot] [RESEND PATCH 4/4] 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: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" From: Chen-Yu Tsai 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 enables the EMAC and Realtek PHY drivers in the defconfig. The device tree file already has the EMAC enabled. Signed-off-by: Chen-Yu Tsai --- configs/Sinovoip_BPI_M3_defconfig | 2 ++ 1 file changed, 2 insertions(+) diff --git a/configs/Sinovoip_BPI_M3_defconfig b/configs/Sinovoip_BPI_M3_defconfig index 79743a9c9a51..bb2dbb5dd5c2 100644 --- a/configs/Sinovoip_BPI_M3_defconfig +++ b/configs/Sinovoip_BPI_M3_defconfig @@ -21,6 +21,8 @@ CONFIG_CONSOLE_MUX=y # CONFIG_SPL_DOS_PARTITION is not set # CONFIG_SPL_EFI_PARTITION is not set CONFIG_DEFAULT_DEVICE_TREE="sun8i-a83t-bananapi-m3" +CONFIG_PHY_REALTEK=y +CONFIG_SUN8I_EMAC=y CONFIG_AXP_DCDC5_VOLT=1200 CONFIG_AXP_DLDO3_VOLT=2500 CONFIG_AXP_SW_ON=y