summaryrefslogtreecommitdiff
path: root/include/spi_flash.h
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2016-09-14 16:48:23 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-09-23 12:21:51 -0700
commit818dea4a07337b96a696f805a207860abf979c8f (patch)
tree6d564d3e0a304360f95e0d3e200796845a83cff4 /include/spi_flash.h
parent5818cdc7286a37cf06d2f2c0d79b0f4ae5ee664c (diff)
downloadchrome-ec-818dea4a07337b96a696f805a207860abf979c8f.tar.gz
flash: Add command to get SPI flash chip info
Previously, there was no way to identify which flash chip was used by the EC, for ECs using an external SPI flash. Now, 'ectool flashinfo' will print more information about the SPI flash chip in these cases. BUG=chrome-os-partner:56765 BRANCH=any EC with MEC1322 or NPCX still going through factory TEST=define CONFIG_HOSTCMD_FLASH_SPI_INFO, then 'ectool flashspiinfo' on samus indicates no SPI flash info, and prints additional info on chell and kevin. Without the config defined, all platforms report no spi flash info. CQ-DEPEND=CL:386368 Change-Id: I3c162f7ad12ed4b30ab951c03f24476683382114 Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/385702 Reviewed-by: Shawn N <shawnn@chromium.org>
Diffstat (limited to 'include/spi_flash.h')
-rw-r--r--include/spi_flash.h22
1 files changed, 16 insertions, 6 deletions
diff --git a/include/spi_flash.h b/include/spi_flash.h
index 9b8a0a64d5..4e4dd96381 100644
--- a/include/spi_flash.h
+++ b/include/spi_flash.h
@@ -123,18 +123,28 @@ int spi_flash_write(unsigned int offset, unsigned int bytes,
const uint8_t const *data);
/**
- * Returns the SPI flash JEDEC ID (manufacturer ID, memory type, and capacity)
+ * Gets the SPI flash JEDEC ID (manufacturer ID, memory type, and capacity)
*
- * @return flash JEDEC ID
+ * @param dest Destination buffer; must be 3 bytes long
+ * @return EC_SUCCESS or non-zero on error
*/
-uint32_t spi_flash_get_jedec_id(void);
+int spi_flash_get_jedec_id(uint8_t *dest);
/**
- * Returns the SPI flash unique ID (serial)
+ * Gets the SPI flash manufacturer and device ID
*
- * @return flash unique ID
+ * @param dest Destination buffer; must be 2 bytes long
+ * @return EC_SUCCESS or non-zero on error
*/
-uint64_t spi_flash_get_unique_id(void);
+int spi_flash_get_mfr_dev_id(uint8_t *dest);
+
+/**
+ * Gets the SPI flash unique ID (serial)
+ *
+ * @param dest Destination buffer; must be 8 bytes long
+ * @return EC_SUCCESS or non-zero on error
+ */
+int spi_flash_get_unique_id(uint8_t *dest);
/**
* Check for SPI flash status register write protection.