Internal Documentation
[DataFlash® Block Device]

Collaboration diagram for Internal Documentation:

Data Structures

struct  dataflash_breq
 DataFlash specific block device request. More...
struct  dataflash_bdev
 DataFlash specific block device. More...

Defines

#define DATAFLASH_BLOCK_SIZE   512
 The DataFlash block device block size.

Functions

static int8_t dataflash_get_page_block_shift (struct dataflash_breq *df_breq)
 Get DataFlash page size vs. block size shift value.
static bool dataflash_is_page_aligned (struct dataflash_breq *df_breq)
 Test if request currently is aligned into whole page.
static bool dataflash_store_page_size (struct dataflash_bdev *df_bdev, uint16_t page_size)
 Store DataFlash page size into shift value.
static uint16_t dataflash_get_remaining_page_size (struct dataflash_breq *df_breq)
 Get DataFlash remaining partial page size.
static void dataflash_submit (struct block_device *bdev, struct block_request *breq)
static int dataflash_submit_buf_list (struct block_device *bdev, struct block_request *breq, struct slist *buf_list)
static void dataflash_prepare_req (struct block_device *bdev, struct block_request *breq, block_addr_t lba, block_len_t nr_blocks, enum block_operation operation)
static struct block_requestdataflash_alloc_req (struct block_device *bdev)
static void dataflash_free_req (struct block_device *bdev, struct block_request *breq)
static void dataflash_detect (struct workqueue_task *task)
 Scan for AT45 DataFlash device.

Detailed Description

DataFlash state machine

When refering to buffer, that means the DataFlash built-in page buffer.

inline_dotgraph_1.dot

Define Documentation

#define DATAFLASH_BLOCK_SIZE   512

The DataFlash block device block size.

Definition at line 107 of file dataflash.c.

Referenced by dataflash_detect().


Function Documentation

static struct block_request* dataflash_alloc_req ( struct block_device bdev  )  [static, read]
static void dataflash_detect ( struct workqueue_task task  )  [static]
static void dataflash_free_req ( struct block_device bdev,
struct block_request breq 
) [static]
See also:
block_free_request

Definition at line 566 of file dataflash.c.

References mem_pool_free(), and dataflash_bdev::req_pool.

static int8_t dataflash_get_page_block_shift ( struct dataflash_breq df_breq  )  [static]

Get DataFlash page size vs. block size shift value.

The values for block size and page size are given in power-of-2 values. So this means that the difference between them can be represented as a bit shift operation.

Parameters:
df_breq DataFlash block request struct
Return values:
<0 Page size is smaller than block size
0 Identical page size and block size
>0 Page size is bigger than block size

Definition at line 180 of file dataflash.c.

References block_request::bdev, dataflash_breq::breq, and dataflash_bdev::page_block_shift.

Referenced by dataflash_get_remaining_page_size(), and dataflash_is_page_aligned().

static uint16_t dataflash_get_remaining_page_size ( struct dataflash_breq df_breq  )  [static]

Get DataFlash remaining partial page size.

For current transfer posisiton get the ramining size of (parital) page.

Parameters:
df_breq DataFlash block request struct

Definition at line 251 of file dataflash.c.

References assert, dataflash_get_page_block_shift(), dataflash_breq::lba, and dataflash_breq::remaining_blocks.

static bool dataflash_is_page_aligned ( struct dataflash_breq df_breq  )  [static]

Test if request currently is aligned into whole page.

Tests the alignment between page size and block size. This is tested for the current block request position.

Parameters:
df_breq DataFlash block request struct
Return values:
true Remaining data transfer is aligned toa whole page
false Remaining data transfer is for a partial page

Definition at line 197 of file dataflash.c.

References dataflash_get_page_block_shift(), dataflash_breq::lba, and dataflash_breq::remaining_blocks.

static void dataflash_prepare_req ( struct block_device bdev,
struct block_request breq,
block_addr_t  lba,
block_len_t  nr_blocks,
enum block_operation  operation 
) [static]
static bool dataflash_store_page_size ( struct dataflash_bdev df_bdev,
uint16_t  page_size 
) [static]

Store DataFlash page size into shift value.

Parameters:
df_bdev DataFlash block device struct
page_size Page size in bytes
Return values:
true Valid page size to store
false Invalid page size

Definition at line 226 of file dataflash.c.

References dataflash_bdev::page_block_shift.

Referenced by dataflash_detect().

static void dataflash_submit ( struct block_device bdev,
struct block_request breq 
) [static]
See also:
block_submit_req

Definition at line 504 of file dataflash.c.

References at45_request(), dataflash_bdev::at45d, and dataflash_breq::task.

Referenced by dataflash_alloc_req().

static int dataflash_submit_buf_list ( struct block_device bdev,
struct block_request breq,
struct slist buf_list 
) [static]
Generated on Thu Apr 29 14:10:34 2010 for xplain-bc by  doxygen 1.6.3