Skip to content
Snippets Groups Projects
Commit 37ba0896 authored by nbd's avatar nbd
Browse files

atheros: fix a spiflash write performance regression

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@15027 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent bfdf3aa8
No related branches found
No related tags found
No related merge requests found
......@@ -288,10 +288,10 @@
+}
+
+static void
+spiflash_wait_complete(struct spiflash_priv *priv)
+spiflash_wait_complete(struct spiflash_priv *priv, unsigned int timeout)
+{
+ busy_wait(priv, spiflash_sendcmd(priv, SPI_RD_STATUS, 0) &
+ SPI_STATUS_WIP, 20);
+ SPI_STATUS_WIP, timeout);
+ spiflash_done(priv);
+}
+
......@@ -321,7 +321,7 @@
+ reg |= op->tx_cnt | SPI_CTL_START;
+ spiflash_write_reg(priv, SPI_FLASH_CTL, reg);
+
+ spiflash_wait_complete(priv);
+ spiflash_wait_complete(priv, 20);
+
+ instr->state = MTD_ERASE_DONE;
+ if (instr->callback)
......@@ -418,7 +418,7 @@
+ reg |= (read_len + 4) | SPI_CTL_START;
+ spiflash_write_reg(priv, SPI_FLASH_CTL, reg);
+
+ spiflash_wait_complete(priv);
+ spiflash_wait_complete(priv, 1);
+
+ bytes_left -= read_len;
+ to += read_len;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment