arch/arm/mach-omap2/prm2xxx_3xxx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/prm2xxx_3xxx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/prm2xxx_3xxx.c- Extension
.c- Size
- 6919 bytes
- Lines
- 238
- 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.hpowerdomain.hprm2xxx_3xxx.hprm-regbits-24xx.hclockdomain.h
Detected Declarations
function Copyrightfunction omap2_prm_assert_hardresetfunction omap2_prm_deassert_hardresetfunction omap2_pwrdm_set_mem_onstfunction omap2_pwrdm_set_mem_retstfunction omap2_pwrdm_read_mem_pwrstfunction omap2_pwrdm_read_mem_retstfunction omap2_pwrdm_set_logic_retstfunction omap2_pwrdm_wait_transitionfunction omap2_clkdm_add_wkdepfunction omap2_clkdm_del_wkdepfunction omap2_clkdm_read_wkdepfunction omap2_clkdm_clear_all_wkdeps
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* OMAP2/3 PRM module functions
*
* Copyright (C) 2010-2011 Texas Instruments, Inc.
* Copyright (C) 2010 Nokia Corporation
* BenoƮt Cousson
* Paul Walmsley
*/
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/io.h>
#include "powerdomain.h"
#include "prm2xxx_3xxx.h"
#include "prm-regbits-24xx.h"
#include "clockdomain.h"
/**
* omap2_prm_is_hardreset_asserted - read the HW reset line state of
* submodules contained in the hwmod module
* @shift: register bit shift corresponding to the reset line to check
* @part: PRM partition, ignored for OMAP2
* @prm_mod: PRM submodule base (e.g. CORE_MOD)
* @offset: register offset, ignored for OMAP2
*
* Returns 1 if the (sub)module hardreset line is currently asserted,
* 0 if the (sub)module hardreset line is not currently asserted, or
* -EINVAL if called while running on a non-OMAP2/3 chip.
*/
int omap2_prm_is_hardreset_asserted(u8 shift, u8 part, s16 prm_mod, u16 offset)
{
return omap2_prm_read_mod_bits_shift(prm_mod, OMAP2_RM_RSTCTRL,
(1 << shift));
}
/**
* omap2_prm_assert_hardreset - assert the HW reset line of a submodule
* @shift: register bit shift corresponding to the reset line to assert
* @part: PRM partition, ignored for OMAP2
* @prm_mod: PRM submodule base (e.g. CORE_MOD)
* @offset: register offset, ignored for OMAP2
*
* Some IPs like dsp or iva contain processors that require an HW
* reset line to be asserted / deasserted in order to fully enable the
* IP. These modules may have multiple hard-reset lines that reset
* different 'submodules' inside the IP block. This function will
* place the submodule into reset. Returns 0 upon success or -EINVAL
* upon an argument error.
*/
int omap2_prm_assert_hardreset(u8 shift, u8 part, s16 prm_mod, u16 offset)
{
u32 mask;
mask = 1 << shift;
omap2_prm_rmw_mod_reg_bits(mask, mask, prm_mod, OMAP2_RM_RSTCTRL);
return 0;
}
/**
* omap2_prm_deassert_hardreset - deassert a submodule hardreset line and wait
* @prm_mod: PRM submodule base (e.g. CORE_MOD)
* @rst_shift: register bit shift corresponding to the reset line to deassert
* @st_shift: register bit shift for the status of the deasserted submodule
* @part: PRM partition, not used for OMAP2
* @prm_mod: PRM submodule base (e.g. CORE_MOD)
* @rst_offset: reset register offset, not used for OMAP2
* @st_offset: reset status register offset, not used for OMAP2
*
* Some IPs like dsp or iva contain processors that require an HW
* reset line to be asserted / deasserted in order to fully enable the
* IP. These modules may have multiple hard-reset lines that reset
* different 'submodules' inside the IP block. This function will
* take the submodule out of reset and wait until the PRCM indicates
* that the reset has completed before returning. Returns 0 upon success or
* -EINVAL upon an argument error, -EEXIST if the submodule was already out
* of reset, or -EBUSY if the submodule did not exit reset promptly.
*/
int omap2_prm_deassert_hardreset(u8 rst_shift, u8 st_shift, u8 part,
s16 prm_mod, u16 rst_offset, u16 st_offset)
{
u32 rst, st;
int c;
rst = 1 << rst_shift;
st = 1 << st_shift;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `powerdomain.h`, `prm2xxx_3xxx.h`, `prm-regbits-24xx.h`, `clockdomain.h`.
- Detected declarations: `function Copyright`, `function omap2_prm_assert_hardreset`, `function omap2_prm_deassert_hardreset`, `function omap2_pwrdm_set_mem_onst`, `function omap2_pwrdm_set_mem_retst`, `function omap2_pwrdm_read_mem_pwrst`, `function omap2_pwrdm_read_mem_retst`, `function omap2_pwrdm_set_logic_retst`, `function omap2_pwrdm_wait_transition`, `function omap2_clkdm_add_wkdep`.
- 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.