Commit Graph

12 Commits

Author SHA1 Message Date
Pedro F. Giffuni
453130d9bf sys/dev: minor spelling fixes.
Most affect comments, very few have user-visible effects.
2016-05-03 03:41:25 +00:00
Alexander Kabaev
6e0628d432 Use correct response bits for MMC_RSP_R4-R7 types 2016-03-27 23:19:21 +00:00
Oleksandr Tymoshenko
10b7c3bf45 Fix highest voltage detection
Submitted by:	Daisuke Aoyama <aoyama at peach.ne.jp>
Approved by:	imp@
2013-01-21 23:24:16 +00:00
Marius Strobl
7aa6584632 o Fixes:
- When switching to 4-bit operation, send a SET_CLR_CARD_DETECT command
    to disconnect the card-detect pull-up resistor from the DAT3 line before
    sending the SET_BUS_WIDTH command.
  - Add the missing "reserved" zero entry to the mantissa table used to
    decode various CSD fields. This was causing SD cards to report that they
    could run at 30 MHz instead of the maximum 25 MHz mandated in the spec.
o Enhancements:
  - At the MMC layer, format various info from the CID into a string that
    uniquely identifies the card instance (manufacturer number, serial
    number, product name and revision, etc). Export it as an instance
    variable.
  - At the MMCSD layer, display the formatted card ID string, and also
    report the clock speed of the hardware (not the card's max speed), and
    the number of bits and number of blocks per transfer. It comes out like
    this now:
    mmcsd0: 968MB <SD SD01G 8.0 SN 276886905 MFG 08/2008 by 3 SD> at mmc0
    22.5MHz/4bit/128-block
o Use DEVMETHOD_END.
o Use NULL instead of 0 for pointers.

PR:		156496
Submitted by:	Ian Lepore
MFC after:	1 week
2012-04-21 01:51:16 +00:00
Warner Losh
711873d44f o Define some symbols for a few items that are bare constants in the
code.
o Use NULL in preference to 0 for a few pointers.
o default to bus timing normal, like we default to bus_width_1.
2009-02-03 04:28:45 +00:00
Alexander Motin
3906d42d63 Implement BIO_DELETE command with MMC and SD erase commands.
Erase operation gives card's logic information about unused areas to help it
implement wear-leveling with lower overhead comparing to usual writing.
Erase is much faster then write and does not depends on data bus speed.
Also as result of hitting in-card write logic optimizations I have measured
up to 50% performance boost on writing undersized blocks into preerased areas.

At the same time there are strict limitations on size and allignment of erase
operations. We can erase only blocks aligned to the erase sector size and
with size multiple of it. Different cards has different erase sector size
which usually varies from 64KB to 4MB. SD cards actually allow to erase
smaller blocks, but it is much more expensive as it is implemented via
read-erase-write sequence and so not sutable for the BIO_DELETE purposes.

Reviewed by:	imp@
2008-10-18 16:17:04 +00:00
Alexander Motin
c18f1e2627 Set of mmc layer improvements:
- add MMC support.
 - add SDHC support.
 - add 4 and 8 bit bus width support.
 - add High Speed bus timing support.
2008-10-08 17:35:41 +00:00
Warner Losh
38c51cbe85 Define and use MMC_SECTOR_SIZE.
Make mmc_get_media_size now return an off_t and remove now useless cast.
2008-10-02 07:06:59 +00:00
Warner Losh
dece39ab88 Minor style fixes from mav@ (with similar problems fixed where I noticed
them):
	#define<tab>
	zero memory when we allocate it
	Put device name in error message.

Submitted by:	mav@
2008-09-29 18:17:23 +00:00
Warner Losh
8aaa15e202 The OCR register defines both acceptable voltage bits, as well as bits
for other things.  Mask out the voltage only bits when returning the
Vdd mask for voltage computation.

Submitted by:	mav@
2008-09-28 22:27:29 +00:00
Warner Losh
14eced725c A careful reading of the disclaimer that is required to download the
SD Simplified specification, as well as other SD and SDIO
implemenations I've examined, suggest this disclaimer may be required.
It is unclear to me exactly what the license would be for, or why it
might be required.  Err on the side of caution and include this
disclaimer so anybody deploying this code can judge for themselves.  I
have no further unformation about the details.
2007-05-26 05:23:36 +00:00
Warner Losh
114b4164dd Preliminary MMC stack. This stack supports SD 1.0 cards only, but
should be easily adapted to SD 2.0 (aka SDHC), SDIO, MMC and MMCplus
cards.  At the present time, there's only one bridge driver for the
ARM9 based Atmel AT91RM9200.
2006-10-20 06:39:59 +00:00