summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/flash.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-04 14:36:08 -0700
committerCommit Bot <commit-bot@chromium.org>2020-12-29 22:16:44 +0000
commit373c310c8e78650d644b038530a34a5433412870 (patch)
tree37e53bff605d9552ff8af5ffdd2cbe569e162e39 /zephyr/shim/src/flash.c
parent0be966a98cd999239152881295acb24e9f4581e3 (diff)
downloadchrome-ec-373c310c8e78650d644b038530a34a5433412870.tar.gz
zephyr: Add the beginnings of a shim for flash access
Add myriad Kconfig options to make the flash code compile. This does not yet do anything useful, as we need to connect up to the Zephyr flash device (and need support for this in the npcx too). BUG=b:174873770 BRANCH=none TEST=build for volteer Change-Id: Ib4bed4cdd39cdf33a1d27b39aadb89df491941b3 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2575208
Diffstat (limited to 'zephyr/shim/src/flash.c')
-rw-r--r--zephyr/shim/src/flash.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/zephyr/shim/src/flash.c b/zephyr/shim/src/flash.c
new file mode 100644
index 0000000000..83d210f270
--- /dev/null
+++ b/zephyr/shim/src/flash.c
@@ -0,0 +1,39 @@
+/* Copyright 2020 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <flash.h>
+#include <kernel.h>
+
+/* TODO(b/174873770): Add calls to Zephyr code here */
+
+int flash_physical_write(int offset, int size, const char *data)
+{
+ return -ENOSYS;
+}
+
+int flash_physical_erase(int offset, int size)
+{
+ return -ENOSYS;
+}
+
+int flash_physical_get_protect(int bank)
+{
+ return -ENOSYS;
+}
+
+uint32_t flash_physical_get_protect_flags(void)
+{
+ return -ENOSYS;
+}
+
+int flash_physical_protect_at_boot(uint32_t new_flags)
+{
+ return -ENOSYS;
+}
+
+int flash_physical_protect_now(int all)
+{
+ return -ENOSYS;
+}