arch/arm/mach-omap2/cm33xx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/cm33xx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/cm33xx.c- Extension
.c- Size
- 11922 bytes
- Lines
- 425
- 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/errno.hlinux/err.hlinux/io.hclockdomain.hcm.hcm33xx.hcm-regbits-34xx.hcm-regbits-33xx.hprm33xx.hlinux/suspend.h
Detected Declarations
function Copyrightfunction am33xx_cm_write_regfunction am33xx_cm_rmw_reg_bitsfunction am33xx_cm_read_reg_bitsfunction _clkctrl_idlestfunction _is_module_readyfunction _clktrctrl_writefunction byfunction byfunction byfunction byfunction byfunction statefunction am33xx_cm_wait_module_idlefunction am33xx_cm_module_enablefunction am33xx_cm_module_disablefunction am33xx_clkdm_sleepfunction am33xx_clkdm_wakeupfunction am33xx_clkdm_allow_idlefunction am33xx_clkdm_deny_idlefunction am33xx_clkdm_clk_enablefunction am33xx_clkdm_clk_disablefunction am33xx_cm_xlate_clkctrlfunction am33xx_clkdm_save_contextfunction am33xx_clkdm_restore_contextfunction am33xx_cm_initfunction am33xx_cm_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* AM33XX CM functions
*
* Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
* Vaibhav Hiremath <hvaibhav@ti.com>
*
* Reference taken from OMAP4 cminst44xx.c
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/io.h>
#include "clockdomain.h"
#include "cm.h"
#include "cm33xx.h"
#include "cm-regbits-34xx.h"
#include "cm-regbits-33xx.h"
#include "prm33xx.h"
#if IS_ENABLED(CONFIG_SUSPEND)
#include <linux/suspend.h>
#endif
/*
* CLKCTRL_IDLEST_*: possible values for the CM_*_CLKCTRL.IDLEST bitfield:
*
* 0x0 func: Module is fully functional, including OCP
* 0x1 trans: Module is performing transition: wakeup, or sleep, or sleep
* abortion
* 0x2 idle: Module is in Idle mode (only OCP part). It is functional if
* using separate functional clock
* 0x3 disabled: Module is disabled and cannot be accessed
*
*/
#define CLKCTRL_IDLEST_FUNCTIONAL 0x0
#define CLKCTRL_IDLEST_INTRANSITION 0x1
#define CLKCTRL_IDLEST_INTERFACE_IDLE 0x2
#define CLKCTRL_IDLEST_DISABLED 0x3
/* Private functions */
/* Read a register in a CM instance */
static inline u32 am33xx_cm_read_reg(u16 inst, u16 idx)
{
return readl_relaxed(cm_base.va + inst + idx);
}
/* Write into a register in a CM */
static inline void am33xx_cm_write_reg(u32 val, u16 inst, u16 idx)
{
writel_relaxed(val, cm_base.va + inst + idx);
}
/* Read-modify-write a register in CM */
static inline u32 am33xx_cm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx)
{
u32 v;
v = am33xx_cm_read_reg(inst, idx);
v &= ~mask;
v |= bits;
am33xx_cm_write_reg(v, inst, idx);
return v;
}
static inline u32 am33xx_cm_read_reg_bits(u16 inst, s16 idx, u32 mask)
{
u32 v;
v = am33xx_cm_read_reg(inst, idx);
v &= mask;
v >>= __ffs(mask);
return v;
}
/**
* _clkctrl_idlest - read a CM_*_CLKCTRL register; mask & shift IDLEST bitfield
* @inst: CM instance register offset (*_INST macro)
* @clkctrl_offs: Module clock control register offset (*_CLKCTRL macro)
*
* Return the IDLEST bitfield of a CM_*_CLKCTRL register, shifted down to
* bit 0.
*/
static u32 _clkctrl_idlest(u16 inst, u16 clkctrl_offs)
{
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `clockdomain.h`, `cm.h`, `cm33xx.h`.
- Detected declarations: `function Copyright`, `function am33xx_cm_write_reg`, `function am33xx_cm_rmw_reg_bits`, `function am33xx_cm_read_reg_bits`, `function _clkctrl_idlest`, `function _is_module_ready`, `function _clktrctrl_write`, `function by`, `function by`, `function by`.
- 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.