From: Simon Guinot Date: Mon, 2 May 2011 09:58:07 +0000 Subject: [U-Boot] [PATCH v2 2/6] sf: disable write protection for Macronix flash In-Reply-To: References: <1304284220-15215-3-git-send-email-sguinot@lacie.com> Message-ID: <20110502095807.GL19806@kw.sim.vm.gnt> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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