arch/arm/mach-omap2/cminst44xx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/cminst44xx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/cminst44xx.c- Extension
.c- Size
- 17108 bytes
- Lines
- 570
- 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.hcm1_44xx.hcm2_44xx.hcm44xx.hcm-regbits-34xx.hprcm44xx.hprm44xx.hprcm_mpu44xx.hprcm-common.h
Detected Declarations
function omap_cm_base_initfunction _clkctrl_idlestfunction _is_module_readyfunction omap4_cminst_read_inst_regfunction omap4_cminst_write_inst_regfunction omap4_cminst_rmw_inst_reg_bitsfunction omap4_cminst_set_inst_reg_bitsfunction omap4_cminst_clear_inst_reg_bitsfunction omap4_cminst_read_inst_reg_bitsfunction _clktrctrl_writefunction byfunction byfunction byfunction byfunction omap4_cminst_clkdm_force_sleepfunction statefunction omap4_cminst_wait_module_idlefunction omap4_cminst_module_enablefunction omap4_cminst_module_disablefunction omap4_clkdm_add_wkup_sleep_depfunction omap4_clkdm_del_wkup_sleep_depfunction omap4_clkdm_read_wkup_sleep_depfunction omap4_clkdm_clear_all_wkup_sleep_depsfunction omap4_clkdm_sleepfunction omap4_clkdm_wakeupfunction omap4_clkdm_allow_idlefunction omap4_clkdm_deny_idlefunction omap4_clkdm_clk_enablefunction omap4_clkdm_clk_disablefunction omap4_cminst_xlate_clkctrlfunction omap4_clkdm_save_contextfunction omap4_clkdm_restore_contextfunction omap4_cm_initfunction omap4_cm_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* OMAP4 CM instance functions
*
* Copyright (C) 2009 Nokia Corporation
* Copyright (C) 2008-2011 Texas Instruments, Inc.
* Paul Walmsley
* Rajendra Nayak <rnayak@ti.com>
*
* This is needed since CM instances can be in the PRM, PRCM_MPU, CM1,
* or CM2 hardware modules. For example, the EMU_CM CM instance is in
* the PRM hardware module. What a mess...
*/
#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 "cm1_44xx.h"
#include "cm2_44xx.h"
#include "cm44xx.h"
#include "cm-regbits-34xx.h"
#include "prcm44xx.h"
#include "prm44xx.h"
#include "prcm_mpu44xx.h"
#include "prcm-common.h"
#define OMAP4430_IDLEST_SHIFT 16
#define OMAP4430_IDLEST_MASK (0x3 << 16)
#define OMAP4430_CLKTRCTRL_SHIFT 0
#define OMAP4430_CLKTRCTRL_MASK (0x3 << 0)
#define OMAP4430_MODULEMODE_SHIFT 0
#define OMAP4430_MODULEMODE_MASK (0x3 << 0)
/*
* 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
static struct omap_domain_base _cm_bases[OMAP4_MAX_PRCM_PARTITIONS];
/**
* omap_cm_base_init - Populates the cm partitions
*
* Populates the base addresses of the _cm_bases
* array used for read/write of cm module registers.
*/
static void omap_cm_base_init(void)
{
memcpy(&_cm_bases[OMAP4430_PRM_PARTITION], &prm_base, sizeof(prm_base));
memcpy(&_cm_bases[OMAP4430_CM1_PARTITION], &cm_base, sizeof(cm_base));
memcpy(&_cm_bases[OMAP4430_CM2_PARTITION], &cm2_base, sizeof(cm2_base));
memcpy(&_cm_bases[OMAP4430_PRCM_MPU_PARTITION], &prcm_mpu_base,
sizeof(prcm_mpu_base));
}
/* Private functions */
static u32 omap4_cminst_read_inst_reg(u8 part, u16 inst, u16 idx);
/**
* _clkctrl_idlest - read a CM_*_CLKCTRL register; mask & shift IDLEST bitfield
* @part: PRCM partition ID that the CM_CLKCTRL register exists in
* @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(u8 part, u16 inst, u16 clkctrl_offs)
{
u32 v = omap4_cminst_read_inst_reg(part, inst, clkctrl_offs);
v &= OMAP4430_IDLEST_MASK;
v >>= OMAP4430_IDLEST_SHIFT;
return v;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `clockdomain.h`, `cm.h`, `cm1_44xx.h`.
- Detected declarations: `function omap_cm_base_init`, `function _clkctrl_idlest`, `function _is_module_ready`, `function omap4_cminst_read_inst_reg`, `function omap4_cminst_write_inst_reg`, `function omap4_cminst_rmw_inst_reg_bits`, `function omap4_cminst_set_inst_reg_bits`, `function omap4_cminst_clear_inst_reg_bits`, `function omap4_cminst_read_inst_reg_bits`, `function _clktrctrl_write`.
- 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.