[PATCH v2 4/5] mtd: spinand: micron: OTP access for MT29F2G01ABAGD

Miquel Raynal miquel.raynal at bootlin.com
Fri Oct 25 00:51:24 PDT 2024


Hi Martin,

mmkurbanov at salutedevices.com wrote on Mon, 14 Oct 2024 15:48:46 +0300:

> Hi Miquel,
> 
> On 10/1/24 12:31, Miquel Raynal wrote:
> 
> >> +#define MICRON_MT29F2G01ABAGD_OTP_PAGES			12
> >> +#define MICRON_MT29F2G01ABAGD_OTP_PAGE_SIZE		2176  
> > 
> > In the core we did add the data size and the OOB size to get the OTP
> > page size. I would prefer something dynamic here as well, otherwise the
> > implementation is very device specific for now reason?  

						no

> 
> Do you mean:
> otp_page_size = nanddev_page_size(nand) + nanddev_per_page_oobsize(nand)

Yes!

> >> +		size_t i = 0;
> >> +
> >> +		/* If all zeros, then the OTP area is locked. */
> >> +		while (i < buf_size && *(uint32_t *)(&buf[i]) == 0)
> >> +			i += 4;  
> > 
> > Shall we expect buf_size to always be a multiple of 4? (real question)  
> 
> This function is only for the nand flash MT29F2G01ABAGD that has a page
> size multiple of 4.

Ok.

Thanks,
Miquèl



More information about the linux-mtd mailing list