[U-Boot] [PATCH v2 2/6] sf: disable write protection for Macronix flash
Simon Guinot
simon.guinot at sequanux.org
Mon May 2 11:58:07 CEST 2011
Hi Prafulla,
On Mon, May 02, 2011 at 01:53:29AM -0700, Prafulla Wadaskar wrote:
> > static int macronix_write(struct spi_flash *flash,
> > u32 offset, size_t len, const void *buf)
> > {
> > @@ -223,5 +307,8 @@ struct spi_flash *spi_flash_probe_macronix(struct
> > spi_slave *spi, u8 *idcode)
> > * params->sectors_per_block;
> > mcx->flash.size = mcx->flash.sector_size * params->nr_blocks;
> >
> > + if (macronix_disable_protect(&mcx->flash))
> > + printf("SF: disable write protection failed\n");
> > +
>
> This will forced disable the flash being written.
Yes, as the SST driver do. Maybe it is good enough for the Macronix
driver too ?
> What if some one has purposely protected certain flash sectors?
Honestly, I don't know. Block protection for SPI flashes is not
supported either by u-boot (except for SST which only disable it)
nor by Linux. So, I am not sure this feature is really used.
>
> This feature should be addressed through protect CLI
I could add an unlock method to the SPI flash operation structure.
And then, I could bind this method to a CLI command "sf unlock"...
Do you want me to do that ?
Regards,
Simon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110502/32c2ee99/attachment.pgp
More information about the U-Boot
mailing list