2 * Copyright (c) 2013-2017 ARM Limited. All rights reserved.
4 * SPDX-License-Identifier: Apache-2.0
6 * Licensed under the Apache License, Version 2.0 (the License); you may
7 * not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS, WITHOUT
14 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
21 * Project: NAND Flash Driver definitions
26 * Extended ARM_NAND_ECC_INFO structure
28 * ARM_NAND_STATUS made volatile
30 * Updated ARM_NAND_ECC_INFO structure and ARM_NAND_ECC_xxx definitions
32 * New simplified driver:
33 * complexity moved to upper layer (command agnostic)
35 * NV-DDR & NV-DDR2 Interface (ONFI specification)
36 * VCC, VCCQ and VPP Power Supply Control
37 * WP (Write Protect) Control
39 * Changed prefix ARM_DRV -> ARM_DRIVER
41 * Namespace prefix ARM_ added
46 #ifndef DRIVER_NAND_H_
47 #define DRIVER_NAND_H_
54 #include "Driver_Common.h"
56 #define ARM_NAND_API_VERSION ARM_DRIVER_VERSION_MAJOR_MINOR(2,3) /* API version */
59 /****** NAND Device Power *****/
60 #define ARM_NAND_POWER_VCC_Pos 0
61 #define ARM_NAND_POWER_VCC_Msk (0x07UL << ARM_NAND_POWER_VCC_Pos)
62 #define ARM_NAND_POWER_VCC_OFF (0x01UL << ARM_NAND_POWER_VCC_Pos) ///< VCC Power off
63 #define ARM_NAND_POWER_VCC_3V3 (0x02UL << ARM_NAND_POWER_VCC_Pos) ///< VCC = 3.3V
64 #define ARM_NAND_POWER_VCC_1V8 (0x03UL << ARM_NAND_POWER_VCC_Pos) ///< VCC = 1.8V
65 #define ARM_NAND_POWER_VCCQ_Pos 3
66 #define ARM_NAND_POWER_VCCQ_Msk (0x07UL << ARM_NAND_POWER_VCCQ_Pos)
67 #define ARM_NAND_POWER_VCCQ_OFF (0x01UL << ARM_NAND_POWER_VCCQ_Pos) ///< VCCQ I/O Power off
68 #define ARM_NAND_POWER_VCCQ_3V3 (0x02UL << ARM_NAND_POWER_VCCQ_Pos) ///< VCCQ = 3.3V
69 #define ARM_NAND_POWER_VCCQ_1V8 (0x03UL << ARM_NAND_POWER_VCCQ_Pos) ///< VCCQ = 1.8V
70 #define ARM_NAND_POWER_VPP_OFF (1UL << 6) ///< VPP off
71 #define ARM_NAND_POWER_VPP_ON (1Ul << 7) ///< VPP on
74 /****** NAND Control Codes *****/
75 #define ARM_NAND_BUS_MODE (0x01) ///< Set Bus Mode as specified with arg
76 #define ARM_NAND_BUS_DATA_WIDTH (0x02) ///< Set Bus Data Width as specified with arg
77 #define ARM_NAND_DRIVER_STRENGTH (0x03) ///< Set Driver Strength as specified with arg
78 #define ARM_NAND_DEVICE_READY_EVENT (0x04) ///< Generate \ref ARM_NAND_EVENT_DEVICE_READY; arg: 0=disabled (default), 1=enabled
79 #define ARM_NAND_DRIVER_READY_EVENT (0x05) ///< Generate \ref ARM_NAND_EVENT_DRIVER_READY; arg: 0=disabled (default), 1=enabled
81 /*----- NAND Bus Mode (ONFI - Open NAND Flash Interface) -----*/
82 #define ARM_NAND_BUS_INTERFACE_Pos 4
83 #define ARM_NAND_BUS_INTERFACE_Msk (0x03UL << ARM_NAND_BUS_INTERFACE_Pos)
84 #define ARM_NAND_BUS_SDR (0x00UL << ARM_NAND_BUS_INTERFACE_Pos) ///< Data Interface: SDR (Single Data Rate) - Traditional interface (default)
85 #define ARM_NAND_BUS_DDR (0x01UL << ARM_NAND_BUS_INTERFACE_Pos) ///< Data Interface: NV-DDR (Double Data Rate)
86 #define ARM_NAND_BUS_DDR2 (0x02UL << ARM_NAND_BUS_INTERFACE_Pos) ///< Data Interface: NV-DDR2 (Double Data Rate)
87 #define ARM_NAND_BUS_TIMING_MODE_Pos 0
88 #define ARM_NAND_BUS_TIMING_MODE_Msk (0x0FUL << ARM_NAND_BUS_TIMING_MODE_Pos)
89 #define ARM_NAND_BUS_TIMING_MODE_0 (0x00UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 0 (default)
90 #define ARM_NAND_BUS_TIMING_MODE_1 (0x01UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 1
91 #define ARM_NAND_BUS_TIMING_MODE_2 (0x02UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 2
92 #define ARM_NAND_BUS_TIMING_MODE_3 (0x03UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 3
93 #define ARM_NAND_BUS_TIMING_MODE_4 (0x04UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 4 (SDR EDO capable)
94 #define ARM_NAND_BUS_TIMING_MODE_5 (0x05UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 5 (SDR EDO capable)
95 #define ARM_NAND_BUS_TIMING_MODE_6 (0x06UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 6 (NV-DDR2 only)
96 #define ARM_NAND_BUS_TIMING_MODE_7 (0x07UL << ARM_NAND_BUS_TIMING_MODE_Pos) ///< Timing Mode 7 (NV-DDR2 only)
97 #define ARM_NAND_BUS_DDR2_DO_WCYC_Pos 8
98 #define ARM_NAND_BUS_DDR2_DO_WCYC_Msk (0x0FUL << ARM_NAND_BUS_DDR2_DO_WCYC_Pos)
99 #define ARM_NAND_BUS_DDR2_DO_WCYC_0 (0x00UL << ARM_NAND_BUS_DDR2_DO_WCYC_Pos) ///< DDR2 Data Output Warm-up cycles: 0 (default)
100 #define ARM_NAND_BUS_DDR2_DO_WCYC_1 (0x01UL << ARM_NAND_BUS_DDR2_DO_WCYC_Pos) ///< DDR2 Data Output Warm-up cycles: 1
101 #define ARM_NAND_BUS_DDR2_DO_WCYC_2 (0x02UL << ARM_NAND_BUS_DDR2_DO_WCYC_Pos) ///< DDR2 Data Output Warm-up cycles: 2
102 #define ARM_NAND_BUS_DDR2_DO_WCYC_4 (0x03UL << ARM_NAND_BUS_DDR2_DO_WCYC_Pos) ///< DDR2 Data Output Warm-up cycles: 4
103 #define ARM_NAND_BUS_DDR2_DI_WCYC_Pos 12
104 #define ARM_NAND_BUS_DDR2_DI_WCYC_Msk (0x0FUL << ARM_NAND_BUS_DDR2_DI_WCYC_Pos)
105 #define ARM_NAND_BUS_DDR2_DI_WCYC_0 (0x00UL << ARM_NAND_BUS_DDR2_DI_WCYC_Pos) ///< DDR2 Data Input Warm-up cycles: 0 (default)
106 #define ARM_NAND_BUS_DDR2_DI_WCYC_1 (0x01UL << ARM_NAND_BUS_DDR2_DI_WCYC_Pos) ///< DDR2 Data Input Warm-up cycles: 1
107 #define ARM_NAND_BUS_DDR2_DI_WCYC_2 (0x02UL << ARM_NAND_BUS_DDR2_DI_WCYC_Pos) ///< DDR2 Data Input Warm-up cycles: 2
108 #define ARM_NAND_BUS_DDR2_DI_WCYC_4 (0x03UL << ARM_NAND_BUS_DDR2_DI_WCYC_Pos) ///< DDR2 Data Input Warm-up cycles: 4
109 #define ARM_NAND_BUS_DDR2_VEN (1UL << 16) ///< DDR2 Enable external VREFQ as reference
110 #define ARM_NAND_BUS_DDR2_CMPD (1UL << 17) ///< DDR2 Enable complementary DQS (DQS_c) signal
111 #define ARM_NAND_BUS_DDR2_CMPR (1UL << 18) ///< DDR2 Enable complementary RE_n (RE_c) signal
113 /*----- NAND Data Bus Width -----*/
114 #define ARM_NAND_BUS_DATA_WIDTH_8 (0x00) ///< Bus Data Width: 8 bit (default)
115 #define ARM_NAND_BUS_DATA_WIDTH_16 (0x01) ///< Bus Data Width: 16 bit
117 /*----- NAND Driver Strength (ONFI - Open NAND Flash Interface) -----*/
118 #define ARM_NAND_DRIVER_STRENGTH_18 (0x00) ///< Driver Strength 2.0x = 18 Ohms
119 #define ARM_NAND_DRIVER_STRENGTH_25 (0x01) ///< Driver Strength 1.4x = 25 Ohms
120 #define ARM_NAND_DRIVER_STRENGTH_35 (0x02) ///< Driver Strength 1.0x = 35 Ohms (default)
121 #define ARM_NAND_DRIVER_STRENGTH_50 (0x03) ///< Driver Strength 0.7x = 50 Ohms
124 /****** NAND ECC for Read/Write Data Mode and Sequence Execution Code *****/
125 #define ARM_NAND_ECC_INDEX_Pos 0
126 #define ARM_NAND_ECC_INDEX_Msk (0xFFUL << ARM_NAND_ECC_INDEX_Pos)
127 #define ARM_NAND_ECC(n) ((n) & ARM_NAND_ECC_INDEX_Msk) ///< Select ECC
128 #define ARM_NAND_ECC0 (1UL << 8) ///< Use ECC0 of selected ECC
129 #define ARM_NAND_ECC1 (1UL << 9) ///< Use ECC1 of selected ECC
131 /****** NAND Flag for Read/Write Data Mode and Sequence Execution Code *****/
132 #define ARM_NAND_DRIVER_DONE_EVENT (1UL << 16) ///< Generate \ref ARM_NAND_EVENT_DRIVER_DONE
134 /****** NAND Sequence Execution Code *****/
135 #define ARM_NAND_CODE_SEND_CMD1 (1UL << 17) ///< Send Command 1
136 #define ARM_NAND_CODE_SEND_ADDR_COL1 (1UL << 18) ///< Send Column Address 1
137 #define ARM_NAND_CODE_SEND_ADDR_COL2 (1UL << 19) ///< Send Column Address 2
138 #define ARM_NAND_CODE_SEND_ADDR_ROW1 (1UL << 20) ///< Send Row Address 1
139 #define ARM_NAND_CODE_SEND_ADDR_ROW2 (1UL << 21) ///< Send Row Address 2
140 #define ARM_NAND_CODE_SEND_ADDR_ROW3 (1UL << 22) ///< Send Row Address 3
141 #define ARM_NAND_CODE_INC_ADDR_ROW (1UL << 23) ///< Auto-increment Row Address
142 #define ARM_NAND_CODE_WRITE_DATA (1UL << 24) ///< Write Data
143 #define ARM_NAND_CODE_SEND_CMD2 (1UL << 25) ///< Send Command 2
144 #define ARM_NAND_CODE_WAIT_BUSY (1UL << 26) ///< Wait while R/Bn busy
145 #define ARM_NAND_CODE_READ_DATA (1UL << 27) ///< Read Data
146 #define ARM_NAND_CODE_SEND_CMD3 (1UL << 28) ///< Send Command 3
147 #define ARM_NAND_CODE_READ_STATUS (1UL << 29) ///< Read Status byte and check FAIL bit (bit 0)
149 /*----- NAND Sequence Execution Code: Command -----*/
150 #define ARM_NAND_CODE_CMD1_Pos 0
151 #define ARM_NAND_CODE_CMD1_Msk (0xFFUL << ARM_NAND_CODE_CMD1_Pos)
152 #define ARM_NAND_CODE_CMD2_Pos 8
153 #define ARM_NAND_CODE_CMD2_Msk (0xFFUL << ARM_NAND_CODE_CMD2_Pos)
154 #define ARM_NAND_CODE_CMD3_Pos 16
155 #define ARM_NAND_CODE_CMD3_Msk (0xFFUL << ARM_NAND_CODE_CMD3_Pos)
157 /*----- NAND Sequence Execution Code: Column Address -----*/
158 #define ARM_NAND_CODE_ADDR_COL1_Pos 0
159 #define ARM_NAND_CODE_ADDR_COL1_Msk (0xFFUL << ARM_NAND_CODE_ADDR_COL1_Pos)
160 #define ARM_NAND_CODE_ADDR_COL2_Pos 8
161 #define ARM_NAND_CODE_ADDR_COL2_Msk (0xFFUL << ARM_NAND_CODE_ADDR_COL2_Pos)
163 /*----- NAND Sequence Execution Code: Row Address -----*/
164 #define ARM_NAND_CODE_ADDR_ROW1_Pos 0
165 #define ARM_NAND_CODE_ADDR_ROW1_Msk (0xFFUL << ARM_NAND_CODE_ADDR_ROW1_Pos)
166 #define ARM_NAND_CODE_ADDR_ROW2_Pos 8
167 #define ARM_NAND_CODE_ADDR_ROW2_Msk (0xFFUL << ARM_NAND_CODE_ADDR_ROW2_Pos)
168 #define ARM_NAND_CODE_ADDR_ROW3_Pos 16
169 #define ARM_NAND_CODE_ADDR_ROW3_Msk (0xFFUL << ARM_NAND_CODE_ADDR_ROW3_Pos)
172 /****** NAND specific error codes *****/
173 #define ARM_NAND_ERROR_ECC (ARM_DRIVER_ERROR_SPECIFIC - 1) ///< ECC generation/correction failed
177 \brief NAND ECC (Error Correction Code) Information
179 typedef struct _ARM_NAND_ECC_INFO {
180 uint32_t type : 2; ///< Type: 1=ECC0 over Main, 2=ECC0 over Main+Spare, 3=ECC0 over Main and ECC1 over Spare
181 uint32_t page_layout : 1; ///< Page layout: 0=|Main0|Spare0|...|MainN-1|SpareN-1|, 1=|Main0|...|MainN-1|Spare0|...|SpareN-1|
182 uint32_t page_count : 3; ///< Number of virtual pages: N = 2 ^ page_count
183 uint32_t page_size : 4; ///< Virtual Page size (Main+Spare): 0=512+16, 1=1k+32, 2=2k+64, 3=4k+128, 4=8k+256, 8=512+28, 9=1k+56, 10=2k+112, 11=4k+224, 12=8k+448, 15=Not used (extended description)
184 uint32_t reserved : 14; ///< Reserved (must be zero)
185 uint32_t correctable_bits : 8; ///< Number of correctable bits (based on 512 byte codeword size)
186 uint16_t codeword_size [2]; ///< Number of bytes over which ECC is calculated
187 uint16_t ecc_size [2]; ///< ECC size in bytes (rounded up)
188 uint16_t ecc_offset [2]; ///< ECC offset in bytes (where ECC starts in Spare)
189 /* Extended description */
190 uint16_t virtual_page_size [2]; ///< Virtual Page size in bytes (Main/Spare)
191 uint16_t codeword_offset [2]; ///< Codeword offset in bytes (where ECC protected data starts in Main/Spare)
192 uint16_t codeword_gap [2]; ///< Codeword gap in bytes till next protected data
193 uint16_t ecc_gap [2]; ///< ECC gap in bytes till next generated ECC
200 typedef volatile struct _ARM_NAND_STATUS {
201 uint32_t busy : 1; ///< Driver busy flag
202 uint32_t ecc_error : 1; ///< ECC error detected (cleared on next Read/WriteData or ExecuteSequence)
203 uint32_t reserved : 30;
207 /****** NAND Event *****/
208 #define ARM_NAND_EVENT_DEVICE_READY (1UL << 0) ///< Device Ready: R/Bn rising edge
209 #define ARM_NAND_EVENT_DRIVER_READY (1UL << 1) ///< Driver Ready
210 #define ARM_NAND_EVENT_DRIVER_DONE (1UL << 2) ///< Driver operation done
211 #define ARM_NAND_EVENT_ECC_ERROR (1UL << 3) ///< ECC could not correct data
214 // Function documentation
216 \fn ARM_DRIVER_VERSION ARM_NAND_GetVersion (void)
217 \brief Get driver version.
218 \return \ref ARM_DRIVER_VERSION
221 \fn ARM_NAND_CAPABILITIES ARM_NAND_GetCapabilities (void)
222 \brief Get driver capabilities.
223 \return \ref ARM_NAND_CAPABILITIES
226 \fn int32_t ARM_NAND_Initialize (ARM_NAND_SignalEvent_t cb_event)
227 \brief Initialize the NAND Interface.
228 \param[in] cb_event Pointer to \ref ARM_NAND_SignalEvent
229 \return \ref execution_status
232 \fn int32_t ARM_NAND_Uninitialize (void)
233 \brief De-initialize the NAND Interface.
234 \return \ref execution_status
237 \fn int32_t ARM_NAND_PowerControl (ARM_POWER_STATE state)
238 \brief Control the NAND interface power.
239 \param[in] state Power state
240 \return \ref execution_status
243 \fn int32_t ARM_NAND_DevicePower (uint32_t voltage)
244 \brief Set device power supply voltage.
245 \param[in] voltage NAND Device supply voltage
246 \return \ref execution_status
249 \fn int32_t ARM_NAND_WriteProtect (uint32_t dev_num, bool enable)
250 \brief Control WPn (Write Protect).
251 \param[in] dev_num Device number
253 - \b false Write Protect off
254 - \b true Write Protect on
255 \return \ref execution_status
258 \fn int32_t ARM_NAND_ChipEnable (uint32_t dev_num, bool enable)
259 \brief Control CEn (Chip Enable).
260 \param[in] dev_num Device number
262 - \b false Chip Enable off
263 - \b true Chip Enable on
264 \return \ref execution_status
267 \fn int32_t ARM_NAND_GetDeviceBusy (uint32_t dev_num)
268 \brief Get Device Busy pin state.
269 \param[in] dev_num Device number
270 \return 1=busy, 0=not busy, or error
273 \fn int32_t ARM_NAND_SendCommand (uint32_t dev_num, uint8_t cmd)
274 \brief Send command to NAND device.
275 \param[in] dev_num Device number
276 \param[in] cmd Command
277 \return \ref execution_status
280 \fn int32_t ARM_NAND_SendAddress (uint32_t dev_num, uint8_t addr)
281 \brief Send address to NAND device.
282 \param[in] dev_num Device number
283 \param[in] addr Address
284 \return \ref execution_status
287 \fn int32_t ARM_NAND_ReadData (uint32_t dev_num, void *data, uint32_t cnt, uint32_t mode)
288 \brief Read data from NAND device.
289 \param[in] dev_num Device number
290 \param[out] data Pointer to buffer for data to read from NAND device
291 \param[in] cnt Number of data items to read
292 \param[in] mode Operation mode
293 \return number of data items read or \ref execution_status
296 \fn int32_t ARM_NAND_WriteData (uint32_t dev_num, const void *data, uint32_t cnt, uint32_t mode)
297 \brief Write data to NAND device.
298 \param[in] dev_num Device number
299 \param[out] data Pointer to buffer with data to write to NAND device
300 \param[in] cnt Number of data items to write
301 \param[in] mode Operation mode
302 \return number of data items written or \ref execution_status
305 \fn int32_t ARM_NAND_ExecuteSequence (uint32_t dev_num, uint32_t code, uint32_t cmd,
306 uint32_t addr_col, uint32_t addr_row,
307 void *data, uint32_t data_cnt,
308 uint8_t *status, uint32_t *count)
309 \brief Execute sequence of operations.
310 \param[in] dev_num Device number
311 \param[in] code Sequence code
312 \param[in] cmd Command(s)
313 \param[in] addr_col Column address
314 \param[in] addr_row Row address
315 \param[in,out] data Pointer to data to be written or read
316 \param[in] data_cnt Number of data items in one iteration
317 \param[out] status Pointer to status read
318 \param[in,out] count Number of iterations
319 \return \ref execution_status
322 \fn int32_t ARM_NAND_AbortSequence (uint32_t dev_num)
323 \brief Abort sequence execution.
324 \param[in] dev_num Device number
325 \return \ref execution_status
328 \fn int32_t ARM_NAND_Control (uint32_t dev_num, uint32_t control, uint32_t arg)
329 \brief Control NAND Interface.
330 \param[in] dev_num Device number
331 \param[in] control Operation
332 \param[in] arg Argument of operation
333 \return \ref execution_status
336 \fn ARM_NAND_STATUS ARM_NAND_GetStatus (uint32_t dev_num)
337 \brief Get NAND status.
338 \param[in] dev_num Device number
339 \return NAND status \ref ARM_NAND_STATUS
342 \fn int32_t ARM_NAND_InquireECC (int32_t index, ARM_NAND_ECC_INFO *info)
343 \brief Inquire about available ECC.
344 \param[in] index Inquire ECC index
345 \param[out] info Pointer to ECC information \ref ARM_NAND_ECC_INFO retrieved
346 \return \ref execution_status
350 \fn void ARM_NAND_SignalEvent (uint32_t dev_num, uint32_t event)
351 \brief Signal NAND event.
352 \param[in] dev_num Device number
353 \param[in] event Event notification mask
357 typedef void (*ARM_NAND_SignalEvent_t) (uint32_t dev_num, uint32_t event); ///< Pointer to \ref ARM_NAND_SignalEvent : Signal NAND Event.
361 \brief NAND Driver Capabilities.
363 typedef struct _ARM_NAND_CAPABILITIES {
364 uint32_t event_device_ready : 1; ///< Signal Device Ready event (R/Bn rising edge)
365 uint32_t reentrant_operation : 1; ///< Supports re-entrant operation (SendCommand/Address, Read/WriteData)
366 uint32_t sequence_operation : 1; ///< Supports Sequence operation (ExecuteSequence, AbortSequence)
367 uint32_t vcc : 1; ///< Supports VCC Power Supply Control
368 uint32_t vcc_1v8 : 1; ///< Supports 1.8 VCC Power Supply
369 uint32_t vccq : 1; ///< Supports VCCQ I/O Power Supply Control
370 uint32_t vccq_1v8 : 1; ///< Supports 1.8 VCCQ I/O Power Supply
371 uint32_t vpp : 1; ///< Supports VPP High Voltage Power Supply Control
372 uint32_t wp : 1; ///< Supports WPn (Write Protect) Control
373 uint32_t ce_lines : 4; ///< Number of CEn (Chip Enable) lines: ce_lines + 1
374 uint32_t ce_manual : 1; ///< Supports manual CEn (Chip Enable) Control
375 uint32_t rb_monitor : 1; ///< Supports R/Bn (Ready/Busy) Monitoring
376 uint32_t data_width_16 : 1; ///< Supports 16-bit data
377 uint32_t ddr : 1; ///< Supports NV-DDR Data Interface (ONFI)
378 uint32_t ddr2 : 1; ///< Supports NV-DDR2 Data Interface (ONFI)
379 uint32_t sdr_timing_mode : 3; ///< Fastest (highest) SDR Timing Mode supported (ONFI)
380 uint32_t ddr_timing_mode : 3; ///< Fastest (highest) NV_DDR Timing Mode supported (ONFI)
381 uint32_t ddr2_timing_mode : 3; ///< Fastest (highest) NV_DDR2 Timing Mode supported (ONFI)
382 uint32_t driver_strength_18 : 1; ///< Supports Driver Strength 2.0x = 18 Ohms
383 uint32_t driver_strength_25 : 1; ///< Supports Driver Strength 1.4x = 25 Ohms
384 uint32_t driver_strength_50 : 1; ///< Supports Driver Strength 0.7x = 50 Ohms
385 uint32_t reserved : 2; ///< Reserved (must be zero)
386 } ARM_NAND_CAPABILITIES;
390 \brief Access structure of the NAND Driver.
392 typedef struct _ARM_DRIVER_NAND {
393 ARM_DRIVER_VERSION (*GetVersion) (void); ///< Pointer to \ref ARM_NAND_GetVersion : Get driver version.
394 ARM_NAND_CAPABILITIES (*GetCapabilities)(void); ///< Pointer to \ref ARM_NAND_GetCapabilities : Get driver capabilities.
395 int32_t (*Initialize) (ARM_NAND_SignalEvent_t cb_event); ///< Pointer to \ref ARM_NAND_Initialize : Initialize NAND Interface.
396 int32_t (*Uninitialize) (void); ///< Pointer to \ref ARM_NAND_Uninitialize : De-initialize NAND Interface.
397 int32_t (*PowerControl) (ARM_POWER_STATE state); ///< Pointer to \ref ARM_NAND_PowerControl : Control NAND Interface Power.
398 int32_t (*DevicePower) (uint32_t voltage); ///< Pointer to \ref ARM_NAND_DevicePower : Set device power supply voltage.
399 int32_t (*WriteProtect) (uint32_t dev_num, bool enable); ///< Pointer to \ref ARM_NAND_WriteProtect : Control WPn (Write Protect).
400 int32_t (*ChipEnable) (uint32_t dev_num, bool enable); ///< Pointer to \ref ARM_NAND_ChipEnable : Control CEn (Chip Enable).
401 int32_t (*GetDeviceBusy) (uint32_t dev_num); ///< Pointer to \ref ARM_NAND_GetDeviceBusy : Get Device Busy pin state.
402 int32_t (*SendCommand) (uint32_t dev_num, uint8_t cmd); ///< Pointer to \ref ARM_NAND_SendCommand : Send command to NAND device.
403 int32_t (*SendAddress) (uint32_t dev_num, uint8_t addr); ///< Pointer to \ref ARM_NAND_SendAddress : Send address to NAND device.
404 int32_t (*ReadData) (uint32_t dev_num, void *data, uint32_t cnt, uint32_t mode); ///< Pointer to \ref ARM_NAND_ReadData : Read data from NAND device.
405 int32_t (*WriteData) (uint32_t dev_num, const void *data, uint32_t cnt, uint32_t mode); ///< Pointer to \ref ARM_NAND_WriteData : Write data to NAND device.
406 int32_t (*ExecuteSequence)(uint32_t dev_num, uint32_t code, uint32_t cmd,
407 uint32_t addr_col, uint32_t addr_row,
408 void *data, uint32_t data_cnt,
409 uint8_t *status, uint32_t *count); ///< Pointer to \ref ARM_NAND_ExecuteSequence : Execute sequence of operations.
410 int32_t (*AbortSequence) (uint32_t dev_num); ///< Pointer to \ref ARM_NAND_AbortSequence : Abort sequence execution.
411 int32_t (*Control) (uint32_t dev_num, uint32_t control, uint32_t arg); ///< Pointer to \ref ARM_NAND_Control : Control NAND Interface.
412 ARM_NAND_STATUS (*GetStatus) (uint32_t dev_num); ///< Pointer to \ref ARM_NAND_GetStatus : Get NAND status.
413 int32_t (*InquireECC) ( int32_t index, ARM_NAND_ECC_INFO *info); ///< Pointer to \ref ARM_NAND_InquireECC : Inquire about available ECC.
414 } const ARM_DRIVER_NAND;
420 #endif /* DRIVER_NAND_H_ */