summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/Kconfig.flash7
-rw-r--r--zephyr/boards/arm/npcx9/npcx9m7f.dts11
-rw-r--r--zephyr/include/cros/binman.dtsi24
-rw-r--r--zephyr/include/cros/ite/it8xxx2.dtsi11
-rw-r--r--zephyr/linker/image_size.ld6
5 files changed, 48 insertions, 11 deletions
diff --git a/zephyr/Kconfig.flash b/zephyr/Kconfig.flash
index db049768a6..e3c161f31b 100644
--- a/zephyr/Kconfig.flash
+++ b/zephyr/Kconfig.flash
@@ -76,6 +76,13 @@ config PLATFORM_EC_INTERNAL_STORAGE
endchoice
+config PLATFORM_EC_RW_TOTAL_IMAGE_SIZE
+ hex
+ default $(dt_node_int_prop_hex,/binman/ec-rw,size)
+ help
+ Total size of the EC RW image, including the 32-byte RW_FWID. The
+ source of truth for this setting is the binman devicetree node.
+
# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_CROS_FLASH := cros-ec,flash
diff --git a/zephyr/boards/arm/npcx9/npcx9m7f.dts b/zephyr/boards/arm/npcx9/npcx9m7f.dts
index b28c5ade40..8a13e298de 100644
--- a/zephyr/boards/arm/npcx9/npcx9m7f.dts
+++ b/zephyr/boards/arm/npcx9/npcx9m7f.dts
@@ -19,6 +19,17 @@
ec-rw {
offset = <0x50000>;
size = <0x50000>;
+ rw-fw {
+ rw-fwid {
+ /* Fix the lcoation of the FWID to the
+ * last 32 bytes of the flash. This
+ * ensures the RW entries in the FMAP
+ * stored in the RO section of flash
+ * are always correct.
+ */
+ offset = <(0x50000 - 32)>;
+ };
+ };
};
};
};
diff --git a/zephyr/include/cros/binman.dtsi b/zephyr/include/cros/binman.dtsi
index 167fd69d1c..1ba7a3bde6 100644
--- a/zephyr/include/cros/binman.dtsi
+++ b/zephyr/include/cros/binman.dtsi
@@ -36,13 +36,23 @@
offset = <0x40000>;
size = <0x40000>;
rw-fw {
- type = "blob";
- filename = "zephyr_rw.bin";
- };
- rw-fwid {
- type = "text";
- size = <32>;
- text-label = "version";
+ type = "section";
+ zephyr-rw {
+ type = "blob";
+ filename = "zephyr_rw.bin";
+ };
+ rw-fwid {
+ /* Fix the lcoation of the FWID to the
+ * last 32 bytes of the flash. This
+ * ensures the RW entries in the FMAP
+ * stored in the RO section of flash
+ * are always correct.
+ */
+ offset = <(0x40000 - 32)>;
+ type = "text";
+ size = <32>;
+ text-label = "version";
+ };
};
};
};
diff --git a/zephyr/include/cros/ite/it8xxx2.dtsi b/zephyr/include/cros/ite/it8xxx2.dtsi
index 4f1431b228..384a8466fe 100644
--- a/zephyr/include/cros/ite/it8xxx2.dtsi
+++ b/zephyr/include/cros/ite/it8xxx2.dtsi
@@ -94,6 +94,17 @@
ec-rw {
offset = <0x60000>;
size = <0x60000>;
+ rw-fw {
+ rw-fwid {
+ /* Fix the lcoation of the FWID to the
+ * last 32 bytes of the flash. This
+ * ensures the RW entries in the FMAP
+ * stored in the RO section of flash
+ * are always correct.
+ */
+ offset = <(0x60000 - 32)>;
+ };
+ };
};
pad-byte = <0xff>;
pad-after = <0x40000>;
diff --git a/zephyr/linker/image_size.ld b/zephyr/linker/image_size.ld
index 4a0c854f05..170daf141d 100644
--- a/zephyr/linker/image_size.ld
+++ b/zephyr/linker/image_size.ld
@@ -4,10 +4,8 @@
*/
#if defined(CONFIG_CPU_CORTEX_M) || defined(CONFIG_CPU_CORTEX_R) || \
- defined(CONFIG_CPU_CORTEX_A)
-__image_size = _flash_used;
-#elif defined(CONFIG_RISCV)
-__image_size = __rom_region_size;
+ defined(CONFIG_CPU_CORTEX_A) || defined (CONFIG_RISCV)
+__image_size = CONFIG_PLATFORM_EC_RW_TOTAL_IMAGE_SIZE;
#else
/*
* Intentionally set to 0. Some components, such as EFS2, need this value.