drivers/mmc/host/sdhci_am654.c
Source file repositories/reference/linux-study-clean/drivers/mmc/host/sdhci_am654.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/mmc/host/sdhci_am654.c- Extension
.c- Size
- 31163 bytes
- Lines
- 1147
- 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/clk.hlinux/iopoll.hlinux/of.hlinux/module.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hlinux/sys_soc.hcqhci.hsdhci-cqhci.hsdhci-pltfm.h
Detected Declarations
struct timing_datastruct sdhci_am654_datastruct windowstruct sdhci_am654_driver_datafunction sdhci_am654_setup_dllfunction sdhci_am654_write_itapdlyfunction sdhci_am654_setup_delay_chainfunction sdhci_am654_set_clockfunction sdhci_j721e_4bit_set_clockfunction sdhci_am654_start_signal_voltage_switchfunction sdhci_am654_write_power_onfunction sdhci_am654_write_bfunction sdhci_am654_resetfunction sdhci_am654_execute_tuningfunction sdhci_am654_cqhci_irqfunction sdhci_am654_calculate_itapfunction sdhci_am654_do_tuningfunction sdhci_am654_platform_execute_tuningfunction sdhci_am654_dumpregsfunction sdhci_am654_cqe_add_hostfunction sdhci_am654_get_otap_delayfunction sdhci_am654_initfunction sdhci_am654_get_of_propertyfunction sdhci_am654_probefunction sdhci_am654_removefunction sdhci_am654_restorefunction sdhci_am654_runtime_suspendfunction sdhci_am654_runtime_resume
Annotated Snippet
struct timing_data {
const char *otap_binding;
const char *itap_binding;
u32 capability;
};
static const struct timing_data td[] = {
[MMC_TIMING_LEGACY] = {"ti,otap-del-sel-legacy",
"ti,itap-del-sel-legacy",
0},
[MMC_TIMING_MMC_HS] = {"ti,otap-del-sel-mmc-hs",
"ti,itap-del-sel-mmc-hs",
MMC_CAP_MMC_HIGHSPEED},
[MMC_TIMING_SD_HS] = {"ti,otap-del-sel-sd-hs",
"ti,itap-del-sel-sd-hs",
MMC_CAP_SD_HIGHSPEED},
[MMC_TIMING_UHS_SDR12] = {"ti,otap-del-sel-sdr12",
"ti,itap-del-sel-sdr12",
MMC_CAP_UHS_SDR12},
[MMC_TIMING_UHS_SDR25] = {"ti,otap-del-sel-sdr25",
"ti,itap-del-sel-sdr25",
MMC_CAP_UHS_SDR25},
[MMC_TIMING_UHS_SDR50] = {"ti,otap-del-sel-sdr50",
NULL,
MMC_CAP_UHS_SDR50},
[MMC_TIMING_UHS_SDR104] = {"ti,otap-del-sel-sdr104",
NULL,
MMC_CAP_UHS_SDR104},
[MMC_TIMING_UHS_DDR50] = {"ti,otap-del-sel-ddr50",
NULL,
MMC_CAP_UHS_DDR50},
[MMC_TIMING_MMC_DDR52] = {"ti,otap-del-sel-ddr52",
"ti,itap-del-sel-ddr52",
MMC_CAP_DDR},
[MMC_TIMING_MMC_HS200] = {"ti,otap-del-sel-hs200",
NULL,
MMC_CAP2_HS200},
[MMC_TIMING_MMC_HS400] = {"ti,otap-del-sel-hs400",
NULL,
MMC_CAP2_HS400},
};
struct sdhci_am654_data {
struct regmap *base;
u32 otap_del_sel[ARRAY_SIZE(td)];
u32 itap_del_sel[ARRAY_SIZE(td)];
u32 itap_del_ena[ARRAY_SIZE(td)];
int clkbuf_sel;
int trm_icp;
int drv_strength;
int strb_sel;
u32 flags;
u32 quirks;
bool dll_enable;
u32 tuning_loop;
#define SDHCI_AM654_QUIRK_FORCE_CDTEST BIT(0)
#define SDHCI_AM654_QUIRK_SUPPRESS_V1P8_ENA BIT(1)
#define SDHCI_AM654_QUIRK_DISABLE_HS400 BIT(2)
};
struct window {
u8 start;
u8 end;
u8 length;
};
struct sdhci_am654_driver_data {
const struct sdhci_pltfm_data *pdata;
u32 flags;
u32 quirks;
#define IOMUX_PRESENT (1 << 0)
#define FREQSEL_2_BIT (1 << 1)
#define STRBSEL_4_BIT (1 << 2)
#define DLL_PRESENT (1 << 3)
#define DLL_CALIB (1 << 4)
};
static void sdhci_am654_setup_dll(struct sdhci_host *host, unsigned int clock)
{
struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
struct sdhci_am654_data *sdhci_am654 = sdhci_pltfm_priv(pltfm_host);
int sel50, sel100, freqsel;
u32 mask, val;
int ret;
/* Disable delay chain mode */
regmap_update_bits(sdhci_am654->base, PHY_CTRL5,
SELDLYTXCLK_MASK | SELDLYRXCLK_MASK, 0);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/iopoll.h`, `linux/of.h`, `linux/module.h`, `linux/pm_runtime.h`, `linux/property.h`, `linux/regmap.h`, `linux/sys_soc.h`.
- Detected declarations: `struct timing_data`, `struct sdhci_am654_data`, `struct window`, `struct sdhci_am654_driver_data`, `function sdhci_am654_setup_dll`, `function sdhci_am654_write_itapdly`, `function sdhci_am654_setup_delay_chain`, `function sdhci_am654_set_clock`, `function sdhci_j721e_4bit_set_clock`, `function sdhci_am654_start_signal_voltage_switch`.
- 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.