Nico Huber has uploaded a new change for review. ( https://review.coreboot.org/19421 )
Change subject: spi: Drop spi_controller type ......................................................................
spi: Drop spi_controller type
Not needed anymore. Drop it fast before it encourages anyone to layering violations again!
Change-Id: I8eda93b429e3ebaef79e22aba76be62987e496f4 Signed-off-by: Nico Huber nico.h@gmx.de --- M buspirate_spi.c M ch341a_spi.c M dediprog.c M dummyflasher.c M ft2232_spi.c M ichspi.c M it85spi.c M it87spi.c M linux_spi.c M mstarddc_spi.c M pickit2_spi.c M programmer.h M sb600spi.c M serprog.c M usbblaster_spi.c M wbsio_spi.c 16 files changed, 0 insertions(+), 68 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/21/19421/1
diff --git a/buspirate_spi.c b/buspirate_spi.c index b6554ac..fe3c831 100644 --- a/buspirate_spi.c +++ b/buspirate_spi.c @@ -135,7 +135,6 @@ const unsigned char *writearr, unsigned char *readarr);
static struct spi_master spi_master_buspirate = { - .type = SPI_CONTROLLER_BUSPIRATE, .max_data_read = MAX_DATA_UNSPECIFIED, .max_data_write = MAX_DATA_UNSPECIFIED, .command = NULL, diff --git a/ch341a_spi.c b/ch341a_spi.c index 6eb2804..01cb847 100644 --- a/ch341a_spi.c +++ b/ch341a_spi.c @@ -398,7 +398,6 @@ }
static const struct spi_master spi_master_ch341a_spi = { - .type = SPI_CONTROLLER_CH341A_SPI, /* flashrom's current maximum is 256 B. CH341A was tested on Linux and Windows to accept atleast * 128 kB. Basically there should be no hard limit because transfers are broken up into USB packets * sent to the device and most of their payload streamed via SPI. */ diff --git a/dediprog.c b/dediprog.c index 6f82772..a73aa8c 100644 --- a/dediprog.c +++ b/dediprog.c @@ -909,7 +909,6 @@ }
static const struct spi_master spi_master_dediprog = { - .type = SPI_CONTROLLER_DEDIPROG, .max_data_read = 16, /* 18 seems to work fine as well, but 19 times out sometimes with FW 5.15. */ .max_data_write = 16, .command = dediprog_spi_send_command, diff --git a/dummyflasher.c b/dummyflasher.c index f171128..2ecff49 100644 --- a/dummyflasher.c +++ b/dummyflasher.c @@ -110,7 +110,6 @@ static void dummy_chip_readn(const struct flashctx *flash, uint8_t *buf, const chipaddr addr, size_t len);
static const struct spi_master spi_master_dummyflasher = { - .type = SPI_CONTROLLER_DUMMY, .max_data_read = MAX_DATA_READ_UNLIMITED, .max_data_write = MAX_DATA_UNSPECIFIED, .command = dummy_spi_send_command, diff --git a/ft2232_spi.c b/ft2232_spi.c index be60837..39d7707 100644 --- a/ft2232_spi.c +++ b/ft2232_spi.c @@ -158,7 +158,6 @@ unsigned char *readarr);
static const struct spi_master spi_master_ft2232 = { - .type = SPI_CONTROLLER_FT2232, .max_data_read = 64 * 1024, .max_data_write = 256, .command = ft2232_spi_send_command, diff --git a/ichspi.c b/ichspi.c index 1ab114c..86d3faf 100644 --- a/ichspi.c +++ b/ichspi.c @@ -1542,7 +1542,6 @@ }
static const struct spi_master spi_master_ich7 = { - .type = SPI_CONTROLLER_ICH7, .max_data_read = 64, .max_data_write = 64, .command = ich_spi_send_command, @@ -1554,7 +1553,6 @@ };
static const struct spi_master spi_master_ich9 = { - .type = SPI_CONTROLLER_ICH9, .max_data_read = 64, .max_data_write = 64, .command = ich_spi_send_command, @@ -1831,7 +1829,6 @@ }
static const struct spi_master spi_master_via = { - .type = SPI_CONTROLLER_VIA, .max_data_read = 16, .max_data_write = 16, .command = ich_spi_send_command, diff --git a/it85spi.c b/it85spi.c index 1cc8730..25b084e 100644 --- a/it85spi.c +++ b/it85spi.c @@ -280,7 +280,6 @@ unsigned char *readarr);
static const struct spi_master spi_master_it85xx = { - .type = SPI_CONTROLLER_IT85XX, .max_data_read = 64, .max_data_write = 64, .command = it85xx_spi_send_command, diff --git a/it87spi.c b/it87spi.c index 09793de..5c7ee3a 100644 --- a/it87spi.c +++ b/it87spi.c @@ -112,7 +112,6 @@ unsigned int start, unsigned int len);
static const struct spi_master spi_master_it87xx = { - .type = SPI_CONTROLLER_IT87XX, .max_data_read = 3, .max_data_write = MAX_DATA_UNSPECIFIED, .command = it8716f_spi_send_command, diff --git a/linux_spi.c b/linux_spi.c index e51fbc4..82e7ef7 100644 --- a/linux_spi.c +++ b/linux_spi.c @@ -54,7 +54,6 @@ unsigned int start, unsigned int len);
static const struct spi_master spi_master_linux = { - .type = SPI_CONTROLLER_LINUX, .max_data_read = MAX_DATA_UNSPECIFIED, /* TODO? */ .max_data_write = MAX_DATA_UNSPECIFIED, /* TODO? */ .command = linux_spi_send_command, diff --git a/mstarddc_spi.c b/mstarddc_spi.c index 809d690..faab347 100644 --- a/mstarddc_spi.c +++ b/mstarddc_spi.c @@ -224,7 +224,6 @@ }
static const struct spi_master spi_master_mstarddc = { - .type = SPI_CONTROLLER_MSTARDDC, .max_data_read = 256, .max_data_write = 256, .command = mstarddc_spi_send_command, diff --git a/pickit2_spi.c b/pickit2_spi.c index 102fe37..d1cd415 100644 --- a/pickit2_spi.c +++ b/pickit2_spi.c @@ -354,7 +354,6 @@ }
static const struct spi_master spi_master_pickit2 = { - .type = SPI_CONTROLLER_PICKIT2, .max_data_read = 40, .max_data_write = 40, .command = pickit2_spi_send_command, diff --git a/programmer.h b/programmer.h index b5306db..2779a13 100644 --- a/programmer.h +++ b/programmer.h @@ -530,60 +530,10 @@ char *extract_programmer_param(const char *param_name);
/* spi.c */ -enum spi_controller { - SPI_CONTROLLER_NONE, -#if CONFIG_INTERNAL == 1 -#if defined(__i386__) || defined(__x86_64__) - SPI_CONTROLLER_ICH7, - SPI_CONTROLLER_ICH9, - SPI_CONTROLLER_IT85XX, - SPI_CONTROLLER_IT87XX, - SPI_CONTROLLER_SB600, - SPI_CONTROLLER_YANGTZE, - SPI_CONTROLLER_VIA, - SPI_CONTROLLER_WBSIO, -#endif -#endif -#if CONFIG_FT2232_SPI == 1 - SPI_CONTROLLER_FT2232, -#endif -#if CONFIG_DUMMY == 1 - SPI_CONTROLLER_DUMMY, -#endif -#if CONFIG_BUSPIRATE_SPI == 1 - SPI_CONTROLLER_BUSPIRATE, -#endif -#if CONFIG_DEDIPROG == 1 - SPI_CONTROLLER_DEDIPROG, -#endif -#if CONFIG_OGP_SPI == 1 || CONFIG_NICINTEL_SPI == 1 || CONFIG_RAYER_SPI == 1 || CONFIG_PONY_SPI == 1 || (CONFIG_INTERNAL == 1 && (defined(__i386__) || defined(__x86_64__))) - SPI_CONTROLLER_BITBANG, -#endif -#if CONFIG_LINUX_SPI == 1 - SPI_CONTROLLER_LINUX, -#endif -#if CONFIG_SERPROG == 1 - SPI_CONTROLLER_SERPROG, -#endif -#if CONFIG_USBBLASTER_SPI == 1 - SPI_CONTROLLER_USBBLASTER, -#endif -#if CONFIG_MSTARDDC_SPI == 1 - SPI_CONTROLLER_MSTARDDC, -#endif -#if CONFIG_PICKIT2_SPI == 1 - SPI_CONTROLLER_PICKIT2, -#endif -#if CONFIG_CH341A_SPI == 1 - SPI_CONTROLLER_CH341A_SPI, -#endif -}; - #define MAX_DATA_UNSPECIFIED 0 #define MAX_DATA_READ_UNLIMITED 64 * 1024 #define MAX_DATA_WRITE_UNLIMITED 256 struct spi_master { - enum spi_controller type; unsigned int max_data_read; // (Ideally,) maximum data read size in one go (excluding opcode+address). unsigned int max_data_write; // (Ideally,) maximum data write size in one go (excluding opcode+address). int (*command)(struct flashctx *flash, unsigned int writecnt, unsigned int readcnt, diff --git a/sb600spi.c b/sb600spi.c index 6bd5679..dc5419b 100644 --- a/sb600spi.c +++ b/sb600spi.c @@ -65,7 +65,6 @@ const unsigned char *writearr, unsigned char *readarr);
static struct spi_master spi_master_sb600 = { - .type = SPI_CONTROLLER_SB600, .max_data_read = FIFO_SIZE_OLD, .max_data_write = FIFO_SIZE_OLD - 3, .command = sb600_spi_send_command, @@ -76,7 +75,6 @@ };
static struct spi_master spi_master_yangtze = { - .type = SPI_CONTROLLER_YANGTZE, .max_data_read = FIFO_SIZE_YANGTZE - 3, /* Apparently the big SPI 100 buffer is not a ring buffer. */ .max_data_write = FIFO_SIZE_YANGTZE - 3, .command = spi100_spi_send_command, diff --git a/serprog.c b/serprog.c index 98aac83..7d35566 100644 --- a/serprog.c +++ b/serprog.c @@ -306,7 +306,6 @@ static int serprog_spi_read(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len); static struct spi_master spi_master_serprog = { - .type = SPI_CONTROLLER_SERPROG, .max_data_read = MAX_DATA_READ_UNLIMITED, .max_data_write = MAX_DATA_WRITE_UNLIMITED, .command = serprog_spi_send_command, diff --git a/usbblaster_spi.c b/usbblaster_spi.c index 7a609f1..8679f24 100644 --- a/usbblaster_spi.c +++ b/usbblaster_spi.c @@ -212,7 +212,6 @@
static const struct spi_master spi_master_usbblaster = { - .type = SPI_CONTROLLER_USBBLASTER, .max_data_read = 256, .max_data_write = 256, .command = usbblaster_spi_send_command, diff --git a/wbsio_spi.c b/wbsio_spi.c index 577a7d1..943653a 100644 --- a/wbsio_spi.c +++ b/wbsio_spi.c @@ -69,7 +69,6 @@ unsigned int start, unsigned int len);
static const struct spi_master spi_master_wbsio = { - .type = SPI_CONTROLLER_WBSIO, .max_data_read = 3, .max_data_write = MAX_DATA_UNSPECIFIED, .command = wbsio_spi_send_command,