Commit Graph

581 Commits

Author SHA1 Message Date
Jamie McCrae 8980799219 boot: zephyr: Fix build for nrf9160dk
Fixes building MCUboot for this board

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-10 07:37:43 +01:00
Jamie McCrae 2f5a7f4721 boot: zephyr: Fix build for thingy53
Fixes building MCUboot for this board

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-10 07:37:43 +01:00
Jamie McCrae c9e4ab8b24 boot: zephyr: Fix build for thingy52
Fixes building MCUboot for this board

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-07-10 07:37:43 +01:00
David Brown c06f7bb367 Revert "boot: Add MCUBOOT_HW_KEY support for image encryption"
This reverts commit 0fa46270c0.

This breaks:

    samples/synchronization/sample.kernel.synchronization on
    b_u585i_iot02a/stm32u585xx/ns error

as this TF-M configuration uses its own keys.  This change is an API
change that needs to be coordinated with TF-M changes.

Before this revert, compiling this test results in:

    .../encrypted.c:447: undefined reference to
    `boot_enc_retrieve_private_key`

Signed-off-by: David Brown <david.brown@linaro.org>
2024-07-09 09:19:43 -06:00
Dinesh Kumar K 0fa46270c0 boot: Add MCUBOOT_HW_KEY support for image encryption
Currently encryption supports only private key embed
in mcuboot itself. To support MCUBOOT_HW_KEY for image
encryption boot_retrieve_private_key() hook is added.

This hook helps retrieving private key from trusted
sources like OTP, TPM.

Signed-off-by: Dinesh Kumar K <dinesh@linumiz.com>
2024-06-12 15:17:54 -06:00
Mahesh Mahadevan 45d379e715 zephyr: boards: Add files needed for NXP FRDM MCXN947 QSPI variant
1. set BOOT_MAX_IMG_SECTORS value for frmd_mcxn947_qspi. W25Q64 flash on the board
   is very large (8MB), so we must increase the number of max sectors when
   targeting this board with MCUboot.
2. Set the zephyr,flash chosen node to point to internal flash as this board
   supports booting from internal flash only.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-05-24 06:45:03 +01:00
Marek Matej 898a1ca64a boot: zephyr: add ESP32-C6 support
Update the list of SoCs to support the ESP32-C6.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-05-21 16:52:51 +02:00
Marek Matej 018dc01d48 boot/zephyr: use socs conf
Use socs folder to configure Espressif targets.
Remove all boards confs which was created by copying other boards.

Signed-off-by: Marek Matej <marek.matej@espressif.com>
2024-05-13 04:25:17 -03:00
Tomi Fontanilles d4394c2f9b mbedtls config: fix too early check_config.h includes
check_config.h was included manually by custom configuration files.
This caused compilation errors when updating MbedTLS to 3.6.0
because check_config.h was processed too early, before the whole
configuration is defined, effectively causing configuration check errors.

MbedTLS already takes care of including check_config.h at the right time.
Remove those erroneous manual check_config.h includes.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
2024-04-25 11:05:54 +02:00
Mahesh Mahadevan 453096b17d zephyr: arm: Update reading the flash image reset vector
This change uses the flash functions to read the applications
reset vector. This allow flexibility on which flash device the
application is programmed.
For e.g: MCUBoot can be programmed and running from Internal
Flash while Zephyr can be loaded from a different Flash device.
This change is made for ARM platform, it can be extended to
non-ARM platforms as well.

Signed-off-by: Mahesh Mahadevan <mahesh.mahadevan@nxp.com>
2024-04-23 10:32:09 -06:00
Jamie McCrae 1496129235 boot: zephyr: Add optional MCUboot boot banner
Adds an optional MCUboot boot banner which displays the MCUboot
version and zephyr version

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-23 11:28:48 +01:00
Alex Tsamakos 7174dd2ba8 boot: zephyr: boards: actinius: enable multithreading in config
Adds config with multithreading enabled for all Actinius boards

Signed-off-by: Alex Tsamakos <alex@actinius.com>
2024-04-23 11:26:34 +01:00
Sylvio Alves 8c0e36c886 boot: zephyr: esp32: rename boards to meet hwmv2
Renames boards to account for hwmv2 changes

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-04-16 18:02:13 -03:00
Jamie McCrae a65ea49515 boot: zephyr: Rename boards
Renames boards to account for hwmv2 changes

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-04-02 21:39:01 +01:00
Jamie McCrae 24ac8cc2be boot: zephyr: Fix disabling I/D caches
Fixes an issue whereby the instruction and data caches being
disabled before booting code had bit-rotted and no longer worked,
adds a new Kconfig that allows this option to be turned off if
wanted.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-20 07:47:28 +00:00
Daniel DeGrasse 5d067f0e0c zephyr: boards: set BOOT_MAX_IMG_SECTORS value for rd_rw612_bga
MX25UM flash on rd_rw612_bga is very large (8MB), so we must increase
the number of max sectors when targeting this board with MCUboot

Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
2024-03-14 10:17:01 +01:00
Jamie McCrae 9fb7ce5d02 boot: zephyr: Fix estimated size calculation
Fixes an issue with the estimated size calculation which wrongly
used the maximum align size for some multiplications, this would
mean that in some instances the estimated maximum image size was
smaller than the actual allowed size

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-13 11:14:41 +00:00
Grzegorz Chwierut 7ace8bd4ad zephyr: boards: Remove CONFIG_FPROTECT from nrf54l15
CONFIG_FPROTECT is defined only in NRF repository, it
should not be added here.

Signed-off-by: Grzegorz Chwierut <grzegorz.chwierut@nordicsemi.no>
2024-03-11 18:00:20 +01:00
Jamie McCrae 8b4c70ab6d boot: zephyr: Update changed Nordic family Kconfig
Updates a Kconfig that was renamed

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-07 09:35:41 +00:00
Sylvio Alves b794d335a4 espressif: modify SOC_FAMILY according to new HWMv2
Update FAMILY reference as needed.

Signed-off-by: Sylvio Alves <sylvio.alves@espressif.com>
2024-03-04 15:47:01 -03:00
David Leach fefe701a5d zephyr: nxp: Update board names for hwmv2
Updates board names as per hwmv2

Signed-off-by: David Leach <david.leach@nxp.com>
Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae ef530384d6 boot: zephyr: boards: Rename configuration files
Renames configuration files for board names that have changed
with hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae 040fc714b1 boot: zephyr: boards: Remove removed boards
Removes configuration for boards that have not been in zephyr
for a long time

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Jamie McCrae fda4afc939 zephyr: Update board names for hwmv2
Updates board names as per hwmv2

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-03-01 14:37:29 +00:00
Dominik Ermel ca02c75060 boot/zephyr: Define SOC_FLASH_0_ID and SPI_FLASH_0_ID
The defines have been taken from the Zephyr flash_map.h
but as they are provided there for MCUboot only, they can be just
defined here.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2024-02-23 15:51:40 +01:00
Andrzej Puzdrowski 89feb4d8e3 zephyr/boards: nrf54l15pdk_nrf54l15_cpuapp config
Renamed the DK config file to proper name.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2024-02-20 17:45:12 +01:00
Mateusz Michalek 4b4cc85c67 zephyr: Add NRF54L configuration
Adds default Kconfig configuration that allows to build MCUboot
for NRF54L.
Currently this configuration turns off WDT and FPROTECT,
which is TODO to fix.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
2024-02-13 13:04:47 +01:00
Jamie McCrae a4eda30f5b zephyr: Add estimated size of update trailer to sysbuild
Adds a new field which is set to the estimated size of the
upgrade slot data, this is used to know how much space should
be reserved in an update image to determine if an update will
fit or not

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-30 13:43:58 +00:00
Mateusz Michalek c3a72e9daf boot: zephyr: moonlight watchdogs
adding WATCHDOG_FEED support for WDT30 and WDT31

Signed-off-by: Mateusz Michalek <mateusz.michalek@nordicsemi.no>
2024-01-10 12:46:35 +01:00
Jamie McCrae db9a7f5822 boot: zephyr: cmake: Fix issue with missing dts entries
Fixes an issue whereby a device might not have a write or erase
entry for the flash controller in devicetree. In the case whereby
the other slot has this information, use that instead. In the case
whereby neither slot has this information, use default values and
show a warning to the user

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2024-01-08 15:35:44 +00:00
Xudong Zheng 8cee355095 zephyr: kconfig: make MBEDTLS_PROMPTLESS depend on MBEDTLS
This addresses compilation error when MBEDTLS module is not present.

Signed-off-by: Xudong Zheng <7pkvm5aw@slicealias.com>
2024-01-02 10:21:59 +00:00
Jamie McCrae e9131ee8b8 zephyr: kconfig: Make saving encrypt TLVs depending on encryption
Prevents enabling the option to save encrypted TLVs if encryption
support is not enabled, as it is required to make use of this
functionality.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-12-12 10:41:26 +00:00
Jamie McCrae 4c7942e58c zephyr: Add estimated image footer size to cache in sysbuild
Adds MCUboot's estimated overhead footer size to the application's
cache when using sysbuild, this allows that information to be
propagated to applications which can use the information to reduce
the available size for an application, preventing the MCUboot
error of image too large to swap.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-12-12 10:41:26 +00:00
YuLong Yao 26d6423b00 boot: zephyr: esp32: zephyr port
Add support for ESP32xx_luatos_core targets to build
as Zephyr application.
This target is simular to esp32 devkitm,
copy conf file from esp32xx_devkitm

Signed-off-by: YuLong Yao <feilongphone@gmail.com>
2023-12-07 14:48:45 -03:00
Jamie McCrae 212997395e zephyr: firmware/single_loader: Fix compile warning
Fixes an issue of an unused function calling an undefined function

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-12-07 10:43:58 +00:00
Jamie McCrae a88e229346 zephyr: sysflash: Fix if condition for zephyr applications
Fixes an issue when sysflash is included by zephyr (non-mcuboot)
applications

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-12-07 10:43:58 +00:00
Piotr Dymacz 2a74a2b580 zephyr: io: add 'io_led_set()'
The static declaration of 'led0' was moved to 'io.c' which broke
building with the 'MCUBOOT_INDICATION_LED' enabled:

  mcuboot/boot/zephyr/main.c:380:22: error:
    'led0' undeclared (first use in this function)
      380 |     gpio_pin_set_dt(&led0, 1);
          |                      ^~~~

This adds simple function 'io_led_set()' for changing LED's value.

Fixes: 433b8480 ("zephyr: Move IO functions out of main to separate file")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-12-06 10:33:28 +00:00
Piotr Dymacz 8c6c67016a zephyr: io: include 'bootutil_log.h' and declare log module membership
This fixes below error when building with 'MCUBOOT_INDICATION_LED' and
'LOG' enabled:

  In file included from zephyr/include/zephyr/logging/log.h:11,
                   from zephyr/include/zephyr/usb/usb_device.h:43,
                   from bootloader/mcuboot/boot/zephyr/io.c:26:
  mcuboot/boot/zephyr/io.c: In function 'io_led_init':
  zephyr/include/zephyr/logging/log_core.h:151:20: error:
    '__log_level' undeclared (first use in this function)
    151 |         (_level <= __log_level) &&                                          \
        |                    ^~~~~~~~~~~

Fixes: 433b8480 ("zephyr: Move IO functions out of main to separate file")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-12-06 10:33:28 +00:00
Piotr Dymacz d99154f441 zephyr: rename 'led_init()' to 'io_led_init()'
This fixes below warning when building with 'MCUBOOT_INDICATION_LED'
enabled:

  mcuboot/boot/zephyr/main.c:410:5:
    warning: implicit declaration of function 'led_init';
             did you mean 'io_led_init'? [-Wimplicit-function-declaration]
      410 |     led_init();
          |     ^~~~~~~~
          |     io_led_init

Fixes: 433b8480 ("zephyr: Move IO functions out of main to separate file")
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-12-06 10:33:28 +00:00
Andrej Butok c43a20fd19 boot: zephyr: add support for mimxrt1040_evk
Add default configuration for mimxrt1040_evk.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-12-05 15:41:56 +00:00
Jamie McCrae 215345f76a zephyr: Add firmware loader MCUboot operation style
Adds a new operation style in which the secondary slot has an
image which is used to update the primary image only.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-28 13:59:00 +00:00
Jamie McCrae 433b8480f7 zephyr: Move IO functions out of main to separate file
Moves IO functions into a separate file to allow reuse

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-28 13:59:00 +00:00
Andrej Butok 3f0b89d680 boot: zephyr: add support for mimxrt101x_evk
Add default configuration for mimxrt1010_evk and mimxrt1015_evk.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-28 09:26:11 +00:00
Jamie McCrae 47b3436255 zephyr: kconfig: Prevent MBEDTLS selection when tinycrypt is used
Prevents an issue which occurs when the MCUboot configuration is
changed which then selects multiple conflicting symbols

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-21 13:30:10 +00:00
Andrej Butok cd82f8bf7a boot: zephyr: add support for lpcxpresso55s28
Add default configuration for lpcxpresso55s28.

Signed-off-by: Andrej Butok <andrey.butok@nxp.com>
2023-11-21 13:29:34 +00:00
Jamie McCrae 013c9e7654 boot: zephyr: board: various: Remove size optimisation
This value is now the default, remove explicitly setting it for
some boards

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-07 09:08:27 +00:00
Jamie McCrae 0a8bbbf4b7 boot: zephyr: Fix USB configs
Fixes USB configurations so that they build out of the box, this
previously falsely built successfully but would not run

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-07 07:44:00 +00:00
Jamie McCrae d5c963c549 boot: zephyr: serial_adapter: Add error if main thread not preemptible
Adds a build failure if the main thread priority is not preemptible
and USB CDC ACM serial recovery is used, this is because if this is
the case, USB events will never be able to be processed and serial
recovery cannot ever enumerate

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-07 07:44:00 +00:00
Jamie McCrae 822b6cb710 boot: zephyr: serial_adapter: Fail if USB CDC enabled with console
This prevents MCUboot from successfully building if console and
serial recovery (USB CDC) are both enabled and they both point to
the same device

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-07 07:44:00 +00:00
Jamie McCrae 4a1effbc30 zephyr: Remove deprecated ZEPHYR_TRY_MASS_ERASE option
This option was deprecated 8 months ago, remove it.

Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
2023-11-01 15:55:46 +00:00