blob: 72a272f2ba0ee0c63d674b11c28881b477b1ebd7 [file] [log] [blame]
Michal Simek293eb332013-04-22 14:56:49 +02001/*
2 * (C) Copyright 2013 Inc.
3 *
4 * Xilinx Zynq SD Host Controller Interface
5 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02006 * SPDX-License-Identifier: GPL-2.0+
Michal Simek293eb332013-04-22 14:56:49 +02007 */
8
9#include <common.h>
10#include <malloc.h>
11#include <sdhci.h>
12#include <asm/arch/sys_proto.h>
13
14int 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;
Siva Durga Prasad Paladuguf9ec45d2014-01-22 09:17:09 +010026 host->quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD |
27 SDHCI_QUIRK_BROKEN_R1B;
Michal Simek293eb332013-04-22 14:56:49 +020028 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}