Linux Kernel
3.7.1
|
#include <linux/init.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/interrupt.h>
#include <linux/mutex.h>
#include <linux/math64.h>
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/mod_devicetable.h>
#include <linux/mtd/cfi.h>
#include <linux/mtd/mtd.h>
#include <linux/mtd/partitions.h>
#include <linux/of_platform.h>
#include <linux/spi/spi.h>
#include <linux/spi/flash.h>
Go to the source code of this file.
Data Structures | |
struct | m25p |
struct | flash_info |
Macros | |
#define | OPCODE_WREN 0x06 /* Write enable */ |
#define | OPCODE_RDSR 0x05 /* Read status register */ |
#define | OPCODE_WRSR 0x01 /* Write status register 1 byte */ |
#define | OPCODE_NORM_READ 0x03 /* Read data bytes (low frequency) */ |
#define | OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */ |
#define | OPCODE_PP 0x02 /* Page program (up to 256 bytes) */ |
#define | OPCODE_BE_4K 0x20 /* Erase 4KiB block */ |
#define | OPCODE_BE_32K 0x52 /* Erase 32KiB block */ |
#define | OPCODE_CHIP_ERASE 0xc7 /* Erase whole flash chip */ |
#define | OPCODE_SE 0xd8 /* Sector erase (usually 64KiB) */ |
#define | OPCODE_RDID 0x9f /* Read JEDEC ID */ |
#define | OPCODE_BP 0x02 /* Byte program */ |
#define | OPCODE_WRDI 0x04 /* Write disable */ |
#define | OPCODE_AAI_WP 0xad /* Auto address increment word program */ |
#define | OPCODE_EN4B 0xb7 /* Enter 4-byte mode */ |
#define | OPCODE_EX4B 0xe9 /* Exit 4-byte mode */ |
#define | OPCODE_BRWR 0x17 /* Bank register write */ |
#define | SR_WIP 1 /* Write in progress */ |
#define | SR_WEL 2 /* Write enable latch */ |
#define | SR_BP0 4 /* Block protect 0 */ |
#define | SR_BP1 8 /* Block protect 1 */ |
#define | SR_BP2 0x10 /* Block protect 2 */ |
#define | SR_SRWD 0x80 /* SR write protect */ |
#define | MAX_READY_WAIT_JIFFIES (40 * HZ) /* M25P16 specs 40s max chip erase */ |
#define | MAX_CMD_SIZE 5 |
#define | OPCODE_READ OPCODE_NORM_READ |
#define | FAST_READ_DUMMY_BYTE 0 |
#define | JEDEC_MFR(_jedec_id) ((_jedec_id) >> 16) |
#define | SECT_4K 0x01 /* OPCODE_BE_4K works uniformly */ |
#define | M25P_NO_ERASE 0x02 /* No erase command needed */ |
#define | INFO(_jedec_id, _ext_id, _sector_size, _n_sectors, _flags) |
#define | CAT25_INFO(_sector_size, _n_sectors, _page_size, _addr_width) |
Functions | |
MODULE_DEVICE_TABLE (spi, m25p_ids) | |
module_spi_driver (m25p80_driver) | |
MODULE_LICENSE ("GPL") | |
MODULE_AUTHOR ("Mike Lavender") | |
MODULE_DESCRIPTION ("MTD SPI driver for ST M25Pxx flash chips") | |
#define CAT25_INFO | ( | _sector_size, | |
_n_sectors, | |||
_page_size, | |||
_addr_width | |||
) |
#define INFO | ( | _jedec_id, | |
_ext_id, | |||
_sector_size, | |||
_n_sectors, | |||
_flags | |||
) |
#define MAX_READY_WAIT_JIFFIES (40 * HZ) /* M25P16 specs 40s max chip erase */ |
#define OPCODE_AAI_WP 0xad /* Auto address increment word program */ |
#define OPCODE_FAST_READ 0x0b /* Read data bytes (high frequency) */ |
#define OPCODE_NORM_READ 0x03 /* Read data bytes (low frequency) */ |
#define OPCODE_READ OPCODE_NORM_READ |
MODULE_AUTHOR | ( | "Mike Lavender" | ) |
MODULE_DEVICE_TABLE | ( | spi | , |
m25p_ids | |||
) |
MODULE_LICENSE | ( | "GPL" | ) |
module_spi_driver | ( | m25p80_driver | ) |