Skip to content

Commit ea60658

Browse files
Graf YangDavid Woodhouse
authored andcommitted
mtd: m25p80: disable SST software protection bits by default
The SST SPI flashes is like Atmel SPI flashes in that the software protection bits are set by default at power up, so clear them at init time. Signed-off-by: Graf Yang <graf.yang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
1 parent de19d02 commit ea60658

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/mtd/devices/m25p80.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,12 @@ static int __devinit m25p_probe(struct spi_device *spi)
775775
dev_set_drvdata(&spi->dev, flash);
776776

777777
/*
778-
* Atmel serial flash tend to power up
779-
* with the software protection bits set
778+
* Atmel and SST serial flash tend to power
779+
* up with the software protection bits set
780780
*/
781781

782-
if (info->jedec_id >> 16 == 0x1f) {
782+
if (info->jedec_id >> 16 == 0x1f ||
783+
info->jedec_id >> 16 == 0xbf) {
783784
write_enable(flash);
784785
write_sr(flash, 0);
785786
}

0 commit comments

Comments
 (0)