blob: 610bef5cbaeff45c37f70031017fba83b5accb14 [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;
26 host->quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD;
27 host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
28
29 host->host_caps = MMC_MODE_HC;
30
31 add_sdhci(host, 52000000, 52000000 >> 9);
32 return 0;
33}