arch/arm/mach-omap2/cm2xxx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/cm2xxx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/cm2xxx.c- Extension
.c- Size
- 7479 bytes
- Lines
- 303
- 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/types.hlinux/delay.hlinux/errno.hlinux/err.hlinux/io.hprm2xxx.hcm.hcm2xxx.hcm-regbits-24xx.hclockdomain.h
Detected Declarations
function _write_clktrctrlfunction omap2xxx_cm_is_clkdm_in_hwsupfunction omap2xxx_cm_clkdm_enable_hwsupfunction omap2xxx_cm_clkdm_disable_hwsupfunction _omap2xxx_set_dpll_autoidlefunction omap2xxx_cm_set_dpll_disable_autoidlefunction omap2xxx_cm_set_dpll_auto_low_power_stopfunction omap2xxx_cm_split_idlest_regfunction omap2xxx_cm_wait_module_readyfunction omap2xxx_clkdm_allow_idlefunction omap2xxx_clkdm_deny_idlefunction omap2xxx_clkdm_clk_enablefunction omap2xxx_clkdm_clk_disablefunction omap2xxx_cm_fclks_activefunction omap2xxx_cm_mpu_retention_allowedfunction omap2xxx_cm_get_core_clk_srcfunction omap2xxx_cm_get_core_pll_configfunction omap2xxx_cm_set_mod_dividersfunction omap2xxx_cm_initfunction omap2xxx_cm_exit
Annotated Snippet
if (idlest_offs == omap2xxx_cm_idlest_offs[i]) {
*idlest_reg_id = i + 1;
break;
}
}
if (i == ARRAY_SIZE(omap2xxx_cm_idlest_offs))
return -EINVAL;
offs = idlest_reg->offset;
offs &= 0xff00;
*prcm_inst = offs;
return 0;
}
/*
*
*/
/**
* omap2xxx_cm_wait_module_ready - wait for a module to leave idle or standby
* @part: PRCM partition, ignored for OMAP2
* @prcm_mod: PRCM module offset
* @idlest_id: CM_IDLESTx register ID (i.e., x = 1, 2, 3)
* @idlest_shift: shift of the bit in the CM_IDLEST* register to check
*
* Wait for the PRCM to indicate that the module identified by
* (@prcm_mod, @idlest_id, @idlest_shift) is clocked. Return 0 upon
* success or -EBUSY if the module doesn't enable in time.
*/
static int omap2xxx_cm_wait_module_ready(u8 part, s16 prcm_mod, u16 idlest_id,
u8 idlest_shift)
{
int ena = 0, i = 0;
u8 cm_idlest_reg;
u32 mask;
if (!idlest_id || (idlest_id > ARRAY_SIZE(omap2xxx_cm_idlest_offs)))
return -EINVAL;
cm_idlest_reg = omap2xxx_cm_idlest_offs[idlest_id - 1];
mask = 1 << idlest_shift;
ena = mask;
omap_test_timeout(((omap2_cm_read_mod_reg(prcm_mod, cm_idlest_reg) &
mask) == ena), MAX_MODULE_READY_TIME, i);
return (i < MAX_MODULE_READY_TIME) ? 0 : -EBUSY;
}
/* Clockdomain low-level functions */
static void omap2xxx_clkdm_allow_idle(struct clockdomain *clkdm)
{
omap2xxx_cm_clkdm_enable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
clkdm->clktrctrl_mask);
}
static void omap2xxx_clkdm_deny_idle(struct clockdomain *clkdm)
{
omap2xxx_cm_clkdm_disable_hwsup(clkdm->pwrdm.ptr->prcm_offs,
clkdm->clktrctrl_mask);
}
static int omap2xxx_clkdm_clk_enable(struct clockdomain *clkdm)
{
bool hwsup = false;
if (!clkdm->clktrctrl_mask)
return 0;
hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
clkdm->clktrctrl_mask);
if (!hwsup && clkdm->flags & CLKDM_CAN_FORCE_WAKEUP)
omap2xxx_clkdm_wakeup(clkdm);
return 0;
}
static int omap2xxx_clkdm_clk_disable(struct clockdomain *clkdm)
{
bool hwsup = false;
if (!clkdm->clktrctrl_mask)
return 0;
hwsup = omap2xxx_cm_is_clkdm_in_hwsup(clkdm->pwrdm.ptr->prcm_offs,
clkdm->clktrctrl_mask);
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/delay.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `prm2xxx.h`, `cm.h`.
- Detected declarations: `function _write_clktrctrl`, `function omap2xxx_cm_is_clkdm_in_hwsup`, `function omap2xxx_cm_clkdm_enable_hwsup`, `function omap2xxx_cm_clkdm_disable_hwsup`, `function _omap2xxx_set_dpll_autoidle`, `function omap2xxx_cm_set_dpll_disable_autoidle`, `function omap2xxx_cm_set_dpll_auto_low_power_stop`, `function omap2xxx_cm_split_idlest_reg`, `function omap2xxx_cm_wait_module_ready`, `function omap2xxx_clkdm_allow_idle`.
- 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.