2008-08-19 11:08:44 +03:00
/*
* OMAP2 / 3 clockdomains
*
2010-01-26 20:13:13 -07:00
* Copyright ( C ) 2008 - 2009 Texas Instruments , Inc .
* Copyright ( C ) 2008 - 2010 Nokia Corporation
2008-08-19 11:08:44 +03:00
*
2010-12-21 20:01:20 -07:00
* Paul Walmsley , Jouni Högander
2010-01-26 20:12:59 -07:00
*
* This file contains clockdomains and clockdomain wakeup / sleep
* dependencies for the OMAP2 / 3 chips . Some notes :
*
* A useful validation rule for struct clockdomain : Any clockdomain
* referenced by a wkdep_srcs or sleepdep_srcs array must have a
* dep_bit assigned . So wkdep_srcs / sleepdep_srcs are really just
* software - controllable dependencies . Non - software - controllable
* dependencies do exist , but they are not encoded below ( yet ) .
*
* 24 xx does not support programmable sleep dependencies ( SLEEPDEP )
*
* The overly - specific dep_bit names are due to a bit name collision
* with CM_FCLKEN_ { DSP , IVA2 } . The DSP / IVA2 PM_WKDEP and CM_SLEEPDEP shift
* value are the same for all powerdomains : 2
*
* XXX should dep_bit be a mask , so we can test to see if it is 0 as a
* sanity check ?
* XXX encode hardware fixed wakeup dependencies - - esp . for 3430 CORE
2008-08-19 11:08:44 +03:00
*/
2010-01-26 20:12:54 -07:00
/*
* To - Do List
* - > Port the Sleep / Wakeup dependencies for the domains
* from the Power domain framework
*/
2010-12-21 20:01:20 -07:00
# include <linux/kernel.h>
# include <linux/io.h>
2008-08-19 11:08:44 +03:00
2010-12-21 21:05:15 -07:00
# include "clockdomain.h"
2010-12-21 15:30:55 -07:00
# include "prm2xxx_3xxx.h"
# include "cm2xxx_3xxx.h"
2010-12-21 20:01:17 -07:00
# include "cm-regbits-24xx.h"
# include "cm-regbits-34xx.h"
# include "cm-regbits-44xx.h"
# include "prm-regbits-24xx.h"
# include "prm-regbits-34xx.h"
2008-08-19 11:08:44 +03:00
2010-01-26 20:12:59 -07:00
/*
* Clockdomain dependencies for wkdeps / sleepdeps
*
* XXX Hardware dependencies ( e . g . , dependencies that cannot be
* changed in software ) are not included here yet , but should be .
*/
/* OMAP2/3-common wakeup dependencies */
/*
* 2420 / 2430 PM_WKDEP_GFX : CORE , MPU , WKUP
* 3430 ES1 PM_WKDEP_GFX : adds IVA2 , removes CORE
* 3430 ES2 PM_WKDEP_SGX : adds IVA2 , removes CORE
2010-01-26 20:12:59 -07:00
* These can share data since they will never be present simultaneously
* on the same device .
2010-01-26 20:12:59 -07:00
*/
static struct clkdm_dep gfx_sgx_wkdeps [ ] = {
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX |
CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX |
CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 24XX-specific possible dependencies */
2011-02-11 09:05:00 +00:00
# ifdef CONFIG_ARCH_OMAP2
2010-01-26 20:12:59 -07:00
/* Wakeup dependency source arrays */
2010-01-26 20:12:59 -07:00
/* 2420/2430 PM_WKDEP_DSP: CORE, MPU, WKUP */
static struct clkdm_dep dsp_24xx_wkdeps [ ] = {
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/*
2010-01-26 20:12:59 -07:00
* 2420 PM_WKDEP_MPU : CORE , DSP , WKUP
* 2430 adds MDM
2010-01-26 20:12:59 -07:00
*/
2010-01-26 20:12:59 -07:00
static struct clkdm_dep mpu_24xx_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " dsp_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " mdm_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 )
} ,
2010-01-26 20:12:59 -07:00
{ NULL } ,
} ;
/*
2010-01-26 20:12:59 -07:00
* 2420 PM_WKDEP_CORE : DSP , GFX , MPU , WKUP
2010-01-26 20:12:59 -07:00
* 2430 adds MDM
*/
2010-01-26 20:12:59 -07:00
static struct clkdm_dep core_24xx_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " dsp_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " gfx_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " mpu_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " mdm_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 )
} ,
{ NULL } ,
} ;
2011-02-11 09:05:00 +00:00
# endif /* CONFIG_ARCH_OMAP2 */
2010-01-26 20:12:59 -07:00
/* 2430-specific possible wakeup dependencies */
2011-01-27 16:39:40 -08:00
# ifdef CONFIG_SOC_OMAP2430
2010-01-26 20:12:59 -07:00
/* 2430 PM_WKDEP_MDM: CORE, MPU, WKUP */
static struct clkdm_dep mdm_2430_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " core_l3_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
2010-01-26 20:12:59 -07:00
. clkdm_name = " core_l4_clkdm " ,
2010-01-26 20:12:59 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX )
} ,
{ NULL } ,
} ;
2011-01-27 16:39:40 -08:00
# endif /* CONFIG_SOC_OMAP2430 */
2010-01-26 20:12:59 -07:00
2010-01-26 20:12:59 -07:00
2010-01-26 20:13:13 -07:00
/* OMAP3-specific possible dependencies */
2010-01-26 20:12:59 -07:00
2010-01-26 20:13:13 -07:00
# ifdef CONFIG_ARCH_OMAP3
2010-01-26 20:12:59 -07:00
2010-01-26 20:12:59 -07:00
/* 3430: PM_WKDEP_PER: CORE, IVA2, MPU, WKUP */
static struct clkdm_dep per_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/* 3430ES2: PM_WKDEP_USBHOST: CORE, IVA2, MPU, WKUP */
static struct clkdm_dep usbhost_wkdeps [ ] = {
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 3430 PM_WKDEP_MPU: CORE, IVA2, DSS, PER */
2010-01-26 20:13:13 -07:00
static struct clkdm_dep mpu_3xxx_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " dss_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " per_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/* 3430 PM_WKDEP_IVA2: CORE, MPU, WKUP, DSS, PER */
2010-01-26 20:12:59 -07:00
static struct clkdm_dep iva2_wkdeps [ ] = {
{
. clkdm_name = " core_l3_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " core_l4_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " dss_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " per_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/* 3430 PM_WKDEP_CAM: IVA2, MPU, WKUP */
static struct clkdm_dep cam_wkdeps [ ] = {
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 3430 PM_WKDEP_DSS: IVA2, MPU, WKUP */
static struct clkdm_dep dss_wkdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " wkup_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 3430: PM_WKDEP_NEON: MPU */
static struct clkdm_dep neon_wkdeps [ ] = {
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:13:13 -07:00
/* Sleep dependency source arrays for OMAP3-specific clkdms */
2010-01-26 20:12:59 -07:00
2010-01-26 20:12:59 -07:00
/* 3430: CM_SLEEPDEP_DSS: MPU, IVA */
static struct clkdm_dep dss_sleepdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/* 3430: CM_SLEEPDEP_PER: MPU, IVA */
static struct clkdm_dep per_sleepdeps [ ] = {
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 3430ES2: CM_SLEEPDEP_USBHOST: MPU, IVA */
static struct clkdm_dep usbhost_sleepdeps [ ] = {
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
. clkdm_name = " iva2_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
/* 3430: CM_SLEEPDEP_CAM: MPU */
static struct clkdm_dep cam_sleepdeps [ ] = {
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:12:59 -07:00
/*
* 3430 ES1 : CM_SLEEPDEP_GFX : MPU
* 3430 ES2 : CM_SLEEPDEP_SGX : MPU
2010-01-26 20:12:59 -07:00
* These can share data since they will never be present simultaneously
* on the same device .
2010-01-26 20:12:59 -07:00
*/
2010-01-26 20:12:59 -07:00
static struct clkdm_dep gfx_sgx_sleepdeps [ ] = {
2010-01-26 20:12:59 -07:00
{
. clkdm_name = " mpu_clkdm " ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{ NULL } ,
} ;
2010-01-26 20:13:13 -07:00
# endif /* CONFIG_ARCH_OMAP3 */
2010-01-26 20:12:59 -07:00
2008-08-19 11:08:44 +03:00
/*
* OMAP2 / 3 - common clockdomains
2008-09-10 10:47:36 -06:00
*
* Even though the 2420 has a single PRCM module from the
* interconnect ' s perspective , internally it does appear to have
* separate PRM and CM clockdomains . The usual test case is
* sys_clkout / sys_clkout2 .
2008-08-19 11:08:44 +03:00
*/
/* This is an implicit clockdomain - it is never defined as such in TRM */
static struct clockdomain wkup_clkdm = {
. name = " wkup_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " wkup_pwrdm " } ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP_EN_WKUP_SHIFT ,
2008-08-19 11:08:44 +03:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430 ) ,
} ;
2008-09-10 10:47:36 -06:00
static struct clockdomain prm_clkdm = {
. name = " prm_clkdm " ,
. pwrdm = { . name = " wkup_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain cm_clkdm = {
. name = " cm_clkdm " ,
. pwrdm = { . name = " core_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP24XX | CHIP_IS_OMAP3430 ) ,
} ;
2008-08-19 11:08:44 +03:00
/*
* 2420 - only clockdomains
*/
2011-01-27 16:39:40 -08:00
# if defined(CONFIG_SOC_OMAP2420)
2008-08-19 11:08:44 +03:00
static struct clockdomain mpu_2420_clkdm = {
. name = " mpu_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " mpu_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = mpu_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
static struct clockdomain iva1_2420_clkdm = {
. name = " iva1_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " dsp_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = dsp_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP2420_AUTOSTATE_IVA_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
2010-01-26 20:12:53 -07:00
static struct clockdomain dsp_2420_clkdm = {
. name = " dsp_clkdm " ,
. pwrdm = { . name = " dsp_pwrdm " } ,
. flags = CLKDM_CAN_HWSUP_SWSUP ,
. clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
static struct clockdomain gfx_2420_clkdm = {
. name = " gfx_clkdm " ,
. pwrdm = { . name = " gfx_pwrdm " } ,
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = gfx_sgx_wkdeps ,
2010-01-26 20:12:53 -07:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
static struct clockdomain core_l3_2420_clkdm = {
. name = " core_l3_clkdm " ,
. pwrdm = { . name = " core_pwrdm " } ,
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = core_24xx_wkdeps ,
2010-01-26 20:12:53 -07:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
static struct clockdomain core_l4_2420_clkdm = {
. name = " core_l4_clkdm " ,
. pwrdm = { . name = " core_pwrdm " } ,
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = core_24xx_wkdeps ,
2010-01-26 20:12:53 -07:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
static struct clockdomain dss_2420_clkdm = {
. name = " dss_clkdm " ,
. pwrdm = { . name = " core_pwrdm " } ,
. flags = CLKDM_CAN_HWSUP ,
. clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2420 ) ,
} ;
2011-01-27 16:39:40 -08:00
# endif /* CONFIG_SOC_OMAP2420 */
2008-08-19 11:08:44 +03:00
/*
* 2430 - only clockdomains
*/
2011-01-27 16:39:40 -08:00
# if defined(CONFIG_SOC_OMAP2430)
2008-08-19 11:08:44 +03:00
static struct clockdomain mpu_2430_clkdm = {
. name = " mpu_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " mpu_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = mpu_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_MPU_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
} ;
2010-01-26 20:12:59 -07:00
/* Another case of bit name collisions between several registers: EN_MDM */
2008-08-19 11:08:44 +03:00
static struct clockdomain mdm_clkdm = {
. name = " mdm_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " mdm_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP2430_PM_WKDEP_MPU_EN_MDM_SHIFT ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = mdm_2430_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP2430_AUTOSTATE_MDM_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
} ;
2010-01-26 20:12:53 -07:00
static struct clockdomain dsp_2430_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " dsp_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " dsp_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP24XX_PM_WKDEP_MPU_EN_DSP_SHIFT ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = dsp_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_DSP_MASK ,
2010-01-26 20:12:53 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2010-01-26 20:12:53 -07:00
static struct clockdomain gfx_2430_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " gfx_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " gfx_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = gfx_sgx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_GFX_MASK ,
2010-01-26 20:12:53 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2010-01-26 20:12:59 -07:00
/*
* XXX add usecounting for clkdm dependencies , otherwise the presence
* of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
* could cause trouble
*/
2010-01-26 20:12:53 -07:00
static struct clockdomain core_l3_2430_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " core_l3_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP24XX_EN_CORE_SHIFT ,
. wkdep_srcs = core_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_L3_MASK ,
2010-01-26 20:12:53 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2010-01-26 20:12:59 -07:00
/*
* XXX add usecounting for clkdm dependencies , otherwise the presence
* of a single dep bit for core_l3_24xx_clkdm and core_l4_24xx_clkdm
* could cause trouble
*/
2010-01-26 20:12:53 -07:00
static struct clockdomain core_l4_2430_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " core_l4_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP24XX_EN_CORE_SHIFT ,
. wkdep_srcs = core_24xx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP24XX_AUTOSTATE_L4_MASK ,
2010-01-26 20:12:53 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2010-01-26 20:12:53 -07:00
static struct clockdomain dss_2430_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " dss_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
. clktrctrl_mask = OMAP24XX_AUTOSTATE_DSS_MASK ,
2010-01-26 20:12:53 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP2430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2011-01-27 16:39:40 -08:00
# endif /* CONFIG_SOC_OMAP2430 */
2008-08-19 11:08:44 +03:00
/*
2010-01-26 20:13:13 -07:00
* OMAP3 clockdomains
2008-08-19 11:08:44 +03:00
*/
2010-01-26 20:13:13 -07:00
# if defined(CONFIG_ARCH_OMAP3)
2008-08-19 11:08:44 +03:00
2010-01-26 20:13:13 -07:00
static struct clockdomain mpu_3xxx_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " mpu_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " mpu_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP | CLKDM_CAN_FORCE_WAKEUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_EN_MPU_SHIFT ,
2010-01-26 20:13:13 -07:00
. wkdep_srcs = mpu_3xxx_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_MPU_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain neon_clkdm = {
. name = " neon_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " neon_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = neon_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_NEON_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain iva2_clkdm = {
. name = " iva2_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " iva2_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_PM_WKDEP_MPU_EN_IVA2_SHIFT ,
. wkdep_srcs = iva2_wkdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_IVA2_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain gfx_3430es1_clkdm = {
. name = " gfx_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " gfx_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = gfx_sgx_wkdeps ,
2010-01-26 20:12:59 -07:00
. sleepdep_srcs = gfx_sgx_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_GFX_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430ES1 ) ,
} ;
static struct clockdomain sgx_clkdm = {
. name = " sgx_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " sgx_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = gfx_sgx_wkdeps ,
2010-01-26 20:12:59 -07:00
. sleepdep_srcs = gfx_sgx_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_SGX_MASK ,
2009-02-05 20:45:25 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_GE_OMAP3430ES2 ) ,
2008-08-19 11:08:44 +03:00
} ;
2008-08-19 11:08:45 +03:00
/*
* The die - to - die clockdomain was documented in the 34 xx ES1 TRM , but
* then that information was removed from the 34 xx ES2 + TRM . It is
* unclear whether the core is still there , but the clockdomain logic
* is there , and must be programmed to an appropriate state if the
* CORE clockdomain is to become inactive .
*/
2008-08-19 11:08:44 +03:00
static struct clockdomain d2d_clkdm = {
. name = " d2d_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-11-25 21:48:28 -08:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430ES1_CLKTRCTRL_D2D_MASK ,
2008-08-19 11:08:45 +03:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
2008-08-19 11:08:44 +03:00
} ;
2010-01-26 20:12:59 -07:00
/*
* XXX add usecounting for clkdm dependencies , otherwise the presence
2010-01-26 20:13:13 -07:00
* of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
2010-01-26 20:12:59 -07:00
* could cause trouble
*/
2010-01-26 20:13:13 -07:00
static struct clockdomain core_l3_3xxx_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " core_l3_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_EN_CORE_SHIFT ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_L3_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
2010-01-26 20:12:59 -07:00
/*
* XXX add usecounting for clkdm dependencies , otherwise the presence
2010-01-26 20:13:13 -07:00
* of a single dep bit for core_l3_3xxx_clkdm and core_l4_3xxx_clkdm
2010-01-26 20:12:59 -07:00
* could cause trouble
*/
2010-01-26 20:13:13 -07:00
static struct clockdomain core_l4_3xxx_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " core_l4_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " core_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_EN_CORE_SHIFT ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_L4_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
2010-01-26 20:12:59 -07:00
/* Another case of bit name collisions between several registers: EN_DSS */
2010-01-26 20:13:13 -07:00
static struct clockdomain dss_3xxx_clkdm = {
2008-08-19 11:08:44 +03:00
. name = " dss_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " dss_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_PM_WKDEP_MPU_EN_DSS_SHIFT ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = dss_wkdeps ,
. sleepdep_srcs = dss_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_DSS_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain cam_clkdm = {
. name = " cam_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " cam_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = cam_wkdeps ,
. sleepdep_srcs = cam_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_CAM_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain usbhost_clkdm = {
. name = " usbhost_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " usbhost_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = usbhost_wkdeps ,
. sleepdep_srcs = usbhost_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430ES2_CLKTRCTRL_USBHOST_MASK ,
2009-02-05 20:45:25 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_GE_OMAP3430ES2 ) ,
2008-08-19 11:08:44 +03:00
} ;
static struct clockdomain per_clkdm = {
. name = " per_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " per_pwrdm " } ,
2008-08-19 11:08:44 +03:00
. flags = CLKDM_CAN_HWSUP_SWSUP ,
2010-01-26 20:12:59 -07:00
. dep_bit = OMAP3430_EN_PER_SHIFT ,
2010-01-26 20:12:59 -07:00
. wkdep_srcs = per_wkdeps ,
. sleepdep_srcs = per_sleepdeps ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_PER_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
2009-01-27 19:44:38 -07:00
/*
* Disable hw supervised mode for emu_clkdm , because emu_pwrdm is
* switched of even if sdti is in use
*/
2008-08-19 11:08:44 +03:00
static struct clockdomain emu_clkdm = {
. name = " emu_clkdm " ,
2009-02-03 02:10:03 -07:00
. pwrdm = { . name = " emu_pwrdm " } ,
2009-01-27 19:44:38 -07:00
. flags = /* CLKDM_CAN_ENABLE_AUTO | */ CLKDM_CAN_SWSUP ,
2008-08-19 11:08:44 +03:00
. clktrctrl_mask = OMAP3430_CLKTRCTRL_EMU_MASK ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
2009-01-27 19:44:18 -07:00
static struct clockdomain dpll1_clkdm = {
. name = " dpll1_clkdm " ,
. pwrdm = { . name = " dpll1_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain dpll2_clkdm = {
. name = " dpll2_clkdm " ,
. pwrdm = { . name = " dpll2_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain dpll3_clkdm = {
. name = " dpll3_clkdm " ,
. pwrdm = { . name = " dpll3_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain dpll4_clkdm = {
. name = " dpll4_clkdm " ,
. pwrdm = { . name = " dpll4_pwrdm " } ,
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 ) ,
} ;
static struct clockdomain dpll5_clkdm = {
. name = " dpll5_clkdm " ,
. pwrdm = { . name = " dpll5_pwrdm " } ,
2009-02-05 20:45:25 -07:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_GE_OMAP3430ES2 ) ,
2009-01-27 19:44:18 -07:00
} ;
2010-01-26 20:13:13 -07:00
# endif /* CONFIG_ARCH_OMAP3 */
2008-08-19 11:08:44 +03:00
/*
2010-01-26 20:13:13 -07:00
* Clockdomain hwsup dependencies ( OMAP3 only )
2008-08-19 11:08:44 +03:00
*/
2010-01-26 20:12:59 -07:00
static struct clkdm_autodep clkdm_autodeps [ ] = {
2008-08-19 11:08:44 +03:00
{
2010-01-26 20:12:59 -07:00
. clkdm = { . name = " mpu_clkdm " } ,
2008-08-19 11:08:44 +03:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
{
2010-01-26 20:12:59 -07:00
. clkdm = { . name = " iva2_clkdm " } ,
2008-08-19 11:08:44 +03:00
. omap_chip = OMAP_CHIP_INIT ( CHIP_IS_OMAP3430 )
} ,
2009-02-03 02:10:03 -07:00
{
2010-01-26 20:12:59 -07:00
. clkdm = { . name = NULL } ,
2009-02-03 02:10:03 -07:00
}
2008-08-19 11:08:44 +03:00
} ;
2010-12-21 20:01:20 -07:00
static struct clockdomain * clockdomains_omap2 [ ] __initdata = {
2008-08-19 11:08:44 +03:00
& wkup_clkdm ,
2008-09-10 10:47:36 -06:00
& cm_clkdm ,
& prm_clkdm ,
2008-08-19 11:08:44 +03:00
2011-01-27 16:39:40 -08:00
# ifdef CONFIG_SOC_OMAP2420
2008-08-19 11:08:44 +03:00
& mpu_2420_clkdm ,
& iva1_2420_clkdm ,
2010-01-26 20:12:53 -07:00
& dsp_2420_clkdm ,
& gfx_2420_clkdm ,
& core_l3_2420_clkdm ,
& core_l4_2420_clkdm ,
& dss_2420_clkdm ,
2008-08-19 11:08:44 +03:00
# endif
2011-01-27 16:39:40 -08:00
# ifdef CONFIG_SOC_OMAP2430
2008-08-19 11:08:44 +03:00
& mpu_2430_clkdm ,
& mdm_clkdm ,
2010-01-26 20:12:53 -07:00
& dsp_2430_clkdm ,
& gfx_2430_clkdm ,
& core_l3_2430_clkdm ,
& core_l4_2430_clkdm ,
& dss_2430_clkdm ,
2008-08-19 11:08:44 +03:00
# endif
2010-01-26 20:13:13 -07:00
# ifdef CONFIG_ARCH_OMAP3
& mpu_3xxx_clkdm ,
2008-08-19 11:08:44 +03:00
& neon_clkdm ,
& iva2_clkdm ,
& gfx_3430es1_clkdm ,
& sgx_clkdm ,
& d2d_clkdm ,
2010-01-26 20:13:13 -07:00
& core_l3_3xxx_clkdm ,
& core_l4_3xxx_clkdm ,
& dss_3xxx_clkdm ,
2008-08-19 11:08:44 +03:00
& cam_clkdm ,
& usbhost_clkdm ,
& per_clkdm ,
& emu_clkdm ,
2009-01-27 19:44:18 -07:00
& dpll1_clkdm ,
& dpll2_clkdm ,
& dpll3_clkdm ,
& dpll4_clkdm ,
& dpll5_clkdm ,
2008-08-19 11:08:44 +03:00
# endif
NULL ,
} ;
2011-02-25 16:06:47 -07:00
void __init omap2xxx_clockdomains_init ( void )
2010-12-21 20:01:20 -07:00
{
2011-02-25 16:06:47 -07:00
clkdm_init ( clockdomains_omap2 , clkdm_autodeps , & omap2_clkdm_operations ) ;
}
void __init omap3xxx_clockdomains_init ( void )
{
clkdm_init ( clockdomains_omap2 , clkdm_autodeps , & omap3_clkdm_operations ) ;
2010-12-21 20:01:20 -07:00
}