Commit e4574444 authored by Daniel DeGrasse's avatar Daniel DeGrasse Committed by David Brown
Browse files

boot: zephyr: enable ram load for ARM



Enable ram loading for ARM, with correct handling of vector table when
code has moved to RAM.

Signed-off-by: default avatarDaniel DeGrasse <daniel.degrasse@nxp.com>
parent 9324d2b8
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -168,20 +168,27 @@ struct arm_vector_table {
static void do_boot(struct boot_rsp *rsp)
{
    struct arm_vector_table *vt;
    uintptr_t flash_base;
    int rc;

    /* The beginning of the image is the ARM vector table, containing
     * the initial stack pointer address and the reset vector
     * consecutively. Manually set the stack pointer and jump into the
     * reset vector
     */
#ifdef CONFIG_BOOT_RAM_LOAD
    /* Get ram address for image */
    vt = (struct arm_vector_table *)(rsp->br_hdr->ih_load_addr + rsp->br_hdr->ih_hdr_size);
#else
    uintptr_t flash_base;
    int rc;

    /* Jump to flash image */
    rc = flash_device_base(rsp->br_flash_dev_id, &flash_base);
    assert(rc == 0);

    vt = (struct arm_vector_table *)(flash_base +
                                     rsp->br_image_off +
                                     rsp->br_hdr->ih_hdr_size);
#endif

    sys_clock_disable();