mirror of
https://review.coreboot.org/flashrom.git
synced 2025-07-02 06:23:18 +02:00
bitbang_spi: Drop bitbang_spi_master_type
It only existed to make maintenance harder and waste our time. Change-Id: I7a3b5d9ff1e99d2d4f873c6f19fb318f93762037 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/c/flashrom/+/33638 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
@ -70,7 +70,6 @@ static int bitbang_spi_send_command(struct flashctx *flash,
|
|||||||
unsigned char *readarr);
|
unsigned char *readarr);
|
||||||
|
|
||||||
static const struct spi_master spi_master_bitbang = {
|
static const struct spi_master spi_master_bitbang = {
|
||||||
.type = SPI_CONTROLLER_BITBANG,
|
|
||||||
.features = SPI_MASTER_4BA,
|
.features = SPI_MASTER_4BA,
|
||||||
.max_data_read = MAX_DATA_READ_UNLIMITED,
|
.max_data_read = MAX_DATA_READ_UNLIMITED,
|
||||||
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
|
.max_data_write = MAX_DATA_WRITE_UNLIMITED,
|
||||||
@ -92,11 +91,8 @@ static int bitbang_spi_shutdown(const struct bitbang_spi_master *master)
|
|||||||
int register_spi_bitbang_master(const struct bitbang_spi_master *master)
|
int register_spi_bitbang_master(const struct bitbang_spi_master *master)
|
||||||
{
|
{
|
||||||
struct spi_master mst = spi_master_bitbang;
|
struct spi_master mst = spi_master_bitbang;
|
||||||
/* BITBANG_SPI_INVALID is 0, so if someone forgot to initialize ->type,
|
/* If someone forgot to initialize a bitbang function, we catch it here. */
|
||||||
* we catch it here. Same goes for missing initialization of bitbanging
|
if (!master || !master->set_cs ||
|
||||||
* functions.
|
|
||||||
*/
|
|
||||||
if (!master || master->type == BITBANG_SPI_INVALID || !master->set_cs ||
|
|
||||||
!master->set_sck || !master->set_mosi || !master->get_miso ||
|
!master->set_sck || !master->set_mosi || !master->get_miso ||
|
||||||
(master->request_bus && !master->release_bus) ||
|
(master->request_bus && !master->release_bus) ||
|
||||||
(!master->request_bus && master->release_bus)) {
|
(!master->request_bus && master->release_bus)) {
|
||||||
|
@ -121,7 +121,6 @@ static void cp210x_bitbang_set_sck_set_mosi(int sck, int mosi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_cp210x = {
|
static const struct bitbang_spi_master bitbang_spi_master_cp210x = {
|
||||||
.type = BITBANG_SPI_MASTER_DEVELOPERBOX,
|
|
||||||
.set_cs = cp210x_bitbang_set_cs,
|
.set_cs = cp210x_bitbang_set_cs,
|
||||||
.set_sck = cp210x_bitbang_set_sck,
|
.set_sck = cp210x_bitbang_set_sck,
|
||||||
.set_mosi = cp210x_bitbang_set_mosi,
|
.set_mosi = cp210x_bitbang_set_mosi,
|
||||||
|
@ -88,7 +88,6 @@ static int mcp6x_bitbang_get_miso(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_mcp6x = {
|
static const struct bitbang_spi_master bitbang_spi_master_mcp6x = {
|
||||||
.type = BITBANG_SPI_MASTER_MCP,
|
|
||||||
.set_cs = mcp6x_bitbang_set_cs,
|
.set_cs = mcp6x_bitbang_set_cs,
|
||||||
.set_sck = mcp6x_bitbang_set_sck,
|
.set_sck = mcp6x_bitbang_set_sck,
|
||||||
.set_mosi = mcp6x_bitbang_set_mosi,
|
.set_mosi = mcp6x_bitbang_set_mosi,
|
||||||
|
@ -168,7 +168,6 @@ static int nicintel_bitbang_get_miso(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_nicintel = {
|
static const struct bitbang_spi_master bitbang_spi_master_nicintel = {
|
||||||
.type = BITBANG_SPI_MASTER_NICINTEL,
|
|
||||||
.set_cs = nicintel_bitbang_set_cs,
|
.set_cs = nicintel_bitbang_set_cs,
|
||||||
.set_sck = nicintel_bitbang_set_sck,
|
.set_sck = nicintel_bitbang_set_sck,
|
||||||
.set_mosi = nicintel_bitbang_set_mosi,
|
.set_mosi = nicintel_bitbang_set_mosi,
|
||||||
|
@ -83,7 +83,6 @@ static int ogp_bitbang_get_miso(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_ogp = {
|
static const struct bitbang_spi_master bitbang_spi_master_ogp = {
|
||||||
.type = BITBANG_SPI_MASTER_OGP,
|
|
||||||
.set_cs = ogp_bitbang_set_cs,
|
.set_cs = ogp_bitbang_set_cs,
|
||||||
.set_sck = ogp_bitbang_set_sck,
|
.set_sck = ogp_bitbang_set_sck,
|
||||||
.set_mosi = ogp_bitbang_set_mosi,
|
.set_mosi = ogp_bitbang_set_mosi,
|
||||||
|
@ -91,7 +91,6 @@ static int pony_bitbang_get_miso(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_pony = {
|
static const struct bitbang_spi_master bitbang_spi_master_pony = {
|
||||||
.type = BITBANG_SPI_MASTER_PONY,
|
|
||||||
.set_cs = pony_bitbang_set_cs,
|
.set_cs = pony_bitbang_set_cs,
|
||||||
.set_sck = pony_bitbang_set_sck,
|
.set_sck = pony_bitbang_set_sck,
|
||||||
.set_mosi = pony_bitbang_set_mosi,
|
.set_mosi = pony_bitbang_set_mosi,
|
||||||
|
26
programmer.h
26
programmer.h
@ -159,33 +159,7 @@ extern const struct programmer_entry programmer_table[];
|
|||||||
int programmer_init(enum programmer prog, const char *param);
|
int programmer_init(enum programmer prog, const char *param);
|
||||||
int programmer_shutdown(void);
|
int programmer_shutdown(void);
|
||||||
|
|
||||||
enum bitbang_spi_master_type {
|
|
||||||
BITBANG_SPI_INVALID = 0, /* This must always be the first entry. */
|
|
||||||
#if CONFIG_RAYER_SPI == 1
|
|
||||||
BITBANG_SPI_MASTER_RAYER,
|
|
||||||
#endif
|
|
||||||
#if CONFIG_PONY_SPI == 1
|
|
||||||
BITBANG_SPI_MASTER_PONY,
|
|
||||||
#endif
|
|
||||||
#if CONFIG_NICINTEL_SPI == 1
|
|
||||||
BITBANG_SPI_MASTER_NICINTEL,
|
|
||||||
#endif
|
|
||||||
#if CONFIG_INTERNAL == 1
|
|
||||||
#if defined(__i386__) || defined(__x86_64__)
|
|
||||||
BITBANG_SPI_MASTER_MCP,
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
#if CONFIG_OGP_SPI == 1
|
|
||||||
BITBANG_SPI_MASTER_OGP,
|
|
||||||
#endif
|
|
||||||
#if CONFIG_DEVELOPERBOX_SPI == 1
|
|
||||||
BITBANG_SPI_MASTER_DEVELOPERBOX,
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
struct bitbang_spi_master {
|
struct bitbang_spi_master {
|
||||||
enum bitbang_spi_master_type type;
|
|
||||||
|
|
||||||
/* Note that CS# is active low, so val=0 means the chip is active. */
|
/* Note that CS# is active low, so val=0 means the chip is active. */
|
||||||
void (*set_cs) (int val);
|
void (*set_cs) (int val);
|
||||||
void (*set_sck) (int val);
|
void (*set_sck) (int val);
|
||||||
|
@ -157,7 +157,6 @@ static int rayer_bitbang_get_miso(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct bitbang_spi_master bitbang_spi_master_rayer = {
|
static const struct bitbang_spi_master bitbang_spi_master_rayer = {
|
||||||
.type = BITBANG_SPI_MASTER_RAYER,
|
|
||||||
.set_cs = rayer_bitbang_set_cs,
|
.set_cs = rayer_bitbang_set_cs,
|
||||||
.set_sck = rayer_bitbang_set_sck,
|
.set_sck = rayer_bitbang_set_sck,
|
||||||
.set_mosi = rayer_bitbang_set_mosi,
|
.set_mosi = rayer_bitbang_set_mosi,
|
||||||
|
Reference in New Issue
Block a user