haiku/headers/private/drivers
Anarchos 74b6097078 sd/mmc: read, naive method
First implementation of reading sectors from an SD card.
This is not the best performance for many reasons:
- No DMA
- Reads only one sector at a time
- Cannot read more than 512 bytes per syscall

Also there are major limitations:
- Cannot read less than 512 bytes. The hardware of course works in full
  sectors. The mmc_disk driver should go through the io scheduler to
  make sure requests have a reasonable size and offset, and nothing
  tries to read just a few bytes in the middle of a sector.
- SD cards only (no SDHC, no MMC)

Architecture problems:
I think too much of the implementation is done in sdhci_pci and should
be moved to the upper layers. However it is difficult to say without
having implemented DMA (which indeed will be at the low level of the
sdhci controller). It doesn't help that the order of operations is a
bit different depending on wether there is DMA or not. In DMA mode you
first prepare the buffer, then run the command. In non-DMA mode you
first send the command, then read the data into the buffer. We need an
API at the mmc_bus level that doesn't care about that low-level detail.
There are other things that the MMC bus should be doing however, such
as switching to different clock speeds depending on which card is
activated and how fast it can go.

At least the following should be done:
- The read method for mmc_bus and sdhci_pci should use a scatter-gather
structure as a parameter instead of a single buffer
- See if can be integrated into ExecuteCommand at sdhci level (it's
essentially a command with an additional data phase)

Change-Id: I688b6c694561074535c9c0c2545f06dc04b06e7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3466
Reviewed-by: Jérôme Duval <jerome.duval@gmail.com>
2020-12-13 18:56:19 +00:00
..
ata_adapter.h Reworked little endian bitfields a bit. 2015-11-10 08:47:48 +01:00
ata_types.h Reworked little endian bitfields a bit. 2015-11-10 08:47:48 +01:00
dvb.h Interface definition of DVB drivers. Currently private API. 2007-04-13 15:52:58 +00:00
ksocket.h Fixed ksocket header as we don't use a socket module anymore. 2008-04-19 23:58:26 +00:00
lendian_bitfield.h Reworked little endian bitfields a bit. 2015-11-10 08:47:48 +01:00
mmc.h sd/mmc: read, naive method 2020-12-13 18:56:19 +00:00
poke.h Fixed some bugs, partially by Oscar Lesta. 2005-07-19 17:19:02 +00:00
random.h random: add a Virtio RNG module 2013-08-29 18:47:48 +02:00
scsi_cmds.h Reworked little endian bitfields a bit. 2015-11-10 08:47:48 +01:00
scsi_periph.h scsi: Use _res and not res in MK_ERROR. 2018-06-18 22:05:45 -04:00
scsi_sense.h Revert "usb_disk: retry when usb disk not ready" 2013-10-19 22:06:10 +02:00
smbios.h smbios: add module to match SMBios vendor and product 2020-04-27 07:38:40 +00:00
tty.h * Set reasonable terminal flag defaults. This makes telnetd fully usable 2008-04-24 21:26:35 +00:00