Skip to contentSkip to conversation

x86: ich-spi: Set the tx operation mode for ich 7

PATCH New Bin Meng 2 participants 4 messages Dec 10, 2014 – Dec 11, 2014 SPI

lore
Share & tools
lore

Bin Meng

author
#0 lore raw

PATCH v3 2/2 x86: ich-spi: Set the tx operation mode for ich 7

ICH 7 SPI controller only supports byte program (02h) for SST flash. Word program (ADh) is not supported.

---
Split from my v2 patch @ http://patchwork.ozlabs.org/patch/405753/
This needs to be applied after Jagan's new patch series:
http://patchwork.ozlabs.org/patch/419154/

 drivers/spi/ich.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/spi/ich.c +7 -2
index c38df08..0379444 100644
@@ -141,9 +141,14 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
 	ich->slave.max_write_size = ctlr.databytes;
 	ich->speed = max_hz;
 
-	/* ICH 7 SPI controller only supports array read command */
-	if (ctlr.ich_version == 7)
+	/*
+	 * ICH 7 SPI controller only supports array read command
+	 * and byte program command for SST flash
+	 */
+	if (ctlr.ich_version == 7) {
 		ich->slave.op_mode_rx = SPI_OPM_RX_AS;
+		ich->slave.op_mode_tx = SPI_OPM_TX_BP;
+	}
 
 	return &ich->slave;
 }
Signature · 1 line
1.8.2.1
#1 lore raw

PATCH v3 2/2 x86: ich-spi: Set the tx operation mode for ich 7

Hi Bin,

Quoted 35 lines · Bin Meng

ICH 7 SPI controller only supports byte program (02h) for SST flash. Word program (ADh) is not supported.

---
Split from my v2 patch @ http://patchwork.ozlabs.org/patch/405753/
This needs to be applied after Jagan's new patch series:
http://patchwork.ozlabs.org/patch/419154/

 drivers/spi/ich.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/spi/ich.c +7 -3
index c38df08..0379444 100644
@@ -141,9 +141,14 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        ich->slave.max_write_size = ctlr.databytes;
        ich->speed = max_hz;
 
-       /* ICH 7 SPI controller only supports array read command */
-       if (ctlr.ich_version == 7)
+       /*
+        * ICH 7 SPI controller only supports array read command
+        * and byte program command for SST flash
+        */
+       if (ctlr.ich_version == 7) {
                ich->slave.op_mode_rx = SPI_OPM_RX_AS;
+               ich->slave.op_mode_tx = SPI_OPM_TX_BP;
+       }
 
        return &ich->slave;
 }
--
Quoted 2 lines

1.8.2.1

This causes a build error on coreboot-x86 (SPI_OPM_TX_BP undeclared).

Regards,
Simon

author
#2 lore raw

PATCH v3 2/2 x86: ich-spi: Set the tx operation mode for ich 7

Hi Simon,

Quoted 35 lines · Simon Glass

Hi Bin,

Quoted 32 lines · Bin Meng

ICH 7 SPI controller only supports byte program (02h) for SST flash. Word program (ADh) is not supported.

---
Split from my v2 patch @ http://patchwork.ozlabs.org/patch/405753/
This needs to be applied after Jagan's new patch series:
http://patchwork.ozlabs.org/patch/419154/

 drivers/spi/ich.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/spi/ich.c +7 -2
index c38df08..0379444 100644
@@ -141,9 +141,14 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        ich->slave.max_write_size = ctlr.databytes;
        ich->speed = max_hz;
 
-       /* ICH 7 SPI controller only supports array read command */
-       if (ctlr.ich_version == 7)
+       /*
+        * ICH 7 SPI controller only supports array read command
+        * and byte program command for SST flash
+        */
+       if (ctlr.ich_version == 7) {
                ich->slave.op_mode_rx = SPI_OPM_RX_AS;
+               ich->slave.op_mode_tx = SPI_OPM_TX_BP;
+       }
 
Quoted 8 lines
Quoted 5 lines
drivers/spi/ich.c +0 -1
        return &ich->slave;
 }
--

1.8.2.1

This causes a build error on coreboot-x86 (SPI_OPM_TX_BP undeclared).

I think you need apply Jagan's patch series first @
http://patchwork.ozlabs.org/patch/419154/

Regards,
Bin

#3 lore raw

PATCH v3 2/2 x86: ich-spi: Set the tx operation mode for ich 7

Hi Bin,

Quoted 47 lines · Bin Meng

Hi Simon,

Quoted 35 lines · Simon Glass

Hi Bin,

Quoted 32 lines · Bin Meng

ICH 7 SPI controller only supports byte program (02h) for SST flash. Word program (ADh) is not supported.

---
Split from my v2 patch @ http://patchwork.ozlabs.org/patch/405753/
This needs to be applied after Jagan's new patch series:
http://patchwork.ozlabs.org/patch/419154/

 drivers/spi/ich.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/spi/ich.c +7 -2
index c38df08..0379444 100644
@@ -141,9 +141,14 @@ struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs,
        ich->slave.max_write_size = ctlr.databytes;
        ich->speed = max_hz;
 
-       /* ICH 7 SPI controller only supports array read command */
-       if (ctlr.ich_version == 7)
+       /*
+        * ICH 7 SPI controller only supports array read command
+        * and byte program command for SST flash
+        */
+       if (ctlr.ich_version == 7) {
                ich->slave.op_mode_rx = SPI_OPM_RX_AS;
+               ich->slave.op_mode_tx = SPI_OPM_TX_BP;
+       }
 
Quoted 8 lines
Quoted 5 lines
drivers/spi/ich.c +0 -1
        return &ich->slave;
 }
--

1.8.2.1

This causes a build error on coreboot-x86 (SPI_OPM_TX_BP undeclared).

Quoted 2 lines

I think you need apply Jagan's patch series first @
http://patchwork.ozlabs.org/patch/419154/

OK, so I suppose I could apply it to x86 so long as I don't send a pull request before Jagan. But it might be better just to wait.

Regards,
Simon