summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/cimx
diff options
context:
space:
mode:
Diffstat (limited to 'src/southbridge/amd/cimx')
-rw-r--r--src/southbridge/amd/cimx/sb800/spi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/southbridge/amd/cimx/sb800/spi.c b/src/southbridge/amd/cimx/sb800/spi.c
index a46349e933..e5b2407082 100644
--- a/src/southbridge/amd/cimx/sb800/spi.c
+++ b/src/southbridge/amd/cimx/sb800/spi.c
@@ -32,6 +32,8 @@
static int bus_claimed = 0;
#endif
+#define AMD_SB_SPI_TX_LEN 8
+
static u32 spibar;
static void reset_internal_fifo_pointer(void)
@@ -56,6 +58,11 @@ void spi_init()
spibar = pci_read_config32(dev, 0xA0) & ~0x1F;
}
+unsigned int spi_crop_chunk(unsigned int cmd_len, unsigned int buf_len)
+{
+ return min(AMD_SB_SPI_TX_LEN - cmd_len, buf_len);
+}
+
int spi_xfer(struct spi_slave *slave, const void *dout,
unsigned int bytesout, void *din, unsigned int bytesin)
{