Commit d5f84b49 authored by Tomasz Chyrowicz's avatar Tomasz Chyrowicz Committed by Dominik Ermel
Browse files

zephyr: Add support for slot selection boot hook



Add a Kconfig option to enable a bootloader hook to alter
the logic of the active slot selection in Direct XIP modes.

Signed-off-by: default avatarTomasz Chyrowicz <tomasz.chyrowicz@nordicsemi.no>
parent 7c4ec9ab
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1096,6 +1096,13 @@ config MCUBOOT_ACTION_HOOKS
	  'mcuboot_status_type_t' is listed in
	  boot/bootutil/include/bootutil/mcuboot_status.h

config FIND_NEXT_SLOT_HOOKS
	bool "Enable hooks for finding the next active slot"
	help
	  Allow to provide procedures for override or extend the search policy
	  for the best slot to boot in the Direct XIP mode.
	  By default a slot with the highest version is selected.

config BOOT_DISABLE_CACHES
	bool "Disable I/D caches before chain-loading application"
	depends on CPU_HAS_ICACHE || CPU_HAS_DCACHE
+5 −0
Original line number Diff line number Diff line
@@ -93,3 +93,8 @@ int boot_img_install_stat_hook(int image_index, int slot, int *img_install_stat)
{
    return BOOT_HOOK_REGULAR;
}

int boot_find_next_slot_hook(struct boot_loader_state *state, uint8_t image, uint32_t *active_slot)
{
    return BOOT_HOOK_REGULAR;
}
+4 −0
Original line number Diff line number Diff line
@@ -278,6 +278,10 @@
#define MCUBOOT_FLASH_AREA_HOOKS
#endif

#ifdef CONFIG_FIND_NEXT_SLOT_HOOKS
#define MCUBOOT_FIND_NEXT_SLOT_HOOKS
#endif

#ifdef CONFIG_MCUBOOT_VERIFY_IMG_ADDRESS
#define MCUBOOT_VERIFY_IMG_ADDRESS
#endif