Skip to content

Commit 8131548

Browse files
committed
Revert "zephyr: arm: Update reading the flash image reset vector"
This reverts commit 453096b. Signed-off-by: Jamie McCrae <[email protected]>
1 parent 47d826e commit 8131548

File tree

2 files changed

+5
-28
lines changed

2 files changed

+5
-28
lines changed

boot/zephyr/flash_map_extended.c

-13
Original file line numberDiff line numberDiff line change
@@ -155,21 +155,8 @@ int flash_area_sector_from_off(off_t off, struct flash_sector *sector)
155155

156156
uint8_t flash_area_get_device_id(const struct flash_area *fa)
157157
{
158-
uint8_t device_id;
159-
int rc;
160-
161-
rc = BOOT_HOOK_FLASH_AREA_CALL(flash_area_get_device_id_hook,
162-
BOOT_HOOK_REGULAR, fa, &device_id);
163-
if (rc != BOOT_HOOK_REGULAR) {
164-
return device_id;
165-
}
166-
167-
#if defined(CONFIG_ARM)
168-
return fa->fa_id;
169-
#else
170158
(void)fa;
171159
return FLASH_DEVICE_ID;
172-
#endif
173160
}
174161

175162
#define ERASED_VAL 0xff

boot/zephyr/main.c

+5-15
Original file line numberDiff line numberDiff line change
@@ -158,26 +158,16 @@ static void do_boot(struct boot_rsp *rsp)
158158
/* Get ram address for image */
159159
vt = (struct arm_vector_table *)(rsp->br_hdr->ih_load_addr + rsp->br_hdr->ih_hdr_size);
160160
#else
161+
uintptr_t flash_base;
161162
int rc;
162-
const struct flash_area *fap;
163-
static uint32_t dst[2];
164163

165164
/* Jump to flash image */
166-
rc = flash_area_open(rsp->br_flash_dev_id, &fap);
167-
assert(rc == 0);
168-
169-
rc = flash_area_read(fap, rsp->br_hdr->ih_hdr_size, dst, sizeof(dst));
165+
rc = flash_device_base(rsp->br_flash_dev_id, &flash_base);
170166
assert(rc == 0);
171-
#ifndef CONFIG_ASSERT
172-
/* Enter a lock up as asserts are disabled */
173-
if (rc != 0) {
174-
while (1);
175-
}
176-
#endif
177-
178-
flash_area_close(fap);
179167

180-
vt = (struct arm_vector_table *)dst;
168+
vt = (struct arm_vector_table *)(flash_base +
169+
rsp->br_image_off +
170+
rsp->br_hdr->ih_hdr_size);
181171
#endif
182172

183173
if (IS_ENABLED(CONFIG_SYSTEM_TIMER_HAS_DISABLE_SUPPORT)) {

0 commit comments

Comments
 (0)