Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
prm33xx.h File Reference
#include "prcm-common.h"
#include "prm.h"

Go to the source code of this file.

Macros

#define AM33XX_PRM_BASE   0x44E00000
 
#define AM33XX_PRM_REGADDR(inst, reg)   AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE + (inst) + (reg))
 
#define AM33XX_PRM_OCP_SOCKET_MOD   0x0B00
 
#define AM33XX_PRM_PER_MOD   0x0C00
 
#define AM33XX_PRM_WKUP_MOD   0x0D00
 
#define AM33XX_PRM_MPU_MOD   0x0E00
 
#define AM33XX_PRM_DEVICE_MOD   0x0F00
 
#define AM33XX_PRM_RTC_MOD   0x1000
 
#define AM33XX_PRM_GFX_MOD   0x1100
 
#define AM33XX_PRM_CEFUSE_MOD   0x1200
 
#define AM33XX_REVISION_PRM_OFFSET   0x0000
 
#define AM33XX_REVISION_PRM   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0000)
 
#define AM33XX_PRM_IRQSTATUS_MPU_OFFSET   0x0004
 
#define AM33XX_PRM_IRQSTATUS_MPU   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0004)
 
#define AM33XX_PRM_IRQENABLE_MPU_OFFSET   0x0008
 
#define AM33XX_PRM_IRQENABLE_MPU   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0008)
 
#define AM33XX_PRM_IRQSTATUS_M3_OFFSET   0x000c
 
#define AM33XX_PRM_IRQSTATUS_M3   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x000c)
 
#define AM33XX_PRM_IRQENABLE_M3_OFFSET   0x0010
 
#define AM33XX_PRM_IRQENABLE_M3   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0010)
 
#define AM33XX_RM_PER_RSTCTRL_OFFSET   0x0000
 
#define AM33XX_RM_PER_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0000)
 
#define AM33XX_RM_PER_RSTST_OFFSET   0x0004
 
#define AM33XX_RM_PER_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0004)
 
#define AM33XX_PM_PER_PWRSTST_OFFSET   0x0008
 
#define AM33XX_PM_PER_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0008)
 
#define AM33XX_PM_PER_PWRSTCTRL_OFFSET   0x000c
 
#define AM33XX_PM_PER_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x000c)
 
#define AM33XX_RM_WKUP_RSTCTRL_OFFSET   0x0000
 
#define AM33XX_RM_WKUP_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0000)
 
#define AM33XX_PM_WKUP_PWRSTCTRL_OFFSET   0x0004
 
#define AM33XX_PM_WKUP_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0004)
 
#define AM33XX_PM_WKUP_PWRSTST_OFFSET   0x0008
 
#define AM33XX_PM_WKUP_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0008)
 
#define AM33XX_RM_WKUP_RSTST_OFFSET   0x000c
 
#define AM33XX_RM_WKUP_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x000c)
 
#define AM33XX_PM_MPU_PWRSTCTRL_OFFSET   0x0000
 
#define AM33XX_PM_MPU_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0000)
 
#define AM33XX_PM_MPU_PWRSTST_OFFSET   0x0004
 
#define AM33XX_PM_MPU_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0004)
 
#define AM33XX_RM_MPU_RSTST_OFFSET   0x0008
 
#define AM33XX_RM_MPU_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0008)
 
#define AM33XX_PRM_RSTCTRL_OFFSET   0x0000
 
#define AM33XX_PRM_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0000)
 
#define AM33XX_PRM_RSTTIME_OFFSET   0x0004
 
#define AM33XX_PRM_RSTTIME   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0004)
 
#define AM33XX_PRM_RSTST_OFFSET   0x0008
 
#define AM33XX_PRM_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0008)
 
#define AM33XX_PRM_SRAM_COUNT_OFFSET   0x000c
 
#define AM33XX_PRM_SRAM_COUNT   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x000c)
 
#define AM33XX_PRM_LDO_SRAM_CORE_SETUP_OFFSET   0x0010
 
#define AM33XX_PRM_LDO_SRAM_CORE_SETUP   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0010)
 
#define AM33XX_PRM_LDO_SRAM_CORE_CTRL_OFFSET   0x0014
 
#define AM33XX_PRM_LDO_SRAM_CORE_CTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0014)
 
#define AM33XX_PRM_LDO_SRAM_MPU_SETUP_OFFSET   0x0018
 
#define AM33XX_PRM_LDO_SRAM_MPU_SETUP   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0018)
 
#define AM33XX_PRM_LDO_SRAM_MPU_CTRL_OFFSET   0x001c
 
#define AM33XX_PRM_LDO_SRAM_MPU_CTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x001c)
 
#define AM33XX_PM_RTC_PWRSTCTRL_OFFSET   0x0000
 
#define AM33XX_PM_RTC_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0000)
 
#define AM33XX_PM_RTC_PWRSTST_OFFSET   0x0004
 
#define AM33XX_PM_RTC_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0004)
 
#define AM33XX_PM_GFX_PWRSTCTRL_OFFSET   0x0000
 
#define AM33XX_PM_GFX_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0000)
 
#define AM33XX_RM_GFX_RSTCTRL_OFFSET   0x0004
 
#define AM33XX_RM_GFX_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0004)
 
#define AM33XX_PM_GFX_PWRSTST_OFFSET   0x0010
 
#define AM33XX_PM_GFX_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0010)
 
#define AM33XX_RM_GFX_RSTST_OFFSET   0x0014
 
#define AM33XX_RM_GFX_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0014)
 
#define AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET   0x0000
 
#define AM33XX_PM_CEFUSE_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0000)
 
#define AM33XX_PM_CEFUSE_PWRSTST_OFFSET   0x0004
 
#define AM33XX_PM_CEFUSE_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004)
 

Functions

u32 am33xx_prm_read_reg (s16 inst, u16 idx)
 
void am33xx_prm_write_reg (u32 val, s16 inst, u16 idx)
 
u32 am33xx_prm_rmw_reg_bits (u32 mask, u32 bits, s16 inst, s16 idx)
 
void am33xx_prm_global_warm_sw_reset (void)
 
int am33xx_prm_is_hardreset_asserted (u8 shift, s16 inst, u16 rstctrl_offs)
 
int am33xx_prm_assert_hardreset (u8 shift, s16 inst, u16 rstctrl_offs)
 
int am33xx_prm_deassert_hardreset (u8 shift, s16 inst, u16 rstctrl_offs, u16 rstst_offs)
 

Macro Definition Documentation

#define AM33XX_PM_CEFUSE_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0000)

Definition at line 116 of file prm33xx.h.

#define AM33XX_PM_CEFUSE_PWRSTCTRL_OFFSET   0x0000

Definition at line 115 of file prm33xx.h.

#define AM33XX_PM_CEFUSE_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_CEFUSE_MOD, 0x0004)

Definition at line 118 of file prm33xx.h.

#define AM33XX_PM_CEFUSE_PWRSTST_OFFSET   0x0004

Definition at line 117 of file prm33xx.h.

#define AM33XX_PM_GFX_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0000)

Definition at line 106 of file prm33xx.h.

#define AM33XX_PM_GFX_PWRSTCTRL_OFFSET   0x0000

Definition at line 105 of file prm33xx.h.

#define AM33XX_PM_GFX_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0010)

Definition at line 110 of file prm33xx.h.

#define AM33XX_PM_GFX_PWRSTST_OFFSET   0x0010

Definition at line 109 of file prm33xx.h.

#define AM33XX_PM_MPU_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0000)

Definition at line 74 of file prm33xx.h.

#define AM33XX_PM_MPU_PWRSTCTRL_OFFSET   0x0000

Definition at line 73 of file prm33xx.h.

#define AM33XX_PM_MPU_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0004)

Definition at line 76 of file prm33xx.h.

#define AM33XX_PM_MPU_PWRSTST_OFFSET   0x0004

Definition at line 75 of file prm33xx.h.

#define AM33XX_PM_PER_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x000c)

Definition at line 60 of file prm33xx.h.

#define AM33XX_PM_PER_PWRSTCTRL_OFFSET   0x000c

Definition at line 59 of file prm33xx.h.

#define AM33XX_PM_PER_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0008)

Definition at line 58 of file prm33xx.h.

#define AM33XX_PM_PER_PWRSTST_OFFSET   0x0008

Definition at line 57 of file prm33xx.h.

#define AM33XX_PM_RTC_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0000)

Definition at line 100 of file prm33xx.h.

#define AM33XX_PM_RTC_PWRSTCTRL_OFFSET   0x0000

Definition at line 99 of file prm33xx.h.

#define AM33XX_PM_RTC_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_RTC_MOD, 0x0004)

Definition at line 102 of file prm33xx.h.

#define AM33XX_PM_RTC_PWRSTST_OFFSET   0x0004

Definition at line 101 of file prm33xx.h.

#define AM33XX_PM_WKUP_PWRSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0004)

Definition at line 66 of file prm33xx.h.

#define AM33XX_PM_WKUP_PWRSTCTRL_OFFSET   0x0004

Definition at line 65 of file prm33xx.h.

#define AM33XX_PM_WKUP_PWRSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0008)

Definition at line 68 of file prm33xx.h.

#define AM33XX_PM_WKUP_PWRSTST_OFFSET   0x0008

Definition at line 67 of file prm33xx.h.

#define AM33XX_PRM_BASE   0x44E00000

Definition at line 22 of file prm33xx.h.

#define AM33XX_PRM_CEFUSE_MOD   0x1200

Definition at line 36 of file prm33xx.h.

#define AM33XX_PRM_DEVICE_MOD   0x0F00

Definition at line 33 of file prm33xx.h.

#define AM33XX_PRM_GFX_MOD   0x1100

Definition at line 35 of file prm33xx.h.

#define AM33XX_PRM_IRQENABLE_M3   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0010)

Definition at line 50 of file prm33xx.h.

#define AM33XX_PRM_IRQENABLE_M3_OFFSET   0x0010

Definition at line 49 of file prm33xx.h.

#define AM33XX_PRM_IRQENABLE_MPU   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0008)

Definition at line 46 of file prm33xx.h.

#define AM33XX_PRM_IRQENABLE_MPU_OFFSET   0x0008

Definition at line 45 of file prm33xx.h.

#define AM33XX_PRM_IRQSTATUS_M3   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x000c)

Definition at line 48 of file prm33xx.h.

#define AM33XX_PRM_IRQSTATUS_M3_OFFSET   0x000c

Definition at line 47 of file prm33xx.h.

#define AM33XX_PRM_IRQSTATUS_MPU   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0004)

Definition at line 44 of file prm33xx.h.

#define AM33XX_PRM_IRQSTATUS_MPU_OFFSET   0x0004

Definition at line 43 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_CORE_CTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0014)

Definition at line 92 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_CORE_CTRL_OFFSET   0x0014

Definition at line 91 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_CORE_SETUP   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0010)

Definition at line 90 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_CORE_SETUP_OFFSET   0x0010

Definition at line 89 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_MPU_CTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x001c)

Definition at line 96 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_MPU_CTRL_OFFSET   0x001c

Definition at line 95 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_MPU_SETUP   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0018)

Definition at line 94 of file prm33xx.h.

#define AM33XX_PRM_LDO_SRAM_MPU_SETUP_OFFSET   0x0018

Definition at line 93 of file prm33xx.h.

#define AM33XX_PRM_MPU_MOD   0x0E00

Definition at line 32 of file prm33xx.h.

#define AM33XX_PRM_OCP_SOCKET_MOD   0x0B00

Definition at line 29 of file prm33xx.h.

#define AM33XX_PRM_PER_MOD   0x0C00

Definition at line 30 of file prm33xx.h.

#define AM33XX_PRM_REGADDR (   inst,
  reg 
)    AM33XX_L4_WK_IO_ADDRESS(AM33XX_PRM_BASE + (inst) + (reg))

Definition at line 24 of file prm33xx.h.

#define AM33XX_PRM_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0000)

Definition at line 82 of file prm33xx.h.

#define AM33XX_PRM_RSTCTRL_OFFSET   0x0000

Definition at line 81 of file prm33xx.h.

#define AM33XX_PRM_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0008)

Definition at line 86 of file prm33xx.h.

#define AM33XX_PRM_RSTST_OFFSET   0x0008

Definition at line 85 of file prm33xx.h.

#define AM33XX_PRM_RSTTIME   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x0004)

Definition at line 84 of file prm33xx.h.

#define AM33XX_PRM_RSTTIME_OFFSET   0x0004

Definition at line 83 of file prm33xx.h.

#define AM33XX_PRM_RTC_MOD   0x1000

Definition at line 34 of file prm33xx.h.

#define AM33XX_PRM_SRAM_COUNT   AM33XX_PRM_REGADDR(AM33XX_PRM_DEVICE_MOD, 0x000c)

Definition at line 88 of file prm33xx.h.

#define AM33XX_PRM_SRAM_COUNT_OFFSET   0x000c

Definition at line 87 of file prm33xx.h.

#define AM33XX_PRM_WKUP_MOD   0x0D00

Definition at line 31 of file prm33xx.h.

#define AM33XX_REVISION_PRM   AM33XX_PRM_REGADDR(AM33XX_PRM_OCP_SOCKET_MOD, 0x0000)

Definition at line 42 of file prm33xx.h.

#define AM33XX_REVISION_PRM_OFFSET   0x0000

Definition at line 41 of file prm33xx.h.

#define AM33XX_RM_GFX_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0004)

Definition at line 108 of file prm33xx.h.

#define AM33XX_RM_GFX_RSTCTRL_OFFSET   0x0004

Definition at line 107 of file prm33xx.h.

#define AM33XX_RM_GFX_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_GFX_MOD, 0x0014)

Definition at line 112 of file prm33xx.h.

#define AM33XX_RM_GFX_RSTST_OFFSET   0x0014

Definition at line 111 of file prm33xx.h.

#define AM33XX_RM_MPU_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_MPU_MOD, 0x0008)

Definition at line 78 of file prm33xx.h.

#define AM33XX_RM_MPU_RSTST_OFFSET   0x0008

Definition at line 77 of file prm33xx.h.

#define AM33XX_RM_PER_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0000)

Definition at line 54 of file prm33xx.h.

#define AM33XX_RM_PER_RSTCTRL_OFFSET   0x0000

Definition at line 53 of file prm33xx.h.

#define AM33XX_RM_PER_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_PER_MOD, 0x0004)

Definition at line 56 of file prm33xx.h.

#define AM33XX_RM_PER_RSTST_OFFSET   0x0004

Definition at line 55 of file prm33xx.h.

#define AM33XX_RM_WKUP_RSTCTRL   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x0000)

Definition at line 64 of file prm33xx.h.

#define AM33XX_RM_WKUP_RSTCTRL_OFFSET   0x0000

Definition at line 63 of file prm33xx.h.

#define AM33XX_RM_WKUP_RSTST   AM33XX_PRM_REGADDR(AM33XX_PRM_WKUP_MOD, 0x000c)

Definition at line 70 of file prm33xx.h.

#define AM33XX_RM_WKUP_RSTST_OFFSET   0x000c

Definition at line 69 of file prm33xx.h.

Function Documentation

int am33xx_prm_assert_hardreset ( u8  shift,
s16  inst,
u16  rstctrl_offs 
)

am33xx_prm_assert_hardreset - assert the HW reset line of a submodule : register bit shift corresponding to the reset line to assert : CM instance register offset (*_INST macro) : RM_RSTCTRL register address for this module

Some IPs like dsp, ipu or iva contain processors that require an HW reset line to be asserted / deasserted in order to fully enable the IP. These modules may have multiple hard-reset lines that reset different 'submodules' inside the IP block. This function will place the submodule into reset. Returns 0 upon success or -EINVAL upon an argument error.

Definition at line 88 of file prm33xx.c.

int am33xx_prm_deassert_hardreset ( u8  shift,
s16  inst,
u16  rstctrl_offs,
u16  rstst_offs 
)

am33xx_prm_deassert_hardreset - deassert a submodule hardreset line and wait : register bit shift corresponding to the reset line to deassert : CM instance register offset (*_INST macro) : RM_RSTCTRL register address for this module : RM_RSTST register address for this module

Some IPs like dsp, ipu or iva contain processors that require an HW reset line to be asserted / deasserted in order to fully enable the IP. These modules may have multiple hard-reset lines that reset different 'submodules' inside the IP block. This function will take the submodule out of reset and wait until the PRCM indicates that the reset has completed before returning. Returns 0 upon success or -EINVAL upon an argument error, -EEXIST if the submodule was already out of reset, or -EBUSY if the submodule did not exit reset promptly.

Definition at line 114 of file prm33xx.c.

void am33xx_prm_global_warm_sw_reset ( void  )
int am33xx_prm_is_hardreset_asserted ( u8  shift,
s16  inst,
u16  rstctrl_offs 
)

am33xx_prm_is_hardreset_asserted - read the HW reset line state of submodules contained in the hwmod module : register bit shift corresponding to the reset line to check : CM instance register offset (*_INST macro) : RM_RSTCTRL register address offset for this module

Returns 1 if the (sub)module hardreset line is currently asserted, 0 if the (sub)module hardreset line is not currently asserted, or -EINVAL upon parameter error.

Definition at line 64 of file prm33xx.c.

u32 am33xx_prm_read_reg ( s16  inst,
u16  idx 
)

Definition at line 29 of file prm33xx.c.

u32 am33xx_prm_rmw_reg_bits ( u32  mask,
u32  bits,
s16  inst,
s16  idx 
)

Definition at line 41 of file prm33xx.c.

void am33xx_prm_write_reg ( u32  val,
s16  inst,
u16  idx 
)

Definition at line 35 of file prm33xx.c.