Boot : Fix boot_platform_quit

According to compiler and optimization:
- registers used to retrieve vt_cpy are pushed in sp,
- sp is modified before calling boot_jump_to_next_image(i.e if some
non scratch registers have been used),this creates an incorrect sp.

Change-Id: I866ac756d3611f67636b99b10d340c77dd12b148
Signed-off-by: Michel Jaouen <michel.jaouen@st.com>
diff --git a/bl2/include/boot_hal.h b/bl2/include/boot_hal.h
index eaf4368..de026e0 100644
--- a/bl2/include/boot_hal.h
+++ b/bl2/include/boot_hal.h
@@ -44,7 +44,7 @@
  * \param[in] reset_handler_addr Address of next image's Reset_Handler() in
                                  the boot chain (TF-M SPE, etc.)
  */
-void boot_jump_to_next_image(uint32_t reset_handler_addr);
+void boot_jump_to_next_image(uint32_t reset_handler_addr) __NO_RETURN;
 
 /**
  * \brief Platform peripherals and devices initialization.
@@ -60,7 +60,7 @@
  *
  * \param[in] vt  pointer to secure application vector table descriptor
  */
-void boot_platform_quit(struct boot_arm_vector_table *vt);
+void boot_platform_quit(struct boot_arm_vector_table *vt) __NO_RETURN;
 
 #ifdef __cplusplus
 }
diff --git a/platform/ext/common/boot_hal.c b/platform/ext/common/boot_hal.c
index 50a6834..a005b73 100644
--- a/platform/ext/common/boot_hal.c
+++ b/platform/ext/common/boot_hal.c
@@ -85,7 +85,7 @@
      */
     __set_MSPLIM(0);
 #endif
-    __set_MSP(vt->msp);
+    __set_MSP(vt_cpy->msp);
     __DSB();
     __ISB();
 
diff --git a/platform/ext/target/stm/stm32l5xx/bl2/boot_hal.c b/platform/ext/target/stm/stm32l5xx/bl2/boot_hal.c
index f14008a..8df0015 100644
--- a/platform/ext/target/stm/stm32l5xx/bl2/boot_hal.c
+++ b/platform/ext/target/stm/stm32l5xx/bl2/boot_hal.c
@@ -86,7 +86,7 @@
      */
     __set_MSPLIM(0);
 #endif
-    __set_MSP(vt->msp);
+    __set_MSP(vt_cpy->msp);
     __DSB();
     __ISB();