From: Simon Glass <sjg@chromium.org>
Date: Fri, 16 Nov 2018 01:43:58 +0000 (-0700)
Subject: spl: Add a comment to spl_set_bd()
X-Git-Tag: v2025.01-rc5-pxa1908~3270^2~11
X-Git-Url: http://git.dujemihanovic.xyz/img/static/html/index.html?a=commitdiff_plain;h=c21f407bf01cf497fd03fe404c1f06bdb36c88f9;p=u-boot.git

spl: Add a comment to spl_set_bd()

There is a strange feature to set global_data to a data-section variable
early in SPL. This only works if SPL actually has access to SRAM which is
not the case on x86, for eaxmple. Add a comment to this effect.

Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
---

diff --git a/common/spl/spl.c b/common/spl/spl.c
index 5a026b844e..43137105ba 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -378,6 +378,10 @@ static int spl_common_init(bool setup_malloc)
 
 void spl_set_bd(void)
 {
+	/*
+	 * NOTE: On some platforms (e.g. x86) bdata may be in flash and not
+	 * writeable.
+	 */
 	if (!gd->bd)
 		gd->bd = &bdata;
 }