From patchwork Mon Mar 31 15:16:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 27465 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f200.google.com (mail-qc0-f200.google.com [209.85.216.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E4439202E0 for ; Mon, 31 Mar 2014 15:18:44 +0000 (UTC) Received: by mail-qc0-f200.google.com with SMTP id i17sf19272822qcy.11 for ; Mon, 31 Mar 2014 08:18:44 -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=QzvYB2nHpG46xoSBC0W1N4qGc1rfyppKEgQIJgXh9W4=; b=OduNrCv38F5xFh31fWdwvJXPb/2rVXU3t+BfRTSGQqIVr2DRC5aj6h3ZI2V03F9T0q swE7UBG9C+aWuybObjCoGCCjc0c2Pmi39xveQr6qnmMq87T4JW/O70Hk+Ew0HC230q4q uOlVH5yNCNjE2F7bJkpDm+KKpz9BJflq++mGZsnD+1BtUBUhAj6q/oo4ZsnHdgJwJZ35 cKRzi8Ap3xDmphkFCfmssBnlZwssTktpkkpujiT0wAzaWEu+AAc1gv9R9233Eu0G2cvc ESZDmkNRAPJarqUtqrMXwUTnrb3NtHXaDUvIwtGo2rOAgQIZqCE/I5kkxiSWefNUBSMz 9WdQ== X-Gm-Message-State: ALoCoQmXABsaznmWUxHyNhRCGmgISnihHr18fsnhWPppqfE+ceUKNTY7E43iF+A85El48ug33xAy X-Received: by 10.224.13.12 with SMTP id z12mr10154725qaz.7.1396279124701; Mon, 31 Mar 2014 08:18:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.103.77 with SMTP id x71ls2641001qge.31.gmail; Mon, 31 Mar 2014 08:18:44 -0700 (PDT) X-Received: by 10.58.161.101 with SMTP id xr5mr147404veb.36.1396279124593; Mon, 31 Mar 2014 08:18:44 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ej2si3016651veb.203.2014.03.31.08.18.44 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 31 Mar 2014 08:18:44 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so8590109vcb.12 for ; Mon, 31 Mar 2014 08:18:44 -0700 (PDT) X-Received: by 10.52.231.72 with SMTP id te8mr35180vdc.54.1396279124428; Mon, 31 Mar 2014 08:18:44 -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 v8csp150786vcv; Mon, 31 Mar 2014 08:18:44 -0700 (PDT) X-Received: by 10.68.231.196 with SMTP id ti4mr25938815pbc.48.1396279123108; Mon, 31 Mar 2014 08:18:43 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uc9si9326144pac.458.2014.03.31.08.18.42; Mon, 31 Mar 2014 08:18:42 -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 S1753888AbaCaPSk (ORCPT + 5 others); Mon, 31 Mar 2014 11:18:40 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:39187 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753561AbaCaPSj (ORCPT ); Mon, 31 Mar 2014 11:18:39 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2VFI4F7005453; Mon, 31 Mar 2014 10:18:04 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2VFI2sv023758; Mon, 31 Mar 2014 10:18:04 -0500 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Mon, 31 Mar 2014 10:18:03 -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 s2VFGm4N013169; Mon, 31 Mar 2014 10:18:00 -0500 From: Tero Kristo To: , , CC: Subject: [PATCH 36/55] ARM: OMAP3: PRM: move prm3xxx.h header to public location Date: Mon, 31 Mar 2014 18:16:15 +0300 Message-ID: <1396278994-12624-37-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.220.181 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/prm3xxx.c | 2 +- arch/arm/mach-omap2/prm3xxx.h | 113 +----------------------------- arch/arm/mach-omap2/prm_common.c | 2 +- include/linux/power/omap/prm3xxx.h | 132 ++++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 114 deletions(-) create mode 100644 include/linux/power/omap/prm3xxx.h diff --git a/arch/arm/mach-omap2/prm3xxx.c b/arch/arm/mach-omap2/prm3xxx.c index 4700605..93f87e1 100644 --- a/arch/arm/mach-omap2/prm3xxx.c +++ b/arch/arm/mach-omap2/prm3xxx.c @@ -20,7 +20,7 @@ #include "vp.h" #include "powerdomain.h" -#include "prm3xxx.h" +#include #include "prm2xxx_3xxx_private.h" #include "cm2xxx_3xxx_private.h" #include diff --git a/arch/arm/mach-omap2/prm3xxx.h b/arch/arm/mach-omap2/prm3xxx.h index ffc8177..6c06fce 100644 --- a/arch/arm/mach-omap2/prm3xxx.h +++ b/arch/arm/mach-omap2/prm3xxx.h @@ -19,120 +19,9 @@ #include "prcm-common.h" #include "prm.h" #include +#include #define OMAP34XX_PRM_REGADDR(module, reg) \ OMAP2_L4_IO_ADDRESS(OMAP3430_PRM_BASE + (module) + (reg)) - -/* - * OMAP3-specific global PRM registers - * Use __raw_{read,write}l() with these registers. - * - * With a few exceptions, these are the register names beginning with - * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE - * bits.) - */ - -#define OMAP3_PRM_REVISION_OFFSET 0x0004 -#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014 - -#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018 -#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c - - -#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020 -#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024 -#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028 -#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c -#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030 -#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034 -#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038 -#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c -#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050 -#define OMAP3_PRM_RSTTIME_OFFSET 0x0054 -#define OMAP3_PRM_RSTST_OFFSET 0x0058 -#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060 -#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064 -#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070 -#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090 -#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094 -#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098 -#define OMAP3_PRM_POLCTRL_OFFSET 0x009c -#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0 -#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0 -#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4 -#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8 -#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc -#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0 -#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4 -#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0 -#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4 -#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8 -#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc -#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0 -#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4 - -#define OMAP3_PRM_CLKSEL_OFFSET 0x0040 -#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070 - -/* OMAP3 specific register offsets */ -#define OMAP3430ES2_PM_WKEN3 0x00f0 -#define OMAP3430ES2_PM_WKST3 0x00b8 - -#define OMAP3430_PM_MPUGRPSEL 0x00a4 -#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL -#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8 - -#define OMAP3430_PM_IVAGRPSEL 0x00a8 -#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL -#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4 - -#define OMAP3430_PM_PREPWSTST 0x00e8 - -#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8 -#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc - - -#ifndef __ASSEMBLER__ - -/* OMAP3-specific VP functions */ -u32 omap3_prm_vp_check_txdone(u8 vp_id); -void omap3_prm_vp_clear_txdone(u8 vp_id); - -/* - * OMAP3 access functions for voltage controller (VC) and - * voltage proccessor (VP) in the PRM. - */ -extern u32 omap3_prm_vcvp_read(u8 offset); -extern void omap3_prm_vcvp_write(u32 val, u8 offset); -extern u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); - -#ifdef CONFIG_ARCH_OMAP3 -void omap3xxx_prm_reconfigure_io_chain(void); -#else -static inline void omap3xxx_prm_reconfigure_io_chain(void) -{ -} -#endif - -/* PRM interrupt-related functions */ -extern void omap3xxx_prm_read_pending_irqs(unsigned long *events); -extern void omap3xxx_prm_ocp_barrier(void); -extern void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); -extern void omap3xxx_prm_restore_irqen(u32 *saved_mask); - -extern void omap3xxx_prm_dpll3_reset(void); - -int __init omap3xxx_prm_init(u16 cpu_type); -extern u32 omap3xxx_prm_get_reset_sources(void); -int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits); -void omap3xxx_prm_iva_idle(void); -void omap3_prm_reset_modem(void); -int omap3xxx_prm_clear_global_cold_reset(void); -void omap3_prm_save_scratchpad_contents(u32 *ptr); -void omap3_prm_init_pm(bool has_uart4, bool has_iva); - -#endif /* __ASSEMBLER */ - - #endif diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index c3eef62..40e94e7 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c @@ -30,7 +30,7 @@ #include #include -#include "prm3xxx.h" +#include #include "prm44xx.h" /* diff --git a/include/linux/power/omap/prm3xxx.h b/include/linux/power/omap/prm3xxx.h new file mode 100644 index 0000000..3bdc372 --- /dev/null +++ b/include/linux/power/omap/prm3xxx.h @@ -0,0 +1,132 @@ +/* + * OMAP3xxx Power/Reset Management (PRM) register definitions + * + * Copyright (C) 2007-2009, 2011-2012 Texas Instruments, Inc. + * Copyright (C) 2008-2010 Nokia Corporation + * Paul Walmsley + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * The PRM hardware modules on the OMAP2/3 are quite similar to each + * other. The PRM on OMAP4 has a new register layout, and is handled + * in a separate file. + */ +#ifndef __LINUX_POWER_OMAP_PRM3XXX_H +#define __LINUX_POWER_OMAP_PRM3XXX_H + +#include + +/* + * OMAP3-specific global PRM registers + * Use __raw_{read,write}l() with these registers. + * + * With a few exceptions, these are the register names beginning with + * PRM_* on 34xx. (The exceptions are the IRQSTATUS and IRQENABLE + * bits.) + */ + +#define OMAP3_PRM_REVISION_OFFSET 0x0004 +#define OMAP3_PRM_SYSCONFIG_OFFSET 0x0014 + +#define OMAP3_PRM_IRQSTATUS_MPU_OFFSET 0x0018 +#define OMAP3_PRM_IRQENABLE_MPU_OFFSET 0x001c + + +#define OMAP3_PRM_VC_SMPS_SA_OFFSET 0x0020 +#define OMAP3_PRM_VC_SMPS_VOL_RA_OFFSET 0x0024 +#define OMAP3_PRM_VC_SMPS_CMD_RA_OFFSET 0x0028 +#define OMAP3_PRM_VC_CMD_VAL_0_OFFSET 0x002c +#define OMAP3_PRM_VC_CMD_VAL_1_OFFSET 0x0030 +#define OMAP3_PRM_VC_CH_CONF_OFFSET 0x0034 +#define OMAP3_PRM_VC_I2C_CFG_OFFSET 0x0038 +#define OMAP3_PRM_VC_BYPASS_VAL_OFFSET 0x003c +#define OMAP3_PRM_RSTCTRL_OFFSET 0x0050 +#define OMAP3_PRM_RSTTIME_OFFSET 0x0054 +#define OMAP3_PRM_RSTST_OFFSET 0x0058 +#define OMAP3_PRM_VOLTCTRL_OFFSET 0x0060 +#define OMAP3_PRM_SRAM_PCHARGE_OFFSET 0x0064 +#define OMAP3_PRM_CLKSRC_CTRL_OFFSET 0x0070 +#define OMAP3_PRM_VOLTSETUP1_OFFSET 0x0090 +#define OMAP3_PRM_VOLTOFFSET_OFFSET 0x0094 +#define OMAP3_PRM_CLKSETUP_OFFSET 0x0098 +#define OMAP3_PRM_POLCTRL_OFFSET 0x009c +#define OMAP3_PRM_VOLTSETUP2_OFFSET 0x00a0 +#define OMAP3_PRM_VP1_CONFIG_OFFSET 0x00b0 +#define OMAP3_PRM_VP1_VSTEPMIN_OFFSET 0x00b4 +#define OMAP3_PRM_VP1_VSTEPMAX_OFFSET 0x00b8 +#define OMAP3_PRM_VP1_VLIMITTO_OFFSET 0x00bc +#define OMAP3_PRM_VP1_VOLTAGE_OFFSET 0x00c0 +#define OMAP3_PRM_VP1_STATUS_OFFSET 0x00c4 +#define OMAP3_PRM_VP2_CONFIG_OFFSET 0x00d0 +#define OMAP3_PRM_VP2_VSTEPMIN_OFFSET 0x00d4 +#define OMAP3_PRM_VP2_VSTEPMAX_OFFSET 0x00d8 +#define OMAP3_PRM_VP2_VLIMITTO_OFFSET 0x00dc +#define OMAP3_PRM_VP2_VOLTAGE_OFFSET 0x00e0 +#define OMAP3_PRM_VP2_STATUS_OFFSET 0x00e4 + +#define OMAP3_PRM_CLKSEL_OFFSET 0x0040 +#define OMAP3_PRM_CLKOUT_CTRL_OFFSET 0x0070 + +/* OMAP3 specific register offsets */ +#define OMAP3430ES2_PM_WKEN3 0x00f0 +#define OMAP3430ES2_PM_WKST3 0x00b8 + +#define OMAP3430_PM_MPUGRPSEL 0x00a4 +#define OMAP3430_PM_MPUGRPSEL1 OMAP3430_PM_MPUGRPSEL +#define OMAP3430ES2_PM_MPUGRPSEL3 0x00f8 + +#define OMAP3430_PM_IVAGRPSEL 0x00a8 +#define OMAP3430_PM_IVAGRPSEL1 OMAP3430_PM_IVAGRPSEL +#define OMAP3430ES2_PM_IVAGRPSEL3 0x00f4 + +#define OMAP3430_PM_PREPWSTST 0x00e8 + +#define OMAP3430_PRM_IRQSTATUS_IVA2 0x00f8 +#define OMAP3430_PRM_IRQENABLE_IVA2 0x00fc + + +#ifndef __ASSEMBLER__ + +/* OMAP3-specific VP functions */ +u32 omap3_prm_vp_check_txdone(u8 vp_id); +void omap3_prm_vp_clear_txdone(u8 vp_id); + +/* + * OMAP3 access functions for voltage controller (VC) and + * voltage proccessor (VP) in the PRM. + */ +u32 omap3_prm_vcvp_read(u8 offset); +void omap3_prm_vcvp_write(u32 val, u8 offset); +u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset); + +#ifdef CONFIG_ARCH_OMAP3 +void omap3xxx_prm_reconfigure_io_chain(void); +#else +static inline void omap3xxx_prm_reconfigure_io_chain(void) +{ +} +#endif + +/* PRM interrupt-related functions */ +void omap3xxx_prm_read_pending_irqs(unsigned long *events); +void omap3xxx_prm_ocp_barrier(void); +void omap3xxx_prm_save_and_clear_irqen(u32 *saved_mask); +void omap3xxx_prm_restore_irqen(u32 *saved_mask); + +void omap3xxx_prm_dpll3_reset(void); + +int __init omap3xxx_prm_init(u16 cpu_type); +u32 omap3xxx_prm_get_reset_sources(void); +int omap3xxx_prm_clear_mod_irqs(s16 module, u8 regs, u32 ignore_bits); +void omap3xxx_prm_iva_idle(void); +void omap3_prm_reset_modem(void); +int omap3xxx_prm_clear_global_cold_reset(void); +void omap3_prm_save_scratchpad_contents(u32 *ptr); +void omap3_prm_init_pm(bool has_uart4, bool has_iva); + +#endif /* __ASSEMBLER */ + + +#endif