From patchwork Mon Jan 28 13:47:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2056031 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 68D533FD49 for ; Mon, 28 Jan 2013 13:52:42 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Tzp6R-0005PG-Mt; Mon, 28 Jan 2013 13:50:27 +0000 Received: from mail-pb0-f43.google.com ([209.85.160.43]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Tzp5S-0004sc-JC for linux-arm-kernel@lists.infradead.org; Mon, 28 Jan 2013 13:49:27 +0000 Received: by mail-pb0-f43.google.com with SMTP id jt11so1491049pbb.30 for ; Mon, 28 Jan 2013 05:49:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=IwyzefEUrNQLtfuBLbsjE6I4hl6jgZZWKMEt3y6ziL4=; b=HgIOc5v0RCN0gwnnHtLNzte/Mvhn7OyxfryB29UO0+kK6NtPqOfEt7uzxyGfrrLL9U m4AiswjQGrqFfNdv89RBnJX+Ws5bPnflVBni2GJA5shD5cQaHWFmC7FL0VM9cSS7hmDF e3CFBSM1Au1jr330JoquOM8CRQiCyQri9X6rk3azwJpYMAvIqTwP4FoPZ+sLGSqdMbP5 hPr8u2AflsmL9OqanllJPQ1aTjGsaSTFzIzECEC6qdAp/qYBTcoObbjUAsUIMEeuExI6 GrBFAa6xUsbfZHhHJGZp4/de18BrgU9AxmzNRbXAEE56Z7lNpYDm7ZE2LDVd8Zsb2gWD 5c5A== X-Received: by 10.66.9.2 with SMTP id v2mr36020148paa.18.1359380965060; Mon, 28 Jan 2013 05:49:25 -0800 (PST) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id nm2sm6355934pbc.43.2013.01.28.05.49.20 (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 28 Jan 2013 05:49:24 -0800 (PST) From: Prabhakar Lad To: Sekhar Nori , linux-arm-kernel@lists.infradead.org, davinci-linux-open-source@linux.davincidsp.com Subject: [PATCH v2 6/6] ARM: davinci: da850: configure system configuration chip(CFGCHIP3) for emac Date: Mon, 28 Jan 2013 19:17:59 +0530 Message-Id: <1359380879-26306-7-git-send-email-prabhakar.lad@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1359380879-26306-1-git-send-email-prabhakar.lad@ti.com> References: <1359380879-26306-1-git-send-email-prabhakar.lad@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130128_084926_755532_9AD98E39 X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.43 listed in list.dnswl.org] 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (prabhakar.csengg[at]gmail.com) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: netdev@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Heiko Schocher , linux-kernel@vger.kernel.org, "Lad, Prabhakar" X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Lad, Prabhakar The system configuration chip CFGCHIP3, controls the emac module. This patch appropriately configures this register for emac and sets DA850_MII_MDIO_CLKEN_PIN GPIO pin appropriately. Signed-off-by: Lad, Prabhakar Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: davinci-linux-open-source@linux.davincidsp.com Cc: netdev@vger.kernel.org Cc: devicetree-discuss@lists.ozlabs.org Cc: Sekhar Nori Cc: Heiko Schocher --- arch/arm/mach-davinci/da8xx-dt.c | 28 ++++++++++++++++++++++++++++ 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index e533a0a..4a096e3 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -8,6 +8,7 @@ * published by the Free Software Foundation. */ #include +#include #include #include #include @@ -39,6 +40,32 @@ static void __init da8xx_init_irq(void) #ifdef CONFIG_ARCH_DAVINCI_DA850 +static void __init da8xx_config_emac(void) +{ +#define DA850_MII_MDIO_CLKEN_PIN GPIO_TO_PIN(2, 6) +#define DA850_EMAC_MODE_SELECT BIT(8) + void __iomem *cfg_chip3_base; + int ret; + u32 val; + + cfg_chip3_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); + + val = __raw_readl(cfg_chip3_base); + val &= ~DA850_EMAC_MODE_SELECT; + /* configure the CFGCHIP3 register for MII */ + __raw_writel(val, cfg_chip3_base); + pr_info("EMAC: MII PHY configured\n"); + + ret = gpio_request(DA850_MII_MDIO_CLKEN_PIN, "mdio_clk_en"); + if (ret) { + pr_warn("Cannot open GPIO %d\n", + DA850_MII_MDIO_CLKEN_PIN); + return; + } + /* Enable/Disable MII MDIO clock */ + gpio_direction_output(DA850_MII_MDIO_CLKEN_PIN, 0); +} + struct of_dev_auxdata da8xx_auxdata[] __initdata = { OF_DEV_AUXDATA("ti,davinci_mdio", 0x01e24000, "davinci_mdio.0", NULL), OF_DEV_AUXDATA("ti,davinci-dm6467-emac", 0x01e20000, "davinci_emac.1", @@ -52,6 +79,7 @@ static void __init da850_init_machine(void) da8xx_auxdata, NULL); da8xx_uart_clk_enable(); + da8xx_config_emac(); } static const char *da850_boards_compat[] __initdata = {