drivers/pci/controller/dwc/pcie-tegra194.c
Source file repositories/reference/linux-study-clean/drivers/pci/controller/dwc/pcie-tegra194.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/controller/dwc/pcie-tegra194.c- Extension
.c- Size
- 72110 bytes
- Lines
- 2579
- 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.
- 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/clk.hlinux/debugfs.hlinux/delay.hlinux/gpio/consumer.hlinux/interconnect.hlinux/interrupt.hlinux/iopoll.hlinux/kernel.hlinux/module.hlinux/of.hlinux/of_pci.hlinux/pci.hlinux/phy/phy.hlinux/pinctrl/consumer.hlinux/platform_device.hlinux/pm_runtime.hlinux/random.hlinux/reset.hlinux/resource.hlinux/types.hpcie-designware.hsoc/tegra/bpmp.hsoc/tegra/bpmp-abi.h../../pci.h
Detected Declarations
struct tegra_pcie_dw_of_datastruct tegra_pcie_dwfunction appl_writelfunction appl_readlfunction tegra_pcie_icc_setfunction apply_bad_link_workaroundfunction tegra_pcie_rp_irq_handlerfunction pex_ep_event_hot_rst_donefunction tegra_pcie_ep_irq_threadfunction tegra_pcie_ep_hard_irqfunction tegra_pcie_dw_rd_own_conffunction tegra_pcie_dw_wr_own_conffunction event_counter_progfunction aspm_state_cntfunction init_host_aspmfunction init_debugfsfunction init_host_aspmfunction init_debugfsfunction tegra_pcie_enable_system_interruptsfunction tegra_pcie_enable_intx_interruptsfunction tegra_pcie_enable_msi_interruptsfunction tegra_pcie_enable_interruptsfunction config_gen3_gen4_eq_presetsfunction tegra_pcie_dw_host_initfunction tegra_pcie_dw_start_linkfunction tegra_pcie_dw_link_upfunction tegra_pcie_dw_stop_linkfunction tegra_pcie_disable_phyfunction tegra_pcie_enable_phyfunction tegra_pcie_dw_parse_dtfunction tegra_pcie_bpmp_set_ctrl_statefunction tegra_pcie_bpmp_set_pll_statefunction tegra_pcie_get_slot_regulatorsfunction tegra_pcie_enable_slot_regulatorsfunction tegra_pcie_disable_slot_regulatorsfunction tegra_pcie_config_controllerfunction tegra_pcie_unconfig_controllerfunction tegra_pcie_init_controllerfunction tegra_pcie_try_link_l2function tegra_pcie_dw_pme_turnofffunction tegra_pcie_deinit_controllerfunction tegra_pcie_config_rpfunction pex_ep_event_pex_rst_assertfunction pex_ep_event_pex_rst_deassertfunction tegra_pcie_ep_pex_rst_irqfunction tegra_pcie_ep_raise_intx_irqfunction tegra_pcie_ep_raise_msi_irqfunction tegra_pcie_ep_raise_msix_irq
Annotated Snippet
struct tegra_pcie_dw_of_data {
u32 version;
enum dw_pcie_device_mode mode;
bool has_msix_doorbell_access_fix;
bool has_sbr_reset_fix;
bool has_l1ss_exit_fix;
bool has_ltr_req_fix;
bool disable_l1_2;
u32 cdm_chk_int_en_bit;
u32 gen4_preset_vec;
u8 n_fts[2];
};
struct tegra_pcie_dw {
struct device *dev;
struct resource *appl_res;
struct resource *dbi_res;
struct resource *atu_dma_res;
void __iomem *appl_base;
struct clk *core_clk;
struct clk *core_clk_m;
struct reset_control *core_apb_rst;
struct reset_control *core_rst;
struct dw_pcie pci;
struct tegra_bpmp *bpmp;
struct tegra_pcie_dw_of_data *of_data;
bool supports_clkreq;
bool enable_cdm_check;
bool enable_srns;
bool link_state;
bool update_fc_fixup;
bool enable_ext_refclk;
u8 init_link_width;
u32 msi_ctrl_int;
u32 num_lanes;
u32 cid;
u32 ras_des_cap;
u32 pcie_cap_base;
u32 aspm_cmrt;
u32 aspm_pwr_on_t;
u32 aspm_l0s_enter_lat;
struct regulator *pex_ctl_supply;
struct regulator *slot_ctl_3v3;
struct regulator *slot_ctl_12v;
unsigned int phy_count;
struct phy **phys;
struct dentry *debugfs;
/* Endpoint mode specific */
struct gpio_desc *pex_rst_gpiod;
struct gpio_desc *pex_refclk_sel_gpiod;
unsigned int pex_rst_irq;
int ep_state;
long link_status;
struct icc_path *icc_path;
};
static inline struct tegra_pcie_dw *to_tegra_pcie(struct dw_pcie *pci)
{
return container_of(pci, struct tegra_pcie_dw, pci);
}
static inline void appl_writel(struct tegra_pcie_dw *pcie, const u32 value,
const u32 reg)
{
writel_relaxed(value, pcie->appl_base + reg);
}
static inline u32 appl_readl(struct tegra_pcie_dw *pcie, const u32 reg)
{
return readl_relaxed(pcie->appl_base + reg);
}
static void tegra_pcie_icc_set(struct tegra_pcie_dw *pcie)
{
struct dw_pcie *pci = &pcie->pci;
u32 val, speed, width;
val = dw_pcie_readw_dbi(pci, pcie->pcie_cap_base + PCI_EXP_LNKSTA);
speed = FIELD_GET(PCI_EXP_LNKSTA_CLS, val);
width = FIELD_GET(PCI_EXP_LNKSTA_NLW, val);
val = width * PCIE_SPEED2MBS_ENC(pcie_get_link_speed(speed));
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/clk.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/gpio/consumer.h`, `linux/interconnect.h`, `linux/interrupt.h`, `linux/iopoll.h`.
- Detected declarations: `struct tegra_pcie_dw_of_data`, `struct tegra_pcie_dw`, `function appl_writel`, `function appl_readl`, `function tegra_pcie_icc_set`, `function apply_bad_link_workaround`, `function tegra_pcie_rp_irq_handler`, `function pex_ep_event_hot_rst_done`, `function tegra_pcie_ep_irq_thread`, `function tegra_pcie_ep_hard_irq`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- Implementation status: source implementation candidate.
- 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.