summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJohan Jonker <jbx6244@gmail.com>2023-03-13 03:29:05 +0300
committerKever Yang <kever.yang@rock-chips.com>2023-05-06 12:28:17 +0300
commitdf08f747749b15b72a8dc953b006ace806c4b2d1 (patch)
tree970d0879550b7a9c1ce20ad957a96f88b9a5319a /drivers
parent14eb61aa2514ba9cf7d8c2410746fefe4cd8295f (diff)
downloadu-boot-df08f747749b15b72a8dc953b006ace806c4b2d1.tar.xz
mtd: nand: raw: rockchip_nfc: fix oobfree offset and description
The MTD framework reserves 1 or 2 bytes for the bad block marker depending on the bus size. The rockchip_nfc driver currently only supports a 8 bit bus, but reserves standard 2 bytes for the BBM. The first free OOB byte is therefore OOB2 at offset 2. Page address(PA) bytes are moved to the last 4 positions before ECC. Update the description for U-boot. Signed-off-by: Johan Jonker <jbx6244@gmail.com> Reviewed-by: Kever Yang <kever.yang@rock-chips.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/raw/rockchip_nfc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/mtd/nand/raw/rockchip_nfc.c b/drivers/mtd/nand/raw/rockchip_nfc.c
index 25e04974c0..5fcf6a6bfc 100644
--- a/drivers/mtd/nand/raw/rockchip_nfc.c
+++ b/drivers/mtd/nand/raw/rockchip_nfc.c
@@ -487,10 +487,10 @@ static int rk_nfc_write_page_raw(struct mtd_info *mtd,
*
* BBM OOB1 OOB2 OOB3 |......| PA0 PA1 PA2 PA3
*
- * The rk_nfc_ooblayout_free() function already has reserved
- * these 4 bytes with:
+ * The oobfree structure already has reserved these 4 bytes
+ * together with 2 bytes for BBM by reducing it's length:
*
- * oob_region->offset = NFC_SYS_DATA_SIZE + 2;
+ * oobfree[0].length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2;
*/
if (!i)
memcpy(rk_nfc_oob_ptr(chip, i),
@@ -867,7 +867,7 @@ static int rk_nfc_ecc_init(struct rk_nfc *nfc, struct nand_chip *chip)
ecc->layout->eccpos[i] = rknand->metadata_size + i;
ecc->layout->oobfree[0].length = rknand->metadata_size - NFC_SYS_DATA_SIZE - 2;
- ecc->layout->oobfree[0].offset = NFC_SYS_DATA_SIZE + 2;
+ ecc->layout->oobfree[0].offset = 2;
return 0;
}