drivers/mmc/host/sdhci-xenon-phy.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/sdhci-xenon-phy.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/sdhci-xenon-phy.c- Extension
.c- Size
- 26358 bytes
- Lines
- 879
- Domain
- Driver Families
- Bucket
- drivers/mmc
- 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/slab.hlinux/delay.hlinux/ktime.hlinux/iopoll.hlinux/of_address.hsdhci-pltfm.hsdhci-xenon.h
Detected Declarations
struct xenon_emmc_phy_regsstruct soc_pad_ctrlstruct xenon_emmc_phy_paramsenum xenon_phy_type_enumenum soc_pad_ctrl_typefunction xenon_alloc_emmc_phyfunction xenon_check_stability_internal_clkfunction xenon_emmc_phy_initfunction armada_3700_soc_pad_voltage_setfunction xenon_emmc_phy_set_soc_padfunction xenon_emmc_phy_enable_dllfunction xenon_emmc_phy_config_tuningfunction xenon_emmc_phy_disable_strobefunction xenon_emmc_phy_strobe_delay_adjfunction modefunction xenon_emmc_phy_setfunction get_dt_pad_ctrl_datafunction xenon_emmc_phy_parse_paramsfunction xenon_soc_pad_ctrlfunction xenon_hs_delay_adjfunction xenon_phy_adjfunction xenon_add_phyfunction xenon_phy_parse_params
Annotated Snippet
struct xenon_emmc_phy_regs {
/* Offset of Timing Adjust register */
u16 timing_adj;
/* Offset of Func Control register */
u16 func_ctrl;
/* Offset of Pad Control register */
u16 pad_ctrl;
/* Offset of Pad Control register 2 */
u16 pad_ctrl2;
/* Offset of DLL Control register */
u16 dll_ctrl;
/* Offset of Logic Timing Adjust register */
u16 logic_timing_adj;
/* DLL Update Enable bit */
u32 dll_update;
/* value in Logic Timing Adjustment register */
u32 logic_timing_val;
};
static const char * const phy_types[] = {
"emmc 5.0 phy",
"emmc 5.1 phy"
};
enum xenon_phy_type_enum {
EMMC_5_0_PHY,
EMMC_5_1_PHY,
NR_PHY_TYPES
};
enum soc_pad_ctrl_type {
SOC_PAD_SD,
SOC_PAD_FIXED_1_8V,
};
struct soc_pad_ctrl {
/* Register address of SoC PHY PAD ctrl */
void __iomem *reg;
/* SoC PHY PAD ctrl type */
enum soc_pad_ctrl_type pad_type;
/* SoC specific operation to set SoC PHY PAD */
void (*set_soc_pad)(struct sdhci_host *host,
unsigned char signal_voltage);
};
static struct xenon_emmc_phy_regs xenon_emmc_5_0_phy_regs = {
.timing_adj = XENON_EMMC_5_0_PHY_TIMING_ADJUST,
.func_ctrl = XENON_EMMC_5_0_PHY_FUNC_CONTROL,
.pad_ctrl = XENON_EMMC_5_0_PHY_PAD_CONTROL,
.pad_ctrl2 = XENON_EMMC_5_0_PHY_PAD_CONTROL2,
.dll_ctrl = XENON_EMMC_5_0_PHY_DLL_CONTROL,
.logic_timing_adj = XENON_EMMC_5_0_PHY_LOGIC_TIMING_ADJUST,
.dll_update = XENON_DLL_UPDATE_STROBE_5_0,
.logic_timing_val = XENON_EMMC_5_0_PHY_LOGIC_TIMING_VALUE,
};
static struct xenon_emmc_phy_regs xenon_emmc_5_1_phy_regs = {
.timing_adj = XENON_EMMC_PHY_TIMING_ADJUST,
.func_ctrl = XENON_EMMC_PHY_FUNC_CONTROL,
.pad_ctrl = XENON_EMMC_PHY_PAD_CONTROL,
.pad_ctrl2 = XENON_EMMC_PHY_PAD_CONTROL2,
.dll_ctrl = XENON_EMMC_PHY_DLL_CONTROL,
.logic_timing_adj = XENON_EMMC_PHY_LOGIC_TIMING_ADJUST,
.dll_update = XENON_DLL_UPDATE,
.logic_timing_val = XENON_LOGIC_TIMING_VALUE,
};
/*
* eMMC PHY configuration and operations
*/
struct xenon_emmc_phy_params {
bool slow_mode;
u8 znr;
u8 zpr;
/* Nr of consecutive Sampling Points of a Valid Sampling Window */
u8 nr_tun_times;
/* Divider for calculating Tuning Step */
u8 tun_step_divider;
struct soc_pad_ctrl pad_ctrl;
};
static int xenon_alloc_emmc_phy(struct sdhci_host *host)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct xenon_priv *priv = sdhci_pltfm_priv(pltfm_host);
struct xenon_emmc_phy_params *params;
Annotation
- Immediate include surface: `linux/slab.h`, `linux/delay.h`, `linux/ktime.h`, `linux/iopoll.h`, `linux/of_address.h`, `sdhci-pltfm.h`, `sdhci-xenon.h`.
- Detected declarations: `struct xenon_emmc_phy_regs`, `struct soc_pad_ctrl`, `struct xenon_emmc_phy_params`, `enum xenon_phy_type_enum`, `enum soc_pad_ctrl_type`, `function xenon_alloc_emmc_phy`, `function xenon_check_stability_internal_clk`, `function xenon_emmc_phy_init`, `function armada_3700_soc_pad_voltage_set`, `function xenon_emmc_phy_set_soc_pad`.
- Atlas domain: Driver Families / drivers/mmc.
- 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.