Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 28318776 authored by Joern Engel's avatar Joern Engel
Browse files

[MTD] Introduce writesize



At least two flashes exists that have the concept of a minimum write unit,
similar to NAND pages, but no other NAND characteristics.  Therefore, rename
the minimum write unit to "writesize" for all flashes, including NAND.

Signed-off-by: default avatarJoern Engel <joern@wh.fh-wedel.de>
parent 8ca9ed5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -545,12 +545,12 @@ static int cfi_intelext_partition_fixup(struct mtd_info *mtd,
		if (extp->MinorVersion >= '4') {
			struct cfi_intelext_programming_regioninfo *prinfo;
			prinfo = (struct cfi_intelext_programming_regioninfo *)&extp->extra[offs];
			MTD_PROGREGION_SIZE(mtd) = cfi->interleave << prinfo->ProgRegShift;
			mtd->writesize = cfi->interleave << prinfo->ProgRegShift;
			MTD_PROGREGION_CTRLMODE_VALID(mtd) = cfi->interleave * prinfo->ControlValid;
			MTD_PROGREGION_CTRLMODE_INVALID(mtd) = cfi->interleave * prinfo->ControlInvalid;
			mtd->flags |= MTD_PROGRAM_REGIONS;
			printk(KERN_DEBUG "%s: program region size/ctrl_valid/ctrl_inval = %d/%d/%d\n",
			       map->name, MTD_PROGREGION_SIZE(mtd),
			       map->name, mtd->writesize,
			       MTD_PROGREGION_CTRLMODE_VALID(mtd),
			       MTD_PROGREGION_CTRLMODE_INVALID(mtd));
		}
+1 −1
Original line number Diff line number Diff line
@@ -579,7 +579,7 @@ void DoC2k_init(struct mtd_info *mtd)
	mtd->ecctype = MTD_ECC_RS_DiskOnChip;
	mtd->size = 0;
	mtd->erasesize = 0;
	mtd->oobblock = 512;
	mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->owner = THIS_MODULE;
	mtd->erase = doc_erase;
+1 −1
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ void DoCMil_init(struct mtd_info *mtd)
	/* FIXME: erase size is not always 8KiB */
	mtd->erasesize = 0x2000;

	mtd->oobblock = 512;
	mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->owner = THIS_MODULE;
	mtd->erase = doc_erase;
+1 −1
Original line number Diff line number Diff line
@@ -483,7 +483,7 @@ void DoCMilPlus_init(struct mtd_info *mtd)
	mtd->size = 0;

	mtd->erasesize = 0;
	mtd->oobblock = 512;
	mtd->writesize = 512;
	mtd->oobsize = 16;
	mtd->owner = THIS_MODULE;
	mtd->erase = doc_erase;
+5 −5
Original line number Diff line number Diff line
@@ -278,9 +278,9 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
		return -EINVAL;

	/* Check alignment */
	if (mtd->oobblock > 1) {
	if (mtd->writesize > 1) {
		loff_t __to = to;
		if (do_div(__to, mtd->oobblock) || (total_len % mtd->oobblock))
		if (do_div(__to, mtd->writesize) || (total_len % mtd->writesize))
			return -EINVAL;
	}

@@ -334,7 +334,7 @@ concat_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
		*retlen += retsize;
		total_len -= wsize;
		if (concat->mtd.type == MTD_NANDFLASH && eccbuf)
			eccbuf += mtd->oobavail * (wsize / mtd->oobblock);
			eccbuf += mtd->oobavail * (wsize / mtd->writesize);

		if (total_len == 0)
			break;
@@ -833,7 +833,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
	concat->mtd.flags = subdev[0]->flags;
	concat->mtd.size = subdev[0]->size;
	concat->mtd.erasesize = subdev[0]->erasesize;
	concat->mtd.oobblock = subdev[0]->oobblock;
	concat->mtd.writesize = subdev[0]->writesize;
	concat->mtd.oobsize = subdev[0]->oobsize;
	concat->mtd.ecctype = subdev[0]->ecctype;
	concat->mtd.eccsize = subdev[0]->eccsize;
@@ -881,7 +881,7 @@ struct mtd_info *mtd_concat_create(struct mtd_info *subdev[], /* subdevices to c
				    subdev[i]->flags & MTD_WRITEABLE;
		}
		concat->mtd.size += subdev[i]->size;
		if (concat->mtd.oobblock   !=  subdev[i]->oobblock ||
		if (concat->mtd.writesize   !=  subdev[i]->writesize ||
		    concat->mtd.oobsize    !=  subdev[i]->oobsize ||
		    concat->mtd.ecctype    !=  subdev[i]->ecctype ||
		    concat->mtd.eccsize    !=  subdev[i]->eccsize ||
Loading