drivers/phy/cadence/phy-cadence-sierra.c
Source file repositories/reference/linux-study-clean/drivers/phy/cadence/phy-cadence-sierra.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/phy/cadence/phy-cadence-sierra.c- Extension
.c- Size
- 93437 bytes
- Lines
- 2925
- 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/module.hlinux/phy/phy.hlinux/platform_device.hlinux/pm_runtime.hlinux/regmap.hlinux/reset.hlinux/slab.hlinux/of.hlinux/of_platform.hdt-bindings/phy/phy.hdt-bindings/phy/phy-cadence.h
Detected Declarations
struct cdns_sierra_pll_mux_reg_fieldsstruct cdns_sierra_pll_muxstruct cdns_sierra_derived_refclkstruct cdns_sierra_inststruct cdns_reg_pairsstruct cdns_sierra_valsstruct cdns_sierra_datastruct cdns_regmap_cdb_contextstruct cdns_sierra_phyenum cdns_sierra_clock_inputenum cdns_sierra_cmn_plllcenum cdns_sierra_phy_typeenum cdns_sierra_ssc_modefunction cdns_regmap_writefunction cdns_regmap_readfunction cdns_sierra_phy_initfunction cdns_sierra_phy_onfunction cdns_sierra_phy_offfunction cdns_sierra_phy_resetfunction cdns_sierra_noop_phy_onfunction cdns_sierra_pll_mux_get_parentfunction cdns_sierra_pll_mux_set_parentfunction cdns_sierra_pll_mux_registerfunction cdns_sierra_phy_register_pll_muxfunction cdns_sierra_derived_refclk_enablefunction cdns_sierra_derived_refclk_disablefunction cdns_sierra_derived_refclk_is_enabledfunction cdns_sierra_derived_refclk_registerfunction cdns_sierra_clk_unregisterfunction cdns_sierra_clk_registerfunction cdns_sierra_get_optionalfunction cdns_regfield_initfunction cdns_regmap_init_blocksfunction cdns_sierra_phy_get_clocksfunction cdns_sierra_phy_clkfunction cdns_sierra_phy_enable_clocksfunction cdns_sierra_phy_disable_clocksfunction cdns_sierra_phy_get_resetsfunction cdns_sierra_phy_configure_multilinkfunction cdns_sierra_phy_probefunction for_each_available_child_of_node_scopedfunction cdns_sierra_phy_remove
Annotated Snippet
struct cdns_sierra_pll_mux_reg_fields {
struct reg_field pfdclk_sel_preg;
struct reg_field plllc1en_field;
struct reg_field termen_field;
};
static const struct cdns_sierra_pll_mux_reg_fields cmn_plllc_pfdclk1_sel_preg[] = {
[CMN_PLLLC] = {
.pfdclk_sel_preg = REG_FIELD(SIERRA_CMN_PLLLC_GEN_PREG, 1, 1),
.plllc1en_field = REG_FIELD(SIERRA_CMN_REFRCV1_PREG, 8, 8),
.termen_field = REG_FIELD(SIERRA_CMN_REFRCV1_PREG, 0, 0),
},
[CMN_PLLLC1] = {
.pfdclk_sel_preg = REG_FIELD(SIERRA_CMN_PLLLC1_GEN_PREG, 1, 1),
.plllc1en_field = REG_FIELD(SIERRA_CMN_REFRCV_PREG, 8, 8),
.termen_field = REG_FIELD(SIERRA_CMN_REFRCV_PREG, 0, 0),
},
};
struct cdns_sierra_pll_mux {
struct clk_hw hw;
struct regmap_field *pfdclk_sel_preg;
struct regmap_field *plllc1en_field;
struct regmap_field *termen_field;
struct clk_init_data clk_data;
};
#define to_cdns_sierra_pll_mux(_hw) \
container_of(_hw, struct cdns_sierra_pll_mux, hw)
#define PLL0_REFCLK_NAME "pll0_refclk"
#define PLL1_REFCLK_NAME "pll1_refclk"
static const struct clk_parent_data pll_mux_parent_data[][SIERRA_NUM_CMN_PLLC_PARENTS] = {
[CMN_PLLLC] = {
{ .fw_name = PLL0_REFCLK_NAME },
{ .fw_name = PLL1_REFCLK_NAME }
},
[CMN_PLLLC1] = {
{ .fw_name = PLL1_REFCLK_NAME },
{ .fw_name = PLL0_REFCLK_NAME }
},
};
static const u32 cdns_sierra_pll_mux_table[][SIERRA_NUM_CMN_PLLC_PARENTS] = {
[CMN_PLLLC] = { 0, 1 },
[CMN_PLLLC1] = { 1, 0 },
};
struct cdns_sierra_derived_refclk {
struct clk_hw hw;
struct regmap_field *cmn_plllc_clk1outdiv_preg;
struct regmap_field *cmn_plllc_clk1_en_preg;
struct clk_init_data clk_data;
};
#define to_cdns_sierra_derived_refclk(_hw) \
container_of(_hw, struct cdns_sierra_derived_refclk, hw)
enum cdns_sierra_phy_type {
TYPE_NONE,
TYPE_PCIE,
TYPE_USB,
TYPE_SGMII,
TYPE_QSGMII
};
enum cdns_sierra_ssc_mode {
NO_SSC,
EXTERNAL_SSC,
INTERNAL_SSC
};
struct cdns_sierra_inst {
struct phy *phy;
enum cdns_sierra_phy_type phy_type;
u32 num_lanes;
u32 mlane;
struct reset_control *lnk_rst;
enum cdns_sierra_ssc_mode ssc_mode;
};
struct cdns_reg_pairs {
u16 val;
u32 off;
};
struct cdns_sierra_vals {
const struct cdns_reg_pairs *reg_pairs;
u32 num_regs;
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/delay.h`, `linux/err.h`, `linux/io.h`, `linux/module.h`, `linux/phy/phy.h`, `linux/platform_device.h`.
- Detected declarations: `struct cdns_sierra_pll_mux_reg_fields`, `struct cdns_sierra_pll_mux`, `struct cdns_sierra_derived_refclk`, `struct cdns_sierra_inst`, `struct cdns_reg_pairs`, `struct cdns_sierra_vals`, `struct cdns_sierra_data`, `struct cdns_regmap_cdb_context`, `struct cdns_sierra_phy`, `enum cdns_sierra_clock_input`.
- 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.