summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/flash.c
diff options
context:
space:
mode:
authormartin yan <martin.yan@microchip.corp-partner.google.com>2022-03-23 17:05:00 -0400
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-29 15:24:56 +0000
commitd7ffcd69db110da6dbffc04c5c1671df6c8cc973 (patch)
tree62d0974a63c5d724958a1d8a495a5f5b7330f6c2 /zephyr/shim/src/flash.c
parent88c0f6f18ca6e01bd316dea8122ae28af298fb7b (diff)
downloadchrome-ec-d7ffcd69db110da6dbffc04c5c1671df6c8cc973.tar.gz
zephyr: mchp: Add shim flash
Add shim layer flash code BUG=b:226599277 BRANCH=main TEST=zmake testall Signed-off-by: martin yan <martin.yan@microchip.corp-partner.google.com> Change-Id: I509d27ec06922a0f51759fbf8c100f43e2ce08e9 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3546981 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'zephyr/shim/src/flash.c')
-rw-r--r--zephyr/shim/src/flash.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/zephyr/shim/src/flash.c b/zephyr/shim/src/flash.c
index 8261fb5633..b5611839a8 100644
--- a/zephyr/shim/src/flash.c
+++ b/zephyr/shim/src/flash.c
@@ -211,9 +211,17 @@ SHELL_CMD_REGISTER(flashchip, NULL, "Information about flash chip",
CONFIG_PLATFORM_EC_GPIO_INIT_PRIORITY
#error "Flash must be initialized after GPIOs"
#endif
+#if IS_ENABLED(CONFIG_SOC_FAMILY_NPCX)
#if CONFIG_PLATFORM_EC_FLASH_INIT_PRIORITY <= \
CONFIG_CROS_FLASH_NPCX_INIT_PRIORITY
#error "CONFIG_PLATFORM_EC_FLASH_INIT_PRIORITY must be greater than" \
"CONFIG_CROS_FLASH_NPCX_INIT_PRIORITY."
#endif
+#elif IS_ENABLED(CONFIG_SOC_FAMILY_MEC)
+#if CONFIG_PLATFORM_EC_FLASH_INIT_PRIORITY <= \
+ CONFIG_CROS_FLASH_MCHP_INIT_PRIORITY
+#error "CONFIG_PLATFORM_EC_FLASH_INIT_PRIORITY must be greater than" \
+ "CONFIG_CROS_FLASH_MCHP_INIT_PRIORITY."
+#endif
+#endif
SYS_INIT(flash_dev_init, POST_KERNEL, CONFIG_PLATFORM_EC_FLASH_INIT_PRIORITY);