Add capability for DIRECT_XIP feature
Add capability detection for the MCUBOOT_DIRECT_XIP feature.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/include/bootutil/caps.h b/boot/bootutil/include/bootutil/caps.h
index aa288b1..4452897 100644
--- a/boot/bootutil/include/bootutil/caps.h
+++ b/boot/bootutil/include/bootutil/caps.h
@@ -50,6 +50,7 @@
#define BOOTUTIL_CAP_BOOTSTRAP (1<<14)
#define BOOTUTIL_CAP_AES256 (1<<15)
#define BOOTUTIL_CAP_RAM_LOAD (1<<16)
+#define BOOTUTIL_CAP_DIRECT_XIP (1<<17)
/*
* Query the number of images this bootloader is configured for. This
diff --git a/boot/bootutil/src/caps.c b/boot/bootutil/src/caps.c
index be06271..f44ab02 100644
--- a/boot/bootutil/src/caps.c
+++ b/boot/bootutil/src/caps.c
@@ -75,6 +75,9 @@
#if defined(MCUBOOT_RAM_LOAD)
res |= BOOTUTIL_CAP_RAM_LOAD;
#endif
+#if defined(MCUBOOT_DIRECT_XIP)
+ res |= BOOTUTIL_CAP_DIRECT_XIP;
+#endif
return res;
}
diff --git a/sim/src/caps.rs b/sim/src/caps.rs
index 932b5ab..441494d 100644
--- a/sim/src/caps.rs
+++ b/sim/src/caps.rs
@@ -27,6 +27,7 @@
Bootstrap = (1 << 14),
Aes256 = (1 << 15),
RamLoad = (1 << 16),
+ DirectXip = (1 << 17),
}
impl Caps {
@@ -44,7 +45,7 @@
/// Query if this configuration performs some kind of upgrade by writing to flash.
pub fn modifies_flash() -> bool {
// All other configurations perform upgrades by writing to flash.
- !Self::RamLoad.present()
+ !(Self::RamLoad.present() || Self::DirectXip.present())
}
}