arch/arm/mach-omap2/omap_hwmod.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/omap_hwmod.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/omap_hwmod.c- Extension
.c- Size
- 111737 bytes
- Lines
- 3949
- Domain
- Architecture Layer
- Bucket
- arch/arm
- Inferred role
- Architecture Layer: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/errno.hlinux/io.hlinux/clk.hlinux/clk-provider.hlinux/delay.hlinux/err.hlinux/list.hlinux/mutex.hlinux/spinlock.hlinux/slab.hlinux/cpu.hlinux/of.hlinux/of_address.hlinux/memblock.hlinux/platform_data/ti-sysc.hdt-bindings/bus/ti-sysc.hasm/system_misc.hclock.homap_hwmod.hsoc.hcommon.hclockdomain.hhdq1w.hmmc.hpowerdomain.hcm2xxx.hcm3xxx.hcm33xx.hprm.hprm3xxx.hprm44xx.h
Detected Declarations
struct clkctrl_providerstruct omap_hwmod_resetstruct omap_hwmod_soc_opsfunction _update_sysc_cachefunction _write_sysconfigfunction _set_master_standbymodefunction _set_slave_idlemodefunction _set_clockactivityfunction _set_softresetfunction _clear_softresetfunction _ocp_softresetfunction _set_dmadisablefunction _set_module_autoidlefunction _enable_wakeupfunction initiatorfunction initiatorfunction _setup_clkctrl_providerfunction _init_clkctrl_providersfunction for_each_matching_nodefunction _omap4_xlate_clkctrlfunction list_for_each_entryfunction _init_clocksfunction _init_clocksfunction list_for_each_entryfunction _init_clocksfunction _enable_optional_clocksfunction _disable_optional_clocksfunction _enable_clocksfunction list_for_each_entryfunction _omap4_clkctrl_managed_by_clkfwkfunction _omap4_has_clkctrl_clockfunction _disable_clocksfunction list_for_each_entryfunction _omap4_enable_modulefunction _omap4_wait_target_disablefunction _save_mpu_port_indexfunction list_for_each_entryfunction MPUfunction _enable_syscfunction _idle_syscfunction _shutdown_syscfunction list_for_each_entryfunction _init_clkdmfunction _init_clocksfunction _lookup_hardresetfunction _lookup_hardresetfunction _lookup_hardresetfunction _lookup_hardreset
Annotated Snippet
struct clkctrl_provider {
int num_addrs;
u32 *addr;
u32 *size;
struct device_node *node;
struct list_head link;
};
static LIST_HEAD(clkctrl_providers);
/**
* struct omap_hwmod_reset - IP specific reset functions
* @match: string to match against the module name
* @len: number of characters to match
* @reset: IP specific reset function
*
* Used only in cases where struct omap_hwmod is dynamically allocated.
*/
struct omap_hwmod_reset {
const char *match;
int len;
int (*reset)(struct omap_hwmod *oh);
};
/**
* struct omap_hwmod_soc_ops - fn ptrs for some SoC-specific operations
* @enable_module: function to enable a module (via MODULEMODE)
* @disable_module: function to disable a module (via MODULEMODE)
*
* XXX Eventually this functionality will be hidden inside the PRM/CM
* device drivers. Until then, this should avoid huge blocks of cpu_is_*()
* conditionals in this code.
*/
struct omap_hwmod_soc_ops {
void (*enable_module)(struct omap_hwmod *oh);
int (*disable_module)(struct omap_hwmod *oh);
int (*wait_target_ready)(struct omap_hwmod *oh);
int (*assert_hardreset)(struct omap_hwmod *oh,
struct omap_hwmod_rst_info *ohri);
int (*deassert_hardreset)(struct omap_hwmod *oh,
struct omap_hwmod_rst_info *ohri);
int (*is_hardreset_asserted)(struct omap_hwmod *oh,
struct omap_hwmod_rst_info *ohri);
int (*init_clkdm)(struct omap_hwmod *oh);
void (*update_context_lost)(struct omap_hwmod *oh);
int (*get_context_lost)(struct omap_hwmod *oh);
int (*disable_direct_prcm)(struct omap_hwmod *oh);
u32 (*xlate_clkctrl)(struct omap_hwmod *oh);
};
/* soc_ops: adapts the omap_hwmod code to the currently-booted SoC */
static struct omap_hwmod_soc_ops soc_ops;
/* omap_hwmod_list contains all registered struct omap_hwmods */
static LIST_HEAD(omap_hwmod_list);
static DEFINE_MUTEX(list_lock);
/* mpu_oh: used to add/remove MPU initiator from sleepdep list */
static struct omap_hwmod *mpu_oh;
/* inited: set to true once the hwmod code is initialized */
static bool inited;
/* Private functions */
/**
* _update_sysc_cache - return the module OCP_SYSCONFIG register, keep copy
* @oh: struct omap_hwmod *
*
* Load the current value of the hwmod OCP_SYSCONFIG register into the
* struct omap_hwmod for later use. Returns -EINVAL if the hwmod has no
* OCP_SYSCONFIG register or 0 upon success.
*/
static int _update_sysc_cache(struct omap_hwmod *oh)
{
if (!oh->class->sysc) {
WARN(1, "omap_hwmod: %s: cannot read OCP_SYSCONFIG: not defined on hwmod's class\n", oh->name);
return -EINVAL;
}
/* XXX ensure module interface clock is up */
oh->_sysc_cache = omap_hwmod_read(oh, oh->class->sysc->sysc_offs);
if (!(oh->class->sysc->sysc_flags & SYSC_NO_CACHE))
oh->_int_flags |= _HWMOD_SYSCONFIG_LOADED;
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/io.h`, `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/list.h`.
- Detected declarations: `struct clkctrl_provider`, `struct omap_hwmod_reset`, `struct omap_hwmod_soc_ops`, `function _update_sysc_cache`, `function _write_sysconfig`, `function _set_master_standbymode`, `function _set_slave_idlemode`, `function _set_clockactivity`, `function _set_softreset`, `function _clear_softreset`.
- Atlas domain: Architecture Layer / arch/arm.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.