From patchwork Tue Aug 16 09:49:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 9283157 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0AF93607FD for ; Tue, 16 Aug 2016 09:56:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EFADA28F1B for ; Tue, 16 Aug 2016 09:56:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E47C428F22; Tue, 16 Aug 2016 09:56:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4C3E728F1D for ; Tue, 16 Aug 2016 09:56:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZb6T-0006CG-KN; Tue, 16 Aug 2016 09:56:13 +0000 Received: from mail-wm0-x243.google.com ([2a00:1450:400c:c09::243]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bZb2Y-0001l9-Dk for linux-amlogic@lists.infradead.org; Tue, 16 Aug 2016 09:52:16 +0000 Received: by mail-wm0-x243.google.com with SMTP id q128so15460976wma.1 for ; Tue, 16 Aug 2016 02:51:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=scGnbFgfQUI4h3+/BbqxYnkdCPQu2Ib8bFJCHbxw3OA=; b=EhMBmkBvOv45INOm1b8A6pEWSsTwFEEr5ALra4LbycJYK1329zxOcn0rsx1DF4bZQs n7q2Wrz741EWAlA6/2qiK/Um+d5PSbLCDLLpGM7GJisYtxlEsr8lcN9hHYMIJOZwuWBJ 8i3TVjcReH6A7wa/fRB8fgZ1H0hIqoSyPMCl6LQTy7FeSjAKaYM3J1Ty2S7D2gm58b9m Qp7Zng+Z5PsKi/5b6uH3P348jARN3yAtUa+s6bKsiu25PCUHSQyvKhpySAkSkfa/YOse leR68G3ugBqM8y0bmdeL8TS9N//mDHb8hhPtRNsm1xDqKMXj5eT3R9H7HEwevFKLC8UN HaCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=scGnbFgfQUI4h3+/BbqxYnkdCPQu2Ib8bFJCHbxw3OA=; b=Vu/A1tnPTXothUDDj9kkulTTwggNLAS62Ga1Kadb5sA8UkmuHSQl5V0PrTaqlgjVtB BrOM1KWU29m08DaOvR8CMN01QfNS5mru+Dw5Sz2AMI+W+1UGzyqUFsig1fM+YVBzTq3u IQoaT+aAdFrRYVee2hUt7393t4i0Eq3QnyVVY7qnQ4kPLebO2OKOAWz+dxj1ox4JLb1F pEPRZGyUrGeX85tuDRlIfuB8VnNSKau9bfq95tEaE07DpI+F77vdQ1CBNpRhyBRuXF4F HPeHizLuWV8V4gCWy0t4Z4/BGVx1Z3/3p/UEhLeDXStSYGV+WXmUeSa1fjuoj8XkMNpD 6tBA== X-Gm-Message-State: AEkooutXf0RoVpvUlCc8pm3zcRM7Z2RsgXfxPB+p33G0IpK7/Zh9aroHFh9+VBD/BKyRdw== X-Received: by 10.28.135.133 with SMTP id j127mr20891265wmd.9.1471341115050; Tue, 16 Aug 2016 02:51:55 -0700 (PDT) Received: from sark.fritz.box (host26-103-dynamic.31-79-r.retail.telecomitalia.it. [79.31.103.26]) by smtp.gmail.com with ESMTPSA id a2sm25812796wjg.46.2016.08.16.02.51.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Aug 2016 02:51:54 -0700 (PDT) From: Beniamino Galvani To: u-boot@lists.denx.de Subject: [PATCH 4/4] meson: odroid-c2: enable Ethernet support through the device tree Date: Tue, 16 Aug 2016 11:49:50 +0200 Message-Id: <1471340990-16247-5-git-send-email-b.galvani@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1471340990-16247-1-git-send-email-b.galvani@gmail.com> References: <1471340990-16247-1-git-send-email-b.galvani@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160816_025210_979692_789897AD X-CRM114-Status: GOOD ( 11.25 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tom Rini , Albert Aribaud , Masahiro Yamada , Simon Glass , Alexander Graf , Beniamino Galvani , Joe Hershberger , linux-amlogic@lists.infradead.org MIME-Version: 1.0 Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Remove the device definition from board file, update the driver with the new compatible property and update config with necessary options. Signed-off-by: Beniamino Galvani Reviewed-by: Simon Glass --- arch/arm/include/asm/arch-meson/gxbb.h | 3 --- board/amlogic/odroid-c2/odroid-c2.c | 13 ------------- configs/odroid-c2_defconfig | 3 +++ drivers/net/designware.c | 1 + 4 files changed, 4 insertions(+), 16 deletions(-) diff --git a/arch/arm/include/asm/arch-meson/gxbb.h b/arch/arm/include/asm/arch-meson/gxbb.h index f90f632..ce41349 100644 --- a/arch/arm/include/asm/arch-meson/gxbb.h +++ b/arch/arm/include/asm/arch-meson/gxbb.h @@ -20,9 +20,6 @@ #define GXBB_GPIO_IN(n) GXBB_PERIPHS_ADDR(_GXBB_GPIO_OFF(n) + 1) #define GXBB_GPIO_OUT(n) GXBB_PERIPHS_ADDR(_GXBB_GPIO_OFF(n) + 2) -/* Pinmux registers 0 to 12 */ -#define GXBB_PINMUX(n) GXBB_PERIPHS_ADDR(0x2c + (n)) - #define GXBB_ETH_REG_0 GXBB_PERIPHS_ADDR(0x50) #define GXBB_ETH_REG_1 GXBB_PERIPHS_ADDR(0x51) diff --git a/board/amlogic/odroid-c2/odroid-c2.c b/board/amlogic/odroid-c2/odroid-c2.c index bd72100..b61daaa 100644 --- a/board/amlogic/odroid-c2/odroid-c2.c +++ b/board/amlogic/odroid-c2/odroid-c2.c @@ -21,24 +21,11 @@ int board_init(void) return 0; } -static const struct eth_pdata gxbb_eth_pdata = { - .iobase = GXBB_ETH_BASE, - .phy_interface = PHY_INTERFACE_MODE_RGMII, -}; - -U_BOOT_DEVICE(meson_eth) = { - .name = "eth_designware", - .platdata = &gxbb_eth_pdata, -}; - int misc_init_r(void) { u8 mac_addr[EFUSE_MAC_SIZE]; ssize_t len; - /* Select Ethernet function */ - setbits_le32(GXBB_PINMUX(6), 0x3fff); - /* Set RGMII mode */ setbits_le32(GXBB_ETH_REG_0, GXBB_ETH_REG_0_PHY_INTF | GXBB_ETH_REG_0_TX_PHASE(1) | diff --git a/configs/odroid-c2_defconfig b/configs/odroid-c2_defconfig index 808bbc2..3e9ef68 100644 --- a/configs/odroid-c2_defconfig +++ b/configs/odroid-c2_defconfig @@ -14,6 +14,9 @@ CONFIG_HUSH_PARSER=y CONFIG_OF_CONTROL=y CONFIG_NET_RANDOM_ETHADDR=y CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_PINCTRL=y +CONFIG_PINCTRL_MESON_GXBB=y CONFIG_DEBUG_UART=y CONFIG_DEBUG_UART_MESON=y CONFIG_DEBUG_UART_BASE=0xc81004c0 diff --git a/drivers/net/designware.c b/drivers/net/designware.c index 8ba72e3..9e6d726 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -737,6 +737,7 @@ static int designware_eth_ofdata_to_platdata(struct udevice *dev) static const struct udevice_id designware_eth_ids[] = { { .compatible = "allwinner,sun7i-a20-gmac" }, { .compatible = "altr,socfpga-stmmac" }, + { .compatible = "amlogic,meson6-dwmac" }, { } };