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: 2056161 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from arroyo.ext.ti.com (arroyo.ext.ti.com [192.94.94.40]) by patchwork1.kernel.org (Postfix) with ESMTP id BE4153FD49 for ; Mon, 28 Jan 2013 13:56:12 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0SDqBNf006213; Mon, 28 Jan 2013 07:52:11 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0SDqB2R021019; Mon, 28 Jan 2013 07:52:11 -0600 Received: from dlelxv23.itg.ti.com (172.17.1.198) by dfle72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.1.323.3; Mon, 28 Jan 2013 07:52:11 -0600 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0SDqBs1026201; Mon, 28 Jan 2013 07:52:11 -0600 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 3D48080627; Mon, 28 Jan 2013 07:52:11 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 7CEBE80633 for ; Mon, 28 Jan 2013 07:50:01 -0600 (CST) Received: from medina.ext.ti.com (medina.ext.ti.com [192.91.81.31]) by dflp51.itg.ti.com (8.13.7/8.13.8) with ESMTP id r0SDo1Vv008935 for ; Mon, 28 Jan 2013 07:50:01 -0600 (CST) Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by medina.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0SDo07e032282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 28 Jan 2013 07:50:00 -0600 Received: from [216.82.250.51:41082] by server-14.bemta-12.messagelabs.com id E5/0E-28605-80286015; Mon, 28 Jan 2013 13:50:00 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-11.tower-108.messagelabs.com!1359380965!10768315!1 X-Originating-IP: [209.85.220.51] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.7; banners=-,-,- X-VirusChecked: Checked Received: (qmail 24730 invoked from network); 28 Jan 2013 13:49:26 -0000 Received: from mail-pa0-f51.google.com (HELO mail-pa0-f51.google.com) (209.85.220.51) by server-11.tower-108.messagelabs.com with RC4-SHA encrypted SMTP; 28 Jan 2013 13:49:26 -0000 Received: by mail-pa0-f51.google.com with SMTP id fb11so1523810pad.38 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 , , 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> CC: , , Heiko Schocher , X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com 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 = {