Edward O'Callaghan submitted this change.
sb600spi.c: Reorder functions with primitives at the top
Reshuffle file with no semantic changes, this avoids unnecessary
prototypes for static member functions as to be an easier implementation
to parse.
BUG=none
TEST=builds
Change-Id: If3970d850989eafc59cec9158ecfcdafc7a8caea
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/47665
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Sam McNally <sammc@google.com>
---
M sb600spi.c
1 file changed, 20 insertions(+), 25 deletions(-)
diff --git a/sb600spi.c b/sb600spi.c
index 5892d57..8eaf41f 100644
--- a/sb600spi.c
+++ b/sb600spi.c
@@ -56,31 +56,6 @@
#define FIFO_SIZE_OLD 8
#define FIFO_SIZE_YANGTZE 71
-static int sb600_spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt,
- const unsigned char *writearr, unsigned char *readarr);
-static int spi100_spi_send_command(const struct flashctx *flash, unsigned int writecnt, unsigned int readcnt,
- const unsigned char *writearr, unsigned char *readarr);
-
-static struct spi_master spi_master_sb600 = {
- .max_data_read = FIFO_SIZE_OLD,
- .max_data_write = FIFO_SIZE_OLD - 3,
- .command = sb600_spi_send_command,
- .multicommand = default_spi_send_multicommand,
- .read = default_spi_read,
- .write_256 = default_spi_write_256,
- .write_aai = default_spi_write_aai,
-};
-
-static struct spi_master spi_master_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,
- .multicommand = default_spi_send_multicommand,
- .read = default_spi_read,
- .write_256 = default_spi_write_256,
- .write_aai = default_spi_write_aai,
-};
-
static int find_smbus_dev_rev(uint16_t vendor, uint16_t device)
{
struct pci_dev *smbus_dev = pci_dev_find(vendor, device);
@@ -570,6 +545,26 @@
return amd_imc_shutdown(dev);
}
+static struct spi_master spi_master_sb600 = {
+ .max_data_read = FIFO_SIZE_OLD,
+ .max_data_write = FIFO_SIZE_OLD - 3,
+ .command = sb600_spi_send_command,
+ .multicommand = default_spi_send_multicommand,
+ .read = default_spi_read,
+ .write_256 = default_spi_write_256,
+ .write_aai = default_spi_write_aai,
+};
+
+static struct spi_master spi_master_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,
+ .multicommand = default_spi_send_multicommand,
+ .read = default_spi_read,
+ .write_256 = default_spi_write_256,
+ .write_aai = default_spi_write_aai,
+};
+
int sb600_probe_spi(struct pci_dev *dev)
{
struct pci_dev *smbus_dev;
To view, visit change 47665. To unsubscribe, or for help writing mail filters, visit settings.