Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Fields
atmel_mci Struct Reference

Data Fields

spinlock_t lock
 
void __iomemregs
 
struct scatterlistsg
 
unsigned int pio_offset
 
unsigned intbuffer
 
unsigned int buf_size
 
dma_addr_t buf_phys_addr
 
struct atmel_mci_slotcur_slot
 
struct mmc_requestmrq
 
struct mmc_commandcmd
 
struct mmc_datadata
 
unsigned int data_size
 
struct atmel_mci_dma dma
 
struct dma_chandata_chan
 
struct dma_slave_config dma_conf
 
u32 cmd_status
 
u32 data_status
 
u32 stop_cmdr
 
struct tasklet_struct tasklet
 
unsigned long pending_events
 
unsigned long completed_events
 
enum atmel_mci_state state
 
struct list_head queue
 
bool need_clock_update
 
bool need_reset
 
struct timer_list timer
 
u32 mode_reg
 
u32 cfg_reg
 
unsigned long bus_hz
 
unsigned long mapbase
 
struct clkmck
 
struct platform_devicepdev
 
struct atmel_mci_slotslot [ATMCI_MAX_NR_SLOTS]
 
struct atmel_mci_caps caps
 
u32(* prepare_data )(struct atmel_mci *host, struct mmc_data *data)
 
void(* submit_data )(struct atmel_mci *host, struct mmc_data *data)
 
void(* stop_transfer )(struct atmel_mci *host)
 

Detailed Description

struct atmel_mci - MMC controller state shared between all slots : Spinlock protecting the queue and associated data. : Pointer to MMIO registers. : Scatterlist entry currently being processed by PIO or PDC code. : Offset into the current scatterlist entry. : Buffer used if we don't have the r/w proof capability. We don't have the time to switch pdc buffers so we have to use only one buffer for the full transaction. : size of the buffer. : buffer address needed for pdc. : The slot which is currently using the controller. : The request currently being processed on , or NULL if the controller is idle. : The command currently being sent to the card, or NULL. : The data currently being transferred, or NULL if no data transfer is in progress. : just data->blocks * data->blksz. : DMA client state. : DMA channel being used for the current data transfer. : Snapshot of SR taken upon completion of the current command. Only valid when EVENT_CMD_COMPLETE is pending. : Snapshot of SR taken upon completion of the current data transfer. Only valid when EVENT_DATA_COMPLETE or EVENT_DATA_ERROR is pending. : Value to be loaded into CMDR when the stop command is to be sent. : Tasklet running the request state machine. : Bitmask of events flagged by the interrupt handler to be processed by the tasklet. : Bitmask of events which the state machine has processed. : Tasklet state. : List of slots waiting for access to the controller. : Update the clock rate before the next request. : Reset controller before next request. : Timer to balance the data timeout error flag which cannot rise. : Value of the MR register. : Value of the CFG register. : The rate of in Hz. This forms the basis for MMC bus rate and timeout calculations. : Physical address of the MMIO registers. : The peripheral bus clock hooked up to the MMC controller. : Platform device associated with the MMC controller. : Slots sharing this MMC controller. : MCI capabilities depending on MCI version. : function to setup MCI before data transfer which depends on MCI capabilities. : function to start data transfer which depends on MCI capabilities. : function to stop data transfer which depends on MCI capabilities.

Locking

is a softirq-safe spinlock protecting as well as , and . These must always be updated at the same time while holding .

also protects mode_reg and need_clock_update since these are used to synchronize mode register updates with the queue processing.

The field of struct atmel_mci_slot is also protected by , and must always be written at the same time as the slot is added to .

and are accessed using atomic bit operations, so they don't need any locking.

None of the fields touched by the interrupt handler need any locking. However, ordering is important: Before EVENT_DATA_ERROR or EVENT_DATA_COMPLETE is set in , all data-related interrupts must be disabled and updated with a snapshot of SR. Similarly, before EVENT_CMD_COMPLETE is set, the CMDRDY interrupt must be disabled and updated with a snapshot of SR, and before EVENT_XFER_COMPLETE can be set, the bytes_xfered field of must be written. This is ensured by using barriers.

Definition at line 176 of file atmel-mci.c.

Field Documentation

dma_addr_t buf_phys_addr

Definition at line 184 of file atmel-mci.c.

unsigned int buf_size

Definition at line 183 of file atmel-mci.c.

unsigned int* buffer

Definition at line 182 of file atmel-mci.c.

unsigned long bus_hz

Definition at line 211 of file atmel-mci.c.

Definition at line 218 of file atmel-mci.c.

u32 cfg_reg

Definition at line 210 of file atmel-mci.c.

Definition at line 188 of file atmel-mci.c.

u32 cmd_status

Definition at line 196 of file atmel-mci.c.

unsigned long completed_events

Definition at line 202 of file atmel-mci.c.

Definition at line 186 of file atmel-mci.c.

Definition at line 189 of file atmel-mci.c.

struct dma_chan* data_chan

Definition at line 193 of file atmel-mci.c.

unsigned int data_size

Definition at line 190 of file atmel-mci.c.

u32 data_status

Definition at line 197 of file atmel-mci.c.

Definition at line 192 of file atmel-mci.c.

Definition at line 194 of file atmel-mci.c.

spinlock_t lock

Definition at line 177 of file atmel-mci.c.

unsigned long mapbase

Definition at line 212 of file atmel-mci.c.

struct clk* mck

Definition at line 213 of file atmel-mci.c.

u32 mode_reg

Definition at line 209 of file atmel-mci.c.

Definition at line 187 of file atmel-mci.c.

bool need_clock_update

Definition at line 206 of file atmel-mci.c.

bool need_reset

Definition at line 207 of file atmel-mci.c.

Definition at line 214 of file atmel-mci.c.

unsigned long pending_events

Definition at line 201 of file atmel-mci.c.

unsigned int pio_offset

Definition at line 181 of file atmel-mci.c.

u32(* prepare_data)(struct atmel_mci *host, struct mmc_data *data)

Definition at line 220 of file atmel-mci.c.

Definition at line 204 of file atmel-mci.c.

Definition at line 178 of file atmel-mci.c.

Definition at line 180 of file atmel-mci.c.

Definition at line 216 of file atmel-mci.c.

Definition at line 203 of file atmel-mci.c.

u32 stop_cmdr

Definition at line 198 of file atmel-mci.c.

void(* stop_transfer)(struct atmel_mci *host)

Definition at line 222 of file atmel-mci.c.

Definition at line 221 of file atmel-mci.c.

Definition at line 200 of file atmel-mci.c.

Definition at line 208 of file atmel-mci.c.


The documentation for this struct was generated from the following file: