Skip to contentSkip to conversation

spl: stash bootstage info before jump to next stage

PATCH In review Kever Yang 3 participants 4 messages Sep 13, 2017 – Sep 22, 2017

lore
Share & tools
lore

Kever Yang

author
#0 lore raw

PATCH 1/1 spl: stash bootstage info before jump to next stage

Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it.

---

 common/spl/spl.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
common/spl/spl.c +9 -9
index 85e2e88..d156e74 100644
@@ -424,6 +424,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
 	      gd->malloc_ptr / 1024);
 #endif
+#ifdef CONFIG_BOOTSTAGE_STASH
+	int ret;
+
+	bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
+	ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
+			      CONFIG_BOOTSTAGE_STASH_SIZE);
+	if (ret)
+		debug("Failed to stash bootstage: err=%d\n", ret);
+#endif
 
 	if (CONFIG_IS_ENABLED(ATF_SUPPORT)) {
 		debug("loaded - jumping to U-Boot via ATF BL31.\n");
@@ -436,15 +445,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	}
 
 	debug("loaded - jumping to U-Boot...\n");
-#ifdef CONFIG_BOOTSTAGE_STASH
-	int ret;
-
-	bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
-	ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
-			      CONFIG_BOOTSTAGE_STASH_SIZE);
-	if (ret)
-		debug("Failed to stash bootstage: err=%d\n", ret);
-#endif
 	spl_board_prepare_for_boot();
 	jump_to_image_no_args(&spl_image);
 }
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 spl: stash bootstage info before jump to next stage

Quoted 35 lines · Kever Yang

Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it.

---

 common/spl/spl.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
common/spl/spl.c +9 -2
index 85e2e88..d156e74 100644
@@ -424,6 +424,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
 	      gd->malloc_ptr / 1024);
 #endif
+#ifdef CONFIG_BOOTSTAGE_STASH
+	int ret;
+
+	bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
+	ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
+			      CONFIG_BOOTSTAGE_STASH_SIZE);
+	if (ret)
+		debug("Failed to stash bootstage: err=%d\n", ret);
+#endif
 
 	if (CONFIG_IS_ENABLED(ATF_SUPPORT)) {
 		debug("loaded - jumping to U-Boot via ATF BL31.\n");
@@ -436,15 +445,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
 	}
 
 	debug("loaded - jumping to U-Boot...\n");
-#ifdef CONFIG_BOOTSTAGE_STASH
-	int ret;

common/spl/spl.c void board_init_r(gd_t *dummy1, ulong dummy2) · line 450

Quoted 10 lines
common/spl/spl.c +0 -7
-
-	bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
-	ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
-			      CONFIG_BOOTSTAGE_STASH_SIZE);
-	if (ret)
-		debug("Failed to stash bootstage: err=%d\n", ret);
-#endif
 	spl_board_prepare_for_boot();
 	jump_to_image_no_args(&spl_image);
 }

Simon, does this seem right to you? Thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170913/ff250127/attachment.sig>
#2 lore raw

PATCH 1/1 spl: stash bootstage info before jump to next stage

Quoted 33 lines · Tom Rini
Quoted 32 lines · Kever Yang

Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it.

---

 common/spl/spl.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
common/spl/spl.c +9 -0
index 85e2e88..d156e74 100644
@@ -424,6 +424,15 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
      debug("SPL malloc() used %#lx bytes (%ld KB)\n", gd->malloc_ptr,
            gd->malloc_ptr / 1024);
 #endif
+#ifdef CONFIG_BOOTSTAGE_STASH
+     int ret;
+
+     bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
+     ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
+                           CONFIG_BOOTSTAGE_STASH_SIZE);
+     if (ret)
+             debug("Failed to stash bootstage: err=%d\n", ret);
+#endif
 
      if (CONFIG_IS_ENABLED(ATF_SUPPORT)) {
              debug("loaded - jumping to U-Boot via ATF BL31.\n");
@@ -436,15 +445,6 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
      }
 
Quoted 15 lines

common/spl/spl.c void board_init_r(gd_t *dummy1, ulong dummy2) · line 450

Quoted 13 lines
common/spl/spl.c +0 -9
      debug("loaded - jumping to U-Boot...\n");
-#ifdef CONFIG_BOOTSTAGE_STASH
-     int ret;
-
-     bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
-     ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
-                           CONFIG_BOOTSTAGE_STASH_SIZE);
-     if (ret)
-             debug("Failed to stash bootstage: err=%d\n", ret);
-#endif
      spl_board_prepare_for_boot();
      jump_to_image_no_args(&spl_image);
 }

Simon, does this seem right to you? Thanks!

Yes. I think the commit message would be better if it mentioned that the code is moved, not added. Really, it is the CONFIG_IS_ENABLED(ATF_SUPPORT) that is being moved I think.

Regards,
Simon

#3 lore raw
In reply to Kever Yang
Quoted 5 lines · Kever Yang

Since we may jump to next stage like ATF/OP-TEE instead of U-Boot, we need to stash the bootstage info before it.

Applied to u-boot/master, thanks!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170922/281e744f/attachment.sig>