aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2013-03-06 06:01:35 -0500
committerDavid Woodhouse <David.Woodhouse@intel.com>2013-04-05 08:14:17 -0400
commita6fb35d3790aeaaaa50575c68fa188da29da6ecf (patch)
tree52a23a6714fed9fa1ff32817698a584d55d40f55 /drivers/mtd
parent1f816bc729fd5dec7c3633b0a54b75dc7a1fea0f (diff)
mtd: bcm47xxsflash: define opcodes
We need them to add erase/write support. This may duplicate some defines with bcma and/or ssb code, but it makes more sense to keep that in bcm47xxsflash which is supposed to work with both buses. Duplicated defines will be removed from ssb/bcma. Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/devices/bcm47xxsflash.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/mtd/devices/bcm47xxsflash.h b/drivers/mtd/devices/bcm47xxsflash.h
index 44985294ed8f..f22f8c46dfc0 100644
--- a/drivers/mtd/devices/bcm47xxsflash.h
+++ b/drivers/mtd/devices/bcm47xxsflash.h
@@ -3,6 +3,54 @@
3 3
4#include <linux/mtd/mtd.h> 4#include <linux/mtd/mtd.h>
5 5
6/* Used for ST flashes only. */
7#define OPCODE_ST_WREN 0x0006 /* Write Enable */
8#define OPCODE_ST_WRDIS 0x0004 /* Write Disable */
9#define OPCODE_ST_RDSR 0x0105 /* Read Status Register */
10#define OPCODE_ST_WRSR 0x0101 /* Write Status Register */
11#define OPCODE_ST_READ 0x0303 /* Read Data Bytes */
12#define OPCODE_ST_PP 0x0302 /* Page Program */
13#define OPCODE_ST_SE 0x02d8 /* Sector Erase */
14#define OPCODE_ST_BE 0x00c7 /* Bulk Erase */
15#define OPCODE_ST_DP 0x00b9 /* Deep Power-down */
16#define OPCODE_ST_RES 0x03ab /* Read Electronic Signature */
17#define OPCODE_ST_CSA 0x1000 /* Keep chip select asserted */
18#define OPCODE_ST_SSE 0x0220 /* Sub-sector Erase */
19
20/* Used for Atmel flashes only. */
21#define OPCODE_AT_READ 0x07e8
22#define OPCODE_AT_PAGE_READ 0x07d2
23#define OPCODE_AT_STATUS 0x01d7
24#define OPCODE_AT_BUF1_WRITE 0x0384
25#define OPCODE_AT_BUF2_WRITE 0x0387
26#define OPCODE_AT_BUF1_ERASE_PROGRAM 0x0283
27#define OPCODE_AT_BUF2_ERASE_PROGRAM 0x0286
28#define OPCODE_AT_BUF1_PROGRAM 0x0288
29#define OPCODE_AT_BUF2_PROGRAM 0x0289
30#define OPCODE_AT_PAGE_ERASE 0x0281
31#define OPCODE_AT_BLOCK_ERASE 0x0250
32#define OPCODE_AT_BUF1_WRITE_ERASE_PROGRAM 0x0382
33#define OPCODE_AT_BUF2_WRITE_ERASE_PROGRAM 0x0385
34#define OPCODE_AT_BUF1_LOAD 0x0253
35#define OPCODE_AT_BUF2_LOAD 0x0255
36#define OPCODE_AT_BUF1_COMPARE 0x0260
37#define OPCODE_AT_BUF2_COMPARE 0x0261
38#define OPCODE_AT_BUF1_REPROGRAM 0x0258
39#define OPCODE_AT_BUF2_REPROGRAM 0x0259
40
41/* Status register bits for ST flashes */
42#define SR_ST_WIP 0x01 /* Write In Progress */
43#define SR_ST_WEL 0x02 /* Write Enable Latch */
44#define SR_ST_BP_MASK 0x1c /* Block Protect */
45#define SR_ST_BP_SHIFT 2
46#define SR_ST_SRWD 0x80 /* Status Register Write Disable */
47
48/* Status register bits for Atmel flashes */
49#define SR_AT_READY 0x80
50#define SR_AT_MISMATCH 0x40
51#define SR_AT_ID_MASK 0x38
52#define SR_AT_ID_SHIFT 3
53
6struct bcma_drv_cc; 54struct bcma_drv_cc;
7 55
8enum bcm47xxsflash_type { 56enum bcm47xxsflash_type {