blob: 2c2968d72170ecf16adfdaefcc806c5eceb650a3 [file] [log] [blame]
David Brown5153bd62017-01-06 11:16:53 -07001/*
2 * Copyright (c) 2012-2014 Wind River Systems, Inc.
Tamas Banee6615d2020-09-30 07:58:48 +01003 * Copyright (c) 2020 Arm Limited
David Brown5153bd62017-01-06 11:16:53 -07004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
Marti Bolivareb940802017-05-01 23:15:29 -040018#include <assert.h>
David Brown5153bd62017-01-06 11:16:53 -070019#include <zephyr.h>
Peter Bigot54c1e3f2020-01-25 05:50:12 -060020#include <drivers/gpio.h>
Andrzej Puzdrowskif1d189c2019-12-12 09:34:11 +010021#include <sys/__assert.h>
Peter Bigot54c1e3f2020-01-25 05:50:12 -060022#include <drivers/flash.h>
Andrzej Puzdrowskif99a4c72019-06-28 15:16:35 +020023#include <drivers/timer/system_timer.h>
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +020024#include <usb/usb_device.h>
Evan Gates4632d8d2018-06-28 13:27:40 -070025#include <soc.h>
Rafał Kuźnia505c6e62020-07-17 13:18:15 +020026#include <linker/linker-defs.h>
David Brown5153bd62017-01-06 11:16:53 -070027
Marti Bolivar51181cf2017-03-20 11:03:41 -040028#include "target.h"
29
Marti Bolivar4a97b4c2017-01-31 18:20:02 -050030#include "bootutil/bootutil_log.h"
Ricardo Salveti3a2c1242017-01-19 10:22:35 -020031#include "bootutil/image.h"
32#include "bootutil/bootutil.h"
Tamas Banee6615d2020-09-30 07:58:48 +010033#include "bootutil/fault_injection_hardening.h"
34#include "bootutil/fault_injection_hardening_delay_rng.h"
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +020035#include "flash_map_backend/flash_map_backend.h"
Ricardo Salveti3a2c1242017-01-19 10:22:35 -020036
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +020037#ifdef CONFIG_MCUBOOT_SERIAL
Marko Kiiskila149b4572018-06-06 14:18:54 +030038#include "boot_serial/boot_serial.h"
39#include "serial_adapter/serial_adapter.h"
40
41const struct boot_uart_funcs boot_funcs = {
42 .read = console_read,
43 .write = console_write
44};
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +020045#endif
46
Rajavardhan Gundi51c9d702019-02-20 14:08:52 +053047#ifdef CONFIG_BOOT_WAIT_FOR_USB_DFU
48#include <usb/class/usb_dfu.h>
49#endif
50
Andrzej Puzdrowski9a605b62020-03-16 13:34:30 +010051#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
52#include <arm_cleanup.h>
53#endif
54
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010055#if defined(CONFIG_LOG) && !defined(CONFIG_LOG_IMMEDIATE)
56#ifdef CONFIG_LOG_PROCESS_THREAD
57#warning "The log internal thread for log processing can't transfer the log"\
58 "well for MCUBoot."
59#else
60#include <logging/log_ctrl.h>
61
Krzysztof Chruscinski821214e2020-03-24 07:50:32 +010062#define BOOT_LOG_PROCESSING_INTERVAL K_MSEC(30) /* [ms] */
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010063
64/* log are processing in custom routine */
Andrzej Puzdrowskiaf148532020-02-25 12:51:26 +010065K_THREAD_STACK_DEFINE(boot_log_stack, CONFIG_MCUBOOT_LOG_THREAD_STACK_SIZE);
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010066struct k_thread boot_log_thread;
Andrzej Puzdrowski84591632020-02-24 11:50:19 +010067volatile bool boot_log_stop = false;
68K_SEM_DEFINE(boot_log_sem, 1, 1);
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010069
70/* log processing need to be initalized by the application */
71#define ZEPHYR_BOOT_LOG_START() zephyr_boot_log_start()
Andrzej Puzdrowski84591632020-02-24 11:50:19 +010072#define ZEPHYR_BOOT_LOG_STOP() zephyr_boot_log_stop()
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010073#endif /* CONFIG_LOG_PROCESS_THREAD */
74#else
75/* synchronous log mode doesn't need to be initalized by the application */
76#define ZEPHYR_BOOT_LOG_START() do { } while (false)
Andrzej Puzdrowski84591632020-02-24 11:50:19 +010077#define ZEPHYR_BOOT_LOG_STOP() do { } while (false)
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +010078#endif /* defined(CONFIG_LOG) && !defined(CONFIG_LOG_IMMEDIATE) */
79
Jon Helge Nistade58f9bd2019-11-25 15:59:52 +010080#ifdef CONFIG_SOC_FAMILY_NRF
81#include <hal/nrf_power.h>
82
83static inline bool boot_skip_serial_recovery()
84{
Fabio Utzig63b4eac2019-12-17 09:59:47 -030085#if NRF_POWER_HAS_RESETREAS
Kumar Gala0813efe2020-05-27 12:25:41 -050086 uint32_t rr = nrf_power_resetreas_get(NRF_POWER);
Jon Helge Nistade58f9bd2019-11-25 15:59:52 +010087
88 return !(rr == 0 || (rr & NRF_POWER_RESETREAS_RESETPIN_MASK));
89#else
90 return false;
91#endif
92}
93#else
94static inline bool boot_skip_serial_recovery()
95{
96 return false;
97}
98#endif
99
Emanuele Di Santo9f1933d2018-11-20 10:59:59 +0100100MCUBOOT_LOG_MODULE_REGISTER(mcuboot);
101
Andrew Boie7238f512017-03-02 13:39:06 -0800102void os_heap_init(void);
103
104#if defined(CONFIG_ARM)
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200105
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200106#ifdef CONFIG_SW_VECTOR_RELAY
107extern void *_vector_table_pointer;
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200108#endif
109
Andrew Boie7238f512017-03-02 13:39:06 -0800110struct arm_vector_table {
David Brown0d0652a2017-04-11 17:33:30 -0600111 uint32_t msp;
112 uint32_t reset;
David Brown5153bd62017-01-06 11:16:53 -0700113};
114
Emanuele Di Santofcfff582018-11-01 16:06:36 +0100115extern void sys_clock_disable(void);
116
Andrew Boie7238f512017-03-02 13:39:06 -0800117static void do_boot(struct boot_rsp *rsp)
118{
David Brown0d0652a2017-04-11 17:33:30 -0600119 struct arm_vector_table *vt;
Marti Bolivareb940802017-05-01 23:15:29 -0400120 uintptr_t flash_base;
121 int rc;
Andrew Boie7238f512017-03-02 13:39:06 -0800122
David Brown0d0652a2017-04-11 17:33:30 -0600123 /* The beginning of the image is the ARM vector table, containing
124 * the initial stack pointer address and the reset vector
125 * consecutively. Manually set the stack pointer and jump into the
126 * reset vector
127 */
Marti Bolivareb940802017-05-01 23:15:29 -0400128 rc = flash_device_base(rsp->br_flash_dev_id, &flash_base);
129 assert(rc == 0);
130
131 vt = (struct arm_vector_table *)(flash_base +
132 rsp->br_image_off +
David Brown0d0652a2017-04-11 17:33:30 -0600133 rsp->br_hdr->ih_hdr_size);
Arvid Rosén9ed399c2020-08-19 08:57:11 +0200134
135#ifdef CONFIG_CPU_CORTEX_M7
136 /* Disable instruction cache and data cache before chain-load the application */
137 SCB_DisableDCache();
138 SCB_DisableICache();
139#endif
140
David Brown0d0652a2017-04-11 17:33:30 -0600141 irq_lock();
Andrzej Puzdrowski960a2d62019-08-12 16:28:26 +0200142#ifdef CONFIG_SYS_CLOCK_EXISTS
David Brown0d0652a2017-04-11 17:33:30 -0600143 sys_clock_disable();
Andrzej Puzdrowski960a2d62019-08-12 16:28:26 +0200144#endif
Jun Li01bef712019-05-08 21:55:54 -0700145#ifdef CONFIG_USB
Emanuele Di Santoc4bf7802018-07-20 11:39:57 +0200146 /* Disable the USB to prevent it from firing interrupts */
147 usb_disable();
148#endif
Andrzej Puzdrowski9a605b62020-03-16 13:34:30 +0100149#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
150 cleanup_arm_nvic(); /* cleanup NVIC registers */
151#endif
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200152
Håkon Øye Amundsen6a8dbba2020-10-01 12:52:38 +0000153#if defined(CONFIG_BUILTIN_STACK_GUARD) && \
154 defined(CONFIG_CPU_CORTEX_M_HAS_SPLIM)
155 /* Reset limit registers to avoid inflicting stack overflow on image
156 * being booted.
157 */
158 __set_PSPLIM(0);
159 __set_MSPLIM(0);
160#endif
161
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200162#ifdef CONFIG_BOOT_INTR_VEC_RELOC
Rafał Kuźnia505c6e62020-07-17 13:18:15 +0200163#if defined(CONFIG_SW_VECTOR_RELAY)
164 _vector_table_pointer = vt;
165#ifdef CONFIG_CPU_CORTEX_M_HAS_VTOR
166 SCB->VTOR = (uint32_t)__vector_relay_table;
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200167#endif
Rafał Kuźnia505c6e62020-07-17 13:18:15 +0200168#elif defined(CONFIG_CPU_CORTEX_M_HAS_VTOR)
169 SCB->VTOR = (uint32_t)vt;
170#endif /* CONFIG_SW_VECTOR_RELAY */
171#else /* CONFIG_BOOT_INTR_VEC_RELOC */
172#if defined(CONFIG_CPU_CORTEX_M_HAS_VTOR) && defined(CONFIG_SW_VECTOR_RELAY)
173 _vector_table_pointer = _vector_start;
174 SCB->VTOR = (uint32_t)__vector_relay_table;
175#endif
176#endif /* CONFIG_BOOT_INTR_VEC_RELOC */
Rafał Kuźniad854bb62020-06-17 15:06:47 +0200177
David Brown57837b92018-03-13 15:56:38 -0600178 __set_MSP(vt->msp);
Andrzej Puzdrowski9a605b62020-03-16 13:34:30 +0100179#if CONFIG_MCUBOOT_CLEANUP_ARM_CORE
180 __set_CONTROL(0x00); /* application will configures core on its own */
181#endif
David Brown0d0652a2017-04-11 17:33:30 -0600182 ((void (*)(void))vt->reset)();
Andrew Boie7238f512017-03-02 13:39:06 -0800183}
Rajavardhan Gundi40c28e32018-12-09 13:32:01 +0530184
185#elif defined(CONFIG_XTENSA)
186#define SRAM_BASE_ADDRESS 0xBE030000
187
188static void copy_img_to_SRAM(int slot, unsigned int hdr_offset)
189{
190 const struct flash_area *fap;
191 int area_id;
192 int rc;
193 unsigned char *dst = (unsigned char *)(SRAM_BASE_ADDRESS + hdr_offset);
194
195 BOOT_LOG_INF("Copying image to SRAM");
196
197 area_id = flash_area_id_from_image_slot(slot);
198 rc = flash_area_open(area_id, &fap);
199 if (rc != 0) {
Fabio Utzigcac58f62019-09-06 08:52:35 -0300200 BOOT_LOG_ERR("flash_area_open failed with %d\n", rc);
Rajavardhan Gundi40c28e32018-12-09 13:32:01 +0530201 goto done;
202 }
203
204 rc = flash_area_read(fap, hdr_offset, dst, fap->fa_size - hdr_offset);
205 if (rc != 0) {
Fabio Utzigcac58f62019-09-06 08:52:35 -0300206 BOOT_LOG_ERR("flash_area_read failed with %d\n", rc);
Rajavardhan Gundi40c28e32018-12-09 13:32:01 +0530207 goto done;
208 }
209
210done:
211 flash_area_close(fap);
212}
213
214/* Entry point (.ResetVector) is at the very beginning of the image.
215 * Simply copy the image to a suitable location and jump there.
216 */
217static void do_boot(struct boot_rsp *rsp)
218{
219 void *start;
220
221 BOOT_LOG_INF("br_image_off = 0x%x\n", rsp->br_image_off);
222 BOOT_LOG_INF("ih_hdr_size = 0x%x\n", rsp->br_hdr->ih_hdr_size);
223
224 /* Copy from the flash to HP SRAM */
225 copy_img_to_SRAM(0, rsp->br_hdr->ih_hdr_size);
226
227 /* Jump to entry point */
228 start = (void *)(SRAM_BASE_ADDRESS + rsp->br_hdr->ih_hdr_size);
229 ((void (*)(void))start)();
230}
231
Andrew Boie7238f512017-03-02 13:39:06 -0800232#else
233/* Default: Assume entry point is at the very beginning of the image. Simply
234 * lock interrupts and jump there. This is the right thing to do for X86 and
235 * possibly other platforms.
236 */
237static void do_boot(struct boot_rsp *rsp)
238{
Marti Bolivareb940802017-05-01 23:15:29 -0400239 uintptr_t flash_base;
David Brown0d0652a2017-04-11 17:33:30 -0600240 void *start;
Marti Bolivareb940802017-05-01 23:15:29 -0400241 int rc;
Andrew Boie7238f512017-03-02 13:39:06 -0800242
Marti Bolivareb940802017-05-01 23:15:29 -0400243 rc = flash_device_base(rsp->br_flash_dev_id, &flash_base);
244 assert(rc == 0);
245
246 start = (void *)(flash_base + rsp->br_image_off +
247 rsp->br_hdr->ih_hdr_size);
Andrew Boie7238f512017-03-02 13:39:06 -0800248
David Brown0d0652a2017-04-11 17:33:30 -0600249 /* Lock interrupts and dive into the entry point */
250 irq_lock();
251 ((void (*)(void))start)();
Andrew Boie7238f512017-03-02 13:39:06 -0800252}
253#endif
David Brown5153bd62017-01-06 11:16:53 -0700254
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100255#if defined(CONFIG_LOG) && !defined(CONFIG_LOG_IMMEDIATE) &&\
256 !defined(CONFIG_LOG_PROCESS_THREAD)
257/* The log internal thread for log processing can't transfer log well as has too
258 * low priority.
259 * Dedicated thread for log processing below uses highest application
260 * priority. This allows to transmit all logs without adding k_sleep/k_yield
261 * anywhere else int the code.
262 */
263
264/* most simple log processing theread */
265void boot_log_thread_func(void *dummy1, void *dummy2, void *dummy3)
266{
267 (void)dummy1;
268 (void)dummy2;
269 (void)dummy3;
270
271 log_init();
272
273 while (1) {
274 if (log_process(false) == false) {
Andrzej Puzdrowski84591632020-02-24 11:50:19 +0100275 if (boot_log_stop) {
276 break;
277 }
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100278 k_sleep(BOOT_LOG_PROCESSING_INTERVAL);
279 }
280 }
Andrzej Puzdrowski84591632020-02-24 11:50:19 +0100281
282 k_sem_give(&boot_log_sem);
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100283}
284
285void zephyr_boot_log_start(void)
286{
287 /* start logging thread */
288 k_thread_create(&boot_log_thread, boot_log_stack,
289 K_THREAD_STACK_SIZEOF(boot_log_stack),
290 boot_log_thread_func, NULL, NULL, NULL,
291 K_HIGHEST_APPLICATION_THREAD_PRIO, 0,
292 BOOT_LOG_PROCESSING_INTERVAL);
293
294 k_thread_name_set(&boot_log_thread, "logging");
295}
Andrzej Puzdrowski84591632020-02-24 11:50:19 +0100296
297void zephyr_boot_log_stop(void)
298{
299 boot_log_stop = true;
300
301 /* wait until log procesing thread expired
302 * This can be reworked using a thread_join() API once a such will be
303 * available in zephyr.
304 * see https://github.com/zephyrproject-rtos/zephyr/issues/21500
305 */
306 (void)k_sem_take(&boot_log_sem, K_FOREVER);
307}
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100308#endif/* defined(CONFIG_LOG) && !defined(CONFIG_LOG_IMMEDIATE) &&\
309 !defined(CONFIG_LOG_PROCESS_THREAD) */
310
David Brown5153bd62017-01-06 11:16:53 -0700311void main(void)
312{
David Brown0d0652a2017-04-11 17:33:30 -0600313 struct boot_rsp rsp;
314 int rc;
Tamas Banee6615d2020-09-30 07:58:48 +0100315 fih_int fih_rc = FIH_FAILURE;
David Brown5153bd62017-01-06 11:16:53 -0700316
David Brown0d0652a2017-04-11 17:33:30 -0600317 BOOT_LOG_INF("Starting bootloader");
Ricardo Salveti7cf3d9e2017-01-18 16:38:22 -0200318
David Brown0d0652a2017-04-11 17:33:30 -0600319 os_heap_init();
David Brown5153bd62017-01-06 11:16:53 -0700320
Andrzej Puzdrowski3f092bd2020-02-17 13:25:32 +0100321 ZEPHYR_BOOT_LOG_START();
322
Tamas Banee6615d2020-09-30 07:58:48 +0100323 (void)rc;
324
Kumar Gala32b61f32020-04-08 12:02:03 -0500325#if (!defined(CONFIG_XTENSA) && defined(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL))
326 if (!flash_device_get_binding(DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL)) {
327 BOOT_LOG_ERR("Flash device %s not found",
328 DT_CHOSEN_ZEPHYR_FLASH_CONTROLLER_LABEL);
David Brown0d0652a2017-04-11 17:33:30 -0600329 while (1)
330 ;
331 }
Kumar Gala9a5b9512020-04-08 12:06:21 -0500332#elif (defined(CONFIG_XTENSA) && defined(JEDEC_SPI_NOR_0_LABEL))
333 if (!flash_device_get_binding(JEDEC_SPI_NOR_0_LABEL)) {
334 BOOT_LOG_ERR("Flash device %s not found", JEDEC_SPI_NOR_0_LABEL);
Rajavardhan Gundi40c28e32018-12-09 13:32:01 +0530335 while (1)
336 ;
337 }
Rajavardhan Gundic3353b22018-12-06 17:24:10 +0530338#endif
David Brown5153bd62017-01-06 11:16:53 -0700339
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200340#ifdef CONFIG_MCUBOOT_SERIAL
341
Dominik Ermel1422b4b2020-09-11 11:31:38 +0000342 struct device const *detect_port;
Kumar Gala0813efe2020-05-27 12:25:41 -0500343 uint32_t detect_value = !CONFIG_BOOT_SERIAL_DETECT_PIN_VAL;
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200344
345 detect_port = device_get_binding(CONFIG_BOOT_SERIAL_DETECT_PORT);
346 __ASSERT(detect_port, "Error: Bad port for boot serial detection.\n");
347
Peter Bigot36e90292020-01-30 05:36:47 -0600348 /* The default presence value is 0 which would normally be
349 * active-low, but historically the raw value was checked so we'll
350 * use the raw interface.
351 */
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200352 rc = gpio_pin_configure(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN,
Peter Bigot36e90292020-01-30 05:36:47 -0600353#ifdef GPIO_INPUT
354 GPIO_INPUT | GPIO_PULL_UP
355#else
356 GPIO_DIR_IN | GPIO_PUD_PULL_UP
357#endif
Andrzej Puzdrowski5d96bd22020-02-20 10:35:33 +0100358 );
Andrzej Puzdrowski82d73952018-06-13 14:55:51 +0200359 __ASSERT(rc == 0, "Error of boot detect pin initialization.\n");
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200360
Peter Bigot36e90292020-01-30 05:36:47 -0600361#ifdef GPIO_INPUT
362 rc = gpio_pin_get_raw(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN);
363 detect_value = rc;
364#else
Emanuele Di Santofcfff582018-11-01 16:06:36 +0100365 rc = gpio_pin_read(detect_port, CONFIG_BOOT_SERIAL_DETECT_PIN,
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200366 &detect_value);
Peter Bigot36e90292020-01-30 05:36:47 -0600367#endif
368 __ASSERT(rc >= 0, "Error of the reading the detect pin.\n");
Jon Helge Nistade58f9bd2019-11-25 15:59:52 +0100369 if (detect_value == CONFIG_BOOT_SERIAL_DETECT_PIN_VAL &&
370 !boot_skip_serial_recovery()) {
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200371 BOOT_LOG_INF("Enter the serial recovery mode");
Marko Kiiskila149b4572018-06-06 14:18:54 +0300372 rc = boot_console_init();
Carles Cufie2a36122018-06-15 10:51:02 +0200373 __ASSERT(rc == 0, "Error initializing boot console.\n");
Marko Kiiskila149b4572018-06-06 14:18:54 +0300374 boot_serial_start(&boot_funcs);
Andrzej Puzdrowski8e96b832017-09-08 16:49:14 +0200375 __ASSERT(0, "Bootloader serial process was terminated unexpectedly.\n");
376 }
377#endif
378
Rajavardhan Gundi51c9d702019-02-20 14:08:52 +0530379#ifdef CONFIG_BOOT_WAIT_FOR_USB_DFU
Andrzej Puzdrowskiac1f1ff2020-02-05 08:40:12 +0100380 rc = usb_enable(NULL);
381 if (rc) {
382 BOOT_LOG_ERR("Cannot enable USB");
383 } else {
384 BOOT_LOG_INF("Waiting for USB DFU");
385 wait_for_usb_dfu();
386 BOOT_LOG_INF("USB DFU wait time elapsed");
387 }
Rajavardhan Gundi51c9d702019-02-20 14:08:52 +0530388#endif
389
Tamas Banee6615d2020-09-30 07:58:48 +0100390 FIH_CALL(boot_go, fih_rc, &rsp);
391 if (fih_not_eq(fih_rc, FIH_SUCCESS)) {
David Brown0d0652a2017-04-11 17:33:30 -0600392 BOOT_LOG_ERR("Unable to find bootable image");
Tamas Banee6615d2020-09-30 07:58:48 +0100393 FIH_PANIC;
David Brown0d0652a2017-04-11 17:33:30 -0600394 }
David Brown5153bd62017-01-06 11:16:53 -0700395
Marti Bolivar88f48d92017-05-01 22:30:02 -0400396 BOOT_LOG_INF("Bootloader chainload address offset: 0x%x",
397 rsp.br_image_off);
Andrzej Puzdrowskib788c712018-04-12 12:42:49 +0200398
David Brown0d0652a2017-04-11 17:33:30 -0600399 BOOT_LOG_INF("Jumping to the first image slot");
Andrzej Puzdrowski84591632020-02-24 11:50:19 +0100400 ZEPHYR_BOOT_LOG_STOP();
David Brown0d0652a2017-04-11 17:33:30 -0600401 do_boot(&rsp);
David Brown5153bd62017-01-06 11:16:53 -0700402
David Brown0d0652a2017-04-11 17:33:30 -0600403 BOOT_LOG_ERR("Never should get here");
404 while (1)
405 ;
David Brown5153bd62017-01-06 11:16:53 -0700406}