zynq_sdhci.c 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * (C) Copyright 2013 Inc.
  3. *
  4. * Xilinx Zynq SD Host Controller Interface
  5. *
  6. * This program is free software; you can redistribute it and/or modify it under
  7. * the terms of the GNU General Public License version 2 as published by the
  8. * Free Software Foundation; either version 2 of the License, or (at your
  9. * option) any later version.
  10. *
  11. * You should have received a copy of the GNU General Public License along with
  12. * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
  13. * Place, Suite 330, Boston, MA 02111-1307 USA
  14. */
  15. #include <common.h>
  16. #include <malloc.h>
  17. #include <sdhci.h>
  18. #include <asm/arch/sys_proto.h>
  19. int zynq_sdhci_init(u32 regbase)
  20. {
  21. struct sdhci_host *host = NULL;
  22. host = (struct sdhci_host *)malloc(sizeof(struct sdhci_host));
  23. if (!host) {
  24. printf("zynq_sdhci_init: sdhci_host malloc fail\n");
  25. return 1;
  26. }
  27. host->name = "zynq_sdhci";
  28. host->ioaddr = (void *)regbase;
  29. host->quirks = SDHCI_QUIRK_NO_CD | SDHCI_QUIRK_WAIT_SEND_CMD;
  30. host->version = sdhci_readw(host, SDHCI_HOST_VERSION);
  31. host->host_caps = MMC_MODE_HC;
  32. add_sdhci(host, 52000000, 52000000 >> 9);
  33. return 0;
  34. }