1ddd04b98SVaibhav Hiremath /* 2ddd04b98SVaibhav Hiremath * AM33XX PRM instance offset macros 3ddd04b98SVaibhav Hiremath * 4ddd04b98SVaibhav Hiremath * Copyright (C) 2011-2012 Texas Instruments Incorporated - http://www.ti.com/ 5ddd04b98SVaibhav Hiremath * 6ddd04b98SVaibhav Hiremath * This program is free software; you can redistribute it and/or 7ddd04b98SVaibhav Hiremath * modify it under the terms of the GNU General Public License as 8ddd04b98SVaibhav Hiremath * published by the Free Software Foundation version 2. 9ddd04b98SVaibhav Hiremath * 10ddd04b98SVaibhav Hiremath * This program is distributed "as is" WITHOUT ANY WARRANTY of any 11ddd04b98SVaibhav Hiremath * kind, whether express or implied; without even the implied warranty 12ddd04b98SVaibhav Hiremath * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13ddd04b98SVaibhav Hiremath * GNU General Public License for more details. 14ddd04b98SVaibhav Hiremath */ 15ddd04b98SVaibhav Hiremath 16ddd04b98SVaibhav Hiremath #ifndef __ARCH_ARM_MACH_OMAP2_PRM33XX_H 17ddd04b98SVaibhav Hiremath #define __ARCH_ARM_MACH_OMAP2_PRM33XX_H 18ddd04b98SVaibhav Hiremath 19ddd04b98SVaibhav Hiremath #include "prcm-common.h" 20ddd04b98SVaibhav Hiremath #include "prm.h" 21ddd04b98SVaibhav Hiremath 22ddd04b98SVaibhav Hiremath #define AM33XX_PRM_BASE 0x44E00000 23ddd04b98SVaibhav Hiremath 24ddd04b98SVaibhav Hiremath #define AM33XX_PRM_REGADDR(inst, reg) \ 25ddd04b98SVaibhav Hiremath AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE + (inst) + (reg)) 26ddd04b98SVaibhav Hiremath 27ddd04b98SVaibhav Hiremath 28ddd04b98SVaibhav Hiremath /* PRM instances */ 29ddd04b98SVaibhav Hiremath #define AM33XX_PRM_OCP_SOCKET_MOD 0x0B00 30ddd04b98SVaibhav Hiremath #define AM33XX_PRM_PER_MOD 0x0C00 31ddd04b98SVaibhav Hiremath #define AM33XX_PRM_WKUP_MOD 0x0D00 32ddd04b98SVaibhav Hiremath #define AM33XX_PRM_MPU_MOD 0x0E00 33ddd04b98SVaibhav Hiremath #define AM33XX_PRM_DEVICE_MOD 0x0F00 34ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RTC_MOD 0x1000 35ddd04b98SVaibhav Hiremath #define AM33XX_PRM_GFX_MOD 0x1100 36ddd04b98SVaibhav Hiremath #define AM33XX_PRM_CEFUSE_MOD 0x1200 37ddd04b98SVaibhav Hiremath 38ddd04b98SVaibhav Hiremath /* PRM */ 39ddd04b98SVaibhav Hiremath 40ddd04b98SVaibhav Hiremath /* PRM.OCP_SOCKET_PRM register offsets */ 41ddd04b98SVaibhav Hiremath #define AM33XX_REVISION_PRM_OFFSET 0x0000 42ddd04b98SVaibhav Hiremath #define AM33XX_REVISION_PRM AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0000) 43ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQSTATUS_MPU_OFFSET 0x0004 44ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQSTATUS_MPU AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0004) 45ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQENABLE_MPU_OFFSET 0x0008 46ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQENABLE_MPU AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0008) 47ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQSTATUS_M3_OFFSET 0x000c 48ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQSTATUS_M3 AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x000c) 49ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQENABLE_M3_OFFSET 0x0010 50ddd04b98SVaibhav Hiremath #define AM33XX_PRM_IRQENABLE_M3 AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0010) 51ddd04b98SVaibhav Hiremath 52ddd04b98SVaibhav Hiremath /* PRM.PER_PRM register offsets */ 53ddd04b98SVaibhav Hiremath #define AM33XX_RM_PER_RSTCTRL_OFFSET 0x0000 54ddd04b98SVaibhav Hiremath #define AM33XX_RM_PER_RSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0000) 55ddd04b98SVaibhav Hiremath #define AM33XX_RM_PER_RSTST_OFFSET 0x0004 56ddd04b98SVaibhav Hiremath #define AM33XX_RM_PER_RSTST AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0004) 57ddd04b98SVaibhav Hiremath #define AM33XX_PM_PER_PWRSTST_OFFSET 0x0008 58ddd04b98SVaibhav Hiremath #define AM33XX_PM_PER_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0008) 59ddd04b98SVaibhav Hiremath #define AM33XX_PM_PER_PWRSTCTRL_OFFSET 0x000c 60ddd04b98SVaibhav Hiremath #define AM33XX_PM_PER_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x000c) 61ddd04b98SVaibhav Hiremath 62ddd04b98SVaibhav Hiremath /* PRM.WKUP_PRM register offsets */ 63ddd04b98SVaibhav Hiremath #define AM33XX_RM_WKUP_RSTCTRL_OFFSET 0x0000 64ddd04b98SVaibhav Hiremath #define AM33XX_RM_WKUP_RSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0000) 65ddd04b98SVaibhav Hiremath #define AM33XX_PM_WKUP_PWRSTCTRL_OFFSET 0x0004 66ddd04b98SVaibhav Hiremath #define AM33XX_PM_WKUP_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0004) 67ddd04b98SVaibhav Hiremath #define AM33XX_PM_WKUP_PWRSTST_OFFSET 0x0008 68ddd04b98SVaibhav Hiremath #define AM33XX_PM_WKUP_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0008) 69ddd04b98SVaibhav Hiremath #define AM33XX_RM_WKUP_RSTST_OFFSET 0x000c 70ddd04b98SVaibhav Hiremath #define AM33XX_RM_WKUP_RSTST AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x000c) 71ddd04b98SVaibhav Hiremath 72ddd04b98SVaibhav Hiremath /* PRM.MPU_PRM register offsets */ 73ddd04b98SVaibhav Hiremath #define AM33XX_PM_MPU_PWRSTCTRL_OFFSET 0x0000 74ddd04b98SVaibhav Hiremath #define AM33XX_PM_MPU_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0000) 75ddd04b98SVaibhav Hiremath #define AM33XX_PM_MPU_PWRSTST_OFFSET 0x0004 76ddd04b98SVaibhav Hiremath #define AM33XX_PM_MPU_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0004) 77ddd04b98SVaibhav Hiremath #define AM33XX_RM_MPU_RSTST_OFFSET 0x0008 78ddd04b98SVaibhav Hiremath #define AM33XX_RM_MPU_RSTST AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0008) 79ddd04b98SVaibhav Hiremath 80ddd04b98SVaibhav Hiremath /* PRM.DEVICE_PRM register offsets */ 81ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTCTRL_OFFSET 0x0000 82ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0000) 83ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTTIME_OFFSET 0x0004 84ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTTIME AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0004) 85ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTST_OFFSET 0x0008 86ddd04b98SVaibhav Hiremath #define AM33XX_PRM_RSTST AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0008) 87ddd04b98SVaibhav Hiremath #define AM33XX_PRM_SRAM_COUNT_OFFSET 0x000c 88ddd04b98SVaibhav Hiremath #define AM33XX_PRM_SRAM_COUNT AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x000c) 89ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_CORE_SETUP_OFFSET 0x0010 90ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_CORE_SETUP AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0010) 91ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_CORE_CTRL_OFFSET 0x0014 92ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_CORE_CTRL AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0014) 93ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_MPU_SETUP_OFFSET 0x0018 94ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_MPU_SETUP AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0018) 95ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_MPU_CTRL_OFFSET 0x001c 96ddd04b98SVaibhav Hiremath #define AM33XX_PRM_LDO_SRAM_MPU_CTRL AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x001c) 97ddd04b98SVaibhav Hiremath 98ddd04b98SVaibhav Hiremath /* PRM.RTC_PRM register offsets */ 99ddd04b98SVaibhav Hiremath #define AM33XX_PM_RTC_PWRSTCTRL_OFFSET 0x0000 100ddd04b98SVaibhav Hiremath #define AM33XX_PM_RTC_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0000) 101ddd04b98SVaibhav Hiremath #define AM33XX_PM_RTC_PWRSTST_OFFSET 0x0004 102ddd04b98SVaibhav Hiremath #define AM33XX_PM_RTC_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0004) 103ddd04b98SVaibhav Hiremath 104ddd04b98SVaibhav Hiremath /* PRM.GFX_PRM register offsets */ 105ddd04b98SVaibhav Hiremath #define AM33XX_PM_GFX_PWRSTCTRL_OFFSET 0x0000 106ddd04b98SVaibhav Hiremath #define AM33XX_PM_GFX_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0000) 107ddd04b98SVaibhav Hiremath #define AM33XX_RM_GFX_RSTCTRL_OFFSET 0x0004 108ddd04b98SVaibhav Hiremath #define AM33XX_RM_GFX_RSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0004) 109ddd04b98SVaibhav Hiremath #define AM33XX_PM_GFX_PWRSTST_OFFSET 0x0010 110ddd04b98SVaibhav Hiremath #define AM33XX_PM_GFX_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0010) 111ddd04b98SVaibhav Hiremath #define AM33XX_RM_GFX_RSTST_OFFSET 0x0014 112ddd04b98SVaibhav Hiremath #define AM33XX_RM_GFX_RSTST AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0014) 113ddd04b98SVaibhav Hiremath 114ddd04b98SVaibhav Hiremath /* PRM.CEFUSE_PRM register offsets */ 115ddd04b98SVaibhav Hiremath #define AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET 0x0000 116ddd04b98SVaibhav Hiremath #define AM33XX_PM_CEFUSE_PWRSTCTRL AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0000) 117ddd04b98SVaibhav Hiremath #define AM33XX_PM_CEFUSE_PWRSTST_OFFSET 0x0004 118ddd04b98SVaibhav Hiremath #define AM33XX_PM_CEFUSE_PWRSTST AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004) 119ddd04b98SVaibhav Hiremath 120ddd04b98SVaibhav Hiremath extern u32 am33xx_prm_read_reg(s16 inst, u16 idx); 121ddd04b98SVaibhav Hiremath extern void am33xx_prm_write_reg(u32 val, s16 inst, u16 idx); 122ddd04b98SVaibhav Hiremath extern u32 am33xx_prm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx); 123ddd04b98SVaibhav Hiremath extern void am33xx_prm_global_warm_sw_reset(void); 124ddd04b98SVaibhav Hiremath extern int am33xx_prm_is_hardreset_asserted(u8 shift, s16 inst, 125ddd04b98SVaibhav Hiremath u16 rstctrl_offs); 126ddd04b98SVaibhav Hiremath extern int am33xx_prm_assert_hardreset(u8 shift, s16 inst, u16 rstctrl_offs); 127ddd04b98SVaibhav Hiremath extern int am33xx_prm_deassert_hardreset(u8 shift, s16 inst, 128ddd04b98SVaibhav Hiremath u16 rstctrl_offs, u16 rstst_offs); 129ddd04b98SVaibhav Hiremath #endif 130