Skip to content

Commit

Permalink
Add fixup for new NAND chip in FRITZ!7530 A1
Browse files Browse the repository at this point in the history
adds a switch-table with fixed OOB size and ECC strength
for the AVM FRITZ!7530 with Toshiba NAND. Unlike the
previously used Macronix NAND this NAND does not support
ONFI and hence needs these values provided separately.

Bootlog:
|[NAND:] 128MB TOSHIBA 2048 Pagesize 128k Blocksize 1024 Blocks HW
|NAND:  Not an ONFI device
|ONFI probe failed
|ID = 1580f198
|Vendor = 98
|Device = f1
|SF: Unsupported manufacturer ff
|ipq_spi: SPI Flash not found (bus/cs/speed/mode) = (0/0/48000000/0)
|128 MiB

Signed-off-by: Andreas Böhler <[email protected]>
(added signed-off + commit message from the OpenWrt package,
made it with switch)
Signed-off-by: Christian Lamparter <[email protected]>
  • Loading branch information
andyboeh authored and chunkeey committed May 1, 2022
1 parent 48430df commit 9d89013
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions drivers/mtd/qpic_nand.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,16 +1303,27 @@ static int qpic_nand_get_info(struct mtd_info *mtd, uint32_t flash_id)

mtd->size = MB_TO_BYTES(flash_dev->chipsize);
/*
* For older NAND flash, we obtained the flash information
* from the flash_dev table. For newer flashes the information
* is available in the cfg byte, in the NAND ID sequence.
*/
* For older NAND flash, we obtained the flash information
* from the flash_dev table. For newer flashes the information
* is available in the cfg byte, in the NAND ID sequence.
*/
if (!flash_dev->pagesize)
qpic_nand_get_info_cfg(mtd, cfg_id);
else
qpic_nand_get_info_flash_dev(mtd, flash_dev);

dev->ecc_width = NAND_WITH_4_BIT_ECC;
switch (flash_id) {
case 0x1580f198:
printf("=================================\n");
printf("Fixup for Toshiba TC58NVG0S3HTA00\n");
printf("=================================\n");
dev->ecc_width = NAND_WITH_8_BIT_ECC;
mtd->oobsize = dev->spare_size = 128;
break;

default:
dev->ecc_width = NAND_WITH_4_BIT_ECC;
}

dev->num_blocks = mtd->size;
dev->num_blocks /= (dev->block_size);
Expand Down

0 comments on commit 9d89013

Please sign in to comment.