162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci *  DaVinci Power & Sleep Controller (PSC) defines
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci *  Copyright (C) 2006 Texas Instruments.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci *  This program is free software; you can redistribute  it and/or modify it
762306a36Sopenharmony_ci *  under  the terms of  the GNU General  Public License as published by the
862306a36Sopenharmony_ci *  Free Software Foundation;  either version 2 of the  License, or (at your
962306a36Sopenharmony_ci *  option) any later version.
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
1262306a36Sopenharmony_ci *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
1362306a36Sopenharmony_ci *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
1462306a36Sopenharmony_ci *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
1562306a36Sopenharmony_ci *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1662306a36Sopenharmony_ci *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
1762306a36Sopenharmony_ci *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
1862306a36Sopenharmony_ci *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
1962306a36Sopenharmony_ci *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
2062306a36Sopenharmony_ci *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2162306a36Sopenharmony_ci *
2262306a36Sopenharmony_ci *  You should have received a copy of the  GNU General Public License along
2362306a36Sopenharmony_ci *  with this program; if not, write  to the Free Software Foundation, Inc.,
2462306a36Sopenharmony_ci *  675 Mass Ave, Cambridge, MA 02139, USA.
2562306a36Sopenharmony_ci *
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#ifndef __ASM_ARCH_PSC_H
2862306a36Sopenharmony_ci#define __ASM_ARCH_PSC_H
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci/* Power and Sleep Controller (PSC) Domains */
3162306a36Sopenharmony_ci#define DAVINCI_GPSC_ARMDOMAIN		0
3262306a36Sopenharmony_ci#define DAVINCI_GPSC_DSPDOMAIN		1
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_ci#define DAVINCI_LPSC_VPSSMSTR		0
3562306a36Sopenharmony_ci#define DAVINCI_LPSC_VPSSSLV		1
3662306a36Sopenharmony_ci#define DAVINCI_LPSC_TPCC		2
3762306a36Sopenharmony_ci#define DAVINCI_LPSC_TPTC0		3
3862306a36Sopenharmony_ci#define DAVINCI_LPSC_TPTC1		4
3962306a36Sopenharmony_ci#define DAVINCI_LPSC_EMAC		5
4062306a36Sopenharmony_ci#define DAVINCI_LPSC_EMAC_WRAPPER	6
4162306a36Sopenharmony_ci#define DAVINCI_LPSC_USB		9
4262306a36Sopenharmony_ci#define DAVINCI_LPSC_ATA		10
4362306a36Sopenharmony_ci#define DAVINCI_LPSC_VLYNQ		11
4462306a36Sopenharmony_ci#define DAVINCI_LPSC_UHPI		12
4562306a36Sopenharmony_ci#define DAVINCI_LPSC_DDR_EMIF		13
4662306a36Sopenharmony_ci#define DAVINCI_LPSC_AEMIF		14
4762306a36Sopenharmony_ci#define DAVINCI_LPSC_MMC_SD		15
4862306a36Sopenharmony_ci#define DAVINCI_LPSC_McBSP		17
4962306a36Sopenharmony_ci#define DAVINCI_LPSC_I2C		18
5062306a36Sopenharmony_ci#define DAVINCI_LPSC_UART0		19
5162306a36Sopenharmony_ci#define DAVINCI_LPSC_UART1		20
5262306a36Sopenharmony_ci#define DAVINCI_LPSC_UART2		21
5362306a36Sopenharmony_ci#define DAVINCI_LPSC_SPI		22
5462306a36Sopenharmony_ci#define DAVINCI_LPSC_PWM0		23
5562306a36Sopenharmony_ci#define DAVINCI_LPSC_PWM1		24
5662306a36Sopenharmony_ci#define DAVINCI_LPSC_PWM2		25
5762306a36Sopenharmony_ci#define DAVINCI_LPSC_GPIO		26
5862306a36Sopenharmony_ci#define DAVINCI_LPSC_TIMER0		27
5962306a36Sopenharmony_ci#define DAVINCI_LPSC_TIMER1		28
6062306a36Sopenharmony_ci#define DAVINCI_LPSC_TIMER2		29
6162306a36Sopenharmony_ci#define DAVINCI_LPSC_SYSTEM_SUBSYS	30
6262306a36Sopenharmony_ci#define DAVINCI_LPSC_ARM		31
6362306a36Sopenharmony_ci#define DAVINCI_LPSC_SCR2		32
6462306a36Sopenharmony_ci#define DAVINCI_LPSC_SCR3		33
6562306a36Sopenharmony_ci#define DAVINCI_LPSC_SCR4		34
6662306a36Sopenharmony_ci#define DAVINCI_LPSC_CROSSBAR		35
6762306a36Sopenharmony_ci#define DAVINCI_LPSC_CFG27		36
6862306a36Sopenharmony_ci#define DAVINCI_LPSC_CFG3		37
6962306a36Sopenharmony_ci#define DAVINCI_LPSC_CFG5		38
7062306a36Sopenharmony_ci#define DAVINCI_LPSC_GEM		39
7162306a36Sopenharmony_ci#define DAVINCI_LPSC_IMCOP		40
7262306a36Sopenharmony_ci
7362306a36Sopenharmony_ci/* PSC0 defines */
7462306a36Sopenharmony_ci#define DA8XX_LPSC0_TPCC		0
7562306a36Sopenharmony_ci#define DA8XX_LPSC0_TPTC0		1
7662306a36Sopenharmony_ci#define DA8XX_LPSC0_TPTC1		2
7762306a36Sopenharmony_ci#define DA8XX_LPSC0_EMIF25		3
7862306a36Sopenharmony_ci#define DA8XX_LPSC0_SPI0		4
7962306a36Sopenharmony_ci#define DA8XX_LPSC0_MMC_SD		5
8062306a36Sopenharmony_ci#define DA8XX_LPSC0_AINTC		6
8162306a36Sopenharmony_ci#define DA8XX_LPSC0_ARM_RAM_ROM		7
8262306a36Sopenharmony_ci#define DA8XX_LPSC0_SECU_MGR		8
8362306a36Sopenharmony_ci#define DA8XX_LPSC0_UART0		9
8462306a36Sopenharmony_ci#define DA8XX_LPSC0_SCR0_SS		10
8562306a36Sopenharmony_ci#define DA8XX_LPSC0_SCR1_SS		11
8662306a36Sopenharmony_ci#define DA8XX_LPSC0_SCR2_SS		12
8762306a36Sopenharmony_ci#define DA8XX_LPSC0_PRUSS		13
8862306a36Sopenharmony_ci#define DA8XX_LPSC0_ARM			14
8962306a36Sopenharmony_ci#define DA8XX_LPSC0_GEM			15
9062306a36Sopenharmony_ci
9162306a36Sopenharmony_ci/* PSC1 defines */
9262306a36Sopenharmony_ci#define DA850_LPSC1_TPCC1		0
9362306a36Sopenharmony_ci#define DA8XX_LPSC1_USB20		1
9462306a36Sopenharmony_ci#define DA8XX_LPSC1_USB11		2
9562306a36Sopenharmony_ci#define DA8XX_LPSC1_GPIO		3
9662306a36Sopenharmony_ci#define DA8XX_LPSC1_UHPI		4
9762306a36Sopenharmony_ci#define DA8XX_LPSC1_CPGMAC		5
9862306a36Sopenharmony_ci#define DA8XX_LPSC1_EMIF3C		6
9962306a36Sopenharmony_ci#define DA8XX_LPSC1_McASP0		7
10062306a36Sopenharmony_ci#define DA830_LPSC1_McASP1		8
10162306a36Sopenharmony_ci#define DA850_LPSC1_SATA		8
10262306a36Sopenharmony_ci#define DA830_LPSC1_McASP2		9
10362306a36Sopenharmony_ci#define DA850_LPSC1_VPIF		9
10462306a36Sopenharmony_ci#define DA8XX_LPSC1_SPI1		10
10562306a36Sopenharmony_ci#define DA8XX_LPSC1_I2C			11
10662306a36Sopenharmony_ci#define DA8XX_LPSC1_UART1		12
10762306a36Sopenharmony_ci#define DA8XX_LPSC1_UART2		13
10862306a36Sopenharmony_ci#define DA850_LPSC1_McBSP0		14
10962306a36Sopenharmony_ci#define DA850_LPSC1_McBSP1		15
11062306a36Sopenharmony_ci#define DA8XX_LPSC1_LCDC		16
11162306a36Sopenharmony_ci#define DA8XX_LPSC1_PWM			17
11262306a36Sopenharmony_ci#define DA850_LPSC1_MMC_SD1		18
11362306a36Sopenharmony_ci#define DA8XX_LPSC1_ECAP		20
11462306a36Sopenharmony_ci#define DA830_LPSC1_EQEP		21
11562306a36Sopenharmony_ci#define DA850_LPSC1_TPTC2		21
11662306a36Sopenharmony_ci#define DA8XX_LPSC1_SCR_P0_SS		24
11762306a36Sopenharmony_ci#define DA8XX_LPSC1_SCR_P1_SS		25
11862306a36Sopenharmony_ci#define DA8XX_LPSC1_CR_P3_SS		26
11962306a36Sopenharmony_ci#define DA8XX_LPSC1_L3_CBA_RAM		31
12062306a36Sopenharmony_ci
12162306a36Sopenharmony_ci/* PSC register offsets */
12262306a36Sopenharmony_ci#define EPCPR		0x070
12362306a36Sopenharmony_ci#define PTCMD		0x120
12462306a36Sopenharmony_ci#define PTSTAT		0x128
12562306a36Sopenharmony_ci#define PDSTAT		0x200
12662306a36Sopenharmony_ci#define PDCTL		0x300
12762306a36Sopenharmony_ci#define MDSTAT		0x800
12862306a36Sopenharmony_ci#define MDCTL		0xA00
12962306a36Sopenharmony_ci
13062306a36Sopenharmony_ci/* PSC module states */
13162306a36Sopenharmony_ci#define PSC_STATE_SWRSTDISABLE	0
13262306a36Sopenharmony_ci#define PSC_STATE_SYNCRST	1
13362306a36Sopenharmony_ci#define PSC_STATE_DISABLE	2
13462306a36Sopenharmony_ci#define PSC_STATE_ENABLE	3
13562306a36Sopenharmony_ci
13662306a36Sopenharmony_ci#define MDSTAT_STATE_MASK	0x3f
13762306a36Sopenharmony_ci#define PDSTAT_STATE_MASK	0x1f
13862306a36Sopenharmony_ci#define MDCTL_LRST		BIT(8)
13962306a36Sopenharmony_ci#define MDCTL_FORCE		BIT(31)
14062306a36Sopenharmony_ci#define PDCTL_NEXT		BIT(0)
14162306a36Sopenharmony_ci#define PDCTL_EPCGOOD		BIT(8)
14262306a36Sopenharmony_ci
14362306a36Sopenharmony_ci#endif /* __ASM_ARCH_PSC_H */
144