18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci *  DaVinci Power & Sleep Controller (PSC) defines
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Copyright (C) 2006 Texas Instruments.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *  This program is free software; you can redistribute  it and/or modify it
78c2ecf20Sopenharmony_ci *  under  the terms of  the GNU General  Public License as published by the
88c2ecf20Sopenharmony_ci *  Free Software Foundation;  either version 2 of the  License, or (at your
98c2ecf20Sopenharmony_ci *  option) any later version.
108c2ecf20Sopenharmony_ci *
118c2ecf20Sopenharmony_ci *  THIS  SOFTWARE  IS PROVIDED   ``AS  IS'' AND   ANY  EXPRESS OR IMPLIED
128c2ecf20Sopenharmony_ci *  WARRANTIES,   INCLUDING, BUT NOT  LIMITED  TO, THE IMPLIED WARRANTIES OF
138c2ecf20Sopenharmony_ci *  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN
148c2ecf20Sopenharmony_ci *  NO  EVENT  SHALL   THE AUTHOR  BE    LIABLE FOR ANY   DIRECT, INDIRECT,
158c2ecf20Sopenharmony_ci *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
168c2ecf20Sopenharmony_ci *  NOT LIMITED   TO, PROCUREMENT OF  SUBSTITUTE GOODS  OR SERVICES; LOSS OF
178c2ecf20Sopenharmony_ci *  USE, DATA,  OR PROFITS; OR  BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
188c2ecf20Sopenharmony_ci *  ANY THEORY OF LIABILITY, WHETHER IN  CONTRACT, STRICT LIABILITY, OR TORT
198c2ecf20Sopenharmony_ci *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
208c2ecf20Sopenharmony_ci *  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
218c2ecf20Sopenharmony_ci *
228c2ecf20Sopenharmony_ci *  You should have received a copy of the  GNU General Public License along
238c2ecf20Sopenharmony_ci *  with this program; if not, write  to the Free Software Foundation, Inc.,
248c2ecf20Sopenharmony_ci *  675 Mass Ave, Cambridge, MA 02139, USA.
258c2ecf20Sopenharmony_ci *
268c2ecf20Sopenharmony_ci */
278c2ecf20Sopenharmony_ci#ifndef __ASM_ARCH_PSC_H
288c2ecf20Sopenharmony_ci#define __ASM_ARCH_PSC_H
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* Power and Sleep Controller (PSC) Domains */
318c2ecf20Sopenharmony_ci#define DAVINCI_GPSC_ARMDOMAIN		0
328c2ecf20Sopenharmony_ci#define DAVINCI_GPSC_DSPDOMAIN		1
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_VPSSMSTR		0
358c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_VPSSSLV		1
368c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TPCC		2
378c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TPTC0		3
388c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TPTC1		4
398c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_EMAC		5
408c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_EMAC_WRAPPER	6
418c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_USB		9
428c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_ATA		10
438c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_VLYNQ		11
448c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_UHPI		12
458c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_DDR_EMIF		13
468c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_AEMIF		14
478c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_MMC_SD		15
488c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_McBSP		17
498c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_I2C		18
508c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_UART0		19
518c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_UART1		20
528c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_UART2		21
538c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_SPI		22
548c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_PWM0		23
558c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_PWM1		24
568c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_PWM2		25
578c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_GPIO		26
588c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TIMER0		27
598c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TIMER1		28
608c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_TIMER2		29
618c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_SYSTEM_SUBSYS	30
628c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_ARM		31
638c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_SCR2		32
648c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_SCR3		33
658c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_SCR4		34
668c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_CROSSBAR		35
678c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_CFG27		36
688c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_CFG3		37
698c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_CFG5		38
708c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_GEM		39
718c2ecf20Sopenharmony_ci#define DAVINCI_LPSC_IMCOP		40
728c2ecf20Sopenharmony_ci
738c2ecf20Sopenharmony_ci#define DM355_LPSC_TIMER3		5
748c2ecf20Sopenharmony_ci#define DM355_LPSC_SPI1			6
758c2ecf20Sopenharmony_ci#define DM355_LPSC_MMC_SD1		7
768c2ecf20Sopenharmony_ci#define DM355_LPSC_McBSP1		8
778c2ecf20Sopenharmony_ci#define DM355_LPSC_PWM3			10
788c2ecf20Sopenharmony_ci#define DM355_LPSC_SPI2			11
798c2ecf20Sopenharmony_ci#define DM355_LPSC_RTO			12
808c2ecf20Sopenharmony_ci#define DM355_LPSC_VPSS_DAC		41
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci/* DM365 */
838c2ecf20Sopenharmony_ci#define DM365_LPSC_TIMER3	5
848c2ecf20Sopenharmony_ci#define DM365_LPSC_SPI1		6
858c2ecf20Sopenharmony_ci#define DM365_LPSC_MMC_SD1	7
868c2ecf20Sopenharmony_ci#define DM365_LPSC_McBSP1	8
878c2ecf20Sopenharmony_ci#define DM365_LPSC_PWM3		10
888c2ecf20Sopenharmony_ci#define DM365_LPSC_SPI2		11
898c2ecf20Sopenharmony_ci#define DM365_LPSC_RTO		12
908c2ecf20Sopenharmony_ci#define DM365_LPSC_TIMER4	17
918c2ecf20Sopenharmony_ci#define DM365_LPSC_SPI0		22
928c2ecf20Sopenharmony_ci#define DM365_LPSC_SPI3		38
938c2ecf20Sopenharmony_ci#define DM365_LPSC_SPI4		39
948c2ecf20Sopenharmony_ci#define DM365_LPSC_EMAC		40
958c2ecf20Sopenharmony_ci#define DM365_LPSC_VOICE_CODEC	44
968c2ecf20Sopenharmony_ci#define DM365_LPSC_DAC_CLK	46
978c2ecf20Sopenharmony_ci#define DM365_LPSC_VPSSMSTR	47
988c2ecf20Sopenharmony_ci#define DM365_LPSC_MJCP		50
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci/*
1018c2ecf20Sopenharmony_ci * LPSC Assignments
1028c2ecf20Sopenharmony_ci */
1038c2ecf20Sopenharmony_ci#define DM646X_LPSC_ARM		0
1048c2ecf20Sopenharmony_ci#define DM646X_LPSC_C64X_CPU	1
1058c2ecf20Sopenharmony_ci#define DM646X_LPSC_HDVICP0	2
1068c2ecf20Sopenharmony_ci#define DM646X_LPSC_HDVICP1	3
1078c2ecf20Sopenharmony_ci#define DM646X_LPSC_TPCC	4
1088c2ecf20Sopenharmony_ci#define DM646X_LPSC_TPTC0	5
1098c2ecf20Sopenharmony_ci#define DM646X_LPSC_TPTC1	6
1108c2ecf20Sopenharmony_ci#define DM646X_LPSC_TPTC2	7
1118c2ecf20Sopenharmony_ci#define DM646X_LPSC_TPTC3	8
1128c2ecf20Sopenharmony_ci#define DM646X_LPSC_PCI		13
1138c2ecf20Sopenharmony_ci#define DM646X_LPSC_EMAC	14
1148c2ecf20Sopenharmony_ci#define DM646X_LPSC_VDCE	15
1158c2ecf20Sopenharmony_ci#define DM646X_LPSC_VPSSMSTR	16
1168c2ecf20Sopenharmony_ci#define DM646X_LPSC_VPSSSLV	17
1178c2ecf20Sopenharmony_ci#define DM646X_LPSC_TSIF0	18
1188c2ecf20Sopenharmony_ci#define DM646X_LPSC_TSIF1	19
1198c2ecf20Sopenharmony_ci#define DM646X_LPSC_DDR_EMIF	20
1208c2ecf20Sopenharmony_ci#define DM646X_LPSC_AEMIF	21
1218c2ecf20Sopenharmony_ci#define DM646X_LPSC_McASP0	22
1228c2ecf20Sopenharmony_ci#define DM646X_LPSC_McASP1	23
1238c2ecf20Sopenharmony_ci#define DM646X_LPSC_CRGEN0	24
1248c2ecf20Sopenharmony_ci#define DM646X_LPSC_CRGEN1	25
1258c2ecf20Sopenharmony_ci#define DM646X_LPSC_UART0	26
1268c2ecf20Sopenharmony_ci#define DM646X_LPSC_UART1	27
1278c2ecf20Sopenharmony_ci#define DM646X_LPSC_UART2	28
1288c2ecf20Sopenharmony_ci#define DM646X_LPSC_PWM0	29
1298c2ecf20Sopenharmony_ci#define DM646X_LPSC_PWM1	30
1308c2ecf20Sopenharmony_ci#define DM646X_LPSC_I2C		31
1318c2ecf20Sopenharmony_ci#define DM646X_LPSC_SPI		32
1328c2ecf20Sopenharmony_ci#define DM646X_LPSC_GPIO	33
1338c2ecf20Sopenharmony_ci#define DM646X_LPSC_TIMER0	34
1348c2ecf20Sopenharmony_ci#define DM646X_LPSC_TIMER1	35
1358c2ecf20Sopenharmony_ci#define DM646X_LPSC_ARM_INTC	45
1368c2ecf20Sopenharmony_ci
1378c2ecf20Sopenharmony_ci/* PSC0 defines */
1388c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_TPCC		0
1398c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_TPTC0		1
1408c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_TPTC1		2
1418c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_EMIF25		3
1428c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_SPI0		4
1438c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_MMC_SD		5
1448c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_AINTC		6
1458c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_ARM_RAM_ROM		7
1468c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_SECU_MGR		8
1478c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_UART0		9
1488c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_SCR0_SS		10
1498c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_SCR1_SS		11
1508c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_SCR2_SS		12
1518c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_PRUSS		13
1528c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_ARM			14
1538c2ecf20Sopenharmony_ci#define DA8XX_LPSC0_GEM			15
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci/* PSC1 defines */
1568c2ecf20Sopenharmony_ci#define DA850_LPSC1_TPCC1		0
1578c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_USB20		1
1588c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_USB11		2
1598c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_GPIO		3
1608c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_UHPI		4
1618c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_CPGMAC		5
1628c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_EMIF3C		6
1638c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_McASP0		7
1648c2ecf20Sopenharmony_ci#define DA830_LPSC1_McASP1		8
1658c2ecf20Sopenharmony_ci#define DA850_LPSC1_SATA		8
1668c2ecf20Sopenharmony_ci#define DA830_LPSC1_McASP2		9
1678c2ecf20Sopenharmony_ci#define DA850_LPSC1_VPIF		9
1688c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_SPI1		10
1698c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_I2C			11
1708c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_UART1		12
1718c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_UART2		13
1728c2ecf20Sopenharmony_ci#define DA850_LPSC1_McBSP0		14
1738c2ecf20Sopenharmony_ci#define DA850_LPSC1_McBSP1		15
1748c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_LCDC		16
1758c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_PWM			17
1768c2ecf20Sopenharmony_ci#define DA850_LPSC1_MMC_SD1		18
1778c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_ECAP		20
1788c2ecf20Sopenharmony_ci#define DA830_LPSC1_EQEP		21
1798c2ecf20Sopenharmony_ci#define DA850_LPSC1_TPTC2		21
1808c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_SCR_P0_SS		24
1818c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_SCR_P1_SS		25
1828c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_CR_P3_SS		26
1838c2ecf20Sopenharmony_ci#define DA8XX_LPSC1_L3_CBA_RAM		31
1848c2ecf20Sopenharmony_ci
1858c2ecf20Sopenharmony_ci/* PSC register offsets */
1868c2ecf20Sopenharmony_ci#define EPCPR		0x070
1878c2ecf20Sopenharmony_ci#define PTCMD		0x120
1888c2ecf20Sopenharmony_ci#define PTSTAT		0x128
1898c2ecf20Sopenharmony_ci#define PDSTAT		0x200
1908c2ecf20Sopenharmony_ci#define PDCTL		0x300
1918c2ecf20Sopenharmony_ci#define MDSTAT		0x800
1928c2ecf20Sopenharmony_ci#define MDCTL		0xA00
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci/* PSC module states */
1958c2ecf20Sopenharmony_ci#define PSC_STATE_SWRSTDISABLE	0
1968c2ecf20Sopenharmony_ci#define PSC_STATE_SYNCRST	1
1978c2ecf20Sopenharmony_ci#define PSC_STATE_DISABLE	2
1988c2ecf20Sopenharmony_ci#define PSC_STATE_ENABLE	3
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci#define MDSTAT_STATE_MASK	0x3f
2018c2ecf20Sopenharmony_ci#define PDSTAT_STATE_MASK	0x1f
2028c2ecf20Sopenharmony_ci#define MDCTL_LRST		BIT(8)
2038c2ecf20Sopenharmony_ci#define MDCTL_FORCE		BIT(31)
2048c2ecf20Sopenharmony_ci#define PDCTL_NEXT		BIT(0)
2058c2ecf20Sopenharmony_ci#define PDCTL_EPCGOOD		BIT(8)
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci#endif /* __ASM_ARCH_PSC_H */
208