From patchwork Thu Mar 14 10:37:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: avinash philip X-Patchwork-Id: 2269281 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id E8BDBDFB79 for ; Thu, 14 Mar 2013 10:40:28 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG5Xo-00027i-UG; Thu, 14 Mar 2013 10:37:56 +0000 Received: from bear.ext.ti.com ([192.94.94.41]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UG5XN-0001vt-7m for linux-arm-kernel@lists.infradead.org; Thu, 14 Mar 2013 10:37:33 +0000 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2EAbOWi009836; Thu, 14 Mar 2013 05:37:24 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2EAbLdX018843; Thu, 14 Mar 2013 16:07:21 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Thu, 14 Mar 2013 16:07:21 +0530 Received: from ucmsshproxy.india.ext.ti.com (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with SMTP id r2EAbJqG004228; Thu, 14 Mar 2013 16:07:19 +0530 Received: from symphony.india.ext.ti.com (unknown [192.168.247.13]) by ucmsshproxy.india.ext.ti.com (Postfix) with ESMTP id A1C75158002; Thu, 14 Mar 2013 16:07:19 +0530 (IST) Received: from ubuntu-psp-linux.india.ext.ti.com (ubuntu-psp-linux [192.168.247.46]) by symphony.india.ext.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r2EAbJR11612; Thu, 14 Mar 2013 16:07:19 +0530 (IST) From: Philip Avinash To: , Subject: [PATCH 2/3] ARM: davinci: da850: Enable EHRPWM TBCLK from CFG_CHIP1 Date: Thu, 14 Mar 2013 16:07:32 +0530 Message-ID: <1363257453-24747-3-git-send-email-avinashphilip@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363257453-24747-1-git-send-email-avinashphilip@ti.com> References: <1363257453-24747-1-git-send-email-avinashphilip@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130314_063729_406907_BA068CAB X-CRM114-Status: GOOD ( 11.85 ) X-Spam-Score: -9.3 (---------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-9.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [192.94.94.41 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -2.4 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: davinci-linux-open-source@linux.davincidsp.com, Philip Avinash , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, prakash.pm@ti.com 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 da850 platforms require TBCLK synchronization in CFG_CHIP1 register for TBCLK enable in EHRPWM modules. Enabling of TBCLK is done only if EHRPWM DT node status is set to "okay" DT blob. Also adds macro definitions for DA8XX_EHRPWM_TBCLKSYNC and DA8XX_CFGCHIP1_REG. Signed-off-by: Philip Avinash --- :100644 100644 6b7a0a2... 72466ab... M arch/arm/mach-davinci/da8xx-dt.c :100644 100644 de439b7... be77ce2... M arch/arm/mach-davinci/include/mach/da8xx.h arch/arm/mach-davinci/da8xx-dt.c | 15 +++++++++++++++ arch/arm/mach-davinci/include/mach/da8xx.h | 1 + 2 files changed, 16 insertions(+) diff --git a/arch/arm/mach-davinci/da8xx-dt.c b/arch/arm/mach-davinci/da8xx-dt.c index 6b7a0a2..72466ab 100644 --- a/arch/arm/mach-davinci/da8xx-dt.c +++ b/arch/arm/mach-davinci/da8xx-dt.c @@ -19,6 +19,7 @@ #include #define DA8XX_NUM_UARTS 3 +#define DA8XX_EHRPWM_TBCLKSYNC BIT(12) void __init da8xx_uart_clk_enable(void) { @@ -47,10 +48,24 @@ struct of_dev_auxdata da850_auxdata_lookup[] __initdata = { static void __init da850_init_machine(void) { + struct device_node *ehrpwm_np; + const char *ehrpwm_compat = "ti,da850-ehrpwm"; + void __iomem *cfg_chip1_base; + + cfg_chip1_base = DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP1_REG); + of_platform_populate(NULL, of_default_bus_match_table, da850_auxdata_lookup, NULL); da8xx_uart_clk_enable(); + + for_each_compatible_node(ehrpwm_np, NULL, ehrpwm_compat) + if (of_device_is_available(ehrpwm_np)) { + /* Enable TBCLK synchronization for EHRWPM modules */ + writel(readl(cfg_chip1_base) | DA8XX_EHRPWM_TBCLKSYNC, + cfg_chip1_base); + break; + } } static const char *da850_boards_compat[] __initdata = { diff --git a/arch/arm/mach-davinci/include/mach/da8xx.h b/arch/arm/mach-davinci/include/mach/da8xx.h index de439b7..be77ce2 100644 --- a/arch/arm/mach-davinci/include/mach/da8xx.h +++ b/arch/arm/mach-davinci/include/mach/da8xx.h @@ -55,6 +55,7 @@ extern unsigned int da850_max_speed; #define DA8XX_SYSCFG0_VIRT(x) (da8xx_syscfg0_base + (x)) #define DA8XX_JTAG_ID_REG 0x18 #define DA8XX_CFGCHIP0_REG 0x17c +#define DA8XX_CFGCHIP1_REG 0x180 #define DA8XX_CFGCHIP2_REG 0x184 #define DA8XX_CFGCHIP3_REG 0x188