arch/arm/mach-omap2/prm3xxx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/prm3xxx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/prm3xxx.c- Extension
.c- Size
- 22283 bytes
- Lines
- 728
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: implementation source
- Status
- source implementation candidate
Why This File Exists
CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- CPU and platform-specific kernel glue: boot entry, traps, syscall entry, interrupts, page tables, context switch, and low-level barriers.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/errno.hlinux/err.hlinux/io.hlinux/irq.hlinux/of_irq.hsoc.hcommon.hvp.hpowerdomain.hprm3xxx.hprm2xxx_3xxx.hcm2xxx_3xxx.hprm-regbits-34xx.hcm3xxx.hcm-regbits-34xx.hclock.h
Detected Declarations
struct omap3_vpfunction omap3_prm_vp_check_txdonefunction omap3_prm_vp_clear_txdonefunction omap3_prm_vcvp_readfunction omap3_prm_vcvp_writefunction omap3_prm_vcvp_rmwfunction omap3xxx_prm_dpll3_resetfunction omap3xxx_prm_read_pending_irqsfunction omap3xxx_prm_ocp_barrierfunction omap3xxx_prm_save_and_clear_irqenfunction omap3xxx_prm_restore_irqenfunction omap3xxx_prm_clear_mod_irqsfunction omap3_prm_reset_modemfunction omap3_prm_init_pmfunction omap3430_pre_es3_1_reconfigure_io_chainfunction omap3_prm_reconfigure_io_chainfunction omap3xxx_prm_enable_io_wakeupfunction omap3xxx_prm_read_reset_sourcesfunction omap3xxx_prm_iva_idlefunction omap3xxx_prm_clear_global_cold_resetfunction omap3_prm_save_scratchpad_contentsfunction omap3_pwrdm_set_next_pwrstfunction omap3_pwrdm_read_next_pwrstfunction omap3_pwrdm_read_pwrstfunction omap3_pwrdm_read_prev_pwrstfunction omap3_pwrdm_read_logic_pwrstfunction omap3_pwrdm_read_logic_retstfunction omap3_pwrdm_read_prev_logic_pwrstfunction omap3_get_mem_bank_lastmemst_maskfunction omap3_pwrdm_read_prev_mem_pwrstfunction omap3_pwrdm_clear_all_prev_pwrstfunction omap3_pwrdm_enable_hdwr_sarfunction omap3_pwrdm_disable_hdwr_sarfunction omap3xxx_prm_initfunction omap3xxx_prm_late_initfunction omap3xxx_prm_exit
Annotated Snippet
struct omap3_vp {
u32 tranxdone_status;
};
static struct omap3_vp omap3_vp[] = {
[OMAP3_VP_VDD_MPU_ID] = {
.tranxdone_status = OMAP3430_VP1_TRANXDONE_ST_MASK,
},
[OMAP3_VP_VDD_CORE_ID] = {
.tranxdone_status = OMAP3430_VP2_TRANXDONE_ST_MASK,
},
};
#define MAX_VP_ID ARRAY_SIZE(omap3_vp);
static u32 omap3_prm_vp_check_txdone(u8 vp_id)
{
struct omap3_vp *vp = &omap3_vp[vp_id];
u32 irqstatus;
irqstatus = omap2_prm_read_mod_reg(OCP_MOD,
OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
return irqstatus & vp->tranxdone_status;
}
static void omap3_prm_vp_clear_txdone(u8 vp_id)
{
struct omap3_vp *vp = &omap3_vp[vp_id];
omap2_prm_write_mod_reg(vp->tranxdone_status,
OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
}
u32 omap3_prm_vcvp_read(u8 offset)
{
return omap2_prm_read_mod_reg(OMAP3430_GR_MOD, offset);
}
void omap3_prm_vcvp_write(u32 val, u8 offset)
{
omap2_prm_write_mod_reg(val, OMAP3430_GR_MOD, offset);
}
u32 omap3_prm_vcvp_rmw(u32 mask, u32 bits, u8 offset)
{
return omap2_prm_rmw_mod_reg_bits(mask, bits, OMAP3430_GR_MOD, offset);
}
/**
* omap3xxx_prm_dpll3_reset - use DPLL3 reset to reboot the OMAP SoC
*
* Set the DPLL3 reset bit, which should reboot the SoC. This is the
* recommended way to restart the SoC, considering Errata i520. No
* return value.
*/
static void omap3xxx_prm_dpll3_reset(void)
{
omap2_prm_set_mod_reg_bits(OMAP_RST_DPLL3_MASK, OMAP3430_GR_MOD,
OMAP2_RM_RSTCTRL);
/* OCP barrier */
omap2_prm_read_mod_reg(OMAP3430_GR_MOD, OMAP2_RM_RSTCTRL);
}
/**
* omap3xxx_prm_read_pending_irqs - read pending PRM MPU IRQs into @events
* @events: ptr to a u32, preallocated by caller
*
* Read PRM_IRQSTATUS_MPU bits, AND'ed with the currently-enabled PRM
* MPU IRQs, and store the result into the u32 pointed to by @events.
* No return value.
*/
static void omap3xxx_prm_read_pending_irqs(unsigned long *events)
{
u32 mask, st;
/* XXX Can the mask read be avoided (e.g., can it come from RAM?) */
mask = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQENABLE_MPU_OFFSET);
st = omap2_prm_read_mod_reg(OCP_MOD, OMAP3_PRM_IRQSTATUS_MPU_OFFSET);
events[0] = mask & st;
}
/**
* omap3xxx_prm_ocp_barrier - force buffered MPU writes to the PRM to complete
*
* Force any buffered writes to the PRM IP block to complete. Needed
* by the PRM IRQ handler, which reads and writes directly to the IP
* block, to avoid race conditions after acknowledging or clearing IRQ
* bits. No return value.
*/
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `linux/irq.h`, `linux/of_irq.h`, `soc.h`, `common.h`.
- Detected declarations: `struct omap3_vp`, `function omap3_prm_vp_check_txdone`, `function omap3_prm_vp_clear_txdone`, `function omap3_prm_vcvp_read`, `function omap3_prm_vcvp_write`, `function omap3_prm_vcvp_rmw`, `function omap3xxx_prm_dpll3_reset`, `function omap3xxx_prm_read_pending_irqs`, `function omap3xxx_prm_ocp_barrier`, `function omap3xxx_prm_save_and_clear_irqen`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.