2 * (C) Copyright 2013 - 2015 Xilinx, Inc.
4 * Xilinx Zynq SD Host Controller Interface
6 * SPDX-License-Identifier: GPL-2.0+
16 #ifndef CONFIG_ZYNQ_SDHCI_MIN_FREQ
17 # define CONFIG_ZYNQ_SDHCI_MIN_FREQ 0
20 static int arasan_sdhci_probe(struct udevice
*dev
)
22 struct mmc_uclass_priv
*upriv
= dev_get_uclass_priv(dev
);
23 struct sdhci_host
*host
= dev_get_priv(dev
);
25 host
->quirks
= SDHCI_QUIRK_WAIT_SEND_CMD
|
26 SDHCI_QUIRK_BROKEN_R1B
;
28 #ifdef CONFIG_ZYNQ_HISPD_BROKEN
29 host
->quirks
|= SDHCI_QUIRK_NO_HISPD_BIT
;
32 host
->version
= sdhci_readw(host
, SDHCI_HOST_VERSION
);
34 add_sdhci(host
, CONFIG_ZYNQ_SDHCI_MAX_FREQ
,
35 CONFIG_ZYNQ_SDHCI_MIN_FREQ
);
37 upriv
->mmc
= host
->mmc
;
43 static int arasan_sdhci_ofdata_to_platdata(struct udevice
*dev
)
45 struct sdhci_host
*host
= dev_get_priv(dev
);
47 host
->name
= dev
->name
;
48 host
->ioaddr
= (void *)dev_get_addr(dev
);
53 static const struct udevice_id arasan_sdhci_ids
[] = {
54 { .compatible
= "arasan,sdhci-8.9a" },
58 U_BOOT_DRIVER(arasan_sdhci_drv
) = {
59 .name
= "arasan_sdhci",
61 .of_match
= arasan_sdhci_ids
,
62 .ofdata_to_platdata
= arasan_sdhci_ofdata_to_platdata
,
63 .probe
= arasan_sdhci_probe
,
64 .priv_auto_alloc_size
= sizeof(struct sdhci_host
),