Revert "Merge pull request #49 from mbolivar/flash-map-updates"
This reverts commit a52d7a21f01bd2859be9e62e20cbe029dc5e846c, reversing
changes made to d21abaaa35c31d88f9b4a18f82bce848adffb569.
Premature merge. Will bring this back in after #41 merges.
diff --git a/boot/zephyr/main.c b/boot/zephyr/main.c
index e5a1eb8..9791f26 100644
--- a/boot/zephyr/main.c
+++ b/boot/zephyr/main.c
@@ -14,7 +14,6 @@
* limitations under the License.
*/
-#include <assert.h>
#include <zephyr.h>
#include <flash.h>
#include <asm_inline.h>
@@ -26,7 +25,6 @@
#include "bootutil/bootutil_log.h"
#include "bootutil/image.h"
#include "bootutil/bootutil.h"
-#include "flash_map/flash_map.h"
struct device *boot_flash_device;
@@ -38,24 +36,16 @@
uint32_t reset;
};
-extern void zephyr_flash_area_warn_on_open(void);
-
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
*/
- 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 +
+ vt = (struct arm_vector_table *)(rsp->br_image_addr +
rsp->br_hdr->ih_hdr_size);
irq_lock();
sys_clock_disable();
@@ -69,15 +59,9 @@
*/
static void do_boot(struct boot_rsp *rsp)
{
- uintptr_t flash_base;
void *start;
- int rc;
- rc = flash_device_base(rsp->br_flash_dev_id, &flash_base);
- assert(rc == 0);
-
- start = (void *)(flash_base + rsp->br_image_off +
- rsp->br_hdr->ih_hdr_size);
+ start = (void *)(rsp->br_image_addr + rsp->br_hdr->ih_hdr_size);
/* Lock interrupts and dive into the entry point */
irq_lock();
@@ -108,9 +92,7 @@
;
}
- BOOT_LOG_INF("Bootloader chainload address offset: 0x%x",
- rsp.br_image_off);
- zephyr_flash_area_warn_on_open();
+ BOOT_LOG_INF("Bootloader chainload address: 0x%x", rsp.br_image_addr);
BOOT_LOG_INF("Jumping to the first image slot");
do_boot(&rsp);