summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMadhurima Paruchuri <mparuchuri@google.com>2023-04-11 11:48:52 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-04-17 18:27:35 +0000
commit5093a223cb5d29197cd498c80c157c1e0b60c389 (patch)
treebe37eaf99a690e71c36002ab4eed1fb533c0607b /include
parent74108a6ab365a110d70b4064ec2d99fa7ea9b73e (diff)
downloadchrome-ec-5093a223cb5d29197cd498c80c157c1e0b60c389.tar.gz
flash: cbi: Block the HCs from flash CBI section modification
BRANCH=None BUG=b:267629295 TEST=./twister -T zephyr/test -c Change-Id: Ibcf176f10860cc126b267908faba054df256c3d4 Signed-off-by: Madhurima Paruchuri <mparuchuri@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4414226 Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'include')
-rw-r--r--include/flash.h23
1 files changed, 20 insertions, 3 deletions
diff --git a/include/flash.h b/include/flash.h
index 240db02d67..08f70182d7 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -320,15 +320,32 @@ int crec_flash_get_size(void);
int crec_flash_dataptr(int offset, int size_req, int align, const char **ptrp);
/**
+ * Read from flash without hiding protected sections data
+ *
+ * If flash is mapped (CONFIG_MAPPED_STORAGE), it is usually more efficient to
+ * use flash_dataptr() to get a pointer directly to the flash memory rather
+ * than use flash_read(), since the former saves a memcpy() operation.
+ *
+ * This method won't hide the protected flash sections data.
+ *
+ * @param offset Flash offset to read.
+ * @param size Number of bytes to read.
+ * @param data Destination buffer for data. Must be 32-bit aligned.
+ */
+int crec_flash_unprotected_read(int offset, int size, char *data);
+
+/**
* Read from flash.
*
* If flash is mapped (CONFIG_MAPPED_STORAGE), it is usually more efficient to
* use flash_dataptr() to get a pointer directly to the flash memory rather
* than use flash_read(), since the former saves a memcpy() operation.
*
- * @param offset Flash offset to write.
- * @param size Number of bytes to write.
- * @param data Destination buffer for data. Must be 32-bit aligned.
+ * This method hides the protected flash sections data.
+ *
+ * @param offset Flash offset to read.
+ * @param size Number of bytes to read.
+ * @param data Destination buffer for data. Must be 32-bit aligned.
*/
int crec_flash_read(int offset, int size, char *data);