nand.h (c786f54b9ace5d7b20a0404a7deb1bae683cd4e8) nand.h (4c6de8560cb42a6b6c2d565d41b6801e4b02d4b3)
1/*
2 * linux/include/linux/mtd/nand.h
3 *
4 * Copyright (c) 2000 David Woodhouse <dwmw2@infradead.org>
5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 4 unchanged lines hidden (view full) ---

13 * Contains standard defines and IDs for NAND flash devices
14 *
15 * Changelog:
16 * See git changelog.
17 */
18#ifndef __LINUX_MTD_NAND_H
19#define __LINUX_MTD_NAND_H
20
1/*
2 * linux/include/linux/mtd/nand.h
3 *
4 * Copyright (c) 2000 David Woodhouse <dwmw2@infradead.org>
5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 4 unchanged lines hidden (view full) ---

13 * Contains standard defines and IDs for NAND flash devices
14 *
15 * Changelog:
16 * See git changelog.
17 */
18#ifndef __LINUX_MTD_NAND_H
19#define __LINUX_MTD_NAND_H
20
21/* XXX U-BOOT XXX */
22#if 0
23#include <linux/wait.h>
24#include <linux/spinlock.h>
25#include <linux/mtd/mtd.h>
26#endif
27
28#include "config.h"
29
30#include "linux/mtd/compat.h"
31#include "linux/mtd/mtd.h"
32#include "linux/mtd/bbm.h"
33
34
35struct mtd_info;

--- 91 unchanged lines hidden (view full) ---

127 * Constants for ECC_MODES
128 */
129typedef enum {
130 NAND_ECC_NONE,
131 NAND_ECC_SOFT,
132 NAND_ECC_HW,
133 NAND_ECC_HW_SYNDROME,
134 NAND_ECC_HW_OOB_FIRST,
21#include "config.h"
22
23#include "linux/mtd/compat.h"
24#include "linux/mtd/mtd.h"
25#include "linux/mtd/bbm.h"
26
27
28struct mtd_info;

--- 91 unchanged lines hidden (view full) ---

120 * Constants for ECC_MODES
121 */
122typedef enum {
123 NAND_ECC_NONE,
124 NAND_ECC_SOFT,
125 NAND_ECC_HW,
126 NAND_ECC_HW_SYNDROME,
127 NAND_ECC_HW_OOB_FIRST,
128 NAND_ECC_SOFT_BCH,
135} nand_ecc_modes_t;
136
137/*
138 * Constants for Hardware ECC
139 */
140/* Reset Hardware ECC for read */
141#define NAND_ECC_READ 0
142/* Reset Hardware ECC for write */

--- 160 unchanged lines hidden (view full) ---

303 * @mode: ecc mode
304 * @steps: number of ecc steps per page
305 * @size: data bytes per ecc step
306 * @bytes: ecc bytes per step
307 * @total: total number of ecc bytes per page
308 * @prepad: padding information for syndrome based ecc generators
309 * @postpad: padding information for syndrome based ecc generators
310 * @layout: ECC layout control struct pointer
129} nand_ecc_modes_t;
130
131/*
132 * Constants for Hardware ECC
133 */
134/* Reset Hardware ECC for read */
135#define NAND_ECC_READ 0
136/* Reset Hardware ECC for write */

--- 160 unchanged lines hidden (view full) ---

297 * @mode: ecc mode
298 * @steps: number of ecc steps per page
299 * @size: data bytes per ecc step
300 * @bytes: ecc bytes per step
301 * @total: total number of ecc bytes per page
302 * @prepad: padding information for syndrome based ecc generators
303 * @postpad: padding information for syndrome based ecc generators
304 * @layout: ECC layout control struct pointer
305 * @priv: pointer to private ecc control data
311 * @hwctl: function to control hardware ecc generator. Must only
312 * be provided if an hardware ECC is available
313 * @calculate: function for ecc calculation or readback from ecc hardware
314 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
315 * @read_page_raw: function to read a raw page without ECC
316 * @write_page_raw: function to write a raw page without ECC
317 * @read_page: function to read a page according to the ecc generator requirements
318 * @write_page: function to write a page according to the ecc generator requirements

--- 4 unchanged lines hidden (view full) ---

323 nand_ecc_modes_t mode;
324 int steps;
325 int size;
326 int bytes;
327 int total;
328 int prepad;
329 int postpad;
330 struct nand_ecclayout *layout;
306 * @hwctl: function to control hardware ecc generator. Must only
307 * be provided if an hardware ECC is available
308 * @calculate: function for ecc calculation or readback from ecc hardware
309 * @correct: function for ecc correction, matching to ecc generator (sw/hw)
310 * @read_page_raw: function to read a raw page without ECC
311 * @write_page_raw: function to write a raw page without ECC
312 * @read_page: function to read a page according to the ecc generator requirements
313 * @write_page: function to write a page according to the ecc generator requirements

--- 4 unchanged lines hidden (view full) ---

318 nand_ecc_modes_t mode;
319 int steps;
320 int size;
321 int bytes;
322 int total;
323 int prepad;
324 int postpad;
325 struct nand_ecclayout *layout;
326 void *priv;
331 void (*hwctl)(struct mtd_info *mtd, int mode);
332 int (*calculate)(struct mtd_info *mtd,
333 const uint8_t *dat,
334 uint8_t *ecc_code);
335 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
336 uint8_t *read_ecc,
337 uint8_t *calc_ecc);
338 int (*read_page_raw)(struct mtd_info *mtd,

--- 295 unchanged lines hidden ---
327 void (*hwctl)(struct mtd_info *mtd, int mode);
328 int (*calculate)(struct mtd_info *mtd,
329 const uint8_t *dat,
330 uint8_t *ecc_code);
331 int (*correct)(struct mtd_info *mtd, uint8_t *dat,
332 uint8_t *read_ecc,
333 uint8_t *calc_ecc);
334 int (*read_page_raw)(struct mtd_info *mtd,

--- 295 unchanged lines hidden ---