Hello Boris, On 15/11/2018 11:46, Boris Brezillon wrote: >>> /* >>> * For non-uniform SPI flash memory, set mtd->erasesize to the >>> * maximum erase sector size. No need to set nor->erase_opcode. >>> */ >>> for (i = SNOR_ERASE_TYPE_MAX - 1; i >= 0; i--) { >>> if (map->erase_type[i].size) { >>> erase = &map->erase_type[i]; >>> break; >>> } >>> } >>> >>> The problem in our case is, we have existing partitioning with 128k partitions >>> (the Flash itself supports 256k and 64k erasesize, depending on configuration). >>> The chip is configured for 64k erasesize, non-uniform mapping. >>> >>> The mapping itself is being detected correctly, but when it comes to the code >>> snippet above, it selects the biggest erasesize from all sizes advertised in >>> SFDP, including 256k, which is not applicable to the current configuration. >> The fix would be to save the supported erase types when parsing the SFDP SMPT >> table and use those instead. > Alexander, Tudor, can one of you work on such a fix? non-uniform case is complicated because currently I don't see the way to tell mtdpart.c about non-uniform maps from spi-nor.c. But same problem applies even to uniform maps, I have a patch already which searches for minimum erase size, not maximum, I just have not tested it... -- Best regards, Alexander Sverdlin. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/