mirror of
https://github.com/torvalds/linux.git
synced 2026-05-27 16:44:58 +02:00
mtd: spinand: fix direct mapping creation sizes
Continuous mode is only supported for data reads, thus writing requires only single flash page mapping. Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
This commit is contained in:
parent
b8df622cf7
commit
e4a0cf9f1d
|
|
@ -1097,18 +1097,13 @@ static int spinand_create_dirmap(struct spinand_device *spinand,
|
|||
unsigned int plane)
|
||||
{
|
||||
struct nand_device *nand = spinand_to_nand(spinand);
|
||||
struct spi_mem_dirmap_info info = {
|
||||
.length = nanddev_page_size(nand) +
|
||||
nanddev_per_page_oobsize(nand),
|
||||
};
|
||||
struct spi_mem_dirmap_info info = { 0 };
|
||||
struct spi_mem_dirmap_desc *desc;
|
||||
|
||||
if (spinand->cont_read_possible)
|
||||
info.length = nanddev_eraseblock_size(nand);
|
||||
|
||||
/* The plane number is passed in MSB just above the column address */
|
||||
info.offset = plane << fls(nand->memorg.pagesize);
|
||||
|
||||
info.length = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand);
|
||||
info.op_tmpl = *spinand->op_templates.update_cache;
|
||||
desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev,
|
||||
spinand->spimem, &info);
|
||||
|
|
@ -1117,6 +1112,8 @@ static int spinand_create_dirmap(struct spinand_device *spinand,
|
|||
|
||||
spinand->dirmaps[plane].wdesc = desc;
|
||||
|
||||
if (spinand->cont_read_possible)
|
||||
info.length = nanddev_eraseblock_size(nand);
|
||||
info.op_tmpl = *spinand->op_templates.read_cache;
|
||||
desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev,
|
||||
spinand->spimem, &info);
|
||||
|
|
@ -1132,6 +1129,7 @@ static int spinand_create_dirmap(struct spinand_device *spinand,
|
|||
return 0;
|
||||
}
|
||||
|
||||
info.length = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand);
|
||||
info.op_tmpl = *spinand->op_templates.update_cache;
|
||||
info.op_tmpl.data.ecc = true;
|
||||
desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev,
|
||||
|
|
@ -1141,6 +1139,8 @@ static int spinand_create_dirmap(struct spinand_device *spinand,
|
|||
|
||||
spinand->dirmaps[plane].wdesc_ecc = desc;
|
||||
|
||||
if (spinand->cont_read_possible)
|
||||
info.length = nanddev_eraseblock_size(nand);
|
||||
info.op_tmpl = *spinand->op_templates.read_cache;
|
||||
info.op_tmpl.data.ecc = true;
|
||||
desc = devm_spi_mem_dirmap_create(&spinand->spimem->spi->dev,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user