drivers/pci/controller/mobiveil/pcie-mobiveil.h
Source file repositories/reference/linux-study-clean/drivers/pci/controller/mobiveil/pcie-mobiveil.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/pci/controller/mobiveil/pcie-mobiveil.h- Extension
.h- Size
- 6594 bytes
- Lines
- 225
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hlinux/irq.hlinux/msi.h../../pci.h
Detected Declarations
struct mobiveil_msistruct mobiveil_pciestruct mobiveil_rp_opsstruct mobiveil_root_portstruct mobiveil_pab_opsstruct mobiveil_pciefunction mobiveil_csr_readlfunction mobiveil_csr_readwfunction mobiveil_csr_readbfunction mobiveil_csr_writelfunction mobiveil_csr_writewfunction mobiveil_csr_writeb
Annotated Snippet
struct mobiveil_msi { /* MSI information */
struct mutex lock; /* protect bitmap variable */
struct irq_domain *dev_domain;
phys_addr_t msi_pages_phys;
int num_of_vectors;
DECLARE_BITMAP(msi_irq_in_use, PCI_NUM_MSI);
};
struct mobiveil_pcie;
struct mobiveil_rp_ops {
int (*interrupt_init)(struct mobiveil_pcie *pcie);
};
struct mobiveil_root_port {
void __iomem *config_axi_slave_base; /* endpoint config base */
struct resource *ob_io_res;
const struct mobiveil_rp_ops *ops;
int irq;
raw_spinlock_t intx_mask_lock;
struct irq_domain *intx_domain;
struct mobiveil_msi msi;
struct pci_host_bridge *bridge;
};
struct mobiveil_pab_ops {
bool (*link_up)(struct mobiveil_pcie *pcie);
};
struct mobiveil_pcie {
struct platform_device *pdev;
void __iomem *csr_axi_slave_base; /* root port config base */
void __iomem *apb_csr_base; /* MSI register base */
phys_addr_t pcie_reg_base; /* Physical PCIe Controller Base */
int apio_wins;
int ppio_wins;
int ob_wins_configured; /* configured outbound windows */
int ib_wins_configured; /* configured inbound windows */
const struct mobiveil_pab_ops *ops;
struct mobiveil_root_port rp;
};
int mobiveil_pcie_host_probe(struct mobiveil_pcie *pcie);
int mobiveil_host_init(struct mobiveil_pcie *pcie, bool reinit);
bool mobiveil_pcie_link_up(struct mobiveil_pcie *pcie);
int mobiveil_bringup_link(struct mobiveil_pcie *pcie);
void program_ob_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr,
u64 pci_addr, u32 type, u64 size);
void program_ib_windows(struct mobiveil_pcie *pcie, int win_num, u64 cpu_addr,
u64 pci_addr, u32 type, u64 size);
u32 mobiveil_csr_read(struct mobiveil_pcie *pcie, u32 off, size_t size);
void mobiveil_csr_write(struct mobiveil_pcie *pcie, u32 val, u32 off,
size_t size);
static inline u32 mobiveil_csr_readl(struct mobiveil_pcie *pcie, u32 off)
{
return mobiveil_csr_read(pcie, off, 0x4);
}
static inline u16 mobiveil_csr_readw(struct mobiveil_pcie *pcie, u32 off)
{
return mobiveil_csr_read(pcie, off, 0x2);
}
static inline u8 mobiveil_csr_readb(struct mobiveil_pcie *pcie, u32 off)
{
return mobiveil_csr_read(pcie, off, 0x1);
}
static inline void mobiveil_csr_writel(struct mobiveil_pcie *pcie, u32 val,
u32 off)
{
mobiveil_csr_write(pcie, val, off, 0x4);
}
static inline void mobiveil_csr_writew(struct mobiveil_pcie *pcie, u16 val,
u32 off)
{
mobiveil_csr_write(pcie, val, off, 0x2);
}
static inline void mobiveil_csr_writeb(struct mobiveil_pcie *pcie, u8 val,
u32 off)
{
mobiveil_csr_write(pcie, val, off, 0x1);
}
#endif /* _PCIE_MOBIVEIL_H */
Annotation
- Immediate include surface: `linux/pci.h`, `linux/irq.h`, `linux/msi.h`, `../../pci.h`.
- Detected declarations: `struct mobiveil_msi`, `struct mobiveil_pcie`, `struct mobiveil_rp_ops`, `struct mobiveil_root_port`, `struct mobiveil_pab_ops`, `struct mobiveil_pcie`, `function mobiveil_csr_readl`, `function mobiveil_csr_readw`, `function mobiveil_csr_readb`, `function mobiveil_csr_writel`.
- 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.