drivers/pci/controller/dwc/pci-exynos.c
Source file repositories/reference/linux-study-clean/drivers/pci/controller/dwc/pci-exynos.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/controller/dwc/pci-exynos.c- Extension
.c- Size
- 9982 bytes
- Lines
- 397
- 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/clk.hlinux/delay.hlinux/interrupt.hlinux/kernel.hlinux/init.hlinux/pci.hlinux/platform_device.hlinux/phy/phy.hlinux/regulator/consumer.hlinux/mod_devicetable.hlinux/module.hpcie-designware.h
Detected Declarations
struct exynos_pciefunction exynos_pcie_writelfunction exynos_pcie_readlfunction exynos_pcie_sideband_dbi_w_modefunction exynos_pcie_sideband_dbi_r_modefunction exynos_pcie_assert_core_resetfunction exynos_pcie_deassert_core_resetfunction exynos_pcie_start_linkfunction exynos_pcie_clear_irq_pulsefunction exynos_pcie_irq_handlerfunction exynos_pcie_enable_irq_pulsefunction exynos_pcie_read_dbifunction exynos_pcie_write_dbifunction exynos_pcie_rd_own_conffunction exynos_pcie_wr_own_conffunction exynos_pcie_link_upfunction exynos_pcie_host_initfunction exynos_add_pcie_portfunction exynos_pcie_probefunction exynos_pcie_removefunction exynos_pcie_suspend_noirqfunction exynos_pcie_resume_noirq
Annotated Snippet
struct exynos_pcie {
struct dw_pcie pci;
struct clk_bulk_data *clks;
struct phy *phy;
struct regulator_bulk_data supplies[2];
};
static void exynos_pcie_writel(void __iomem *base, u32 val, u32 reg)
{
writel(val, base + reg);
}
static u32 exynos_pcie_readl(void __iomem *base, u32 reg)
{
return readl(base + reg);
}
static void exynos_pcie_sideband_dbi_w_mode(struct exynos_pcie *ep, bool on)
{
struct dw_pcie *pci = &ep->pci;
u32 val;
val = exynos_pcie_readl(pci->elbi_base, PCIE_ELBI_SLV_AWMISC);
if (on)
val |= PCIE_ELBI_SLV_DBI_ENABLE;
else
val &= ~PCIE_ELBI_SLV_DBI_ENABLE;
exynos_pcie_writel(pci->elbi_base, val, PCIE_ELBI_SLV_AWMISC);
}
static void exynos_pcie_sideband_dbi_r_mode(struct exynos_pcie *ep, bool on)
{
struct dw_pcie *pci = &ep->pci;
u32 val;
val = exynos_pcie_readl(pci->elbi_base, PCIE_ELBI_SLV_ARMISC);
if (on)
val |= PCIE_ELBI_SLV_DBI_ENABLE;
else
val &= ~PCIE_ELBI_SLV_DBI_ENABLE;
exynos_pcie_writel(pci->elbi_base, val, PCIE_ELBI_SLV_ARMISC);
}
static void exynos_pcie_assert_core_reset(struct exynos_pcie *ep)
{
struct dw_pcie *pci = &ep->pci;
u32 val;
val = exynos_pcie_readl(pci->elbi_base, PCIE_CORE_RESET);
val &= ~PCIE_CORE_RESET_ENABLE;
exynos_pcie_writel(pci->elbi_base, val, PCIE_CORE_RESET);
exynos_pcie_writel(pci->elbi_base, 0, PCIE_STICKY_RESET);
exynos_pcie_writel(pci->elbi_base, 0, PCIE_NONSTICKY_RESET);
}
static void exynos_pcie_deassert_core_reset(struct exynos_pcie *ep)
{
struct dw_pcie *pci = &ep->pci;
u32 val;
val = exynos_pcie_readl(pci->elbi_base, PCIE_CORE_RESET);
val |= PCIE_CORE_RESET_ENABLE;
exynos_pcie_writel(pci->elbi_base, val, PCIE_CORE_RESET);
exynos_pcie_writel(pci->elbi_base, 1, PCIE_STICKY_RESET);
exynos_pcie_writel(pci->elbi_base, 1, PCIE_NONSTICKY_RESET);
exynos_pcie_writel(pci->elbi_base, 1, PCIE_APP_INIT_RESET);
exynos_pcie_writel(pci->elbi_base, 0, PCIE_APP_INIT_RESET);
}
static int exynos_pcie_start_link(struct dw_pcie *pci)
{
u32 val;
val = exynos_pcie_readl(pci->elbi_base, PCIE_SW_WAKE);
val &= ~PCIE_BUS_EN;
exynos_pcie_writel(pci->elbi_base, val, PCIE_SW_WAKE);
/* assert LTSSM enable */
exynos_pcie_writel(pci->elbi_base, PCIE_ELBI_LTSSM_ENABLE,
PCIE_APP_LTSSM_ENABLE);
return 0;
}
static void exynos_pcie_clear_irq_pulse(struct exynos_pcie *ep)
{
struct dw_pcie *pci = &ep->pci;
u32 val = exynos_pcie_readl(pci->elbi_base, PCIE_IRQ_PULSE);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/interrupt.h`, `linux/kernel.h`, `linux/init.h`, `linux/pci.h`, `linux/platform_device.h`, `linux/phy/phy.h`.
- Detected declarations: `struct exynos_pcie`, `function exynos_pcie_writel`, `function exynos_pcie_readl`, `function exynos_pcie_sideband_dbi_w_mode`, `function exynos_pcie_sideband_dbi_r_mode`, `function exynos_pcie_assert_core_reset`, `function exynos_pcie_deassert_core_reset`, `function exynos_pcie_start_link`, `function exynos_pcie_clear_irq_pulse`, `function exynos_pcie_irq_handler`.
- 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.