From patchwork Sun Apr 5 22:07:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 458296 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id ADB8F14012F for ; Mon, 6 Apr 2015 08:09:01 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7C06EB37D3; Mon, 6 Apr 2015 00:08:45 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kZ1Y7fTtCr6F; Mon, 6 Apr 2015 00:08:45 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 875A2B37F1; Mon, 6 Apr 2015 00:08:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C25BB37C8 for ; Mon, 6 Apr 2015 00:08:11 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dLmG7CDNukht for ; Mon, 6 Apr 2015 00:08:11 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-pa0-f74.google.com (mail-pa0-f74.google.com [209.85.220.74]) by theia.denx.de (Postfix) with ESMTPS id 0BA14B37B7 for ; Mon, 6 Apr 2015 00:08:07 +0200 (CEST) Received: by pabli10 with SMTP id li10so1215555pab.1 for ; Sun, 05 Apr 2015 15:08:06 -0700 (PDT) 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=2E7AbbwvJynGJndI/+MVVmHaQiYIG2WSDAgeC7QUSGw=; b=ZTeAHhWiO7sT0XLhOgXesIwLsoV/ildVHR2gsLM+SsTueogqdUqRzP4qDbay6Xp1cu vq4+xW+vgrOeejvzeRLSeBpTRkSRVtYfY7ykueBTyP9OWscvhhJRHWc7Jei7abEyodYC 6CbtmYdT2axqAs2/pLDMEDtHbcVFzW54atJheiUt7fODzw4jGpIBGPJhGJObNILAr/on dRfxjPtPPoWAty60nbCB8ENZuS0ykTJVQObxd4GC+JXdMGkSAghHt1rojSnHK6AEXmGL XjZTXI6HmJwH3NraxZfOtNpTc2tBbS/la0hiGIXY84cX6uSUSBI1BCgElEe4zdQXvtw7 LtrA== X-Gm-Message-State: ALoCoQnWTrFDxcDFQqlvNqfe+Z32cbQFrbawT90xe21yrzFcSxHFKO3RXt8Lf5/nJbtQFM5UH+pD X-Received: by 10.66.162.202 with SMTP id yc10mr8819793pab.47.1428271686702; Sun, 05 Apr 2015 15:08:06 -0700 (PDT) Received: from corpmail-nozzle1-1.hot.corp.google.com ([100.108.1.104]) by gmr-mx.google.com with ESMTPS id f100si130784yhp.7.2015.04.05.15.08.06 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Apr 2015 15:08:06 -0700 (PDT) Received: from kaki.bld.corp.google.com ([172.29.216.32]) by corpmail-nozzle1-1.hot.corp.google.com with ESMTP id bpHR4728.1; Sun, 05 Apr 2015 15:08:06 -0700 Received: by kaki.bld.corp.google.com (Postfix, from userid 121222) id 07E4A220FAD; Sun, 5 Apr 2015 16:08:05 -0600 (MDT) From: Simon Glass To: U-Boot Mailing List Date: Sun, 5 Apr 2015 16:07:42 -0600 Message-Id: <1428271663-3814-11-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 2.2.0.rc0.207.ga3a616c In-Reply-To: <1428271663-3814-1-git-send-email-sjg@chromium.org> References: <1428271663-3814-1-git-send-email-sjg@chromium.org> Cc: Ian Campbell Subject: [U-Boot] [PATCH v2 10/11] dm: sunxi: Support driver model for Ethernet X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 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" Adjust the Ethernet initialisation code to support driver model. It is no-longer necessary to call designware_initialize(). The device will be probed when it is used. The PHY type and GMAC base will come from the device tree. Signed-off-by: Simon Glass --- Changes in v2: - Remove unwanted printf() board/sunxi/gmac.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/board/sunxi/gmac.c b/board/sunxi/gmac.c index 8849132..1540633 100644 --- a/board/sunxi/gmac.c +++ b/board/sunxi/gmac.c @@ -80,11 +80,15 @@ int sunxi_gmac_initialize(bd_t *bis) sunxi_gpio_set_cfgpin(pin, SUN6I_GPA0_GMAC); #endif -#ifdef CONFIG_RGMII +#ifdef CONFIG_DM_ETH + return 0; +#else +# ifdef CONFIG_RGMII return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_RGMII); -#elif defined CONFIG_GMII +# elif defined CONFIG_GMII return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_GMII); -#else +# else return designware_initialize(SUNXI_GMAC_BASE, PHY_INTERFACE_MODE_MII); +# endif #endif }