1 /*\r
2 * Copyright (c) 2016 - 2019, Texas Instruments Incorporated\r
3 * All rights reserved.\r
4 *\r
5 * Redistribution and use in source and binary forms, with or without\r
6 * modification, are permitted provided that the following conditions\r
7 * are met:\r
8 *\r
9 * * Redistributions of source code must retain the above copyright\r
10 * notice, this list of conditions and the following disclaimer.\r
11 *\r
12 * * Redistributions in binary form must reproduce the above copyright\r
13 * notice, this list of conditions and the following disclaimer in the\r
14 * documentation and/or other materials provided with the distribution.\r
15 *\r
16 * * Neither the name of Texas Instruments Incorporated nor the names of\r
17 * its contributors may be used to endorse or promote products derived\r
18 * from this software without specific prior written permission.\r
19 *\r
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"\r
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r
22 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
23 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\r
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\r
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\r
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;\r
27 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\r
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\r
29 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r
30 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r
31 *\r
32 */\r
33 \r
34 /**\r
35 *\r
36 * \file s25fl512s.h\r
37 *\r
38 * \brief This file contains S25Fl512S NOR device definitions\r
39 *\r
40 *****************************************************************************/\r
41 #ifndef S25Fl512S_H_\r
42 #define S25Fl512S_H_\r
43 \r
44 #include <ti/drv/spi/SPI.h>\r
45 \r
46 #ifdef __cplusplus\r
47 extern "C" {\r
48 #endif\r
49 \r
50 /**************************************************************************\r
51 ** Macro Definitions\r
52 **************************************************************************/\r
53 \r
54 /** Macro to enable 4 byte addressing */\r
55 /* #define EXT_ADDRESS_ENABLE (0U) */\r
56 \r
57 /** FLASH device specific items (note: sizes are in bytes) */\r
58 #define NOR_BLOCK_SIZE (256U * 1024U)\r
59 #define NOR_SECTOR_SIZE (0U)\r
60 #define NOR_SIZE (64U * 1024U * 1024U)\r
61 #define NOR_NUM_BLOCKS (NOR_SIZE / NOR_BLOCK_SIZE)\r
62 #define NOR_NUM_SECTORS (0U)\r
63 #define NOR_PAGE_SIZE (512U)\r
64 #define NOR_NUM_PAGES_PER_SECTOR (NOR_BLOCK_SIZE / NOR_PAGE_SIZE)\r
65 #define NOR_NUM_PAGES_PER_BLOCK (NOR_BLOCK_SIZE / NOR_PAGE_SIZE)\r
66 \r
67 /** Flash device commands */\r
68 #define NOR_BE_SECTOR_NUM (-1U)\r
69 #define NOR_CMD_BULK_ERASE (0x60U)\r
70 #define NOR_CMD_WRR (0x01U)\r
71 #define NOR_CMD_WREN (0x06U)\r
72 #define NOR_CMD_RDSR (0x05U)\r
73 #define NOR_CMD_RDCR (0x35U)\r
74 #define NOR_CMD_RDID (0x9FU)\r
75 \r
76 /** Different commands for 4 byte addressing and 3 byte addressing */\r
77 #ifdef EXT_ADDRESS_ENABLE\r
78 #define NOR_CMD_BLOCK_ERASE (0xDCU)\r
79 #define NOR_CMD_SECTOR_ERASE (0x0U)\r
80 #define NOR_CMD_READ (0x13U)\r
81 #define NOR_CMD_DUAL_READ (0x3CU)\r
82 #define NOR_CMD_QUAD_READ (0x6CU)\r
83 #define NOR_CMD_PAGE_PROG (0x12U)\r
84 #define NOR_CMD_QUAD_PAGE_PROG (0x34U)\r
85 #else\r
86 #define NOR_CMD_BLOCK_ERASE (0xD8U)\r
87 #define NOR_CMD_SECTOR_ERASE (0x0U)\r
88 #define NOR_CMD_READ (0x03U)\r
89 #define NOR_CMD_DUAL_READ (0x3BU)\r
90 #define NOR_CMD_QUAD_READ (0x6BU)\r
91 #define NOR_CMD_PAGE_PROG (0x02U)\r
92 #define NOR_CMD_QUAD_PAGE_PROG (0x32U)\r
93 #endif\r
94 \r
95 /* \brief Read ID command definitions */\r
96 #define NOR_RDID_NUM_BYTES (0x3U)\r
97 #define NOR_MANF_ID (0x01U) /* Manufacturer ID */\r
98 #define NOR_DEVICE_ID (0x0220) /* Device ID */\r
99 \r
100 /** Status Register, Write-in-Progress bit */\r
101 #define NOR_SR_WIP (1U << 0U)\r
102 \r
103 /** Dummy cycles for Read operation */\r
104 #define NOR_SINGLE_READ_DUMMY_CYCLE (0U)\r
105 #define NOR_DUAL_READ_DUMMY_CYCLE (8U)\r
106 #define NOR_QUAD_READ_DUMMY_CYCLE (8U)\r
107 \r
108 /** In Micro seconds */\r
109 #define NOR_PAGE_PROG_TIMEOUT (400U)\r
110 #define NOR_SECTOR_ERASE_TIMEOUT (600U * 1000U)\r
111 #define NOR_WRR_WRITE_TIMEOUT (600U * 1000U)\r
112 #define NOR_BULK_ERASE_TIMEOUT (110U * 1000U * 1000U)\r
113 \r
114 #define NOR_MANUFACTURE_ID (0x01U)\r
115 \r
116 #ifdef __cplusplus\r
117 }\r
118 #endif\r
119 \r
120 #endif /* S25Fl512S_H_ */\r
121 \r
122 /* Nothing past this point */\r