| .. | .. |
|---|
| 1 | +/* SPDX-License-Identifier: GPL-2.0-only */ |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright (C) 2000-2010 Steven J. Hill <sjhill@realitydiluted.com> |
|---|
| 3 | 4 | * David Woodhouse <dwmw2@infradead.org> |
|---|
| 4 | 5 | * Thomas Gleixner <tglx@linutronix.de> |
|---|
| 5 | | - * |
|---|
| 6 | | - * This program is free software; you can redistribute it and/or modify |
|---|
| 7 | | - * it under the terms of the GNU General Public License version 2 as |
|---|
| 8 | | - * published by the Free Software Foundation. |
|---|
| 9 | 6 | * |
|---|
| 10 | 7 | * This file is the header for the ECC algorithm. |
|---|
| 11 | 8 | */ |
|---|
| .. | .. |
|---|
| 13 | 10 | #ifndef __MTD_NAND_ECC_H__ |
|---|
| 14 | 11 | #define __MTD_NAND_ECC_H__ |
|---|
| 15 | 12 | |
|---|
| 16 | | -struct mtd_info; |
|---|
| 13 | +struct nand_chip; |
|---|
| 17 | 14 | |
|---|
| 18 | 15 | /* |
|---|
| 19 | 16 | * Calculate 3 byte ECC code for eccsize byte block |
|---|
| 20 | 17 | */ |
|---|
| 21 | 18 | void __nand_calculate_ecc(const u_char *dat, unsigned int eccsize, |
|---|
| 22 | | - u_char *ecc_code); |
|---|
| 19 | + u_char *ecc_code, bool sm_order); |
|---|
| 23 | 20 | |
|---|
| 24 | 21 | /* |
|---|
| 25 | 22 | * Calculate 3 byte ECC code for 256/512 byte block |
|---|
| 26 | 23 | */ |
|---|
| 27 | | -int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, u_char *ecc_code); |
|---|
| 24 | +int nand_calculate_ecc(struct nand_chip *chip, const u_char *dat, |
|---|
| 25 | + u_char *ecc_code); |
|---|
| 28 | 26 | |
|---|
| 29 | 27 | /* |
|---|
| 30 | 28 | * Detect and correct a 1 bit error for eccsize byte block |
|---|
| 31 | 29 | */ |
|---|
| 32 | 30 | int __nand_correct_data(u_char *dat, u_char *read_ecc, u_char *calc_ecc, |
|---|
| 33 | | - unsigned int eccsize); |
|---|
| 31 | + unsigned int eccsize, bool sm_order); |
|---|
| 34 | 32 | |
|---|
| 35 | 33 | /* |
|---|
| 36 | 34 | * Detect and correct a 1 bit error for 256/512 byte block |
|---|
| 37 | 35 | */ |
|---|
| 38 | | -int nand_correct_data(struct mtd_info *mtd, u_char *dat, u_char *read_ecc, u_char *calc_ecc); |
|---|
| 36 | +int nand_correct_data(struct nand_chip *chip, u_char *dat, u_char *read_ecc, |
|---|
| 37 | + u_char *calc_ecc); |
|---|
| 39 | 38 | |
|---|
| 40 | 39 | #endif /* __MTD_NAND_ECC_H__ */ |
|---|