drivers/spi: Add ISSI IS25WP256D flash

datasheet: IS25WP256D Rev A13 (2023-08-03)

tested:
boot SiFive Hifive Unmatched board

Signed-off-by: Maximilian Brune <maximilian.brune@9elements.com>
Change-Id: I655776258cbcf464becf38cbb5045cda5bca711c
Reviewed-on: https://review.coreboot.org/c/coreboot/+/79369
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Maximilian Brune 2023-08-28 13:57:20 +02:00 committed by Felix Held
parent b24eadb973
commit 7bcf4ae4d2
6 changed files with 42 additions and 0 deletions

View File

@ -155,6 +155,13 @@ config SPI_FLASH_WINBOND
Select this option if your chipset driver needs to store certain Select this option if your chipset driver needs to store certain
data in the SPI flash and your SPI flash is made by Winbond. data in the SPI flash and your SPI flash is made by Winbond.
config SPI_FLASH_ISSI
bool
default y if SPI_FLASH_INCLUDE_ALL_DRIVERS
help
Select this option if your chipset driver needs to store certain
data in the SPI flash and your SPI flash is made by ISSI.
config SPI_FLASH_HAS_VOLATILE_GROUP config SPI_FLASH_HAS_VOLATILE_GROUP
bool bool
default n default n

View File

@ -30,6 +30,7 @@ $(1)-$(CONFIG_SPI_FLASH_SPANSION) += spansion.c
$(1)-$(CONFIG_SPI_FLASH_SST) += sst.c $(1)-$(CONFIG_SPI_FLASH_SST) += sst.c
$(1)-$(CONFIG_SPI_FLASH_STMICRO) += stmicro.c $(1)-$(CONFIG_SPI_FLASH_STMICRO) += stmicro.c
$(1)-$(CONFIG_SPI_FLASH_WINBOND) += winbond.c $(1)-$(CONFIG_SPI_FLASH_WINBOND) += winbond.c
$(1)-$(CONFIG_SPI_FLASH_ISSI) += issi.c
endef endef
$(eval $(call add_spi_stage,bootblock,_EARLY)) $(eval $(call add_spi_stage,bootblock,_EARLY))

29
src/drivers/spi/issi.c Normal file
View File

@ -0,0 +1,29 @@
/* SPDX-License-Identifier: GPL-2.0-or-later */
#include <console/console.h>
#include <commonlib/helpers.h>
#include <spi_flash.h>
#include <spi-generic.h>
#include <delay.h>
#include <lib.h>
#include "spi_flash_internal.h"
static const struct spi_flash_part_id flash_table[] = {
{
/* IS25WP256D */
.id[0] = 0x7019,
.nr_sectors_shift = 13,
},
};
const struct spi_flash_vendor_info spi_flash_issi_vi = {
.id = VENDOR_ID_ISSI,
.page_size_shift = 8, // 256 byte page size
.sector_size_kib_shift = 2, // 4 Kbyte sector size
.match_id_mask[0] = 0xffff,
.ids = flash_table,
.nr_part_ids = ARRAY_SIZE(flash_table),
.desc = &spi_flash_pp_0x20_sector_desc,
.prot_ops = NULL,
};

View File

@ -397,6 +397,9 @@ static const struct spi_flash_vendor_info *spi_flash_vendors[] = {
#if CONFIG(SPI_FLASH_WINBOND) #if CONFIG(SPI_FLASH_WINBOND)
&spi_flash_winbond_vi, &spi_flash_winbond_vi,
#endif #endif
#if CONFIG(SPI_FLASH_ISSI)
&spi_flash_issi_vi,
#endif
}; };
#define IDCODE_LEN 5 #define IDCODE_LEN 5

View File

@ -123,6 +123,7 @@ extern const struct spi_flash_vendor_info spi_flash_stmicro2_vi;
extern const struct spi_flash_vendor_info spi_flash_stmicro3_vi; extern const struct spi_flash_vendor_info spi_flash_stmicro3_vi;
extern const struct spi_flash_vendor_info spi_flash_stmicro4_vi; extern const struct spi_flash_vendor_info spi_flash_stmicro4_vi;
extern const struct spi_flash_vendor_info spi_flash_winbond_vi; extern const struct spi_flash_vendor_info spi_flash_winbond_vi;
extern const struct spi_flash_vendor_info spi_flash_issi_vi;
/* Page Programming Command Set with 0x20 Sector Erase command. */ /* Page Programming Command Set with 0x20 Sector Erase command. */
extern const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc; extern const struct spi_flash_ops_descriptor spi_flash_pp_0x20_sector_desc;

View File

@ -25,6 +25,7 @@
#define VENDOR_ID_SST 0xbf #define VENDOR_ID_SST 0xbf
#define VENDOR_ID_STMICRO 0x20 #define VENDOR_ID_STMICRO 0x20
#define VENDOR_ID_WINBOND 0xef #define VENDOR_ID_WINBOND 0xef
#define VENDOR_ID_ISSI 0x9d
/* Controller-specific definitions: */ /* Controller-specific definitions: */