mirror of
https://github.com/apache/nuttx.git
synced 2026-08-18 20:18:17 +00:00
The SD path never performs the CMD6 switch its eMMC counterpart has performed for years, so an SD card is left in default speed and every host clocked accordingly, at 25MHz rather than the 50MHz the card supports. A TODO in this file has asked for it since 2010; this removes it. A host asks for the switch by reporting SDIO_CAPS_SD_HS_MODE, which mirrors the eMMC capability beside it. The switch is attempted once the bus is at the default transfer rate and the wide bus is selected, and the card's own answer decides the outcome: the 64 byte status block reports the function actually selected, and a card that cannot do what was asked says so there rather than failing the command. Cards below version 1.10 of the physical layer specification are not asked, since CMD6 postdates them. Only a confirmed switch reaches the host, as the new CLOCK_SD_TRANSFER_4BIT_HS rate. That is a rate rather than a flag on an existing one because the host is clocked twice during initialization, once before the switch can have happened, and a host that cannot tell the two apart would run a card in default speed past its rated 25MHz. The enumerator is added last, so no existing driver's switch statement changes meaning, and the rate reaches only a host that reported the new capability, which none in tree does. Every failure path is survivable: a card that declines, a card too old to ask, and a host that never asks all stay at the default rate. Documents the two capabilities and the clock rates a lower half has to handle. The MMC/SD documentation was three sentences and a pointer to the SDIO page, so it said nothing about how a card is registered, how the bus width and clock are negotiated, or what any of the configuration options do. It now covers those, the ioctl interface and /proc/mmcsd, and the high speed switch this commit adds is described where somebody looking for it would look rather than only in the SDIO lower half page. Assisted-by: Claude:claude-opus-5 Signed-off-by: Justin Hammond <justin@dynam.ac> |
||
|---|---|---|
| .. | ||
| android | ||
| arpa | ||
| crypto | ||
| cxx | ||
| net | ||
| netinet | ||
| netpacket | ||
| nuttx | ||
| ssp | ||
| sys | ||
| .gitignore | ||
| aio.h | ||
| alloca.h | ||
| assert.h | ||
| byteswap.h | ||
| ctype.h | ||
| debug.h | ||
| dirent.h | ||
| dlfcn.h | ||
| dsp.h | ||
| dspb16.h | ||
| elf.h | ||
| elf32.h | ||
| elf64.h | ||
| endian.h | ||
| err.h | ||
| errno.h | ||
| execinfo.h | ||
| fcntl.h | ||
| fixedmath.h | ||
| fnmatch.h | ||
| ftw.h | ||
| gcov.h | ||
| getopt.h | ||
| glob.h | ||
| grp.h | ||
| hex2bin.h | ||
| iconv.h | ||
| ifaddrs.h | ||
| imx_container.h | ||
| inttypes.h | ||
| iso646.h | ||
| langinfo.h | ||
| libgen.h | ||
| libintl.h | ||
| limits.h | ||
| locale.h | ||
| lzf.h | ||
| malloc.h | ||
| mqueue.h | ||
| netdb.h | ||
| nl_types.h | ||
| nxflat.h | ||
| obstack.h | ||
| poll.h | ||
| pthread.h | ||
| pty.h | ||
| pwd.h | ||
| regex.h | ||
| resolv.h | ||
| sched.h | ||
| search.h | ||
| semaphore.h | ||
| shadow.h | ||
| signal.h | ||
| spawn.h | ||
| stdbool.h | ||
| stddef.h | ||
| stdint.h | ||
| stdio.h | ||
| stdlib.h | ||
| stdnoreturn.h | ||
| string.h | ||
| strings.h | ||
| syscall.h | ||
| syslog.h | ||
| termios.h | ||
| threads.h | ||
| time.h | ||
| ulimit.h | ||
| unistd.h | ||
| utime.h | ||
| uuid.h | ||
| wait.h | ||
| wchar.h | ||
| wctype.h | ||