xref: /openbmc/linux/arch/arm/mach-omap2/prm33xx.h (revision c059ee9d)
1 /*
2  * AM33XX PRM instance offset macros
3  *
4  * Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License as
8  * published by the Free Software Foundation version 2.
9  *
10  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11  * kind, whether express or implied; without even the implied warranty
12  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  */
15 
16 #ifndef __ARCH_ARM_MACH_OMAP2_PRM33XX_H
17 #define __ARCH_ARM_MACH_OMAP2_PRM33XX_H
18 
19 #include "prcm-common.h"
20 #include "prm.h"
21 
22 #define AM33XX_PRM_BASE               0x44E00000
23 
24 #define AM33XX_PRM_REGADDR(inst, reg)                         \
25 	AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE + (inst) + (reg))
26 
27 
28 /* PRM instances */
29 #define AM33XX_PRM_OCP_SOCKET_MOD	0x0B00
30 #define AM33XX_PRM_PER_MOD		0x0C00
31 #define AM33XX_PRM_WKUP_MOD		0x0D00
32 #define AM33XX_PRM_MPU_MOD		0x0E00
33 #define AM33XX_PRM_DEVICE_MOD		0x0F00
34 #define AM33XX_PRM_RTC_MOD		0x1000
35 #define AM33XX_PRM_GFX_MOD		0x1100
36 #define AM33XX_PRM_CEFUSE_MOD		0x1200
37 
38 /* PRM.PER_PRM register offsets */
39 #define AM33XX_PM_PER_PWRSTST_OFFSET		0x0008
40 #define AM33XX_PM_PER_PWRSTST			AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0008)
41 #define AM33XX_PM_PER_PWRSTCTRL_OFFSET		0x000c
42 #define AM33XX_PM_PER_PWRSTCTRL			AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x000c)
43 
44 /* PRM.WKUP_PRM register offsets */
45 #define AM33XX_PM_WKUP_PWRSTCTRL_OFFSET		0x0004
46 #define AM33XX_PM_WKUP_PWRSTCTRL		AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0004)
47 #define AM33XX_PM_WKUP_PWRSTST_OFFSET		0x0008
48 #define AM33XX_PM_WKUP_PWRSTST			AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0008)
49 
50 /* PRM.MPU_PRM register offsets */
51 #define AM33XX_PM_MPU_PWRSTCTRL_OFFSET		0x0000
52 #define AM33XX_PM_MPU_PWRSTCTRL			AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0000)
53 #define AM33XX_PM_MPU_PWRSTST_OFFSET		0x0004
54 #define AM33XX_PM_MPU_PWRSTST			AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0004)
55 
56 /* PRM.DEVICE_PRM register offsets */
57 #define AM33XX_PRM_RSTCTRL_OFFSET		0x0000
58 #define AM33XX_PRM_RSTCTRL			AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0000)
59 
60 /* PRM.RTC_PRM register offsets */
61 #define AM33XX_PM_RTC_PWRSTCTRL_OFFSET		0x0000
62 #define AM33XX_PM_RTC_PWRSTCTRL			AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0000)
63 #define AM33XX_PM_RTC_PWRSTST_OFFSET		0x0004
64 #define AM33XX_PM_RTC_PWRSTST			AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0004)
65 
66 /* PRM.GFX_PRM register offsets */
67 #define AM33XX_PM_GFX_PWRSTCTRL_OFFSET		0x0000
68 #define AM33XX_PM_GFX_PWRSTCTRL			AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0000)
69 #define AM33XX_PM_GFX_PWRSTST_OFFSET		0x0010
70 #define AM33XX_PM_GFX_PWRSTST			AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0010)
71 
72 /* PRM.CEFUSE_PRM register offsets */
73 #define AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET	0x0000
74 #define AM33XX_PM_CEFUSE_PWRSTCTRL		AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0000)
75 #define AM33XX_PM_CEFUSE_PWRSTST_OFFSET		0x0004
76 #define AM33XX_PM_CEFUSE_PWRSTST		AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004)
77 
78 #ifndef __ASSEMBLER__
79 int am33xx_prm_init(const struct omap_prcm_init_data *data);
80 
81 #endif /* ASSEMBLER */
82 #endif
83