blob: 02ba9f7e63be9fb2df01eb5e517dfddef28440f3 [file] [log] [blame]
Wolfgang Denk2f9b7e42005-08-17 12:55:25 +02001/*
2 * drivers/mtd/nand_ecc.h
3 *
Tom Rinif76fe252015-10-23 09:37:47 -04004 * Copyright (C) 2000-2010 Steven J. Hill <sjhill@realitydiluted.com>
5 * David Woodhouse <dwmw2@infradead.org>
6 * Thomas Gleixner <tglx@linutronix.de>
Wolfgang Denk2f9b7e42005-08-17 12:55:25 +02007 *
Tom Rinif76fe252015-10-23 09:37:47 -04008 * SPDX-License-Identifier: GPL-2.0
Wolfgang Denk2f9b7e42005-08-17 12:55:25 +02009 *
10 * This file is the header for the ECC algorithm.
11 */
12
13#ifndef __MTD_NAND_ECC_H__
14#define __MTD_NAND_ECC_H__
15
16struct mtd_info;
17
18/*
19 * Calculate 3 byte ECC code for 256 byte block
20 */
21int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code);
22
23/*
24 * Detect and correct a 1 bit error for 256 byte block
25 */
26int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc);
27
Wolfgang Denk2f9b7e42005-08-17 12:55:25 +020028#endif /* __MTD_NAND_ECC_H__ */