Skip to contentSkip to conversation

arm: mvebu: Replace hardcoded values 0x0030/0x4030 by proper calculation

PATCH In review Pali Rohár 3 participants 6 messages Jan 12, 2022 – Jan 14, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: mvebu: Replace hardcoded values 0x0030/0x4030 by proper calculation

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

---
 include/configs/clearfog.h       | 2 +-
 include/configs/db-88f6720.h     | 2 +-
 include/configs/db-88f6820-amc.h | 2 +-
 include/configs/db-88f6820-gp.h  | 2 +-
 include/configs/db-mv784mp-gp.h  | 2 +-
 include/configs/ds414.h          | 2 +-
 include/configs/helios4.h        | 2 +-
 include/configs/maxbcm.h         | 2 +-
 include/configs/theadorable.h    | 2 +-
 include/configs/turris_omnia.h   | 2 +-
 include/configs/x530.h           | 2 +-
 11 files changed, 11 insertions(+), 11 deletions(-)
include/configs/clearfog.h +1 -1
index a30bca5147a8..c9af5a40cec0 100644
@@ -53,7 +53,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6720.h +1 -1
index cf9e44d17c32..16c83a88dace 100644
@@ -34,7 +34,7 @@
 
 /* SPL */
 /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-amc.h +1 -1
index 1f70c609d234..6538e66052aa 100644
@@ -41,7 +41,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-gp.h +1 -1
index 41dadfebb948..5f2611995d35 100644
@@ -50,7 +50,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-mv784mp-gp.h +1 -1
index dbbc33ebf9c3..449a56753b17 100644
@@ -59,7 +59,7 @@
 
 /* SPL */
 /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/ds414.h +1 -1
index 7fba2b4cc427..dbccd46bbdb1 100644
@@ -45,7 +45,7 @@
 
 /* SPL */
 /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/helios4.h +1 -1
index 56d35d6fdbc6..de1ebbf37516 100644
@@ -53,7 +53,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/maxbcm.h +1 -1
index 53ba64909e1f..073c5a57b2c9 100644
@@ -48,7 +48,7 @@
 
 /* SPL */
 /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/theadorable.h +1 -1
index b43c03d3e8a9..3c942cc6fa01 100644
@@ -77,7 +77,7 @@
 
 /* SPL */
 /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/turris_omnia.h +1 -1
index 9436a623d6fe..b35299b2fbb3 100644
@@ -28,7 +28,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/x530.h +1 -1
index e78e249e41ae..67ff01db9041 100644
@@ -68,7 +68,7 @@
 
 /* Defines for SPL */
 #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
 #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
 #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
Signature · 1 line
2.20.1
#1 lore raw
Quoted 4 lines · On Wed, 12 Jan 2022 18:32:08 +0100 Pali Rohár <[email protected]> wrote:

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

Is there any point in having these configurable? Can the board boot if the user changes it? If not, wouldn't it make more sense to convert these to macros in soc.h, and changing their names?

Or does compilation need CONFIG_SPL_TEXT_BASE to link properly?

Marek

#2 lore raw
Quoted 11 lines · On Wednesday 12 January 2022 23:27:06 Marek Behún wrote:
Quoted 4 lines · On Wed, 12 Jan 2022 18:32:08 +0100 Pali Rohár <[email protected]> wrote:

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

Is there any point in having these configurable? Can the board boot if the user changes it? If not, wouldn't it make more sense to convert these to macros in soc.h, and changing their names?

With this patch series it is possible to change CONFIG_SPL_TEXT_BASE and board would be normally bootable. Build system propagates CONFIG_SPL_TEXT_BASE to kwbimage and kwbimage then set correct load address.

So user can change CONFIG_SPL_TEXT_BASE also to other value.

Quoted 1 line

Or does compilation need CONFIG_SPL_TEXT_BASE to link properly?

And yes, compilation needs CONFIG_SPL_TEXT_BASE for proper linking. Because U-Boot SPL for 32-bit ARM is not position independent.

Reviewed-by on v1 1/1
#3 lore raw
In reply to Pali Rohár
Quoted 38 lines · Pali Rohár

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

---
  include/configs/clearfog.h       | 2 +-
  include/configs/db-88f6720.h     | 2 +-
  include/configs/db-88f6820-amc.h | 2 +-
  include/configs/db-88f6820-gp.h  | 2 +-
  include/configs/db-mv784mp-gp.h  | 2 +-
  include/configs/ds414.h          | 2 +-
  include/configs/helios4.h        | 2 +-
  include/configs/maxbcm.h         | 2 +-
  include/configs/theadorable.h    | 2 +-
  include/configs/turris_omnia.h   | 2 +-
  include/configs/x530.h           | 2 +-
  11 files changed, 11 insertions(+), 11 deletions(-)
include/configs/clearfog.h +1 -1
index a30bca5147a8..c9af5a40cec0 100644
@@ -53,7 +53,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6720.h +0 -0
index cf9e44d17c32..16c83a88dace 100644

include/configs/db-88f6720.h line 39

Quoted 7 lines
include/configs/db-88f6720.h +1 -1
@@ -34,7 +34,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))

Thanks for working on this. Looking at this diff I'm wondering if it would be another "improvement" to replace all 0x40000000 occurrences by some other macro? Perhaps in a follow-up patch.

But anyways, for this patch:

Thanks,
Stefan

Quoted 111 lines
include/configs/db-88f6720.h +0 -0
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-amc.h +1 -1
index 1f70c609d234..6538e66052aa 100644
@@ -41,7 +41,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-gp.h +1 -1
index 41dadfebb948..5f2611995d35 100644
@@ -50,7 +50,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-mv784mp-gp.h +1 -1
index dbbc33ebf9c3..449a56753b17 100644
@@ -59,7 +59,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/ds414.h +1 -1
index 7fba2b4cc427..dbccd46bbdb1 100644
@@ -45,7 +45,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/helios4.h +1 -1
index 56d35d6fdbc6..de1ebbf37516 100644
@@ -53,7 +53,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/maxbcm.h +1 -1
index 53ba64909e1f..073c5a57b2c9 100644
@@ -48,7 +48,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/theadorable.h +1 -1
index b43c03d3e8a9..3c942cc6fa01 100644
@@ -77,7 +77,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/turris_omnia.h +1 -1
index 9436a623d6fe..b35299b2fbb3 100644
@@ -28,7 +28,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/x530.h +0 -0
index e78e249e41ae..67ff01db9041 100644

include/configs/x530.h line 74

Quoted 8 lines
include/configs/x530.h +1 -1
@@ -68,7 +68,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#4 lore raw
Quoted 38 lines · On Thursday 13 January 2022 07:51:41 Stefan Roese wrote:
Quoted 37 lines · Pali Rohár

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

---
  include/configs/clearfog.h       | 2 +-
  include/configs/db-88f6720.h     | 2 +-
  include/configs/db-88f6820-amc.h | 2 +-
  include/configs/db-88f6820-gp.h  | 2 +-
  include/configs/db-mv784mp-gp.h  | 2 +-
  include/configs/ds414.h          | 2 +-
  include/configs/helios4.h        | 2 +-
  include/configs/maxbcm.h         | 2 +-
  include/configs/theadorable.h    | 2 +-
  include/configs/turris_omnia.h   | 2 +-
  include/configs/x530.h           | 2 +-
  11 files changed, 11 insertions(+), 11 deletions(-)
include/configs/clearfog.h +1 -1
index a30bca5147a8..c9af5a40cec0 100644
@@ -53,7 +53,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6720.h +0 -0
index cf9e44d17c32..16c83a88dace 100644
@@ -34,7 +34,7 @@
  /* SPL */
Quoted 8 lines

include/configs/db-88f6720.h line 39

Quoted 4 lines
include/configs/db-88f6720.h +1 -1
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))

Thanks for working on this. Looking at this diff I'm wondering if it would be another "improvement" to replace all 0x40000000 occurrences by some other macro? Perhaps in a follow-up patch.

Yes, adding a new macro for 0x40000000 address, perhaps in mv-common.h in a follow-up patch is a good idea. And now it should be possible to move more CONFIG_SPL_* macros into mv-common.h file.

Quoted 116 lines

But anyways, for this patch:

Thanks,
Stefan

Quoted 94 lines
include/configs/db-88f6720.h +0 -0
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-amc.h +1 -1
index 1f70c609d234..6538e66052aa 100644
@@ -41,7 +41,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-gp.h +1 -1
index 41dadfebb948..5f2611995d35 100644
@@ -50,7 +50,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-mv784mp-gp.h +1 -1
index dbbc33ebf9c3..449a56753b17 100644
@@ -59,7 +59,7 @@
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/ds414.h +1 -1
index 7fba2b4cc427..dbccd46bbdb1 100644
@@ -45,7 +45,7 @@
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/helios4.h +1 -1
index 56d35d6fdbc6..de1ebbf37516 100644
@@ -53,7 +53,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/maxbcm.h +1 -1
index 53ba64909e1f..073c5a57b2c9 100644
@@ -48,7 +48,7 @@
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/theadorable.h +1 -1
index b43c03d3e8a9..3c942cc6fa01 100644
@@ -77,7 +77,7 @@
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/turris_omnia.h +1 -1
index 9436a623d6fe..b35299b2fbb3 100644
@@ -28,7 +28,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/x530.h +0 -0
index e78e249e41ae..67ff01db9041 100644

include/configs/x530.h line 73

Quoted 7 lines
include/configs/x530.h +1 -1
@@ -68,7 +68,7 @@
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
 

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#5 lore raw
In reply to Pali Rohár
Quoted 6 lines · Pali Rohár

These hardcoded values were calculated from CONFIG_SPL_TEXT_BASE macro. Now this macro is configurable via Kconfig, so calculate values 0x0030/0x4030 at compile time via CONFIG_SPL_TEXT_BASE option. Values 0x0030/0x4030 represents offset of CONFIG_SPL_TEXT_BASE from address 0x40000000.

Quoted 13 lines
---
  include/configs/clearfog.h       | 2 +-
  include/configs/db-88f6720.h     | 2 +-
  include/configs/db-88f6820-amc.h | 2 +-
  include/configs/db-88f6820-gp.h  | 2 +-
  include/configs/db-mv784mp-gp.h  | 2 +-
  include/configs/ds414.h          | 2 +-
  include/configs/helios4.h        | 2 +-
  include/configs/maxbcm.h         | 2 +-
  include/configs/theadorable.h    | 2 +-
  include/configs/turris_omnia.h   | 2 +-
  include/configs/x530.h           | 2 +-
  11 files changed, 11 insertions(+), 11 deletions(-)

Applied to u-boot-marvell/master

Thanks,
Stefan

Quoted 136 lines
include/configs/clearfog.h +1 -1
index a30bca5147a8..c9af5a40cec0 100644
@@ -53,7 +53,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6720.h +1 -1
index cf9e44d17c32..16c83a88dace 100644
@@ -34,7 +34,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-amc.h +1 -1
index 1f70c609d234..6538e66052aa 100644
@@ -41,7 +41,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-88f6820-gp.h +1 -1
index 41dadfebb948..5f2611995d35 100644
@@ -50,7 +50,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/db-mv784mp-gp.h +1 -1
index dbbc33ebf9c3..449a56753b17 100644
@@ -59,7 +59,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/ds414.h +1 -1
index 7fba2b4cc427..dbccd46bbdb1 100644
@@ -45,7 +45,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/helios4.h +1 -1
index 56d35d6fdbc6..de1ebbf37516 100644
@@ -53,7 +53,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/maxbcm.h +1 -1
index 53ba64909e1f..073c5a57b2c9 100644
@@ -48,7 +48,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/theadorable.h +1 -1
index b43c03d3e8a9..3c942cc6fa01 100644
@@ -77,7 +77,7 @@
 
  /* SPL */
  /* Defines for SPL */
-#define CONFIG_SPL_MAX_SIZE		((128 << 10) - 0x4030)
+#define CONFIG_SPL_MAX_SIZE		((128 << 10) - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + (128 << 10))
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/turris_omnia.h +1 -1
index 9436a623d6fe..b35299b2fbb3 100644
@@ -28,7 +28,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)
include/configs/x530.h +0 -0
index e78e249e41ae..67ff01db9041 100644

include/configs/x530.h line 74

Quoted 8 lines
include/configs/x530.h +1 -1
@@ -68,7 +68,7 @@
 
  /* Defines for SPL */
  #define CONFIG_SPL_SIZE			(140 << 10)
-#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - 0x0030)
+#define CONFIG_SPL_MAX_SIZE		(CONFIG_SPL_SIZE - (CONFIG_SPL_TEXT_BASE - 0x40000000))
 
  #define CONFIG_SPL_BSS_START_ADDR	(0x40000000 + CONFIG_SPL_SIZE)
  #define CONFIG_SPL_BSS_MAX_SIZE		(16 << 10)

Viele Grüße,
Stefan Roese

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]