ftsdc010_mci.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Faraday FTSDC010 Secure Digital Memory Card Host Controller
  3. *
  4. * Copyright (C) 2011 Andes Technology Corporation
  5. * Macpaul Lin, Andes Technology Corporation <macpaul@andestech.com>
  6. *
  7. * SPDX-License-Identifier: GPL-2.0+
  8. */
  9. #include <mmc.h>
  10. #ifndef __FTSDC010_MCI_H
  11. #define __FTSDC010_MCI_H
  12. struct ftsdc010_chip {
  13. void __iomem *regs;
  14. uint32_t wprot; /* write protected (locked) */
  15. uint32_t rate; /* actual SD clock in Hz */
  16. uint32_t sclk; /* FTSDC010 source clock in Hz */
  17. uint32_t fifo; /* fifo depth in bytes */
  18. uint32_t acmd;
  19. struct mmc_config cfg; /* mmc configuration */
  20. const char *name;
  21. void *ioaddr;
  22. unsigned int caps;
  23. unsigned int version;
  24. unsigned int clock;
  25. unsigned int bus_hz;
  26. unsigned int div;
  27. int dev_index;
  28. int dev_id;
  29. int buswidth;
  30. u32 fifoth_val;
  31. struct mmc *mmc;
  32. void *priv;
  33. bool fifo_mode;
  34. };
  35. #ifdef CONFIG_DM_MMC
  36. /* Export the operations to drivers */
  37. int ftsdc010_probe(struct udevice *dev);
  38. extern const struct dm_mmc_ops dm_ftsdc010_ops;
  39. #endif
  40. void ftsdc_setup_cfg(struct mmc_config *cfg, const char *name, int buswidth,
  41. uint caps, u32 max_clk, u32 min_clk);
  42. void set_bus_width(struct ftsdc010_mmc __iomem *regs, struct mmc_config *cfg);
  43. #ifdef CONFIG_BLK
  44. int ftsdc010_bind(struct udevice *dev, struct mmc *mmc, struct mmc_config *cfg);
  45. #endif
  46. #endif /* __FTSDC010_MCI_H */