1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * OMAP2/3 clockdomain common data 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * Copyright (C) 2008-2011 Texas Instruments, Inc. 6*4882a593Smuzhiyun * Copyright (C) 2008-2010 Nokia Corporation 7*4882a593Smuzhiyun * 8*4882a593Smuzhiyun * Paul Walmsley, Jouni Högander 9*4882a593Smuzhiyun * 10*4882a593Smuzhiyun * This file contains clockdomains and clockdomain wakeup/sleep 11*4882a593Smuzhiyun * dependencies for the OMAP2/3 chips. Some notes: 12*4882a593Smuzhiyun * 13*4882a593Smuzhiyun * A useful validation rule for struct clockdomain: Any clockdomain 14*4882a593Smuzhiyun * referenced by a wkdep_srcs or sleepdep_srcs array must have a 15*4882a593Smuzhiyun * dep_bit assigned. So wkdep_srcs/sleepdep_srcs are really just 16*4882a593Smuzhiyun * software-controllable dependencies. Non-software-controllable 17*4882a593Smuzhiyun * dependencies do exist, but they are not encoded below (yet). 18*4882a593Smuzhiyun * 19*4882a593Smuzhiyun * 24xx does not support programmable sleep dependencies (SLEEPDEP) 20*4882a593Smuzhiyun * 21*4882a593Smuzhiyun * The overly-specific dep_bit names are due to a bit name collision 22*4882a593Smuzhiyun * with CM_FCLKEN_{DSP,IVA2}. The DSP/IVA2 PM_WKDEP and CM_SLEEPDEP shift 23*4882a593Smuzhiyun * value are the same for all powerdomains: 2 24*4882a593Smuzhiyun * 25*4882a593Smuzhiyun * XXX should dep_bit be a mask, so we can test to see if it is 0 as a 26*4882a593Smuzhiyun * sanity check? 27*4882a593Smuzhiyun * XXX encode hardware fixed wakeup dependencies -- esp. for 3430 CORE 28*4882a593Smuzhiyun */ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun /* 31*4882a593Smuzhiyun * To-Do List 32*4882a593Smuzhiyun * -> Port the Sleep/Wakeup dependencies for the domains 33*4882a593Smuzhiyun * from the Power domain framework 34*4882a593Smuzhiyun */ 35*4882a593Smuzhiyun 36*4882a593Smuzhiyun #include <linux/kernel.h> 37*4882a593Smuzhiyun #include <linux/io.h> 38*4882a593Smuzhiyun 39*4882a593Smuzhiyun #include "clockdomain.h" 40*4882a593Smuzhiyun #include "prm2xxx_3xxx.h" 41*4882a593Smuzhiyun #include "cm2xxx_3xxx.h" 42*4882a593Smuzhiyun #include "cm-regbits-24xx.h" 43*4882a593Smuzhiyun #include "cm-regbits-34xx.h" 44*4882a593Smuzhiyun #include "cm-regbits-44xx.h" 45*4882a593Smuzhiyun #include "prm-regbits-24xx.h" 46*4882a593Smuzhiyun #include "prm-regbits-34xx.h" 47*4882a593Smuzhiyun 48*4882a593Smuzhiyun /* 49*4882a593Smuzhiyun * Clockdomain dependencies for wkdeps/sleepdeps 50*4882a593Smuzhiyun * 51*4882a593Smuzhiyun * XXX Hardware dependencies (e.g., dependencies that cannot be 52*4882a593Smuzhiyun * changed in software) are not included here yet, but should be. 53*4882a593Smuzhiyun */ 54*4882a593Smuzhiyun 55*4882a593Smuzhiyun /* Wakeup dependency source arrays */ 56*4882a593Smuzhiyun 57*4882a593Smuzhiyun /* 2xxx-specific possible dependencies */ 58*4882a593Smuzhiyun 59*4882a593Smuzhiyun /* 2xxx PM_WKDEP_GFX: CORE, MPU, WKUP */ 60*4882a593Smuzhiyun struct clkdm_dep gfx_24xx_wkdeps[] = { 61*4882a593Smuzhiyun { .clkdm_name = "core_l3_clkdm" }, 62*4882a593Smuzhiyun { .clkdm_name = "core_l4_clkdm" }, 63*4882a593Smuzhiyun { .clkdm_name = "mpu_clkdm" }, 64*4882a593Smuzhiyun { .clkdm_name = "wkup_clkdm" }, 65*4882a593Smuzhiyun { NULL }, 66*4882a593Smuzhiyun }; 67*4882a593Smuzhiyun 68*4882a593Smuzhiyun /* 2xxx PM_WKDEP_DSP: CORE, MPU, WKUP */ 69*4882a593Smuzhiyun struct clkdm_dep dsp_24xx_wkdeps[] = { 70*4882a593Smuzhiyun { .clkdm_name = "core_l3_clkdm" }, 71*4882a593Smuzhiyun { .clkdm_name = "core_l4_clkdm" }, 72*4882a593Smuzhiyun { .clkdm_name = "mpu_clkdm" }, 73*4882a593Smuzhiyun { .clkdm_name = "wkup_clkdm" }, 74*4882a593Smuzhiyun { NULL }, 75*4882a593Smuzhiyun }; 76*4882a593Smuzhiyun 77*4882a593Smuzhiyun 78*4882a593Smuzhiyun /* 79*4882a593Smuzhiyun * OMAP2/3-common clockdomains 80*4882a593Smuzhiyun * 81*4882a593Smuzhiyun * Even though the 2420 has a single PRCM module from the 82*4882a593Smuzhiyun * interconnect's perspective, internally it does appear to have 83*4882a593Smuzhiyun * separate PRM and CM clockdomains. The usual test case is 84*4882a593Smuzhiyun * sys_clkout/sys_clkout2. 85*4882a593Smuzhiyun */ 86*4882a593Smuzhiyun 87*4882a593Smuzhiyun /* This is an implicit clockdomain - it is never defined as such in TRM */ 88*4882a593Smuzhiyun struct clockdomain wkup_common_clkdm = { 89*4882a593Smuzhiyun .name = "wkup_clkdm", 90*4882a593Smuzhiyun .pwrdm = { .name = "wkup_pwrdm" }, 91*4882a593Smuzhiyun .dep_bit = OMAP_EN_WKUP_SHIFT, 92*4882a593Smuzhiyun .flags = CLKDM_ACTIVE_WITH_MPU, 93*4882a593Smuzhiyun }; 94