From: Simon Glass <sjg@chromium.org>
Date: Mon, 11 Mar 2013 06:08:07 +0000 (+0000)
Subject: x86: spi: Set maximum write size for ICH
X-Git-Tag: v2025.01-rc5-pxa1908~16349^2~6
X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-favicon.png?a=commitdiff_plain;h=5e6fb69778fa41e685add00b73ed5f22c7a96166;p=u-boot.git

x86: spi: Set maximum write size for ICH

This SPI controller can only write 64 bytes at a time. Add this restriction
in so that 'sf write' works correct for blocks larger than 64 bytes.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index ef1ce1d96c..8865df5bef 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -147,6 +147,11 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 		return NULL;
 	}
 
+	/*
+	 * Yes this controller can only write a small number of bytes at
+	 * once! The limit is typically 64 bytes.
+	 */
+	ich->slave.max_write_size = ctlr.databytes;
 	ich->speed = max_hz;
 
 	return &ich->slave;