drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
Source file repositories/reference/linux-study-clean/drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c- Extension
.c- Size
- 237643 bytes
- Lines
- 5542
- Domain
- Driver Families
- Bucket
- drivers/phy
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- 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/clk-provider.hlinux/delay.hlinux/err.hlinux/io.hlinux/iopoll.hlinux/kernel.hlinux/mfd/syscon.hlinux/module.hlinux/of.hlinux/of_address.hlinux/phy/pcie.hlinux/phy/phy.hlinux/platform_device.hlinux/regmap.hlinux/regulator/consumer.hlinux/reset.hlinux/slab.hdt-bindings/phy/phy-qcom-qmp.hphy-qcom-qmp-common.hphy-qcom-qmp.hphy-qcom-qmp-pcs-misc-v3.hphy-qcom-qmp-pcs-pcie-v4.hphy-qcom-qmp-pcs-pcie-v4_20.hphy-qcom-qmp-pcs-pcie-v5.hphy-qcom-qmp-pcs-pcie-v5_20.hphy-qcom-qmp-pcs-pcie-v6.hphy-qcom-qmp-pcs-pcie-v6_20.hphy-qcom-qmp-pcs-pcie-v6_30.hphy-qcom-qmp-pcs-v6_30.hphy-qcom-qmp-pcie-qhp.hphy-qcom-qmp-qserdes-com-v8.h
Detected Declarations
struct qmp_pcie_offsetsstruct qmp_phy_cfg_tblsstruct qmp_phy_cfgstruct qmp_pcieenum qphy_reg_layoutfunction qphy_checkbitsfunction qphy_setbitsfunction qphy_clrbitsfunction qmp_pcie_init_port_bfunction qmp_pcie_init_registersfunction qmp_pcie_initfunction qmp_pcie_exitfunction qmp_pcie_power_onfunction qmp_pcie_power_offfunction qmp_pcie_enablefunction qmp_pcie_disablefunction qmp_pcie_set_modefunction qmp_pcie_vreg_initfunction qmp_pcie_reset_initfunction qmp_pcie_clk_initfunction phy_clk_release_providerfunction phy_pipe_clk_registerfunction phy_aux_clk_registerfunction qmp_pcie_register_clocksfunction qmp_pcie_parse_dt_legacyfunction qmp_pcie_get_4ln_configfunction qmp_pcie_parse_dtfunction qmp_pcie_probe
Annotated Snippet
struct qmp_pcie_offsets {
u16 serdes;
u16 pcs;
u16 pcs_misc;
u16 pcs_lane1;
u16 tx;
u16 rx;
u16 tx2;
u16 rx2;
u16 txz;
u16 rxz;
u16 txrxz;
u16 ln_shrd;
};
struct qmp_phy_cfg_tbls {
const struct qmp_phy_init_tbl *serdes;
int serdes_num;
const struct qmp_phy_init_tbl *tx;
int tx_num;
const struct qmp_phy_init_tbl *rx;
int rx_num;
const struct qmp_phy_init_tbl *txz;
int txz_num;
const struct qmp_phy_init_tbl *rxz;
int rxz_num;
const struct qmp_phy_init_tbl *pcs;
int pcs_num;
const struct qmp_phy_init_tbl *pcs_misc;
int pcs_misc_num;
const struct qmp_phy_init_tbl *pcs_lane1;
int pcs_lane1_num;
const struct qmp_phy_init_tbl *ln_shrd;
int ln_shrd_num;
};
/* struct qmp_phy_cfg - per-PHY initialization config */
struct qmp_phy_cfg {
int lanes;
const struct qmp_pcie_offsets *offsets;
/* Main init sequence for PHY blocks - serdes, tx, rx, pcs */
const struct qmp_phy_cfg_tbls tbls;
/*
* Additional init sequences for PHY blocks, providing additional
* register programming. They are used for providing separate sequences
* for the Root Complex and End Point use cases.
*
* If EP mode is not supported, both tables can be left unset.
*/
const struct qmp_phy_cfg_tbls *tbls_rc;
const struct qmp_phy_cfg_tbls *tbls_ep;
const struct qmp_phy_init_tbl *serdes_4ln_tbl;
int serdes_4ln_num;
/* resets to be requested */
const char * const *reset_list;
int num_resets;
/* regulators to be requested */
const char * const *vreg_list;
int num_vregs;
/* array of registers with different offsets */
const unsigned int *regs;
unsigned int pwrdn_ctrl;
/* bit offset of PHYSTATUS in QPHY_PCS_STATUS register */
unsigned int phy_status;
bool skip_start_delay;
/* QMP PHY pipe clock interface rate */
unsigned long pipe_clock_rate;
/* QMP PHY AUX clock interface rate */
unsigned long aux_clock_rate;
};
struct qmp_pcie {
struct device *dev;
const struct qmp_phy_cfg *cfg;
bool tcsr_4ln_config;
bool skip_init;
void __iomem *serdes;
void __iomem *pcs;
void __iomem *pcs_misc;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/iopoll.h`, `linux/kernel.h`, `linux/mfd/syscon.h`.
- Detected declarations: `struct qmp_pcie_offsets`, `struct qmp_phy_cfg_tbls`, `struct qmp_phy_cfg`, `struct qmp_pcie`, `enum qphy_reg_layout`, `function qphy_checkbits`, `function qphy_setbits`, `function qphy_clrbits`, `function qmp_pcie_init_port_b`, `function qmp_pcie_init_registers`.
- Atlas domain: Driver Families / drivers/phy.
- 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.