diff options
author | Álvaro Fernández Rojas <noltari@gmail.com> | 2020-06-11 09:07:04 +0200 |
---|---|---|
committer | Álvaro Fernández Rojas <noltari@gmail.com> | 2020-06-11 09:07:04 +0200 |
commit | ce33ef997cfeb7b77300227a6ffab9936ea51940 (patch) | |
tree | 50a86b5d51bdc62b7b33b95fcaa3e3e64f9a168b /target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch | |
parent | e6d4744f9ad0f76ddf1cded75355e240e81be41e (diff) | |
download | upstream-ce33ef997cfeb7b77300227a6ffab9936ea51940.tar.gz upstream-ce33ef997cfeb7b77300227a6ffab9936ea51940.tar.bz2 upstream-ce33ef997cfeb7b77300227a6ffab9936ea51940.zip |
bcm63xx: switch to upstream NAND patches
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch')
-rw-r--r-- | target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch b/target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch deleted file mode 100644 index 68bbc7ad19..0000000000 --- a/target/linux/bcm63xx/patches-5.4/437-mtd-rawnand-brcmnand-improve-hamming-oob-layout.patch +++ /dev/null @@ -1,52 +0,0 @@ ---- a/drivers/mtd/nand/raw/brcmnand/brcmnand.c -+++ b/drivers/mtd/nand/raw/brcmnand/brcmnand.c -@@ -1003,33 +1003,30 @@ static int brcmnand_hamming_ooblayout_fr - struct brcmnand_cfg *cfg = &host->hwcfg; - int sas = cfg->spare_area_size << cfg->sector_size_1k; - int sectors = cfg->page_size / (512 << cfg->sector_size_1k); -+ u32 next; - -- if (section >= sectors * 2) -+ if (section > sectors) - return -ERANGE; - -- oobregion->offset = (section / 2) * sas; -+ next = (section * sas); -+ if (section < sectors) -+ next += 6; - -- if (section & 1) { -- oobregion->offset += 9; -- oobregion->length = 7; -+ if (section) { -+ oobregion->offset = ((section - 1) * sas) + 9; - } else { -- oobregion->length = 6; -- -- /* First sector of each page may have BBI */ -- if (!section) { -- /* -- * Small-page NAND use byte 6 for BBI while large-page -- * NAND use bytes 0 and 1. -- */ -- if (cfg->page_size > 512) { -- oobregion->offset += 2; -- oobregion->length -= 2; -- } else { -- oobregion->length--; -- } -+ if (cfg->page_size > 512) { -+ /* Large page NAND uses first 2 bytes for BBI */ -+ oobregion->offset = 2; -+ } else { -+ /* Small page NAND uses last byte before ECC for BBI */ -+ oobregion->offset = 0; -+ next--; - } - } - -+ oobregion->length = next - oobregion->offset; -+ - return 0; - } - |