summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Huber <nico.h@gmx.de>2017-04-22 00:09:42 +0200
committerNico Huber <nico.h@gmx.de>2019-06-27 10:25:15 +0000
commitdeeac7e41a311a0806af0e65a2ce5c6673f9cf92 (patch)
tree2ff1082bf9ed049c2863deff9a6d66b6980b1812
parent959aafa53eeae4f22766b9d098e5ca952af8c070 (diff)
downloadflashrom-deeac7e41a311a0806af0e65a2ce5c6673f9cf92.tar.gz
flashrom-deeac7e41a311a0806af0e65a2ce5c6673f9cf92.tar.bz2
flashrom-deeac7e41a311a0806af0e65a2ce5c6673f9cf92.zip
spi: Drop spi_controller type
Not needed anymore. Drop it fast before it encourages anyone to violate layers again! Change-Id: I8eda93b429e3ebaef79e22aba76be62987e496f4 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33651 Reviewed-by: Angel Pons <th3fanbus@gmail.com>
-rw-r--r--buspirate_spi.c3
-rw-r--r--ch341a_spi.c1
-rw-r--r--dediprog.c1
-rw-r--r--digilent_spi.c1
-rw-r--r--dummyflasher.c1
-rw-r--r--ft2232_spi.c1
-rw-r--r--ichspi.c3
-rw-r--r--it85spi.c1
-rw-r--r--it87spi.c1
-rw-r--r--jlink_spi.c1
-rw-r--r--linux_spi.c1
-rw-r--r--mstarddc_spi.c1
-rw-r--r--pickit2_spi.c1
-rw-r--r--programmer.h59
-rw-r--r--sb600spi.c2
-rw-r--r--serprog.c1
-rw-r--r--usbblaster_spi.c1
-rw-r--r--wbsio_spi.c1
18 files changed, 1 insertions, 80 deletions
diff --git a/buspirate_spi.c b/buspirate_spi.c
index 09f10c3ab..fb066c2a6 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -133,7 +133,6 @@ static int buspirate_spi_send_command_v2(struct flashctx *flash, unsigned int wr
const unsigned char *writearr, unsigned char *readarr);
static struct spi_master spi_master_buspirate = {
- .type = SPI_CONTROLLER_BUSPIRATE,
.features = SPI_MASTER_4BA,
.max_data_read = MAX_DATA_UNSPECIFIED,
.max_data_write = MAX_DATA_UNSPECIFIED,
@@ -663,4 +662,4 @@ static int buspirate_spi_send_command_v2(struct flashctx *flash, unsigned int wr
memcpy(readarr, bp_commbuf + 1, readcnt);
return ret;
-} \ No newline at end of file
+}
diff --git a/ch341a_spi.c b/ch341a_spi.c
index 83d5ccf35..d3af32f10 100644
--- a/ch341a_spi.c
+++ b/ch341a_spi.c
@@ -385,7 +385,6 @@ static int ch341a_spi_spi_send_command(struct flashctx *flash, unsigned int writ
}
static const struct spi_master spi_master_ch341a_spi = {
- .type = SPI_CONTROLLER_CH341A_SPI,
.features = SPI_MASTER_4BA,
/* 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
diff --git a/dediprog.c b/dediprog.c
index 5af1eec66..356610976 100644
--- a/dediprog.c
+++ b/dediprog.c
@@ -966,7 +966,6 @@ static int parse_voltage(char *voltage)
}
static struct spi_master spi_master_dediprog = {
- .type = SPI_CONTROLLER_DEDIPROG,
.features = SPI_MASTER_NO_4BA_MODES,
.max_data_read = 16, /* 18 seems to work fine as well, but 19 times out sometimes with FW 5.15. */
.max_data_write = 16,
diff --git a/digilent_spi.c b/digilent_spi.c
index d42c90f46..13a876e1d 100644
--- a/digilent_spi.c
+++ b/digilent_spi.c
@@ -313,7 +313,6 @@ static int digilent_spi_send_command(struct flashctx *flash, unsigned int writec
}
static const struct spi_master spi_master_digilent_spi = {
- .type = SPI_CONTROLLER_DIGILENT_SPI,
.features = SPI_MASTER_4BA,
.max_data_read = 252,
.max_data_write = 252,
diff --git a/dummyflasher.c b/dummyflasher.c
index 2ff989877..8f3dfda96 100644
--- a/dummyflasher.c
+++ b/dummyflasher.c
@@ -107,7 +107,6 @@ static uint32_t dummy_chip_readl(const struct flashctx *flash, const chipaddr ad
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,
.features = SPI_MASTER_4BA,
.max_data_read = MAX_DATA_READ_UNLIMITED,
.max_data_write = MAX_DATA_UNSPECIFIED,
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 5c4d06bd6..34b43ddee 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -154,7 +154,6 @@ static int ft2232_spi_send_command(struct flashctx *flash,
unsigned char *readarr);
static const struct spi_master spi_master_ft2232 = {
- .type = SPI_CONTROLLER_FT2232,
.features = SPI_MASTER_4BA,
.max_data_read = 64 * 1024,
.max_data_write = 256,
diff --git a/ichspi.c b/ichspi.c
index 6932678d7..66010403d 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -1666,7 +1666,6 @@ static void ich9_set_pr(const size_t reg_pr0, int i, int read_prot, int write_pr
}
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,
@@ -1677,7 +1676,6 @@ static const struct spi_master spi_master_ich7 = {
};
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,
@@ -1990,7 +1988,6 @@ int ich_init_spi(void *spibar, enum ich_chipset ich_gen)
}
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 3dbba78bf..3cd551420 100644
--- a/it85spi.c
+++ b/it85spi.c
@@ -276,7 +276,6 @@ static int it85xx_spi_send_command(struct flashctx *flash,
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 9e7a8eafc..f8b2b0ffb 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -108,7 +108,6 @@ static int it8716f_spi_chip_write_256(struct flashctx *flash, const uint8_t *buf
unsigned int start, unsigned int len);
static const struct spi_master spi_master_it87xx = {
- .type = SPI_CONTROLLER_IT87XX,
.max_data_read = MAX_DATA_UNSPECIFIED,
.max_data_write = MAX_DATA_UNSPECIFIED,
.command = it8716f_spi_send_command,
diff --git a/jlink_spi.c b/jlink_spi.c
index 08a9ba98c..8a69b41e6 100644
--- a/jlink_spi.c
+++ b/jlink_spi.c
@@ -152,7 +152,6 @@ static int jlink_spi_send_command(struct flashctx *flash, unsigned int writecnt,
}
static const struct spi_master spi_master_jlink_spi = {
- .type = SPI_CONTROLLER_JLINK_SPI,
/* Maximum data read size in one go (excluding opcode+address). */
.max_data_read = JTAG_MAX_TRANSFER_SIZE - 5,
/* Maximum data write size in one go (excluding opcode+address). */
diff --git a/linux_spi.c b/linux_spi.c
index 711ab4ac9..de09e607b 100644
--- a/linux_spi.c
+++ b/linux_spi.c
@@ -54,7 +54,6 @@ static int linux_spi_write_256(struct flashctx *flash, const uint8_t *buf,
unsigned int start, unsigned int len);
static const struct spi_master spi_master_linux = {
- .type = SPI_CONTROLLER_LINUX,
.features = SPI_MASTER_4BA,
.max_data_read = MAX_DATA_UNSPECIFIED, /* TODO? */
.max_data_write = MAX_DATA_UNSPECIFIED, /* TODO? */
diff --git a/mstarddc_spi.c b/mstarddc_spi.c
index afe4e1249..db1115774 100644
--- a/mstarddc_spi.c
+++ b/mstarddc_spi.c
@@ -220,7 +220,6 @@ static int mstarddc_spi_send_command(struct flashctx *flash,
}
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 4354025ea..e13e7211c 100644
--- a/pickit2_spi.c
+++ b/pickit2_spi.c
@@ -350,7 +350,6 @@ static int parse_voltage(char *voltage)
}
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 8f0183ff9..e34289865 100644
--- a/programmer.h
+++ b/programmer.h
@@ -571,64 +571,6 @@ unsigned int count_max_decode_exceedings(const struct flashctx *flash);
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_MTD == 1
- SPI_CONTROLLER_LINUX_MTD,
-#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
-#if CONFIG_DIGILENT_SPI == 1
- SPI_CONTROLLER_DIGILENT_SPI,
-#endif
-#if CONFIG_JLINK_SPI == 1
- SPI_CONTROLLER_JLINK_SPI,
-#endif
-};
-
#define MAX_DATA_UNSPECIFIED 0
#define MAX_DATA_READ_UNLIMITED 64 * 1024
#define MAX_DATA_WRITE_UNLIMITED 256
@@ -638,7 +580,6 @@ enum spi_controller {
register, 4BA mode switch) don't work */
struct spi_master {
- enum spi_controller type;
uint32_t features;
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).
diff --git a/sb600spi.c b/sb600spi.c
index 1efb2ce86..fd9487c36 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -61,7 +61,6 @@ static int spi100_spi_send_command(struct flashctx *flash, unsigned int writecnt
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,
@@ -72,7 +71,6 @@ static struct spi_master spi_master_sb600 = {
};
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 b7ef35ce7..b6c85c9fb 100644
--- a/serprog.c
+++ b/serprog.c
@@ -300,7 +300,6 @@ static int serprog_spi_send_command(struct flashctx *flash,
const unsigned char *writearr,
unsigned char *readarr);
static struct spi_master spi_master_serprog = {
- .type = SPI_CONTROLLER_SERPROG,
.features = SPI_MASTER_4BA,
.max_data_read = MAX_DATA_READ_UNLIMITED,
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
diff --git a/usbblaster_spi.c b/usbblaster_spi.c
index f9d72c27a..886cb57d3 100644
--- a/usbblaster_spi.c
+++ b/usbblaster_spi.c
@@ -208,7 +208,6 @@ static int usbblaster_spi_send_command(struct flashctx *flash, unsigned int writ
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 d7651c092..28b568e58 100644
--- a/wbsio_spi.c
+++ b/wbsio_spi.c
@@ -65,7 +65,6 @@ static int wbsio_spi_read(struct flashctx *flash, uint8_t *buf,
unsigned int start, unsigned int len);
static const struct spi_master spi_master_wbsio = {
- .type = SPI_CONTROLLER_WBSIO,
.max_data_read = MAX_DATA_UNSPECIFIED,
.max_data_write = MAX_DATA_UNSPECIFIED,
.command = wbsio_spi_send_command,