From patchwork Mon Mar 31 15:16:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27445 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f72.google.com (mail-oa0-f72.google.com [209.85.219.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A2886202E0 for ; Mon, 31 Mar 2014 15:18:11 +0000 (UTC) Received: by mail-oa0-f72.google.com with SMTP id eb12sf29730084oac.7 for ; Mon, 31 Mar 2014 08:18:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=uXS0/hzSMP+MMd9jIkbJmnpWIEhG/toFXEBmMIESdlc=; b=atOWsdb8xLK76bswTe4XI1ZAETdsEYizlmZzhHCywN4feUMYTs9jXst0oeOo+dv8nt wDBrkvbOoobUu0Yl9XxdLvWGxx7xlgLov4fJiw2CJJZTwAOUP99Klle4pGLQZ4ogcVgk 4EdFqC23Nx3XhRBKjmCk2GCwBYoPlCJM1ys1N5yXAKsmosvqsc3RvRMIWlLRBRWc1PoG 8Ff7lqYnY1V5x4IFRYtzw4F++u0t08ZXc/uytfs0iQL+L8FBgi1urUbrhpfhRtQOHUUf o0NsfMsRrz43HPxYC3aBKwyOxT/VvyKwoNnra2eHVm+Ef4OJeLyt0x5bAiudi6+m1Eq7 tfOg== X-Gm-Message-State: ALoCoQno9NtohsDDe0pLXaTVQi8aTjOwqlxrSv9E+pkhk3kbZ+G0FHUHog03vwXCrGnbuGfHvDMS X-Received: by 10.42.13.198 with SMTP id e6mr8848458ica.21.1396279091182; Mon, 31 Mar 2014 08:18:11 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.18.241 with SMTP id 104ls77763qgf.24.gmail; Mon, 31 Mar 2014 08:18:11 -0700 (PDT) X-Received: by 10.52.113.1 with SMTP id iu1mr484503vdb.35.1396279091066; Mon, 31 Mar 2014 08:18:11 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id iz10si3023287vec.114.2014.03.31.08.18.11 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:18:11 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jw12so8492079veb.13 for ; Mon, 31 Mar 2014 08:18:11 -0700 (PDT) X-Received: by 10.220.170.202 with SMTP id e10mr2504943vcz.20.1396279090976; Mon, 31 Mar 2014 08:18:10 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.12.8 with SMTP id v8csp150725vcv; Mon, 31 Mar 2014 08:18:10 -0700 (PDT) X-Received: by 10.68.34.197 with SMTP id b5mr25920117pbj.16.1396279089994; Mon, 31 Mar 2014 08:18:09 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k1si9354231pao.142.2014.03.31.08.18.09; Mon, 31 Mar 2014 08:18:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753828AbaCaPSI (ORCPT + 5 others); Mon, 31 Mar 2014 11:18:08 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:54693 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753483AbaCaPSG (ORCPT ); Mon, 31 Mar 2014 11:18:06 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2VFHaqk028654; Mon, 31 Mar 2014 10:17:36 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFHZKT023412; Mon, 31 Mar 2014 10:17:35 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Mon, 31 Mar 2014 10:17:35 -0500 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFGm4A013169; Mon, 31 Mar 2014 10:17:34 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 23/55] ARM: AM33xx: CM: move cm33xx.h header to a public location Date: Mon, 31 Mar 2014 18:16:02 +0300 Message-ID: <1396278994-12624-24-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1396278994-12624-1-git-send-email-t-kristo@ti.com> References: <1396278994-12624-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: t-kristo@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This file needs to be accessible from the PRCM core and mach-omap2 board support code. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/cm33xx.c | 2 +- arch/arm/mach-omap2/cm33xx.h | 50 +-------------------------- include/linux/power/omap/cm33xx.h | 68 +++++++++++++++++++++++++++++++++++++ 3 files changed, 70 insertions(+), 50 deletions(-) create mode 100644 include/linux/power/omap/cm33xx.h diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index c7be4e4..7a7b2e7 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -24,7 +24,7 @@ #include "clockdomain.h" #include "cm.h" -#include "cm33xx.h" +#include #include "prm33xx.h" #define AM33XX_MODULEMODE_SHIFT 0 diff --git a/arch/arm/mach-omap2/cm33xx.h b/arch/arm/mach-omap2/cm33xx.h index 8f9e479..67f1d49 100644 --- a/arch/arm/mach-omap2/cm33xx.h +++ b/arch/arm/mach-omap2/cm33xx.h @@ -18,6 +18,7 @@ #define __ARCH_ARM_MACH_OMAP2_CM_33XX_H #include "cm.h" +#include /* CM base address */ #define AM33XX_CM_BASE 0x44e00000 @@ -25,16 +26,6 @@ #define AM33XX_CM_REGADDR(inst, reg) \ AM33XX_L4_WK_IO_ADDRESS(AM33XX_CM_BASE + (inst) + (reg)) -/* CM instances */ -#define AM33XX_CM_PER_MOD 0x0000 -#define AM33XX_CM_WKUP_MOD 0x0400 -#define AM33XX_CM_DPLL_MOD 0x0500 -#define AM33XX_CM_MPU_MOD 0x0600 -#define AM33XX_CM_DEVICE_MOD 0x0700 -#define AM33XX_CM_RTC_MOD 0x0800 -#define AM33XX_CM_GFX_MOD 0x0900 -#define AM33XX_CM_CEFUSE_MOD 0x0A00 - /* CM */ /* CM.PER_CM register offsets */ @@ -371,43 +362,4 @@ #define AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL_OFFSET 0x0020 #define AM33XX_CM_CEFUSE_CEFUSE_CLKCTRL AM33XX_CM_REGADDR(AM33XX_CM_CEFUSE_MOD, 0x0020) - -#ifndef __ASSEMBLER__ -bool am33xx_cm_is_clkdm_in_hwsup(u16 inst, u16 cdoffs); -void am33xx_cm_clkdm_enable_hwsup(u16 inst, u16 cdoffs); -void am33xx_cm_clkdm_disable_hwsup(u16 inst, u16 cdoffs); -void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs); -void am33xx_cm_clkdm_force_wakeup(u16 inst, u16 cdoffs); - -#ifdef CONFIG_SOC_AM33XX -extern int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs, - u16 clkctrl_offs); -extern void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs, - u16 clkctrl_offs); -extern void am33xx_cm_module_disable(u16 inst, s16 cdoffs, - u16 clkctrl_offs); -extern int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, - u16 clkctrl_offs); -#else -static inline int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs, - u16 clkctrl_offs) -{ - return 0; -} -static inline void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs, - u16 clkctrl_offs) -{ -} -static inline void am33xx_cm_module_disable(u16 inst, s16 cdoffs, - u16 clkctrl_offs) -{ -} -static inline int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, - u16 clkctrl_offs) -{ - return 0; -} -#endif - -#endif /* ASSEMBLER */ #endif diff --git a/include/linux/power/omap/cm33xx.h b/include/linux/power/omap/cm33xx.h new file mode 100644 index 0000000..2449ba8 --- /dev/null +++ b/include/linux/power/omap/cm33xx.h @@ -0,0 +1,68 @@ +/* + * AM33XX CM offset macros + * + * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/ + * Vaibhav Hiremath + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation version 2. + * + * This program is distributed "as is" WITHOUT ANY WARRANTY of any + * kind, whether express or implied; without even the implied warranty + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef __LINUX_POWER_OMAP_CM33XX_H +#define __LINUX_POWER_OMAP_CM33XX_H + +/* CM instances */ +#define AM33XX_CM_PER_MOD 0x0000 +#define AM33XX_CM_WKUP_MOD 0x0400 +#define AM33XX_CM_DPLL_MOD 0x0500 +#define AM33XX_CM_MPU_MOD 0x0600 +#define AM33XX_CM_DEVICE_MOD 0x0700 +#define AM33XX_CM_RTC_MOD 0x0800 +#define AM33XX_CM_GFX_MOD 0x0900 +#define AM33XX_CM_CEFUSE_MOD 0x0A00 + +#ifndef __ASSEMBLER__ +bool am33xx_cm_is_clkdm_in_hwsup(u16 inst, u16 cdoffs); +void am33xx_cm_clkdm_enable_hwsup(u16 inst, u16 cdoffs); +void am33xx_cm_clkdm_disable_hwsup(u16 inst, u16 cdoffs); +void am33xx_cm_clkdm_force_sleep(u16 inst, u16 cdoffs); +void am33xx_cm_clkdm_force_wakeup(u16 inst, u16 cdoffs); + +#ifdef CONFIG_SOC_AM33XX +int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs, + u16 clkctrl_offs); +void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs, + u16 clkctrl_offs); +void am33xx_cm_module_disable(u16 inst, s16 cdoffs, + u16 clkctrl_offs); +int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, + u16 clkctrl_offs); +#else +static inline int am33xx_cm_wait_module_idle(u16 inst, s16 cdoffs, + u16 clkctrl_offs) +{ + return 0; +} +static inline void am33xx_cm_module_enable(u8 mode, u16 inst, s16 cdoffs, + u16 clkctrl_offs) +{ +} +static inline void am33xx_cm_module_disable(u16 inst, s16 cdoffs, + u16 clkctrl_offs) +{ +} +static inline int am33xx_cm_wait_module_ready(u16 inst, s16 cdoffs, + u16 clkctrl_offs) +{ + return 0; +} +#endif + +#endif /* ASSEMBLER */ +#endif