xref: /openbmc/u-boot/drivers/mmc/zynq_sdhci.c (revision 365475e6)
1 /*
2  * (C) Copyright 2013 Inc.
3  *
4  * Xilinx Zynq SD Host Controller Interface
5  *
6  * SPDX-License-Identifier:	GPL-2.0+
7  */
8 
9 #include <common.h>
10 #include <malloc.h>
11 #include <sdhci.h>
12 #include <asm/arch/sys_proto.h>
13 
14 int zynq_sdhci_init(u32 regbase)
15 {
16 	struct sdhci_host *host = NULL;
17 
18 	host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
19 	if (!host) {
20 		printf("zynq_sdhci_init: sdhci_host malloc fail\n");
21 		return 1;
22 	}
23 
24 	host->name = "zynq_sdhci";
25 	host->ioaddr = (void *)regbase;
26 	host->quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD |
27 		       SDHCI_QUIRK_BROKEN_R1B;
28 	host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
29 
30 	host->host_caps = MMC_MODE_HC;
31 
32 	add_sdhci(host, 52000000, 52000000 >> 9);
33 	return 0;
34 }
35