diff options
author | Stefan Agner <stefan.agner@toradex.com> | 2018-12-06 14:57:09 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-01-16 16:14:45 -0500 |
commit | a38c3af868ad2a7a7c04667e559570d5f81b1d51 (patch) | |
tree | 264995e66034673b57767d226fe491cda6219a1c /drivers/mtd/nand/raw/nand_base.c | |
parent | aac0c29d4b8418c5c78b552070ffeda022b16949 (diff) |
mtd: nand: raw: allow to disable unneeded ECC layouts
Each ECC layout consumes about 2984 bytes in the .data section. Allow
to disable the default ECC layouts if a driver is known to provide its
own ECC layout.
Signed-off-by: Stefan Agner <stefan.agner@toradex.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'drivers/mtd/nand/raw/nand_base.c')
-rw-r--r-- | drivers/mtd/nand/raw/nand_base.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c index 92daebe120..6d2ff58d86 100644 --- a/drivers/mtd/nand/raw/nand_base.c +++ b/drivers/mtd/nand/raw/nand_base.c @@ -47,6 +47,7 @@ #include <linux/errno.h> /* Define default oob placement schemes for large and small page devices */ +#ifdef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT static struct nand_ecclayout nand_oob_8 = { .eccbytes = 3, .eccpos = {0, 1, 2}, @@ -89,6 +90,7 @@ static struct nand_ecclayout nand_oob_128 = { {.offset = 2, .length = 78} } }; +#endif static int nand_get_device(struct mtd_info *mtd, int new_state); @@ -4339,6 +4341,7 @@ int nand_scan_tail(struct mtd_info *mtd) */ if (!ecc->layout && (ecc->mode != NAND_ECC_SOFT_BCH)) { switch (mtd->oobsize) { +#ifdef CONFIG_SYS_NAND_DRIVER_ECC_LAYOUT case 8: ecc->layout = &nand_oob_8; break; @@ -4351,6 +4354,7 @@ int nand_scan_tail(struct mtd_info *mtd) case 128: ecc->layout = &nand_oob_128; break; +#endif default: pr_warn("No oob scheme defined for oobsize %d\n", mtd->oobsize); |