sdhci.h 832 B

1234567891011121314151617181920212223
  1. /* Polled SDHCI/eMMC driver for the Intel Braswell MMC controller. */
  2. #ifndef SDHCI_H
  3. #define SDHCI_H
  4. struct sdhci_disk {
  5. unsigned int sectors; /* 512-byte sectors */
  6. char model[41];
  7. };
  8. /* Probe the Intel MMC controller and initialise the eMMC. Returns the
  9. * number of disks found (0 or 1); the result is cached after the first
  10. * call. Logs the PCI id, BAR, capabilities and eMMC capacity to COM1. */
  11. unsigned int sdhci_scan(struct sdhci_disk *out, unsigned int max);
  12. /* 512-byte-sector I/O on the selected eMMC. Returns 0 on success. */
  13. int sdhci_read_sectors(unsigned int lba, void *buf, unsigned int count);
  14. int sdhci_write_sectors(unsigned int lba, const void *buf, unsigned int count);
  15. /* The eMMC write path completes on the write command; there is no host
  16. * cache to flush. */
  17. int sdhci_flush(void);
  18. #endif