drivers/pci/controller/dwc/pcie-visconti.c
Source file repositories/reference/linux-study-clean/drivers/pci/controller/dwc/pcie-visconti.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/controller/dwc/pcie-visconti.c- Extension
.c- Size
- 8923 bytes
- Lines
- 330
- 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.
- 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/gpio.hlinux/interrupt.hlinux/init.hlinux/iopoll.hlinux/kernel.hlinux/of_platform.hlinux/pci.hlinux/platform_device.hlinux/resource.hlinux/types.hpcie-designware.h../../pci.h
Detected Declarations
struct visconti_pciefunction visconti_ulreg_writelfunction visconti_ulreg_readlfunction visconti_smu_writelfunction visconti_mpu_writelfunction visconti_mpu_readlfunction visconti_pcie_link_upfunction visconti_pcie_start_linkfunction visconti_pcie_stop_linkfunction visconti_pcie_cpu_addr_fixupfunction visconti_pcie_host_initfunction visconti_get_resourcesfunction visconti_add_pcie_portfunction visconti_pcie_probe
Annotated Snippet
struct visconti_pcie {
struct dw_pcie pci;
void __iomem *ulreg_base;
void __iomem *smu_base;
void __iomem *mpu_base;
struct clk *refclk;
struct clk *coreclk;
struct clk *auxclk;
};
#define PCIE_UL_REG_S_PCIE_MODE 0x00F4
#define PCIE_UL_REG_S_PCIE_MODE_EP 0x00
#define PCIE_UL_REG_S_PCIE_MODE_RC 0x04
#define PCIE_UL_REG_S_PERSTN_CTRL 0x00F8
#define PCIE_UL_IOM_PCIE_PERSTN_I_EN BIT(3)
#define PCIE_UL_DIRECT_PERSTN_EN BIT(2)
#define PCIE_UL_PERSTN_OUT BIT(1)
#define PCIE_UL_DIRECT_PERSTN BIT(0)
#define PCIE_UL_REG_S_PERSTN_CTRL_INIT (PCIE_UL_IOM_PCIE_PERSTN_I_EN | \
PCIE_UL_DIRECT_PERSTN_EN | \
PCIE_UL_DIRECT_PERSTN)
#define PCIE_UL_REG_S_PHY_INIT_02 0x0104
#define PCIE_UL_PHY0_SRAM_EXT_LD_DONE BIT(0)
#define PCIE_UL_REG_S_PHY_INIT_03 0x0108
#define PCIE_UL_PHY0_SRAM_INIT_DONE BIT(0)
#define PCIE_UL_REG_S_INT_EVENT_MASK1 0x0138
#define PCIE_UL_CFG_PME_INT BIT(0)
#define PCIE_UL_CFG_LINK_EQ_REQ_INT BIT(1)
#define PCIE_UL_EDMA_INT0 BIT(2)
#define PCIE_UL_EDMA_INT1 BIT(3)
#define PCIE_UL_EDMA_INT2 BIT(4)
#define PCIE_UL_EDMA_INT3 BIT(5)
#define PCIE_UL_S_INT_EVENT_MASK1_ALL (PCIE_UL_CFG_PME_INT | \
PCIE_UL_CFG_LINK_EQ_REQ_INT | \
PCIE_UL_EDMA_INT0 | \
PCIE_UL_EDMA_INT1 | \
PCIE_UL_EDMA_INT2 | \
PCIE_UL_EDMA_INT3)
#define PCIE_UL_REG_S_SB_MON 0x0198
#define PCIE_UL_REG_S_SIG_MON 0x019C
#define PCIE_UL_CORE_RST_N_MON BIT(0)
#define PCIE_UL_REG_V_SII_DBG_00 0x0844
#define PCIE_UL_REG_V_SII_GEN_CTRL_01 0x0860
#define PCIE_UL_APP_LTSSM_ENABLE BIT(0)
#define PCIE_UL_REG_V_PHY_ST_00 0x0864
#define PCIE_UL_SMLH_LINK_UP BIT(0)
#define PCIE_UL_REG_V_PHY_ST_02 0x0868
#define PCIE_UL_S_DETECT_ACT 0x01
#define PCIE_UL_S_L0 0x11
#define PISMU_CKON_PCIE 0x0038
#define PISMU_CKON_PCIE_AUX_CLK BIT(1)
#define PISMU_CKON_PCIE_MSTR_ACLK BIT(0)
#define PISMU_RSOFF_PCIE 0x0538
#define PISMU_RSOFF_PCIE_ULREG_RST_N BIT(1)
#define PISMU_RSOFF_PCIE_PWR_UP_RST_N BIT(0)
#define PCIE_MPU_REG_MP_EN 0x0
#define MPU_MP_EN_DISABLE BIT(0)
/* Access registers in PCIe ulreg */
static void visconti_ulreg_writel(struct visconti_pcie *pcie, u32 val, u32 reg)
{
writel_relaxed(val, pcie->ulreg_base + reg);
}
static u32 visconti_ulreg_readl(struct visconti_pcie *pcie, u32 reg)
{
return readl_relaxed(pcie->ulreg_base + reg);
}
/* Access registers in PCIe smu */
static void visconti_smu_writel(struct visconti_pcie *pcie, u32 val, u32 reg)
{
writel_relaxed(val, pcie->smu_base + reg);
}
/* Access registers in PCIe mpu */
static void visconti_mpu_writel(struct visconti_pcie *pcie, u32 val, u32 reg)
{
writel_relaxed(val, pcie->mpu_base + reg);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/delay.h`, `linux/gpio.h`, `linux/interrupt.h`, `linux/init.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/of_platform.h`.
- Detected declarations: `struct visconti_pcie`, `function visconti_ulreg_writel`, `function visconti_ulreg_readl`, `function visconti_smu_writel`, `function visconti_mpu_writel`, `function visconti_mpu_readl`, `function visconti_pcie_link_up`, `function visconti_pcie_start_link`, `function visconti_pcie_stop_link`, `function visconti_pcie_cpu_addr_fixup`.
- Atlas domain: Representative Device Path / PCIe NVMe Storage Path.
- 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.