diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/spi/spi_flash.c | 22 | ||||
-rw-r--r-- | src/include/spi-generic.h | 13 |
2 files changed, 24 insertions, 11 deletions
diff --git a/src/drivers/spi/spi_flash.c b/src/drivers/spi/spi_flash.c index e2485ab7a7..5dbe1f4d8e 100644 --- a/src/drivers/spi/spi_flash.c +++ b/src/drivers/spi/spi_flash.c @@ -282,38 +282,38 @@ static struct { } flashes[] = { /* Keep it sorted by define name */ #if CONFIG(SPI_FLASH_AMIC) - { 0, 0x37, spi_flash_probe_amic, }, + { 0, VENDOR_ID_AMIC, spi_flash_probe_amic, }, #endif #if CONFIG(SPI_FLASH_ATMEL) - { 0, 0x1f, spi_flash_probe_atmel, }, + { 0, VENDOR_ID_ATMEL, spi_flash_probe_atmel, }, #endif #if CONFIG(SPI_FLASH_EON) - { 0, 0x1c, spi_flash_probe_eon, }, + { 0, VENDOR_ID_EON, spi_flash_probe_eon, }, #endif #if CONFIG(SPI_FLASH_GIGADEVICE) - { 0, 0xc8, spi_flash_probe_gigadevice, }, + { 0, VENDOR_ID_GIGADEVICE, spi_flash_probe_gigadevice, }, #endif #if CONFIG(SPI_FLASH_MACRONIX) - { 0, 0xc2, spi_flash_probe_macronix, }, + { 0, VENDOR_ID_MACRONIX, spi_flash_probe_macronix, }, #endif #if CONFIG(SPI_FLASH_SPANSION) - { 0, 0x01, spi_flash_probe_spansion, }, + { 0, VENDOR_ID_SPANSION, spi_flash_probe_spansion, }, #endif #if CONFIG(SPI_FLASH_SST) - { 0, 0xbf, spi_flash_probe_sst, }, + { 0, VENDOR_ID_SST, spi_flash_probe_sst, }, #endif #if CONFIG(SPI_FLASH_STMICRO) - { 0, 0x20, spi_flash_probe_stmicro, }, + { 0, VENDOR_ID_STMICRO, spi_flash_probe_stmicro, }, #endif #if CONFIG(SPI_FLASH_WINBOND) - { 0, 0xef, spi_flash_probe_winbond, }, + { 0, VENDOR_ID_WINBOND, spi_flash_probe_winbond, }, #endif /* Keep it sorted by best detection */ #if CONFIG(SPI_FLASH_STMICRO) - { 0, 0xff, spi_flash_probe_stmicro, }, + { 0, VENDOR_ID_STMICRO_FF, spi_flash_probe_stmicro, }, #endif #if CONFIG(SPI_FLASH_ADESTO) - { 0, 0x1f, spi_flash_probe_adesto, }, + { 0, VENDOR_ID_ADESTO, spi_flash_probe_adesto, }, #endif }; #define IDCODE_LEN (IDCODE_CONT_LEN + IDCODE_PART_LEN) diff --git a/src/include/spi-generic.h b/src/include/spi-generic.h index ffd3d2d008..c8dbb6798a 100644 --- a/src/include/spi-generic.h +++ b/src/include/spi-generic.h @@ -28,6 +28,19 @@ #include <stdint.h> #include <stddef.h> +/* SPI vendor IDs */ +#define VENDOR_ID_ADESTO 0x1f +#define VENDOR_ID_AMIC 0x37 +#define VENDOR_ID_ATMEL 0x1f +#define VENDOR_ID_EON 0x1c +#define VENDOR_ID_GIGADEVICE 0xc8 +#define VENDOR_ID_MACRONIX 0xc2 +#define VENDOR_ID_SPANSION 0x01 +#define VENDOR_ID_SST 0xbf +#define VENDOR_ID_STMICRO 0x20 +#define VENDOR_ID_STMICRO_FF 0xff +#define VENDOR_ID_WINBOND 0xef + /* Controller-specific definitions: */ struct spi_ctrlr; |