mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 23:43:42 +02:00
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>
This commit is contained in:
parent
36e5bd3c21
commit
97dcc971c4
45
sb600spi.c
45
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user