From 97dcc971c48f9c802a2f8ec8a68a51ccc27e5829 Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Tue, 17 Nov 2020 19:27:13 +1100 Subject: 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 Reviewed-on: https://review.coreboot.org/c/flashrom/+/47665 Tested-by: build bot (Jenkins) Reviewed-by: Sam McNally --- sb600spi.c | 45 ++++++++++++++++++++------------------------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/sb600spi.c b/sb600spi.c index 5892d57b..8eaf41f3 100644 --- a/sb600spi.c +++ b/sb600spi.c @@ -56,31 +56,6 @@ static enum amd_chipset amd_gen = CHIPSET_AMD_UNKNOWN; #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 @@ static int handle_imc(struct pci_dev *dev) 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; -- cgit v1.2.3