drivers/irqchip/irq-renesas-rzv2h.c
Source file repositories/reference/linux-study-clean/drivers/irqchip/irq-renesas-rzv2h.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/irqchip/irq-renesas-rzv2h.c- Extension
.c- Size
- 27877 bytes
- Lines
- 954
- Domain
- Driver Families
- Bucket
- drivers/irqchip
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/bitfield.hlinux/cleanup.hlinux/err.hlinux/interrupt.hlinux/io.hlinux/irqchip.hlinux/irqchip/irq-renesas-rzv2h.hlinux/irqdomain.hlinux/of_platform.hlinux/pm_runtime.hlinux/reset.hlinux/spinlock.hlinux/syscore_ops.h
Detected Declarations
struct rzv2h_irqc_reg_cachestruct rzv2h_hw_infofunction rzv2h_icu_register_dma_reqfunction rzv2h_icu_tint_eoifunction rzv2h_icu_irq_eoifunction rzv2h_icu_nmi_eoifunction rzv2h_tint_irq_endisablefunction rzv2h_icu_tint_disablefunction rzv2h_icu_tint_enablefunction rzv2h_nmi_set_typefunction rzv2h_clear_irq_intfunction rzv2h_irq_set_typefunction scoped_guardfunction rzv2h_clear_tint_intfunction rzv2h_tint_set_typefunction scoped_guardfunction rzv2h_icu_swint_set_irqchip_statefunction rzv2h_icu_swpe_set_irqchip_statefunction rzv2h_irqc_irq_suspendfunction rzv2h_irqc_irq_resumefunction rzv2h_icu_allocfunction rzv2h_icu_parse_interruptsfunction rzv2h_icu_error_irqfunction rzv2h_icu_swint_irqfunction rzv2h_icu_setup_irqsfunction rzv2h_icu_probe_commonfunction rzg3e_icu_probefunction rzv2n_icu_probefunction rzv2h_icu_probeexport rzv2h_icu_register_dma_req
Annotated Snippet
struct rzv2h_irqc_reg_cache {
u32 nitsr;
u32 iitsr;
u32 titsr[2];
};
/**
* struct rzv2h_hw_info - Interrupt Control Unit controller hardware info structure.
* @tssel_lut: TINT lookup table
* @t_offs: TINT offset
* @max_tssel: TSSEL max value
* @field_width: TSSR field width
* @ecc_start: Start index of ECC RAM interrupts
* @ecc_end: End index of ECC RAM interrupts
*/
struct rzv2h_hw_info {
const u8 *tssel_lut;
u16 t_offs;
u8 max_tssel;
u8 field_width;
u8 ecc_start;
u8 ecc_end;
};
/* DMAC */
#define ICU_DMAC_DkRQ_SEL_MASK GENMASK(9, 0)
#define ICU_DMAC_DMAREQ_SHIFT(up) ((up) * 16)
#define ICU_DMAC_DMAREQ_MASK(up) (ICU_DMAC_DkRQ_SEL_MASK \
<< ICU_DMAC_DMAREQ_SHIFT(up))
#define ICU_DMAC_PREP_DMAREQ(sel, up) (FIELD_PREP(ICU_DMAC_DkRQ_SEL_MASK, (sel)) \
<< ICU_DMAC_DMAREQ_SHIFT(up))
/**
* struct rzv2h_icu_priv - Interrupt Control Unit controller private data structure.
* @base: Controller's base address
* @fwspec: IRQ firmware specific data
* @lock: Lock to serialize access to hardware registers
* @info: Pointer to struct rzv2h_hw_info
* @cache: Registers cache for suspend/resume
*/
static struct rzv2h_icu_priv {
void __iomem *base;
struct irq_fwspec fwspec[ICU_NUM_IRQ];
raw_spinlock_t lock;
const struct rzv2h_hw_info *info;
struct rzv2h_irqc_reg_cache cache;
} *rzv2h_icu_data;
void rzv2h_icu_register_dma_req(struct platform_device *icu_dev, u8 dmac_index, u8 dmac_channel,
u16 req_no)
{
struct rzv2h_icu_priv *priv = platform_get_drvdata(icu_dev);
u32 icu_dmksely, dmareq, dmareq_mask;
u8 y, upper;
y = dmac_channel / 2;
upper = dmac_channel % 2;
dmareq = ICU_DMAC_PREP_DMAREQ(req_no, upper);
dmareq_mask = ICU_DMAC_DMAREQ_MASK(upper);
guard(raw_spinlock_irqsave)(&priv->lock);
icu_dmksely = readl(priv->base + ICU_DMkSELy(dmac_index, y));
icu_dmksely = (icu_dmksely & ~dmareq_mask) | dmareq;
writel(icu_dmksely, priv->base + ICU_DMkSELy(dmac_index, y));
}
EXPORT_SYMBOL_GPL(rzv2h_icu_register_dma_req);
static inline struct rzv2h_icu_priv *irq_data_to_priv(struct irq_data *data)
{
return data->domain->host_data;
}
static void rzv2h_icu_tint_eoi(struct irq_data *d)
{
struct rzv2h_icu_priv *priv = irq_data_to_priv(d);
unsigned int hw_irq = irqd_to_hwirq(d);
unsigned int tintirq_nr;
u32 bit;
if (!irqd_is_level_type(d)) {
tintirq_nr = hw_irq - ICU_TINT_START;
bit = BIT(tintirq_nr);
writel_relaxed(bit, priv->base + priv->info->t_offs + ICU_TSCLR);
}
irq_chip_eoi_parent(d);
}
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/cleanup.h`, `linux/err.h`, `linux/interrupt.h`, `linux/io.h`, `linux/irqchip.h`, `linux/irqchip/irq-renesas-rzv2h.h`, `linux/irqdomain.h`.
- Detected declarations: `struct rzv2h_irqc_reg_cache`, `struct rzv2h_hw_info`, `function rzv2h_icu_register_dma_req`, `function rzv2h_icu_tint_eoi`, `function rzv2h_icu_irq_eoi`, `function rzv2h_icu_nmi_eoi`, `function rzv2h_tint_irq_endisable`, `function rzv2h_icu_tint_disable`, `function rzv2h_icu_tint_enable`, `function rzv2h_nmi_set_type`.
- Atlas domain: Driver Families / drivers/irqchip.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.