X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=drivers%2Fmtd%2Fnand%2Fnand_ecc.c;h=083e0e99e4fcf3414dc1e9d4b389ecf02e03c03e;hb=31c5614af406bdb686c305d707eee2a0898d864e;hp=ee1f6cc8a85a98ddd136fc4c464d0ab425b2183b;hpb=ce0eb70333331da6942167c41e6841c8c7994a33;p=u-boot diff --git a/drivers/mtd/nand/nand_ecc.c b/drivers/mtd/nand/nand_ecc.c index ee1f6cc8a8..083e0e99e4 100644 --- a/drivers/mtd/nand/nand_ecc.c +++ b/drivers/mtd/nand/nand_ecc.c @@ -9,21 +9,7 @@ * * Copyright (C) 2006 Thomas Gleixner * - * $Id: nand_ecc.c,v 1.15 2005/11/07 11:14:30 gleixner Exp $ - * - * This file is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the - * Free Software Foundation; either version 2 or (at your option) any - * later version. - * - * This file is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - * - * You should have received a copy of the GNU General Public License along - * with this file; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * SPDX-License-Identifier: GPL-2.0+ * * As a special exception, if other files instantiate templates or use * macros or inline functions from these files, or you compile these @@ -39,22 +25,21 @@ #include -/* XXX U-BOOT XXX */ -#if 0 -#include -#include -#include +#include +#include #include -#endif -#include +/* The PPC4xx NDFC uses Smart Media (SMC) bytes order */ +#ifdef CONFIG_NAND_NDFC +#define CONFIG_MTD_NAND_ECC_SMC +#endif /* * NAND-SPL has no sofware ECC for now, so don't include nand_calculate_ecc(), * only nand_correct_data() is needed */ -#ifndef CONFIG_NAND_SPL +#if !defined(CONFIG_NAND_SPL) || defined(CONFIG_SPL_NAND_SOFTECC) /* * Pre-calculated 256-way 1 byte column parity */ @@ -136,10 +121,6 @@ int nand_calculate_ecc(struct mtd_info *mtd, const u_char *dat, return 0; } -/* XXX U-BOOT XXX */ -#if 0 -EXPORT_SYMBOL(nand_calculate_ecc); -#endif #endif /* CONFIG_NAND_SPL */ static inline int countbits(uint32_t byte) @@ -206,10 +187,5 @@ int nand_correct_data(struct mtd_info *mtd, u_char *dat, if(countbits(s0 | ((uint32_t)s1 << 8) | ((uint32_t)s2 <<16)) == 1) return 1; - return -1; + return -EBADMSG; } - -/* XXX U-BOOT XXX */ -#if 0 -EXPORT_SYMBOL(nand_correct_data); -#endif