[PATCH v8 3/3] mtd: rawnand: Add support for secure regions in NAND memory
Boris Brezillon
boris.brezillon at collabora.com
Thu Apr 1 16:50:52 BST 2021
On Thu, 1 Apr 2021 15:48:12 +0530
Manivannan Sadhasivam <manivannan.sadhasivam at linaro.org> wrote:
> static int nand_isbad_bbm(struct nand_chip *chip, loff_t ofs)
> {
> + struct mtd_info *mtd = nand_to_mtd(chip);
> + int last_page = ((mtd->erasesize - mtd->writesize) >>
> + chip->page_shift) & chip->pagemask;
> int ret;
>
> if (chip->options & NAND_NO_BBM_QUIRK)
> return 0;
>
> /* Check if the region is secured */
> - ret = nand_check_secure_region(chip, ofs, 0);
> + ret = nand_check_secure_region(chip, ofs, last_page);
or just:
ret = nand_check_secure_region(chip, ofs, mtd->erasesize);
> if (ret)
> return ret;
>
> > */
> >
More information about the linux-mtd
mailing list