
-----Original Message----- From: Simon Guinot [mailto:simon.guinot@sequanux.org] Sent: Monday, May 02, 2011 3:28 PM To: Prafulla Wadaskar Cc: Simon Guinot; Albert ARIBAUD; Wolfgang Denk; u-boot@lists.denx.de; Prabhanjan Sarnaik; Ashish Karkare; Mike Frysinger Subject: Re: [U-Boot] [PATCH v2 2/6] sf: disable write protection for Macronix flash
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 ?
Let's get Mike's opinion on this.
Regards.. Prafulla . .