59fb659b06
In preparation for adding OMAP4-specific PRCM accessor/mutator functions, split the existing OMAP2/3 PRCM code into OMAP2/3-specific files. Most of what was in mach-omap2/{cm,prm}.{c,h} has now been moved into mach-omap2/{cm,prm}2xxx_3xxx.{c,h}, since it was OMAP2xxx/3xxx-specific. This process also requires the #includes in each of these files to be changed to reference the new file name. As part of doing so, add some comments into plat-omap/sram.c and plat-omap/mcbsp.c, which use "sideways includes", to indicate that these users of the PRM/CM includes should not be doing so. Thanks to Felipe Contreras <felipe.contreras@gmail.com> for comments on this patch. Signed-off-by: Paul Walmsley <paul@pwsan.com> Cc: Jarkko Nikula <jhnikula@gmail.com> Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Cc: Omar Ramirez Luna <omar.ramirez@ti.com> Acked-by: Omar Ramirez Luna <omar.ramirez@ti.com> Cc: Felipe Contreras <felipe.contreras@gmail.com> Acked-by: Felipe Contreras <felipe.contreras@gmail.com> Cc: Greg Kroah-Hartman <greg@kroah.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Tested-by: Rajendra Nayak <rnayak@ti.com> Tested-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
126 lines
4.1 KiB
C
126 lines
4.1 KiB
C
/*
|
|
* OMAP3-specific clock framework functions
|
|
*
|
|
* Copyright (C) 2007-2008 Texas Instruments, Inc.
|
|
* Copyright (C) 2007-2010 Nokia Corporation
|
|
*
|
|
* Paul Walmsley
|
|
* Jouni Högander
|
|
*
|
|
* Parts of this code are based on code written by
|
|
* Richard Woodruff, Tony Lindgren, Tuukka Tikkanen, Karthik Dasu,
|
|
* Russell King
|
|
*
|
|
* 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.
|
|
*/
|
|
#undef DEBUG
|
|
|
|
#include <linux/kernel.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/io.h>
|
|
|
|
#include <plat/clock.h>
|
|
|
|
#include "clock.h"
|
|
#include "clock34xx.h"
|
|
#include "cm2xxx_3xxx.h"
|
|
#include "cm-regbits-34xx.h"
|
|
|
|
/**
|
|
* omap3430es2_clk_ssi_find_idlest - return CM_IDLEST info for SSI
|
|
* @clk: struct clk * being enabled
|
|
* @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
|
|
* @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
|
|
* @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
|
|
*
|
|
* The OMAP3430ES2 SSI target CM_IDLEST bit is at a different shift
|
|
* from the CM_{I,F}CLKEN bit. Pass back the correct info via
|
|
* @idlest_reg and @idlest_bit. No return value.
|
|
*/
|
|
static void omap3430es2_clk_ssi_find_idlest(struct clk *clk,
|
|
void __iomem **idlest_reg,
|
|
u8 *idlest_bit,
|
|
u8 *idlest_val)
|
|
{
|
|
u32 r;
|
|
|
|
r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20);
|
|
*idlest_reg = (__force void __iomem *)r;
|
|
*idlest_bit = OMAP3430ES2_ST_SSI_IDLE_SHIFT;
|
|
*idlest_val = OMAP34XX_CM_IDLEST_VAL;
|
|
}
|
|
|
|
const struct clkops clkops_omap3430es2_ssi_wait = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.find_idlest = omap3430es2_clk_ssi_find_idlest,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
};
|
|
|
|
/**
|
|
* omap3430es2_clk_dss_usbhost_find_idlest - CM_IDLEST info for DSS, USBHOST
|
|
* @clk: struct clk * being enabled
|
|
* @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
|
|
* @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
|
|
* @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
|
|
*
|
|
* Some OMAP modules on OMAP3 ES2+ chips have both initiator and
|
|
* target IDLEST bits. For our purposes, we are concerned with the
|
|
* target IDLEST bits, which exist at a different bit position than
|
|
* the *CLKEN bit position for these modules (DSS and USBHOST) (The
|
|
* default find_idlest code assumes that they are at the same
|
|
* position.) No return value.
|
|
*/
|
|
static void omap3430es2_clk_dss_usbhost_find_idlest(struct clk *clk,
|
|
void __iomem **idlest_reg,
|
|
u8 *idlest_bit,
|
|
u8 *idlest_val)
|
|
{
|
|
u32 r;
|
|
|
|
r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20);
|
|
*idlest_reg = (__force void __iomem *)r;
|
|
/* USBHOST_IDLE has same shift */
|
|
*idlest_bit = OMAP3430ES2_ST_DSS_IDLE_SHIFT;
|
|
*idlest_val = OMAP34XX_CM_IDLEST_VAL;
|
|
}
|
|
|
|
const struct clkops clkops_omap3430es2_dss_usbhost_wait = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.find_idlest = omap3430es2_clk_dss_usbhost_find_idlest,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
};
|
|
|
|
/**
|
|
* omap3430es2_clk_hsotgusb_find_idlest - return CM_IDLEST info for HSOTGUSB
|
|
* @clk: struct clk * being enabled
|
|
* @idlest_reg: void __iomem ** to store CM_IDLEST reg address into
|
|
* @idlest_bit: pointer to a u8 to store the CM_IDLEST bit shift into
|
|
* @idlest_val: pointer to a u8 to store the CM_IDLEST indicator
|
|
*
|
|
* The OMAP3430ES2 HSOTGUSB target CM_IDLEST bit is at a different
|
|
* shift from the CM_{I,F}CLKEN bit. Pass back the correct info via
|
|
* @idlest_reg and @idlest_bit. No return value.
|
|
*/
|
|
static void omap3430es2_clk_hsotgusb_find_idlest(struct clk *clk,
|
|
void __iomem **idlest_reg,
|
|
u8 *idlest_bit,
|
|
u8 *idlest_val)
|
|
{
|
|
u32 r;
|
|
|
|
r = (((__force u32)clk->enable_reg & ~0xf0) | 0x20);
|
|
*idlest_reg = (__force void __iomem *)r;
|
|
*idlest_bit = OMAP3430ES2_ST_HSOTGUSB_IDLE_SHIFT;
|
|
*idlest_val = OMAP34XX_CM_IDLEST_VAL;
|
|
}
|
|
|
|
const struct clkops clkops_omap3430es2_hsotgusb_wait = {
|
|
.enable = omap2_dflt_clk_enable,
|
|
.disable = omap2_dflt_clk_disable,
|
|
.find_idlest = omap3430es2_clk_hsotgusb_find_idlest,
|
|
.find_companion = omap2_clk_dflt_find_companion,
|
|
};
|