1 #ifndef _P30_STRATAFLASH_
2 #define _P30_STRATAFLASH_
31 #define uint16_t UINT16
34 #define uint32_t UINT32
37 #define uint64_t UINT64
46 #define P30_READ_ARRAY 0x00FF
47 #define P30_READ_ID 0x0090
48 #define P30_BUFFERED_PROGRAM 0x00E8
49 #define P30_BUFFERED_PROGRAM_CONFIRM 0x00D0
50 #define P30_BLOCK_LOCK_SETUP 0x0060
51 #define P30_BLOCK_UNLOCK 0x00D0
52 #define P30_BLOCK_ERASE_SETUP 0x0020
53 #define P30_BLOCK_ERASE_CONFIRM 0x00D0
54 #define P30_READ_CFI 0x0098
55 #define P30_READ_STATUS 0x0070
56 #define P30_CLEAR_STATUS 0x0050
60 #define P30_STAT_BLOCK_LOCKED 0x0002
61 #define P30_STAT_PROGRAM_SUSPENDED 0x0004
62 #define P30_STAT_VPP_LOW 0x0008
63 #define P30_STAT_PROGRAM_ERROR 0x0010
64 #define P30_STAT_ERASE_ERROR 0x0020
65 #define P30_STAT_ERASE_SUSPENDED 0x0040
66 #define P30_STAT_STATUS_READY 0x0080
69 #define TOTAL_NUMBLOCKS 0x102
70 #define MAIN_BLOCK_NUMBYTES 0x20000
71 #define PARM_BLOCK_NUMBYTES 0x8000
73 #define TOP_PARTITION_BASE 0xFF0000
74 #define BOTTOM_PARTITION_BASE 0x0000
76 #define TOP_BLOCK_LOWER 0xFF
77 #define TOP_BLOCK_UPPER 0x102
79 #define BOTTOM_BLOCK_LOWER 0x0
80 #define BOTTOM_BLOCK_UPPER 0x3
83 #define TOTAL_SIZE 0x2000000
84 #define BLOCK_MASK 0xFFFF
86 #define PRINT_POINTS 1
89 #define A3818_BPI_FLASH_AD (0x20) // R/W - BPI_FLASH TEST
90 #define A3818_BPI_FLASH_DT (0x24) // R/W
91 #define A3818_BPI_FLASH_CMD (0x28) // R/W
92 #define A3818_DMISCCS (0x08) // Device Miscellaneous Control Status
93 # define A3818_DMISCCS_SPI_BPI_FLASH_SEL (1 << 4) // BPI/SPI FLASH access select (default 0 = SPI FLASH)
96 #define mIsStatusReady(A) ( ( A & P30_STAT_STATUS_READY ) == P30_STAT_STATUS_READY )
116 unsigned int verifyFlash(uint32_t
handle,uint32_t *buffer, uint32_t bufferLength, uint32_t startWordAddress);
118 void writeFlash(uint32_t
handle, uint32_t *buffer, uint32_t bufferLength, uint32_t startWordAddress);
120 #endif // _P30_STRATAFLASH_