drivers/pci/controller/pcie-rzg3s-host.c
Source file repositories/reference/linux-study-clean/drivers/pci/controller/pcie-rzg3s-host.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/controller/pcie-rzg3s-host.c- Extension
.c- Size
- 54897 bytes
- Lines
- 1948
- Domain
- Representative Device Path
- Bucket
- PCIe NVMe Storage Path
- Inferred role
- Representative Device Path: implementation source
- Status
- source implementation candidate
Why This File Exists
Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- Part of the selected hardware vertical slice: PCI discovery, driver binding, NVMe queues, block requests, DMA, interrupts, and completion.
- 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/bitmap.hlinux/bitops.hlinux/cleanup.hlinux/clk.hlinux/delay.hlinux/iopoll.hlinux/interrupt.hlinux/irq.hlinux/irqchip/chained_irq.hlinux/irqchip/irq-msi-lib.hlinux/irqdomain.hlinux/kernel.hlinux/mfd/syscon.hlinux/mutex.hlinux/msi.hlinux/of_irq.hlinux/pci.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/reset.hlinux/sizes.hlinux/slab.hlinux/units.h../pci.h
Detected Declarations
struct rzg3s_sysc_functionstruct rzg3s_sysc_infostruct rzg3s_syscstruct rzg3s_pcie_msistruct rzg3s_pcie_hoststruct rzg3s_pcie_soc_datastruct rzg3s_pcie_portstruct rzg3s_pcie_hostenum rzg3s_sysc_func_idfunction rzg3s_sysc_config_funcfunction rzg3s_pcie_update_bitsfunction rzg3s_pcie_child_issue_requestfunction rzg3s_pcie_child_prepare_busfunction rzg3s_pcie_child_read_conffunction rzg3s_pcie_child_readfunction rzg3s_pcie_child_write_conffunction rzg3s_pcie_child_writefunction rzg3s_pcie_intx_irq_handlerfunction rzg3s_pcie_msi_irqfunction for_each_set_bitfunction rzg3s_pcie_msi_irq_ackfunction rzg3s_pcie_msi_irq_maskfunction rzg3s_pcie_msi_irq_unmaskfunction rzg3s_pcie_irq_compose_msi_msgfunction rzg3s_pcie_msi_domain_allocfunction scoped_guardfunction rzg3s_pcie_msi_domain_freefunction rzg3s_pcie_msi_allocate_domainsfunction rzg3s_pcie_msi_hw_setupfunction rzg3s_pcie_msi_setupfunction rzg3s_pcie_msi_hw_teardownfunction rzg3s_pcie_teardown_msifunction rzg3s_pcie_init_msifunction rzg3s_pcie_intx_irq_ackfunction rzg3s_pcie_intx_irq_maskfunction rzg3s_pcie_intx_irq_unmaskfunction rzg3s_pcie_intx_mapfunction rzg3s_pcie_init_irqdomainfunction rzg3s_pcie_teardown_irqdomainfunction rzg3s_pcie_set_max_link_speedfunction rzg3s_pcie_config_initfunction rzg3s_pcie_config_post_initfunction rzg3s_pcie_config_deinitfunction rzg3e_pcie_config_pre_initfunction rzg3e_pcie_config_deinitfunction rzg3e_pcie_config_post_initfunction rzg3s_pcie_irq_initfunction rzg3s_pcie_power_resets_deassert
Annotated Snippet
struct rzg3s_sysc_function {
u32 offset;
u32 mask;
};
/**
* enum rzg3s_sysc_func_id - System controller function IDs
* @RZG3S_SYSC_FUNC_ID_RST_RSM_B: RST_RSM_B SYSC function ID
* @RZG3S_SYSC_FUNC_ID_L1_ALLOW: L1 allow SYSC function ID
* @RZG3S_SYSC_FUNC_ID_MODE: Mode SYSC function ID
* @RZG3S_SYSC_FUNC_ID_MAX: Max SYSC function ID
*/
enum rzg3s_sysc_func_id {
RZG3S_SYSC_FUNC_ID_RST_RSM_B,
RZG3S_SYSC_FUNC_ID_L1_ALLOW,
RZG3S_SYSC_FUNC_ID_MODE,
RZG3S_SYSC_FUNC_ID_MAX,
};
/**
* struct rzg3s_sysc_info - RZ/G3S System Controller info
* @functions: SYSC function descriptors array
*/
struct rzg3s_sysc_info {
const struct rzg3s_sysc_function functions[RZG3S_SYSC_FUNC_ID_MAX];
};
/**
* struct rzg3s_sysc - RZ/G3S System Controller descriptor
* @regmap: System controller regmap
* @info: System controller info
*/
struct rzg3s_sysc {
struct regmap *regmap;
const struct rzg3s_sysc_info *info;
};
/**
* struct rzg3s_pcie_msi - RZ/G3S PCIe MSI data structure
* @domain: IRQ domain
* @map: bitmap with the allocated MSIs
* @dma_addr: address of the allocated MSI window
* @window_base: base address of the MSI window
* @pages: allocated pages for MSI window mapping
* @map_lock: lock for bitmap with the allocated MSIs
* @irq: MSI interrupt
*/
struct rzg3s_pcie_msi {
struct irq_domain *domain;
DECLARE_BITMAP(map, RZG3S_PCI_MSI_INT_NR);
dma_addr_t dma_addr;
dma_addr_t window_base;
unsigned long pages;
struct mutex map_lock;
int irq;
};
struct rzg3s_pcie_host;
/**
* struct rzg3s_pcie_soc_data - SoC specific data
* @init_phy: PHY initialization function
* @config_pre_init: Optional callback for SoC-specific pre-configuration
* @config_post_init: Callback for SoC-specific post-configuration
* @config_deinit: Callback for SoC-specific de-initialization
* @power_resets: array with the resets that need to be de-asserted after
* power-on
* @cfg_resets: array with the resets that need to be de-asserted after
* configuration
* @sysc_info: SYSC info
* @num_power_resets: number of power resets
* @num_cfg_resets: number of configuration resets
*/
struct rzg3s_pcie_soc_data {
int (*init_phy)(struct rzg3s_pcie_host *host);
void (*config_pre_init)(struct rzg3s_pcie_host *host);
int (*config_post_init)(struct rzg3s_pcie_host *host);
int (*config_deinit)(struct rzg3s_pcie_host *host);
const char * const *power_resets;
const char * const *cfg_resets;
struct rzg3s_sysc_info sysc_info;
u8 num_power_resets;
u8 num_cfg_resets;
};
/**
* struct rzg3s_pcie_port - RZ/G3S PCIe Root Port data structure
* @refclk: PCIe reference clock
* @vendor_id: Vendor ID
* @device_id: Device ID
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/bitmap.h`, `linux/bitops.h`, `linux/cleanup.h`, `linux/clk.h`, `linux/delay.h`, `linux/iopoll.h`, `linux/interrupt.h`.
- Detected declarations: `struct rzg3s_sysc_function`, `struct rzg3s_sysc_info`, `struct rzg3s_sysc`, `struct rzg3s_pcie_msi`, `struct rzg3s_pcie_host`, `struct rzg3s_pcie_soc_data`, `struct rzg3s_pcie_port`, `struct rzg3s_pcie_host`, `enum rzg3s_sysc_func_id`, `function rzg3s_sysc_config_func`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: source 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.