[U-Boot] [PATCH 2/2] x86: ich-spi: Clear atomic preop only when SPI settings are not locked

Bin Meng bmeng.cn at gmail.com
Sun Aug 27 02:22:59 UTC 2017


The atomic preop register can only be written when SPI settings are
not locked, otherwise it's read-only.

Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
---

 drivers/spi/ich.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/ich.c b/drivers/spi/ich.c
index 5a3d690..22fc83d 100644
--- a/drivers/spi/ich.c
+++ b/drivers/spi/ich.c
@@ -563,7 +563,8 @@ static int ich_spi_xfer(struct udevice *dev, unsigned int bitlen,
 	}
 
 	/* Clear atomic preop now that xfer is done */
-	ich_writew(ctlr, 0, ctlr->preop);
+	if (!lock)
+		ich_writew(ctlr, 0, ctlr->preop);
 
 	return 0;
 }
-- 
2.9.2



More information about the U-Boot mailing list