espressif:esp32: Move app entry point call back to iram_loader_seg region

Entry point call was moved back from main to esp_loader, so it is
called from iram_loader_seg memory region

Signed-off-by: Almir Okato <almir.okato@espressif.com>
diff --git a/boot/espressif/main.c b/boot/espressif/main.c
index 6e59b00..b3d2b76 100644
--- a/boot/espressif/main.c
+++ b/boot/espressif/main.c
@@ -22,9 +22,6 @@
 #ifdef CONFIG_SECURE_FLASH_ENC_ENABLED
 #include "esp_flash_encrypt.h"
 #endif
-#ifdef CONFIG_ESP_MULTI_PROCESSOR_BOOT
-#include "app_cpu_start.h"
-#endif
 
 #include "esp_loader.h"
 #include "os/os_malloc.h"
@@ -41,13 +38,10 @@
 
 void do_boot(struct boot_rsp *rsp)
 {
-    unsigned int entry_addr;
     BOOT_LOG_INF("br_image_off = 0x%x", rsp->br_image_off);
     BOOT_LOG_INF("ih_hdr_size = 0x%x", rsp->br_hdr->ih_hdr_size);
     int slot = (rsp->br_image_off == CONFIG_ESP_IMAGE0_PRIMARY_START_ADDRESS) ? PRIMARY_SLOT : SECONDARY_SLOT;
-    esp_app_image_load(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size, &entry_addr);
-    ((void (*)(void))entry_addr)(); /* Call to application entry address should not return */
-    FIH_PANIC; /* It should not get here */
+    start_cpu0_image(IMAGE_INDEX_0, slot, rsp->br_hdr->ih_hdr_size);
 }
 
 #ifdef CONFIG_ESP_MULTI_PROCESSOR_BOOT
@@ -79,15 +73,13 @@
 
 void do_boot_appcpu(uint32_t img_index, uint32_t slot)
 {
-    unsigned int entry_addr;
     struct image_header img_header;
 
     if (read_image_header(img_index, slot, &img_header) != 0) {
         FIH_PANIC;
     }
 
-    esp_app_image_load(img_index, slot, img_header.ih_hdr_size, &entry_addr);
-    appcpu_start(entry_addr);
+    start_cpu1_image(img_index, slot, img_header.ih_hdr_size);
 }
 #endif