From patchwork Thu Oct 14 21:44:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Rodriguez X-Patchwork-Id: 254721 Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o9ELjla0013156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 14 Oct 2010 21:46:12 GMT Received: from dlep35.itg.ti.com ([157.170.170.118]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id o9ELiE5U026417 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Oct 2010 16:44:14 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep35.itg.ti.com (8.13.7/8.13.7) with ESMTP id o9ELiDKr021017; Thu, 14 Oct 2010 16:44:13 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 2E02580627; Thu, 14 Oct 2010 16:44:12 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp53.itg.ti.com (dflp53.itg.ti.com [128.247.5.6]) by linux.omap.com (Postfix) with ESMTP id 6F96280626 for ; Thu, 14 Oct 2010 16:44:10 -0500 (CDT) Received: from red.ext.ti.com (localhost [127.0.0.1]) by dflp53.itg.ti.com (8.13.8/8.13.8) with ESMTP id o9ELiAji000831 for ; Thu, 14 Oct 2010 16:44:10 -0500 (CDT) Received: from psmtp.com (na3sys009amx170.postini.com [74.125.149.96]) by red.ext.ti.com (8.13.7/8.13.7) with SMTP id o9ELi9LS019425 for ; Thu, 14 Oct 2010 16:44:09 -0500 Received: from source ([209.85.160.173]) by na3sys009amx170.postini.com ([74.125.148.10]) with SMTP; Fri, 15 Oct 2010 08:44:09 EST Received: by gyb11 with SMTP id 11so72683gyb.4 for ; Thu, 14 Oct 2010 14:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=ERBDu40heAJU+LL/HWjYxffKE7XD3BpvEdFhqbaSiL4=; b=rdxMc6RoWCUTur2jLJf56namWLe5VeJwyR9UKCMOyTZTPsjf+Ey1VOrfFeHytendjG h1Zj5GTr0ZHNmelSobiEbEEs8ng+qSN31djzaXGsoqUUC9KvXG3g4SeM7tbW0CaYMNfi 8C9ydjJxbifVNL1Z3qmE5umSzsJL9my4JArHM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=JfD6WVTsnHRjzgVy3H9LeBdLmiz16SgaK0MaLq+QF+DtOrCLscT+tC1w2avYwlaODg 3Din3FBrW9O8Q5Oa9seDmkT6Vs25YCp4QwZLZXzrjw3aClXEdTMY1+6suWttd17e/BHm B2nE5aVutoPApiAKdGampT8qIXpPSTBVUocB0= MIME-Version: 1.0 Received: by 10.42.171.196 with SMTP id k4mr5368420icz.202.1287092648753; Thu, 14 Oct 2010 14:44:08 -0700 (PDT) Received: by 10.42.177.70 with HTTP; Thu, 14 Oct 2010 14:44:08 -0700 (PDT) In-Reply-To: <4CB73AD5.2060907@mvista.com> References: <1287076899-4365-1-git-send-email-vm.rod25@gmail.com> <4CB73AD5.2060907@mvista.com> Date: Thu, 14 Oct 2010 16:44:08 -0500 Message-ID: Subject: Re: [PATCH v3 1/9] davinci: EMAC support for Omapl138-Hawkboard From: Victor Rodriguez To: Sergei Shtylyov X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S:99.90000/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.0750) s cv GT3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] Cc: davinci-linux-open-source@linux.davincidsp.com, alsa-devel@alsa-project.org 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: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Thu, 14 Oct 2010 21:46:13 +0000 (UTC) X-MIME-Autoconverted: from quoted-printable to 8bit by demeter1.kernel.org id o9ELjla0013156 diff --git a/arch/arm/mach-davinci/board-omapl138-hawk.c b/arch/arm/mach-davinci/board-omapl138-hawk.c index c472dd8..35bcea1 100644 --- a/arch/arm/mach-davinci/board-omapl138-hawk.c +++ b/arch/arm/mach-davinci/board-omapl138-hawk.c @@ -19,6 +19,53 @@ #include #include +#include + +#define HAWKBOARD_PHY_ID "0:07" + +static short omapl138_hawk_mii_pins[] __initdata = { + DA850_MII_TXEN, DA850_MII_TXCLK, DA850_MII_COL, DA850_MII_TXD_3, + DA850_MII_TXD_2, DA850_MII_TXD_1, DA850_MII_TXD_0, DA850_MII_RXER, + DA850_MII_CRS, DA850_MII_RXCLK, DA850_MII_RXDV, DA850_MII_RXD_3, + DA850_MII_RXD_2, DA850_MII_RXD_1, DA850_MII_RXD_0, DA850_MDIO_CLK, + DA850_MDIO_D, + -1 +}; + +static __init void omapl138_hawk_config_emac(void) +{ + void __iomem *cfgchip3; + int ret; + u32 val; + struct davinci_soc_info *soc_info = &davinci_soc_info; + + if (!machine_is_omapl138_hawkboard()) + return; + + cfgchip3 = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG); + + val = __raw_readl(cfgchip3); + + val &= ~BIT(8); + ret = davinci_cfg_reg_list(omapl138_hawk_mii_pins); + if (ret) + pr_warning("%s: " + "cpgmac/mii mux setup failed: %d\n", __func__, ret); + return; + + /* configure the CFGCHIP3 register for MII */ + __raw_writel(val, cfgchip3); + pr_info("EMAC: MII PHY configured\n"); + + soc_info->emac_pdata->phy_id = HAWKBOARD_PHY_ID; + + ret = da8xx_register_emac(); + if (ret) + pr_warning("%s: " + "emac registration failed: %d\n", __func__, ret); + return; +} + static struct davinci_uart_config omapl138_hawk_uart_config __initdata = { .enabled_uarts = 0x7, @@ -30,6 +77,8 @@ static __init void omapl138_hawk_init(void) davinci_serial_init(&omapl138_hawk_uart_config); + omapl138_hawk_config_emac(); + ret = da8xx_register_watchdog(); if (ret) pr_warning("omapl138_hawk_init: "