diff options
author | Edward O'Callaghan <quasisec@google.com> | 2020-11-17 19:27:13 +1100 |
---|---|---|
committer | Edward O'Callaghan <quasisec@chromium.org> | 2020-11-22 23:25:41 +0000 |
commit | 97dcc971c48f9c802a2f8ec8a68a51ccc27e5829 (patch) | |
tree | 46c897241cbb453ab334f855b1ced2bd71478178 /sb600spi.c | |
parent | 36e5bd3c21587276e18e398cca82c023507e7b18 (diff) | |
download | flashrom-97dcc971c48f9c802a2f8ec8a68a51ccc27e5829.tar.gz flashrom-97dcc971c48f9c802a2f8ec8a68a51ccc27e5829.tar.bz2 flashrom-97dcc971c48f9c802a2f8ec8a68a51ccc27e5829.zip |
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>
Diffstat (limited to 'sb600spi.c')
-rw-r--r-- | sb600spi.c | 45 |
1 files changed, 20 insertions, 25 deletions
@@ -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; |