From patchwork Thu Jul 11 06:34:03 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Afzal Mohammed X-Patchwork-Id: 2826047 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 40F17C0AB2 for ; Thu, 11 Jul 2013 07:42:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9E8682010B for ; Thu, 11 Jul 2013 07:42:52 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7B992200D9 for ; Thu, 11 Jul 2013 07:42:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxAU3-00018Q-0J; Thu, 11 Jul 2013 06:36:09 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxASV-0007Pe-77; Thu, 11 Jul 2013 06:34:31 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxASS-0007PH-JX for linux-arm-kernel@lists.infradead.org; Thu, 11 Jul 2013 06:34:29 +0000 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r6B6Y6IR027015; Thu, 11 Jul 2013 01:34:06 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id r6B6Y6VX009698; Thu, 11 Jul 2013 01:34:06 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.2.342.3; Thu, 11 Jul 2013 01:34:05 -0500 Received: from psplinux063.india.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r6B6Y3sp003080; Thu, 11 Jul 2013 01:34:04 -0500 From: Afzal Mohammed To: , Subject: [PATCH RFC 01/13] ARM: OMAP2+: hwmod: AM335x: prepare for AM43x reuse Date: Thu, 11 Jul 2013 12:04:03 +0530 Message-ID: <1c4a872117bd814d7fad856b6ef89fc6dbcf37da.1373519192.git.afzal@ti.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130711_023428_774879_9FEEF8C9 X-CRM114-Status: GOOD ( 12.54 ) X-Spam-Score: -7.2 (-------) Cc: Tony Lindgren , Benoit Cousson , Paul Walmsley X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP AM335x & AM43x have most of the interconnects, IPs similar. Instead of adding new hwmod data for AM43x, reuse AM335x hwmod data as much as possible. In the hwmod entries that could be reused on AM43x, major changes are in register offsets and different ocpif clock for most of peripherals that comes under l4_wkup interconnect. To achieve reuse, as a first step, bring out ocpif's relevant for both SoC's to a new array and handle appropriately. Signed-off-by: Afzal Mohammed --- arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c index 7a9b492..b0a38f0 100644 --- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c +++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c @@ -29,6 +29,7 @@ #include "i2c.h" #include "mmc.h" #include "wd_timer.h" +#include "soc.h" /* * IP blocks @@ -2458,6 +2459,13 @@ static struct omap_hwmod_ocp_if am33xx_l3_main__aes0 = { static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { &am33xx_l3_main__emif, + &am33xx_l4_hs__pruss, + &am33xx_l3_main__lcdc, + &am33xx_l3_s__usbss, + NULL, +}; + +static struct omap_hwmod_ocp_if *amx3xx_hwmod_ocp_ifs[] __initdata = { &am33xx_mpu__l3_main, &am33xx_mpu__prcm, &am33xx_l3_s__l4_ls, @@ -2481,7 +2489,6 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { &am33xx_l4_wkup__gpio0, &am33xx_l4_wkup__adc_tsc, &am33xx_l4_wkup__wd_timer1, - &am33xx_l4_hs__pruss, &am33xx_l4_per__dcan0, &am33xx_l4_per__dcan1, &am33xx_l4_per__gpio1, @@ -2522,14 +2529,12 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { &am33xx_epwmss2__eqep2, &am33xx_epwmss2__ehrpwm2, &am33xx_l3_s__gpmc, - &am33xx_l3_main__lcdc, &am33xx_l4_ls__mcspi0, &am33xx_l4_ls__mcspi1, &am33xx_l3_main__tptc0, &am33xx_l3_main__tptc1, &am33xx_l3_main__tptc2, &am33xx_l3_main__ocmc, - &am33xx_l3_s__usbss, &am33xx_l4_hs__cpgmac0, &am33xx_cpgmac0__mdio, &am33xx_l3_main__sha0, @@ -2539,6 +2544,15 @@ static struct omap_hwmod_ocp_if *am33xx_hwmod_ocp_ifs[] __initdata = { int __init am33xx_hwmod_init(void) { + int ret; + omap_hwmod_init(); - return omap_hwmod_register_links(am33xx_hwmod_ocp_ifs); + ret = omap_hwmod_register_links(amx3xx_hwmod_ocp_ifs); + if (ret < 0) + return ret; + + if (soc_is_am33xx()) + return omap_hwmod_register_links(am33xx_hwmod_ocp_ifs); + + return 0; }