summaryrefslogtreecommitdiff
path: root/chip
diff options
context:
space:
mode:
authormartin yan <martin.yan@microchip.corp-partner.google.com>2021-08-05 10:41:42 -0400
committerCommit Bot <commit-bot@chromium.org>2021-08-06 19:19:17 +0000
commit1b3e74bc3ba38aae245f8958c012f7e4c18447d6 (patch)
treecaf22f8b10bef9f04269e45abd290bf801402b5a /chip
parentb3f5db5be78e15290dc7d80eaeecbb0f1b754a2c (diff)
downloadchrome-ec-1b3e74bc3ba38aae245f8958c012f7e4c18447d6.tar.gz
mchp: Optimize spi_flash_read() API
Optimize SPI flash read timing, MEC172x QMSPI controller controls CS# by hardware, it will add several system clock cycles delay between CS deassertion to CS assertion at the start of the next transaction, this guarantees SPI back to back transactions, so 1ms delay can be removed to optimze timing. BUG=none BRANCH=none TEST=Tested on ADL RVP and MCHP1727 MECC system via FAFT ECBootTime job save 720ms as EC performs 180KB RW code's SHA256 hash computation Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I5cf9c668efb1cd008b91cdd8aa09f7351c017af0 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3074767 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r--chip/mchp/config_chip.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/chip/mchp/config_chip.h b/chip/mchp/config_chip.h
index 71b765894a..cf7ead512a 100644
--- a/chip/mchp/config_chip.h
+++ b/chip/mchp/config_chip.h
@@ -150,6 +150,18 @@
#define CONFIG_PROGRAM_MEMORY_BASE 0x000E0000
#endif
+/*
+ * Optimize SPI flash read timing, MEC172x QMSPI controller controls CS#
+ * by hardware, it will add several system clock cycles delay between CS
+ * deassertion to CS assertion at the start of the next transaction, this
+ * guarantees SPI back to back transactions, so 1ms delay can be removed
+ * to optimze timing. MEC172x chip supports this hardware feature.
+ */
+#if defined(CHIP_FAMILY_MEC172X)
+#undef CONFIG_SPI_FLASH_READ_WAIT_MS
+#define CONFIG_SPI_FLASH_READ_WAIT_MS 0
+#endif
+
#include "config_flash_layout.h"
/************************************************************************/