1*3acf731cSArnd Bergmann /* 2*3acf731cSArnd Bergmann * DaVinci Power & Sleep Controller (PSC) defines 3*3acf731cSArnd Bergmann * 4*3acf731cSArnd Bergmann * Copyright (C) 2006 Texas Instruments. 5*3acf731cSArnd Bergmann * 6*3acf731cSArnd Bergmann * This program is free software; you can redistribute it and/or modify it 7*3acf731cSArnd Bergmann * under the terms of the GNU General Public License as published by the 8*3acf731cSArnd Bergmann * Free Software Foundation; either version 2 of the License, or (at your 9*3acf731cSArnd Bergmann * option) any later version. 10*3acf731cSArnd Bergmann * 11*3acf731cSArnd Bergmann * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED 12*3acf731cSArnd Bergmann * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 13*3acf731cSArnd Bergmann * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN 14*3acf731cSArnd Bergmann * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 15*3acf731cSArnd Bergmann * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 16*3acf731cSArnd Bergmann * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 17*3acf731cSArnd Bergmann * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 18*3acf731cSArnd Bergmann * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 19*3acf731cSArnd Bergmann * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 20*3acf731cSArnd Bergmann * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 21*3acf731cSArnd Bergmann * 22*3acf731cSArnd Bergmann * You should have received a copy of the GNU General Public License along 23*3acf731cSArnd Bergmann * with this program; if not, write to the Free Software Foundation, Inc., 24*3acf731cSArnd Bergmann * 675 Mass Ave, Cambridge, MA 02139, USA. 25*3acf731cSArnd Bergmann * 26*3acf731cSArnd Bergmann */ 27*3acf731cSArnd Bergmann #ifndef __ASM_ARCH_PSC_H 28*3acf731cSArnd Bergmann #define __ASM_ARCH_PSC_H 29*3acf731cSArnd Bergmann 30*3acf731cSArnd Bergmann #define DAVINCI_PWR_SLEEP_CNTRL_BASE 0x01C41000 31*3acf731cSArnd Bergmann 32*3acf731cSArnd Bergmann /* Power and Sleep Controller (PSC) Domains */ 33*3acf731cSArnd Bergmann #define DAVINCI_GPSC_ARMDOMAIN 0 34*3acf731cSArnd Bergmann #define DAVINCI_GPSC_DSPDOMAIN 1 35*3acf731cSArnd Bergmann 36*3acf731cSArnd Bergmann #define DAVINCI_LPSC_VPSSMSTR 0 37*3acf731cSArnd Bergmann #define DAVINCI_LPSC_VPSSSLV 1 38*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TPCC 2 39*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TPTC0 3 40*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TPTC1 4 41*3acf731cSArnd Bergmann #define DAVINCI_LPSC_EMAC 5 42*3acf731cSArnd Bergmann #define DAVINCI_LPSC_EMAC_WRAPPER 6 43*3acf731cSArnd Bergmann #define DAVINCI_LPSC_USB 9 44*3acf731cSArnd Bergmann #define DAVINCI_LPSC_ATA 10 45*3acf731cSArnd Bergmann #define DAVINCI_LPSC_VLYNQ 11 46*3acf731cSArnd Bergmann #define DAVINCI_LPSC_UHPI 12 47*3acf731cSArnd Bergmann #define DAVINCI_LPSC_DDR_EMIF 13 48*3acf731cSArnd Bergmann #define DAVINCI_LPSC_AEMIF 14 49*3acf731cSArnd Bergmann #define DAVINCI_LPSC_MMC_SD 15 50*3acf731cSArnd Bergmann #define DAVINCI_LPSC_McBSP 17 51*3acf731cSArnd Bergmann #define DAVINCI_LPSC_I2C 18 52*3acf731cSArnd Bergmann #define DAVINCI_LPSC_UART0 19 53*3acf731cSArnd Bergmann #define DAVINCI_LPSC_UART1 20 54*3acf731cSArnd Bergmann #define DAVINCI_LPSC_UART2 21 55*3acf731cSArnd Bergmann #define DAVINCI_LPSC_SPI 22 56*3acf731cSArnd Bergmann #define DAVINCI_LPSC_PWM0 23 57*3acf731cSArnd Bergmann #define DAVINCI_LPSC_PWM1 24 58*3acf731cSArnd Bergmann #define DAVINCI_LPSC_PWM2 25 59*3acf731cSArnd Bergmann #define DAVINCI_LPSC_GPIO 26 60*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TIMER0 27 61*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TIMER1 28 62*3acf731cSArnd Bergmann #define DAVINCI_LPSC_TIMER2 29 63*3acf731cSArnd Bergmann #define DAVINCI_LPSC_SYSTEM_SUBSYS 30 64*3acf731cSArnd Bergmann #define DAVINCI_LPSC_ARM 31 65*3acf731cSArnd Bergmann #define DAVINCI_LPSC_SCR2 32 66*3acf731cSArnd Bergmann #define DAVINCI_LPSC_SCR3 33 67*3acf731cSArnd Bergmann #define DAVINCI_LPSC_SCR4 34 68*3acf731cSArnd Bergmann #define DAVINCI_LPSC_CROSSBAR 35 69*3acf731cSArnd Bergmann #define DAVINCI_LPSC_CFG27 36 70*3acf731cSArnd Bergmann #define DAVINCI_LPSC_CFG3 37 71*3acf731cSArnd Bergmann #define DAVINCI_LPSC_CFG5 38 72*3acf731cSArnd Bergmann #define DAVINCI_LPSC_GEM 39 73*3acf731cSArnd Bergmann #define DAVINCI_LPSC_IMCOP 40 74*3acf731cSArnd Bergmann 75*3acf731cSArnd Bergmann #define DM355_LPSC_TIMER3 5 76*3acf731cSArnd Bergmann #define DM355_LPSC_SPI1 6 77*3acf731cSArnd Bergmann #define DM355_LPSC_MMC_SD1 7 78*3acf731cSArnd Bergmann #define DM355_LPSC_McBSP1 8 79*3acf731cSArnd Bergmann #define DM355_LPSC_PWM3 10 80*3acf731cSArnd Bergmann #define DM355_LPSC_SPI2 11 81*3acf731cSArnd Bergmann #define DM355_LPSC_RTO 12 82*3acf731cSArnd Bergmann #define DM355_LPSC_VPSS_DAC 41 83*3acf731cSArnd Bergmann 84*3acf731cSArnd Bergmann /* DM365 */ 85*3acf731cSArnd Bergmann #define DM365_LPSC_TIMER3 5 86*3acf731cSArnd Bergmann #define DM365_LPSC_SPI1 6 87*3acf731cSArnd Bergmann #define DM365_LPSC_MMC_SD1 7 88*3acf731cSArnd Bergmann #define DM365_LPSC_McBSP1 8 89*3acf731cSArnd Bergmann #define DM365_LPSC_PWM3 10 90*3acf731cSArnd Bergmann #define DM365_LPSC_SPI2 11 91*3acf731cSArnd Bergmann #define DM365_LPSC_RTO 12 92*3acf731cSArnd Bergmann #define DM365_LPSC_TIMER4 17 93*3acf731cSArnd Bergmann #define DM365_LPSC_SPI0 22 94*3acf731cSArnd Bergmann #define DM365_LPSC_SPI3 38 95*3acf731cSArnd Bergmann #define DM365_LPSC_SPI4 39 96*3acf731cSArnd Bergmann #define DM365_LPSC_EMAC 40 97*3acf731cSArnd Bergmann #define DM365_LPSC_VOICE_CODEC 44 98*3acf731cSArnd Bergmann #define DM365_LPSC_DAC_CLK 46 99*3acf731cSArnd Bergmann #define DM365_LPSC_VPSSMSTR 47 100*3acf731cSArnd Bergmann #define DM365_LPSC_MJCP 50 101*3acf731cSArnd Bergmann 102*3acf731cSArnd Bergmann /* 103*3acf731cSArnd Bergmann * LPSC Assignments 104*3acf731cSArnd Bergmann */ 105*3acf731cSArnd Bergmann #define DM646X_LPSC_ARM 0 106*3acf731cSArnd Bergmann #define DM646X_LPSC_C64X_CPU 1 107*3acf731cSArnd Bergmann #define DM646X_LPSC_HDVICP0 2 108*3acf731cSArnd Bergmann #define DM646X_LPSC_HDVICP1 3 109*3acf731cSArnd Bergmann #define DM646X_LPSC_TPCC 4 110*3acf731cSArnd Bergmann #define DM646X_LPSC_TPTC0 5 111*3acf731cSArnd Bergmann #define DM646X_LPSC_TPTC1 6 112*3acf731cSArnd Bergmann #define DM646X_LPSC_TPTC2 7 113*3acf731cSArnd Bergmann #define DM646X_LPSC_TPTC3 8 114*3acf731cSArnd Bergmann #define DM646X_LPSC_PCI 13 115*3acf731cSArnd Bergmann #define DM646X_LPSC_EMAC 14 116*3acf731cSArnd Bergmann #define DM646X_LPSC_VDCE 15 117*3acf731cSArnd Bergmann #define DM646X_LPSC_VPSSMSTR 16 118*3acf731cSArnd Bergmann #define DM646X_LPSC_VPSSSLV 17 119*3acf731cSArnd Bergmann #define DM646X_LPSC_TSIF0 18 120*3acf731cSArnd Bergmann #define DM646X_LPSC_TSIF1 19 121*3acf731cSArnd Bergmann #define DM646X_LPSC_DDR_EMIF 20 122*3acf731cSArnd Bergmann #define DM646X_LPSC_AEMIF 21 123*3acf731cSArnd Bergmann #define DM646X_LPSC_McASP0 22 124*3acf731cSArnd Bergmann #define DM646X_LPSC_McASP1 23 125*3acf731cSArnd Bergmann #define DM646X_LPSC_CRGEN0 24 126*3acf731cSArnd Bergmann #define DM646X_LPSC_CRGEN1 25 127*3acf731cSArnd Bergmann #define DM646X_LPSC_UART0 26 128*3acf731cSArnd Bergmann #define DM646X_LPSC_UART1 27 129*3acf731cSArnd Bergmann #define DM646X_LPSC_UART2 28 130*3acf731cSArnd Bergmann #define DM646X_LPSC_PWM0 29 131*3acf731cSArnd Bergmann #define DM646X_LPSC_PWM1 30 132*3acf731cSArnd Bergmann #define DM646X_LPSC_I2C 31 133*3acf731cSArnd Bergmann #define DM646X_LPSC_SPI 32 134*3acf731cSArnd Bergmann #define DM646X_LPSC_GPIO 33 135*3acf731cSArnd Bergmann #define DM646X_LPSC_TIMER0 34 136*3acf731cSArnd Bergmann #define DM646X_LPSC_TIMER1 35 137*3acf731cSArnd Bergmann #define DM646X_LPSC_ARM_INTC 45 138*3acf731cSArnd Bergmann 139*3acf731cSArnd Bergmann /* PSC0 defines */ 140*3acf731cSArnd Bergmann #define DA8XX_LPSC0_TPCC 0 141*3acf731cSArnd Bergmann #define DA8XX_LPSC0_TPTC0 1 142*3acf731cSArnd Bergmann #define DA8XX_LPSC0_TPTC1 2 143*3acf731cSArnd Bergmann #define DA8XX_LPSC0_EMIF25 3 144*3acf731cSArnd Bergmann #define DA8XX_LPSC0_SPI0 4 145*3acf731cSArnd Bergmann #define DA8XX_LPSC0_MMC_SD 5 146*3acf731cSArnd Bergmann #define DA8XX_LPSC0_AINTC 6 147*3acf731cSArnd Bergmann #define DA8XX_LPSC0_ARM_RAM_ROM 7 148*3acf731cSArnd Bergmann #define DA8XX_LPSC0_SECU_MGR 8 149*3acf731cSArnd Bergmann #define DA8XX_LPSC0_UART0 9 150*3acf731cSArnd Bergmann #define DA8XX_LPSC0_SCR0_SS 10 151*3acf731cSArnd Bergmann #define DA8XX_LPSC0_SCR1_SS 11 152*3acf731cSArnd Bergmann #define DA8XX_LPSC0_SCR2_SS 12 153*3acf731cSArnd Bergmann #define DA8XX_LPSC0_PRUSS 13 154*3acf731cSArnd Bergmann #define DA8XX_LPSC0_ARM 14 155*3acf731cSArnd Bergmann #define DA8XX_LPSC0_GEM 15 156*3acf731cSArnd Bergmann 157*3acf731cSArnd Bergmann /* PSC1 defines */ 158*3acf731cSArnd Bergmann #define DA850_LPSC1_TPCC1 0 159*3acf731cSArnd Bergmann #define DA8XX_LPSC1_USB20 1 160*3acf731cSArnd Bergmann #define DA8XX_LPSC1_USB11 2 161*3acf731cSArnd Bergmann #define DA8XX_LPSC1_GPIO 3 162*3acf731cSArnd Bergmann #define DA8XX_LPSC1_UHPI 4 163*3acf731cSArnd Bergmann #define DA8XX_LPSC1_CPGMAC 5 164*3acf731cSArnd Bergmann #define DA8XX_LPSC1_EMIF3C 6 165*3acf731cSArnd Bergmann #define DA8XX_LPSC1_McASP0 7 166*3acf731cSArnd Bergmann #define DA830_LPSC1_McASP1 8 167*3acf731cSArnd Bergmann #define DA850_LPSC1_SATA 8 168*3acf731cSArnd Bergmann #define DA830_LPSC1_McASP2 9 169*3acf731cSArnd Bergmann #define DA850_LPSC1_VPIF 9 170*3acf731cSArnd Bergmann #define DA8XX_LPSC1_SPI1 10 171*3acf731cSArnd Bergmann #define DA8XX_LPSC1_I2C 11 172*3acf731cSArnd Bergmann #define DA8XX_LPSC1_UART1 12 173*3acf731cSArnd Bergmann #define DA8XX_LPSC1_UART2 13 174*3acf731cSArnd Bergmann #define DA8XX_LPSC1_LCDC 16 175*3acf731cSArnd Bergmann #define DA8XX_LPSC1_PWM 17 176*3acf731cSArnd Bergmann #define DA850_LPSC1_MMC_SD1 18 177*3acf731cSArnd Bergmann #define DA8XX_LPSC1_ECAP 20 178*3acf731cSArnd Bergmann #define DA830_LPSC1_EQEP 21 179*3acf731cSArnd Bergmann #define DA850_LPSC1_TPTC2 21 180*3acf731cSArnd Bergmann #define DA8XX_LPSC1_SCR_P0_SS 24 181*3acf731cSArnd Bergmann #define DA8XX_LPSC1_SCR_P1_SS 25 182*3acf731cSArnd Bergmann #define DA8XX_LPSC1_CR_P3_SS 26 183*3acf731cSArnd Bergmann #define DA8XX_LPSC1_L3_CBA_RAM 31 184*3acf731cSArnd Bergmann 185*3acf731cSArnd Bergmann /* PSC register offsets */ 186*3acf731cSArnd Bergmann #define EPCPR 0x070 187*3acf731cSArnd Bergmann #define PTCMD 0x120 188*3acf731cSArnd Bergmann #define PTSTAT 0x128 189*3acf731cSArnd Bergmann #define PDSTAT 0x200 190*3acf731cSArnd Bergmann #define PDCTL 0x300 191*3acf731cSArnd Bergmann #define MDSTAT 0x800 192*3acf731cSArnd Bergmann #define MDCTL 0xA00 193*3acf731cSArnd Bergmann 194*3acf731cSArnd Bergmann /* PSC module states */ 195*3acf731cSArnd Bergmann #define PSC_STATE_SWRSTDISABLE 0 196*3acf731cSArnd Bergmann #define PSC_STATE_SYNCRST 1 197*3acf731cSArnd Bergmann #define PSC_STATE_DISABLE 2 198*3acf731cSArnd Bergmann #define PSC_STATE_ENABLE 3 199*3acf731cSArnd Bergmann 200*3acf731cSArnd Bergmann #define MDSTAT_STATE_MASK 0x3f 201*3acf731cSArnd Bergmann #define PDSTAT_STATE_MASK 0x1f 202*3acf731cSArnd Bergmann #define MDCTL_LRST BIT(8) 203*3acf731cSArnd Bergmann #define MDCTL_FORCE BIT(31) 204*3acf731cSArnd Bergmann #define PDCTL_NEXT BIT(0) 205*3acf731cSArnd Bergmann #define PDCTL_EPCGOOD BIT(8) 206*3acf731cSArnd Bergmann 207*3acf731cSArnd Bergmann #ifndef __ASSEMBLER__ 208*3acf731cSArnd Bergmann 209*3acf731cSArnd Bergmann extern int davinci_psc_is_clk_active(unsigned int ctlr, unsigned int id); 210*3acf731cSArnd Bergmann extern void davinci_psc_reset(unsigned int ctlr, unsigned int id, 211*3acf731cSArnd Bergmann bool reset); 212*3acf731cSArnd Bergmann extern void davinci_psc_config(unsigned int domain, unsigned int ctlr, 213*3acf731cSArnd Bergmann unsigned int id, bool enable, u32 flags); 214*3acf731cSArnd Bergmann 215*3acf731cSArnd Bergmann #endif 216*3acf731cSArnd Bergmann 217*3acf731cSArnd Bergmann #endif /* __ASM_ARCH_PSC_H */ 218