Hello Sajida Bhanu,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/38542
to review the following change.
Change subject: sc7180: QSIP SPI NOR addressing mode ......................................................................
sc7180: QSIP SPI NOR addressing mode
Putting SPI NOR 3 byte addressing mode as it is not supporting 4 byte addressing mode.
Change-Id: I232dde9387f0c83dd1578f3cbab4ab85a711349d Signed-off-by: Veerabhadrarao Badiganti vbadigan@codeaurora.org Signed-off-by: Shaik Sajida Bhanu sbhanu@codeaurora.org --- M src/drivers/spi/spi_flash.c M src/drivers/spi/winbond.c 2 files changed, 24 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/42/38542/1
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index 90dd587..85cc160 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -459,6 +459,7 @@ { struct spi_slave spi; int ret = -1; + u8 reg8;
if (spi_setup_slave(bus, cs, &spi)) { printk(BIOS_WARNING, "SF: Failed to set up slave\n"); @@ -491,6 +492,21 @@ " CONFIG_ROM_SIZE 0x%x!!\n", flash->size, CONFIG_ROM_SIZE); } + + /*Check addressing mode*/ + spi_flash_cmd(&flash->spi, 0x15, ®8, sizeof(reg8)); + + if (reg8 & 0x1 ) { + printk(BIOS_WARNING, "4 byte adressing mode set:%02x\n. Falling back to 3 byte addressing mode\n", reg8); + } + + spi_flash_cmd(&flash->spi, 0xe9, NULL, 0); + spi_flash_cmd(&flash->spi, 0x15, ®8, sizeof(reg8)); + if (reg8 & 0x1 ) { + printk(BIOS_WARNING, "4 byte adressing mode set:%02x\n. Exiting 4 byte mode not working . Looping here\n ", reg8); + while(1); + } + return 0; }
diff --git a/src/drivers/spi/winbond.c b/src/drivers/spi/winbond.c index e85f59d..c4dc3d4 100644 --- a/src/drivers/spi/winbond.c +++ b/src/drivers/spi/winbond.c @@ -174,6 +174,14 @@ .bp_bits = 3, }, { + .id = 0x6019, + .name = "W25Q64DW", + .nr_sectors_shift = 11, + .fast_read_dual_output_support = 1, + .protection_granularity_shift = 17, + .bp_bits = 3, + }, + { .id = 0x4018, .name = "W25Q128_V", .nr_sectors_shift = 12,