summaryrefslogtreecommitdiffstats
path: root/include/mci.h
Commit message (Collapse)AuthorAgeFilesLines
* mci: Use tran_speed field to fix highspeed MMC card clockSascha Hauer2013-06-201-1/+1
| | | | | | | | | | | | | | | The tran_speed field as decoded from csd is valid in most cases, so use it to determine the maximum clock we can support. It is not valid though for MMC highspeed cards, in this case the csd contains invalid values and we have to set tran_speed explicitly to the maximum speed. As the values passed into mci_set_clock are now based on tran_speed we no longer have to limit the rate to tran_speed in mci_set_clock. The (intended) effect of this patch is that highspeed MMC cards are no longer limited to non highspeed rates. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: provide static inline function for mmc_host_is_spiSascha Hauer2013-06-201-6/+8
| | | | | | | | | | To prevent compiler warnings like: warning: unused variable 'host' When CONFIG_MCI_SPI is disabled. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: rename capabilities flagsSascha Hauer2013-06-031-5/+6
| | | | | | | | | | Use MMC_CAP_ names instead of MMC_MODE_. This makes it more clear that these are capabilities of host/card and do not refer to the current mode. These are in line with the Linux Kernel except for MMC_CAP_MMC_HIGHSPEED_52MHZ which could be fixed later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add devicetree helper functionSascha Hauer2013-05-311-0/+1
| | | | | | | This adds helper code to parse the bus-width and max-frequency property from devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: implement detect driver callbackSascha Hauer2013-05-311-2/+4
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: embed mci device into struct mciSascha Hauer2013-05-301-1/+1
| | | | | | To safe a separate allocation and to make the code simpler. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add support for MMC boot partitionsSascha Hauer2013-05-301-1/+30
| | | | | | | | | | | | | | | | | Some MMC cards support boot partitions. These are special regions on the MMC card intended to put a bootloader on. This patch adds support for these partitions, they are accessible as /dev/diskx.boot[0|1]. Additionally the partitions can be configured bootable using a device parameter. This can be used to mark the user area or one of the boot partitions as bootable. Since this feature is mostly seen on eMMC cards it is made optional to lower the size impact for boards which do not have eMMC. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Use dev_add_param_int for probe parameterSascha Hauer2013-04-111-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: add card_write_protectedJean-Christophe PLAGNIOL-VILLARD2013-01-271-0/+2
| | | | | | | | | Currently there is no common way for the mci host driver to tell that thee car is write protected. This adds a card_write_protected callback which is used by the framework to tell whether it's protected or not. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add card_present callbackSascha Hauer2013-01-201-0/+2
| | | | | | | | Currently there is no common way for the mci host driver to tell that there is no card present. This adds a card_present callback which is used by the framework to tell whether it's present or not. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Allow to specify device nameSascha Hauer2012-12-171-0/+1
| | | | | | | | When multiple MMC/SD cards are present in the system we often have to have persistent names to identify them during runtime. This patch allows to overwrite the devicename which is used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Fix 8 bit mmc cardsSascha Hauer2012-02-091-0/+1
| | | | | | | | | | Currently we test the cards capabilities for being 8bit capable. This does not work since noone ever sets this bit. Unfortunately there is no bit to test 8bit capability, so we introduce a patch from the kernel which puts the mmc card into 8bit mode and tests whether it can succesfully read the ext_csd in this mode. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add a complete list of EXT_CSD_* fields from the kernelSascha Hauer2012-02-091-5/+45
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Use struct mci for internal argument passingSascha Hauer2012-02-091-5/+2
| | | | | | | | | The mci layer currently passes around a struct device_d for its internal use. Apart from being confusing this drops typesafety for no good reason. Instead, pass around a struct mci. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: remove unused device argument from set_iosSascha Hauer2012-02-091-1/+1
| | | | | | This argmuent is unused in all drivers, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci core: replace discrete ios values with struct iosSascha Hauer2012-02-091-1/+31
| | | | | | | As we'll need more arguments to set_ios over time put them in a struct mci_ios like the kernel does. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: use card type definitionsSascha Hauer2012-02-091-1/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add complete definitions for the card typeSascha Hauer2012-02-091-2/+10
| | | | | | | Add the different DDR types and also a definition for the card type mask. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use generic block layer to access the drives and do partition parsingJuergen Beisert2011-11-281-1/+2
| | | | | | | Change all relevant blockdevice users to the simplified interface. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: Add MCI over SPI supportFranck Jullien2011-11-251-0/+18
| | | | | | | | | | | This patch adds MMC over SPI support to mci-core.c and mci_spi.c driver. This driver is useful when SOC doesn't have built-in MCI component. Tested with nios, 2Go SD-CARD and FAT file system. Signed-off-by: Franck Jullien <franck.jullien@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mci: embed mci_dev into mci_host instead of allocating it seperatelySascha Hauer2011-08-151-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add MCI card support to bareboxJuergen Beisert2010-10-111-0/+239
This adds the basic framework to handle MCI cards in barebox. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>