From patchwork Thu Aug 2 19:51:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 1268041 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 8CF7A3FCC5 for ; Thu, 2 Aug 2012 19:54:26 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sx1R4-0001WV-3O; Thu, 02 Aug 2012 19:51:54 +0000 Received: from bombadil.infradead.org ([2001:4830:2446:ff00:4687:fcff:fea6:5117]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sx1R2-0001W1-0K for linux-arm-kernel@merlin.infradead.org; Thu, 02 Aug 2012 19:51:52 +0000 Received: from svenfoo.org ([82.94.215.22] helo=mail.zonque.de) by bombadil.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Sx1Qx-0001Ba-O5 for linux-arm-kernel@lists.infradead.org; Thu, 02 Aug 2012 19:51:49 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.zonque.de (Postfix) with ESMTP id 5E49A1B40E9; Thu, 2 Aug 2012 21:51:42 +0200 (CEST) Received: from mail.zonque.de ([127.0.0.1]) by localhost (rambrand.bugwerft.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 0q90RrxPqyFs; Thu, 2 Aug 2012 21:51:42 +0200 (CEST) Received: from tamtam.taperay.com (i59F72AC4.versanet.de [89.247.42.196]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.zonque.de (Postfix) with ESMTPSA id D1244C0067; Thu, 2 Aug 2012 21:51:41 +0200 (CEST) From: Daniel Mack To: linux-arm-kernel@lists.infradead.org Subject: [PATCH RFC] ARM: omap2/am33xx: add hwmod for davinci_mdio Date: Thu, 2 Aug 2012 21:51:37 +0200 Message-Id: <1343937097-30484-1-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.7.11.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20120802_155148_092478_6095CC33 X-CRM114-Status: GOOD ( 11.34 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.3.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (zonque[at]gmail.com) 0.0 DKIM_ADSP_CUSTOM_MED No valid author signature, adsp_override is CUSTOM_MED 0.8 SPF_NEUTRAL SPF: sender does not match SPF record (neutral) -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.9 NML_ADSP_CUSTOM_MED ADSP custom_med hit, and not from a mailing list Cc: mugunthanvnm@ti.com, tony@atomide.com, koen@dominion.thruhere.net, hvaibhav@ti.com, Daniel Mack , linux-omap@vger.kernel.org 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 Add a hwmod entry for the davinci_mdio hardware block. This aliases the cpsw_125mhz_clkdm and re-uses am33xx_cpgmac0_hwmod_class. Signed-off-by: Daniel Mack --- I'm still not totally confident with the hwmod environment, so I'm not entirely sure whether sharing the hwmod_class is the right thing to do here. However, I can at least get ethernet to work on my board now. arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 31 ++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c index 5a4660b..637b6cc 100644 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c @@ -684,6 +684,19 @@ static struct omap_hwmod am33xx_cpgmac0_hwmod = { }, }; +static struct omap_hwmod am33xx_cpsw_mdio_hwmod = { + .name = "davinci_mdio", + .class = &am33xx_cpgmac0_hwmod_class, + .clkdm_name = "cpsw_125mhz_clkdm", + .main_clk = "cpsw_125mhz_gclk", + .prcm = { + .omap4 = { + .clkctrl_offs = AM33XX_CM_PER_CPGMAC0_CLKCTRL_OFFSET, + .modulemode = MODULEMODE_SWCTRL, + }, + }, +}; + /* * dcan class */ @@ -2501,6 +2514,23 @@ static struct omap_hwmod_ocp_if am33xx_l4_hs__cpgmac0 = { .user = OCP_USER_MPU, }; +static struct omap_hwmod_addr_space am33xx_cpsw_mdio_addr_space[] = { + { + .pa_start = 0x4a101000, + .pa_end = 0x4a101000 + SZ_256 - 1, + .flags = ADDR_TYPE_RT, + }, + { } +}; + +static struct omap_hwmod_ocp_if am33xx_l4_hs__cpsw_mdio = { + .master = &am33xx_l4_hs_hwmod, + .slave = &am33xx_cpsw_mdio_hwmod, + .clk = "cpsw_125mhz_gclk", + .addr = am33xx_cpsw_mdio_addr_space, + .user = OCP_USER_MPU, +}; + static struct omap_hwmod_addr_space am33xx_elm_addr_space[] = { { .pa_start = 0x48080000, @@ -3371,6 +3401,7 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { &am33xx_l3_main__tptc2, &am33xx_l3_s__usbss, &am33xx_l4_hs__cpgmac0, + &am33xx_l4_hs__cpsw_mdio, NULL, };