2 * (C) Copyright 2013 Inc.
4 * Xilinx Zynq SD Host Controller Interface
6 * SPDX-License-Identifier: GPL-2.0+
14 #include <asm/arch/sys_proto.h>
16 int zynq_sdhci_init(u32 regbase
)
18 struct sdhci_host
*host
= NULL
;
20 host
= (struct sdhci_host
*)malloc(sizeof(struct sdhci_host
));
22 printf("zynq_sdhci_init: sdhci_host malloc fail\n");
26 host
->name
= "zynq_sdhci";
27 host
->ioaddr
= (void *)regbase
;
28 host
->quirks
= SDHCI_QUIRK_NO_CD
| SDHCI_QUIRK_WAIT_SEND_CMD
|
29 SDHCI_QUIRK_BROKEN_R1B
;
30 host
->version
= sdhci_readw(host
, SDHCI_HOST_VERSION
);
32 host
->host_caps
= MMC_MODE_HC
;
34 add_sdhci(host
, 52000000, 52000000 >> 9);
38 #ifdef CONFIG_OF_CONTROL
39 int zynq_sdhci_of_init(const void *blob
)
45 debug("ZYNQ SDHCI: Initialization\n");
48 offset
= fdt_node_offset_by_compatible(blob
, offset
,
51 reg
= fdtdec_get_addr(blob
, offset
, "reg");
52 if (reg
!= FDT_ADDR_T_NONE
) {
53 ret
|= zynq_sdhci_init(reg
);
55 debug("ZYNQ SDHCI: Can't get base address\n");
59 } while (offset
!= -1);