drivers/sdmmc/mcihost.c File Reference

SD/MMC MCI host driver. More...

#include <stdbool.h>
#include <string.h>
#include <debug.h>
#include <delayed_work.h>
#include <bitops.h>
#include <io.h>
#include <interrupt.h>
#include <irq_handler.h>
#include <softirq.h>
#include <status-codes.h>
#include <util.h>
#include <slist.h>
#include <timeout.h>
#include <workqueue.h>
#include <buffer.h>
#include <malloc.h>
#include <dmac/dma_controller.h>
#include <chip/clk.h>
#include <chip/portmux.h>
#include <chip/irq-map.h>
#include <sdmmc/sdmmc.h>
#include <sdmmc/mcihost.h>
#include "protocol.h"
#include "mci_regs.h"
#include <board/sdmmc.h>
#include <app/softirq.h>
#include <app/timer.h>
#include <app/workqueue.h>

Include dependency graph for mcihost.c:

Go to the source code of this file.

Enumerations

enum  sdmmc_mcihost_state {
  STATE_IDLE = 0, STATE_SENDING_CMD, STATE_DATA_XFER, STATE_SENDING_STOP,
  STATE_FINISH_REQ, STATE_CARD_STATUS
}
enum  mci_send_cmd_flags { MCI_SEND_CMD_STOP, MCI_SEND_CMD_WRITE }

Functions

static void sdmmc_mcihost_load_data (struct sdmmc_mcihost *mcihost)
 Process the DMA queue.
struct sdmmc_hostsdmmc_mcihost_init ()
 Initialize SD/MMC MCI host driver.


Detailed Description

SD/MMC MCI host driver.

SD/MMC MCI host driver providing interface between host layer and hardware.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file mcihost.c.


Enumeration Type Documentation

Enumerator:
MCI_SEND_CMD_STOP  CMD is a STOP command
MCI_SEND_CMD_WRITE  CMD is a write command

Definition at line 135 of file mcihost.c.

Enumerator:
STATE_IDLE  Initial state.
STATE_SENDING_CMD  Sending initial command.
STATE_DATA_XFER  Data transfer to/from card.
STATE_SENDING_STOP  Sending STOP command.
STATE_FINISH_REQ  Waiting for XFRDONE.
STATE_CARD_STATUS  Check card status.

Definition at line 96 of file mcihost.c.


Function Documentation

struct sdmmc_host* sdmmc_mcihost_init ( void   )  [read]

Initialize SD/MMC MCI host driver.

Returns:
0 on success, or a negative error code on failure.

Definition at line 1090 of file mcihost.c.

References BOARD_MCISLOT_A_CD, dbg_panic, dbg_printf, delayed_work_init(), DMAC_REG_WIDTH_32BIT, dmac_req_init(), get_mci_pclk_rate(), memset(), min, sdmmc_cd_init(), SDMMC_OCR_V_32_33, SDMMC_OCR_V_33_34, sdmmc_slot_init(), setup_irq_handler, slist_init(), softirq_set_handler(), and workqueue_init_item().

Here is the call graph for this function:

static void sdmmc_mcihost_load_data ( struct sdmmc_mcihost *  mcihost  )  [static]


Generated on Tue Sep 15 10:19:41 2009 for libavr32 by  doxygen 1.5.8