drivers/mmc/host/dw_mmc-exynos.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/dw_mmc-exynos.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/dw_mmc-exynos.c- Extension
.c- Size
- 20139 bytes
- Lines
- 732
- 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/module.hlinux/platform_device.hlinux/clk.hlinux/mmc/host.hlinux/mmc/mmc.hlinux/of.hlinux/pm_runtime.hlinux/slab.hdw_mmc.hdw_mmc-pltfm.hdw_mmc-exynos.h
Detected Declarations
struct dw_mci_exynos_priv_dataenum dw_mci_exynos_typefunction dw_mci_exynos_get_ciu_divfunction dw_mci_exynos_config_smufunction dw_mci_exynos_priv_initfunction dw_mci_exynos_set_clksel_timingfunction dw_mci_exynos_runtime_resumefunction pm_runtime_force_resumefunction dw_mci_exynos_resume_noirqfunction dw_mci_exynos_config_hs400function dw_mci_exynos_adjust_clockfunction dw_mci_exynos_set_iosfunction dw_mci_exynos_parse_dtfunction dw_mci_exynos_get_clksmplfunction dw_mci_exynos_set_clksmplfunction dw_mci_exynos_move_next_clksmplfunction dw_mci_exynos_get_best_clksmplfunction dw_mci_exynos_execute_tuningfunction dw_mci_exynos_prepare_hs400_tuningfunction dw_mci_exynos_set_data_timeoutfunction dw_mci_exynos_get_drto_clksfunction dw_mci_exynos_probefunction dw_mci_exynos_remove
Annotated Snippet
struct dw_mci_exynos_priv_data {
enum dw_mci_exynos_type ctrl_type;
u8 ciu_div;
u32 sdr_timing;
u32 ddr_timing;
u32 hs400_timing;
u32 tuned_sample;
u32 cur_speed;
u32 dqs_delay;
u32 saved_dqs_en;
u32 saved_strobe_ctrl;
};
static struct dw_mci_exynos_compatible {
char *compatible;
enum dw_mci_exynos_type ctrl_type;
} exynos_compat[] = {
{
.compatible = "samsung,exynos4210-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS4210,
}, {
.compatible = "samsung,exynos4412-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS4412,
}, {
.compatible = "samsung,exynos5250-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS5250,
}, {
.compatible = "samsung,exynos5420-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS5420,
}, {
.compatible = "samsung,exynos5420-dw-mshc-smu",
.ctrl_type = DW_MCI_TYPE_EXYNOS5420_SMU,
}, {
.compatible = "samsung,exynos7-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS7,
}, {
.compatible = "samsung,exynos7-dw-mshc-smu",
.ctrl_type = DW_MCI_TYPE_EXYNOS7_SMU,
}, {
.compatible = "samsung,exynos7870-dw-mshc",
.ctrl_type = DW_MCI_TYPE_EXYNOS7870,
}, {
.compatible = "samsung,exynos7870-dw-mshc-smu",
.ctrl_type = DW_MCI_TYPE_EXYNOS7870_SMU,
}, {
.compatible = "axis,artpec8-dw-mshc",
.ctrl_type = DW_MCI_TYPE_ARTPEC8,
},
};
static inline u8 dw_mci_exynos_get_ciu_div(struct dw_mci *host)
{
struct dw_mci_exynos_priv_data *priv = host->priv;
if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS4412)
return EXYNOS4412_FIXED_CIU_CLK_DIV;
else if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS4210)
return EXYNOS4210_FIXED_CIU_CLK_DIV;
else if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS7 ||
priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU ||
priv->ctrl_type == DW_MCI_TYPE_EXYNOS7870 ||
priv->ctrl_type == DW_MCI_TYPE_EXYNOS7870_SMU ||
priv->ctrl_type == DW_MCI_TYPE_ARTPEC8)
return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL64)) + 1;
else
return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;
}
static void dw_mci_exynos_config_smu(struct dw_mci *host)
{
struct dw_mci_exynos_priv_data *priv = host->priv;
/*
* If Exynos is provided the Security management,
* set for non-ecryption mode at this time.
*/
if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU ||
priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU ||
priv->ctrl_type == DW_MCI_TYPE_EXYNOS7870_SMU) {
mci_writel(host, MPSBEGIN0, 0);
mci_writel(host, MPSEND0, SDMMC_ENDING_SEC_NR_MAX);
mci_writel(host, MPSCTRL0, SDMMC_MPSCTRL_SECURE_WRITE_BIT |
SDMMC_MPSCTRL_NON_SECURE_READ_BIT |
SDMMC_MPSCTRL_VALID |
SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT);
}
}
static int dw_mci_exynos_priv_init(struct dw_mci *host)
{
Annotation
- Immediate include surface: `linux/module.h`, `linux/platform_device.h`, `linux/clk.h`, `linux/mmc/host.h`, `linux/mmc/mmc.h`, `linux/of.h`, `linux/pm_runtime.h`, `linux/slab.h`.
- Detected declarations: `struct dw_mci_exynos_priv_data`, `enum dw_mci_exynos_type`, `function dw_mci_exynos_get_ciu_div`, `function dw_mci_exynos_config_smu`, `function dw_mci_exynos_priv_init`, `function dw_mci_exynos_set_clksel_timing`, `function dw_mci_exynos_runtime_resume`, `function pm_runtime_force_resume`, `function dw_mci_exynos_resume_noirq`, `function dw_mci_exynos_config_hs400`.
- 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.