2006-12-24 21:46:55 +00:00
|
|
|
/*
|
2007-07-11 18:04:50 +00:00
|
|
|
* linux/drivers/mmc/core/mmc_ops.h
|
2006-12-24 21:46:55 +00:00
|
|
|
*
|
|
|
|
* Copyright 2006-2007 Pierre Ossman
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _MMC_MMC_OPS_H
|
|
|
|
#define _MMC_MMC_OPS_H
|
|
|
|
|
|
|
|
int mmc_select_card(struct mmc_card *card);
|
|
|
|
int mmc_deselect_cards(struct mmc_host *host);
|
2014-08-19 08:45:51 +00:00
|
|
|
int mmc_set_dsr(struct mmc_host *host);
|
2006-12-24 21:46:55 +00:00
|
|
|
int mmc_go_idle(struct mmc_host *host);
|
|
|
|
int mmc_send_op_cond(struct mmc_host *host, u32 ocr, u32 *rocr);
|
|
|
|
int mmc_all_send_cid(struct mmc_host *host, u32 *cid);
|
|
|
|
int mmc_set_relative_addr(struct mmc_card *card);
|
|
|
|
int mmc_send_csd(struct mmc_card *card, u32 *csd);
|
|
|
|
int mmc_send_status(struct mmc_card *card, u32 *status);
|
MMC core learns about SPI
Teach the MMC/SD/SDIO core about using SPI mode.
- Use mmc_host_is_spi() so enumeration works through SPI signaling
and protocols, not just the native versions.
- Provide the SPI response type flags with each request issued,
including requests from the new lock/unlock code.
- Understand that cmd->resp[0] and mmc_get_status() results for SPI
return different values than for "native" MMC/SD protocol; this
affects resetting, checking card lock status, and some others.
- Understand that some commands act a bit differently ... notably:
* OP_COND command doesn't return the OCR
* APP_CMD status doesn't have an R1_APP_CMD analogue
Those changes required some new and updated primitives:
- Provide utilities to access two SPI-only requests, and one
request that wasn't previously needed:
* mmc_spi_read_ocr() ... SPI only
* mmc_spi_set_crc() ... SPI only (override by module parm)
* mmc_send_cid() ... for use without broadcast mode
- Updated internal routines:
* Previous mmc_send_csd() modified into mmc_send_cxd_native();
it uses native "R2" responses, which include 16 bytes of data.
* Previous mmc_send_ext_csd() becomes new mmc_send_cxd_data()
helper for command-and-data access
* Bugfix to that mmc_send_cxd_data() code: dma-to-stack is
unsafe/nonportable, so kmalloc a bounce buffer instead.
- Modified mmc_send_ext_csd() now uses mmc_send_cxd_data() helper
- Modified mmc_send_csd(), and new mmc_spi_send_cid(), routines use
those helper routines based on whether they're native or SPI
The newest categories of cards supported by the MMC stack aren't expected
to work yet with SPI: MMC or SD cards with over 4GB data, and SDIO.
All those cards support SPI mode, so eventually they should work too.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
2007-08-08 16:11:32 +00:00
|
|
|
int mmc_send_cid(struct mmc_host *host, u32 *cid);
|
|
|
|
int mmc_spi_read_ocr(struct mmc_host *host, int highcap, u32 *ocrp);
|
|
|
|
int mmc_spi_set_crc(struct mmc_host *host, int use_crc);
|
2010-12-15 07:14:24 +00:00
|
|
|
int mmc_bus_test(struct mmc_card *card, u8 bus_width);
|
2011-10-18 05:26:42 +00:00
|
|
|
int mmc_send_hpi_cmd(struct mmc_card *card, u32 *status);
|
2014-10-20 09:33:53 +00:00
|
|
|
int mmc_can_ext_csd(struct mmc_card *card);
|
2015-05-07 10:10:19 +00:00
|
|
|
int mmc_switch_status_error(struct mmc_host *host, u32 status);
|
2015-09-15 13:19:45 +00:00
|
|
|
int __mmc_switch(struct mmc_card *card, u8 set, u8 index, u8 value,
|
|
|
|
unsigned int timeout_ms, bool use_busy_signal, bool send_status,
|
|
|
|
bool ignore_crc);
|
2006-12-24 21:46:55 +00:00
|
|
|
|
|
|
|
#endif
|
|
|
|
|