arch/arm/mach-omap2/prm33xx.c
Source file repositories/reference/linux-study-clean/arch/arm/mach-omap2/prm33xx.c
File Facts
- System
- Linux kernel
- Corpus path
arch/arm/mach-omap2/prm33xx.c- Extension
.c- Size
- 10962 bytes
- Lines
- 408
- 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.hlinux/reboot.hpowerdomain.hprm33xx.hprm-regbits-33xx.h
Detected Declarations
function Copyrightfunction am33xx_prm_write_regfunction am33xx_prm_rmw_reg_bitsfunction thefunction am33xx_prm_assert_hardresetfunction am33xx_prm_deassert_hardresetfunction am33xx_pwrdm_set_next_pwrstfunction am33xx_pwrdm_read_next_pwrstfunction am33xx_pwrdm_read_pwrstfunction am33xx_pwrdm_set_lowpwrstchangefunction am33xx_pwrdm_clear_all_prev_pwrstfunction am33xx_pwrdm_set_logic_retstfunction am33xx_pwrdm_read_logic_pwrstfunction am33xx_pwrdm_read_logic_retstfunction am33xx_pwrdm_set_mem_onstfunction am33xx_pwrdm_set_mem_retstfunction am33xx_pwrdm_read_mem_pwrstfunction am33xx_pwrdm_read_mem_retstfunction am33xx_pwrdm_wait_transitionfunction am33xx_check_vcvpfunction am33xx_prm_global_sw_resetfunction am33xx_pwrdm_save_contextfunction am33xx_pwrdm_restore_contextfunction am33xx_prm_initfunction am33xx_prm_exit
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-only
/*
* AM33XX PRM functions
*
* Copyright (C) 2011-2012 Texas Instruments Incorporated - https://www.ti.com/
*/
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/err.h>
#include <linux/io.h>
#include <linux/reboot.h>
#include "powerdomain.h"
#include "prm33xx.h"
#include "prm-regbits-33xx.h"
/* Read a register in a PRM instance */
static u32 am33xx_prm_read_reg(s16 inst, u16 idx)
{
return readl_relaxed(prm_base.va + inst + idx);
}
/* Write into a register in a PRM instance */
static void am33xx_prm_write_reg(u32 val, s16 inst, u16 idx)
{
writel_relaxed(val, prm_base.va + inst + idx);
}
/* Read-modify-write a register in PRM. Caller must lock */
static u32 am33xx_prm_rmw_reg_bits(u32 mask, u32 bits, s16 inst, s16 idx)
{
u32 v;
v = am33xx_prm_read_reg(inst, idx);
v &= ~mask;
v |= bits;
am33xx_prm_write_reg(v, inst, idx);
return v;
}
/**
* am33xx_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 AM33xx
* @inst: CM instance register offset (*_INST macro)
* @rstctrl_offs: RM_RSTCTRL register address offset for this module
*
* Returns 1 if the (sub)module hardreset line is currently asserted,
* 0 if the (sub)module hardreset line is not currently asserted, or
* -EINVAL upon parameter error.
*/
static int am33xx_prm_is_hardreset_asserted(u8 shift, u8 part, s16 inst,
u16 rstctrl_offs)
{
u32 v;
v = am33xx_prm_read_reg(inst, rstctrl_offs);
v &= 1 << shift;
v >>= shift;
return v;
}
/**
* am33xx_prm_assert_hardreset - assert the HW reset line of a submodule
* @shift: register bit shift corresponding to the reset line to assert
* @part: CM partition, ignored for AM33xx
* @inst: CM instance register offset (*_INST macro)
* @rstctrl_reg: RM_RSTCTRL register address for this module
*
* Some IPs like dsp, ipu 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.
*/
static int am33xx_prm_assert_hardreset(u8 shift, u8 part, s16 inst,
u16 rstctrl_offs)
{
u32 mask = 1 << shift;
am33xx_prm_rmw_reg_bits(mask, mask, inst, rstctrl_offs);
return 0;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/errno.h`, `linux/err.h`, `linux/io.h`, `linux/reboot.h`, `powerdomain.h`, `prm33xx.h`.
- Detected declarations: `function Copyright`, `function am33xx_prm_write_reg`, `function am33xx_prm_rmw_reg_bits`, `function the`, `function am33xx_prm_assert_hardreset`, `function am33xx_prm_deassert_hardreset`, `function am33xx_pwrdm_set_next_pwrst`, `function am33xx_pwrdm_read_next_pwrst`, `function am33xx_pwrdm_read_pwrst`, `function am33xx_pwrdm_set_lowpwrstchange`.
- 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.