Chapter 2
Flash Device Driver
9
The following
ioctl
commands are supported:
The following
ioctl
commands are
not
supported:
Using Structures in IOCTL Arguments
The following sections describe the PROM information structure and the flash user
interface structure.
PROM Information Structure
The PROM information structure holds device information returned by the driver in
response to an identify command.
#define UIOCIBLK
(uflashIOC|0)
/* identify */
#define UIOCQBLK (uflashIOC|1)
/* query a block */
#define UIOCLBLK (uflashIOC|2)
/* lock a block */
#define UIOCCLCK (uflashIOC|4)
/* clear all locks */
#define UIOCEBLK (uflashIOC|5)
/* erase a block */
#define UIOCMLCK (uflashIOC|3)
/* master lock */
#define UIOCEALL (uflashIOC|6)
/* erase all unlocked blocks */
CODE
EXAMPLE
2-1
PROM Information Structure
/*
* PROM info structure.
*/
typedef struct {
uint16_t mfr_id; /* manufacturer id */
uint16_t dev_id; /* device id */
/* allow future expansion */
int8_t blk_status[256]; /* blks status filled
by driver */
int32_t blk_num; /* total # of blocks */
int32_t
blk_size;
/* # of bytes per block */
} uflash_info_t;