Commit Graph

14 Commits

Author SHA1 Message Date
Carles Cufi df4d9a4de1 zephyr: Disable power management
Power management requires multithreading and other kernel features that
are disabled in MCUboot, so disable it to avoid interrupts being
confused by power management code wrappers.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-06-20 16:08:58 +02:00
Carles Cufi 29af9feeb7 zephyr: Default to RSA .pem file in config fragment
In order to provide a pleasant out-of-the-box experience to users,
default to the RSA .pem file so that users do not get a cryptic error
when building with the default .conf file in upstream.

Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
2018-06-12 17:36:54 +02:00
Fabio Utzig c690c76120 Add public/private key file option to Kconfig
Also adds instrutions and defaults to prj.conf.

Signed-off-by: Fabio Utzig <utzig@apache.org>
2018-06-06 11:07:06 -03:00
Marti Bolivar a4818a5565 zephyr: migrate signature type to Kconfig
Handle the CONFIG_BOOT_SIGNATURE_TYPE_xxx values in Zephyr's
mcuboot_config.h by converting them into the platform-agnostic MCUboot
definitions.

This requires some changes to the way the release test Makefile is
structured, since Kconfig symbols cannot be set from the command line.

Instead, use the OVERLAY_CONFIG feature of the Zephyr build system,
which allows specifying extra fragments to merge into the final
.config. (This is an orthogonal mechanism to setting CONF_FILE; it is
used by Zephyr's CI script sanitycheck to add additional fragments, so
it's appropriate for use by MCUboot's testing scripts as well.)

We additionally need to move to a single prj.conf file due to a
dependency issue. We can no longer determine CONF_FILE from the
signature type, since that is now determined from the final .config or
autoconf.h, which is a build output that depends on CONF_FILE.

To move to a single prj.conf:

- delete prj-p256.conf and adjust prj.conf to serve both signature types
- add a top-level mbedTLS configuration file which dispatches to
  the right sub-header depending on the key type
- as a side effect, have the simulator pick the right config file
  depending on the case

This fixes and cleans up quite a bit of the signature type handling,
which had become something of a mess over time. For example, it fixes
a bug in ECDSA mode's configuration that wasn't actually selecting
config-asn1.h, and forces the simulator to use the same mbedTLS
configuration file as builds for real hardware.

Finally, we also have to move the mbedTLS vs. TinyCrypt choice into
mcuboot_config.h at the same time as well, since CMakeLists.txt was
making that decision based on the signature type.

Signed-off-by: Marti Bolivar <marti@opensourcefoundries.com>
2018-04-25 18:44:03 -03:00
David Brown 0bae965fd8 Zephyr: Use mbed TLS allocator
Instead of the overly-simplistic allocator in Zephyr, use the still
simplistic allocator in mbed TLS.

On K64f, this saves 848 bytes of text, 44 bytes of data, and 208 bytes
of bss.

Signed-off-by: David Brown <david.brown@linaro.org>
2017-10-30 22:33:08 -06:00
Marti Bolivar f4d0e1adf2 zephyr: turn off I2C
Upstream Zephyr is making a habit of enabling subsystems on any board
that supports them. That's a potential security risk if any of those
allow interference with the running bootloader, and is currently
exceeding mcuboot's flash allowance on some STM32 targets,
e.g. 96b_carbon. Turn off I2C to restore the build for those.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-31 08:29:53 -06:00
Marti Bolivar d9072bc3c8 zephyr: s/BLUETOOTH/BT/
Upstream has made a breaking namespace change. Keep up.

Signed-off-by: Marti Bolivar <marti.bolivar@linaro.org>
2017-08-09 15:43:09 -06:00
David Brown 0d1b0b952e zephyr: Enable MPU flash writing
Recent Zephyr trees require this config option to be set in order to be
able to write to the flash device.  Without it, targets with an MPU
enabled will abort during startup, usually before even printing a
message to the UART.

Signed-off-by: David Brown <david.brown@linaro.org>
2017-07-26 18:42:29 -06:00
Ricardo Salveti 8e4d44d1e4 zephyr: disable clock before reset
Avoid clock related interrupts before jumping into the first image. Safe
to disable as the first application will enable the clock/timer again
once booted.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-03-17 15:12:17 -04:00
Andrew Boie 240ac64e83 zephyr: disable multithreading
The bootloader is just using Zephyr as a HAL and doesn't require
thread scheduling. Build Zephyr in single-threaded mode and gain
some footprint savings.

Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
2017-03-15 10:16:17 -07:00
Ricardo Salveti 7cf3d9ec91 zephyr: use SYS_LOG instead of printk
Easier to manage and can be easily disabled via config.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-19 19:51:35 -02:00
Ricardo Salveti 3dbf2229e6 boot/zephyr/prj.conf: disable bluetooth support by default
Bluetooth is enabled by default with some boards, so just make sure that
it gets disabled here to avoid having a large bootloader firmware.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-19 19:51:01 -02:00
Ricardo Salveti 43fc2cd556 boot/zephyr/prj.conf: remove SOC_FLASH_STM32F4, make it generic
Make it generic and let the SoC itself handle the FLASH driver support
as part of the Zephyr build system.

Signed-off-by: Ricardo Salveti <ricardo.salveti@linaro.org>
2017-01-19 19:51:01 -02:00
David Brown 299245d7de zephyr: Move code under 'boot' directory
The Zephyr build systems makes some assumptions about the directory
layout, and encounters problems if the necessary path contains "../..".
To help this, place the zephyr directory next to the bootutil directory
so that the Makefile can just refer to "../bootutil".  This keeps all of
the build artifacts under the proper top-level directory.
2017-01-10 09:49:47 -07:00