Do you have driver software for 4-bit SDIO? I've looked a bit on the internet and not found driver software. The mbed K64F uses SPI for its onboard microSD, though MCU supports SDHC/SDIO.
I've made a bit of progress
experimenting with SDHC on mbed K64F. Here is a link describing an RTOS implementation of SDHC driver
https://community.freescale.com/thread/85176
I downloaded the brtos.rar and hacked away. The driver does talk directly to the SDHC module (no SPI), but doesn't utilize the FIFO or DMA. I got driver to read a sector of my choosing from a SanDisk microSD card. Driver is reading 32-bit data from SDHC_DATPORT register in a loop. With 120MHz K64F, driver sets SDHC clock to 20mhz. I get 4.9mbs (megabits/sec) reading a 512-byte sector (1-bit width). I don't have a fast SPI driver for the SDHC, but @120mhz, teensy SdFat SPI (FIFO/16-bit) can do 27mbs. A simple byte-loop SPI read of the microSD on the K64F's SDHC runs at 2.7mbs, even with the SPI clock @30mhz.
i'll see what i can figure out about SDHC FIFO, high speed (50mbs), and DMA ...
EDIT: setting to 4-bit width, get modest improvement to 6.2mbs (you have to configure the card to use 4-bit and the SDHC module). Here are bits in the two main SDHC control registers
Code:
SDHC_SYSCTL 0xe0128
SDHC_PROCTL 0x2a
EDIT 2:
I upped the clock to 40mhz, and think I enabled FIFO, but the data rate improvement was negligible (6.3mbs). The sector read's were correct.
The slow data rate is due to a 630us delay in
while (SDHC_PRSSTAT & SDHC_PRSSTAT_DLA_MASK){};
If i put a testpin toggle around the the word-copy loop in the driver and use a logic analyzer, I measure 137mbs. In FIFO mode, with a 16-word threshold, I measure 400mbs to read the 512-byte sector from the SDHC buffer/FIFO. If I remove the while(), then the sector read returns bad data. If the timed sector read is not the first disk_read(), the delay is reduced to 280us, effective data rate of 14mbs. Presumably a multi-sector read would amortize the delay (though I haven't succeeded yet with a multi-sector read).
EDIT 3: The driver must be out of sync with DLA. The DLA wait-times are the short duration numbers, the longer times are data transfer times. so 400mbs rate is just time for reading words from DATPORT. The SDHC hardware has a 512-byte FIFO/buffer, when DLA is no longer active, the program can read from the DATPORT (32 bits), or use DMA (see K66 beta testing WMXZ driver and
uSDFS)
uTasker also has a kinetis SDHC driver.