Skip to contentSkip to conversation

SPL improvements

PATCH New Marek Vasut 2 participants 8 messages Sep 12, 2011 – Sep 16, 2011

lore
Share & tools
lore
#0 lore raw

cover SPL improvements

This series introduces a few modifications to the new SPL framework to make it a bit more flexible.

Marek Vasut (2):
SPL: Make path to start.S configurable
SPL: Allow user to disable CPU support library

 spl/Makefile |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)
Signature · 1 line
1.7.5.4
#1 lore raw

PATCH 1/2 SPL: Make path to start.S configurable

Introduce CONFIG_SPL_START_S_PATH to configure path to start.S file. It's not always fitting to use CPU's start.S .

---
 spl/Makefile |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
spl/Makefile +8 -2
index 95ecce1..56d8ea1 100644
@@ -26,7 +26,13 @@ obj := $(OBJTREE)/spl/
 HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
 			&& echo y || echo n)
 
-START := $(CPUDIR)/start.o
+ifdef	CONFIG_SPL_START_S_PATH
+START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH))
+else
+START_PATH := $(CPUDIR)
+endif
+
+START := $(START_PATH)/start.o
 
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS-y += $(CPUDIR)/lib$(CPU).o
@@ -119,7 +125,7 @@ $(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
 	$(GEN_UBOOT)
 
 $(START):	depend
-	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@
 
 $(LIBS):	depend
 	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/2 SPL: Make path to start.S configurable

Quoted 14 lines · Marek Vasut

Introduce CONFIG_SPL_START_S_PATH to configure path to start.S file. It's not always fitting to use CPU's start.S .

---
 spl/Makefile |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
spl/Makefile +0 -0
index 95ecce1..56d8ea1 100644
@@ -26,7 +26,13 @@ obj := $(OBJTREE)/spl/
 HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \

spl/Makefile obj := $(OBJTREE)/spl/ · line 35

Quoted 10 lines
spl/Makefile +7 -1
 			&& echo y || echo n)
 
-START := $(CPUDIR)/start.o
+ifdef	CONFIG_SPL_START_S_PATH
+START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH))
+else
+START_PATH := $(CPUDIR)
+endif
+
+START := $(START_PATH)/start.o

So you can override the path, but not the filename? What if I want to have arch/.../cpu/.../start-nand-spl.o?

How about:

ifdef CONFIG_SPL_START_FILE
START := $(subst ",,$(CONFIG_SPL_START_FILE))
else
START := $(CPUDIR)/start.o
endif

START_PATH := $(dir $(START))

spl/Makefile $(obj)u-boot-spl: depend $(START) $(LIBS) $(obj)u-boot-spl.lds · line 128

Quoted 8 lines
spl/Makefile +1 -1
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
 LIBS-y += $(CPUDIR)/lib$(CPU).o
@@ -119,7 +125,7 @@ $(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
 	$(GEN_UBOOT)
 
 $(START):	depend
-	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@

Yay recursive make. :-P

-Scott

#3 lore raw

PATCH 1/2 SPL: Make path to start.S configurable

Quoted 49 lines · Scott Wood
Quoted 18 lines · Marek Vasut

Introduce CONFIG_SPL_START_S_PATH to configure path to start.S file. It's not always fitting to use CPU's start.S .

---

 spl/Makefile |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
spl/Makefile +0 -0
index 95ecce1..56d8ea1 100644
@@ -26,7 +26,13 @@ obj := $(OBJTREE)/spl/
 
 HAVE_VENDOR_COMMON_LIB := $(shell [ -f
 $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
 

spl/Makefile obj := $(OBJTREE)/spl/ · line 38

Quoted 10 lines
spl/Makefile +7 -1
 			&& echo y || echo n)
 
-START := $(CPUDIR)/start.o
+ifdef	CONFIG_SPL_START_S_PATH
+START_PATH := $(subst ",,$(CONFIG_SPL_START_S_PATH))
+else
+START_PATH := $(CPUDIR)
+endif
+
+START := $(START_PATH)/start.o

So you can override the path, but not the filename? What if I want to have arch/.../cpu/.../start-nand-spl.o?

How about:

ifdef CONFIG_SPL_START_FILE
START := $(subst ",,$(CONFIG_SPL_START_FILE))
else
START := $(CPUDIR)/start.o
endif

START_PATH := $(dir $(START))

Quoted 6 lines

LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
LIBS-y += $(CPUDIR)/lib$(CPU).o

spl/Makefile +0 -0
@@ -119,7 +125,7 @@ $(obj)u-boot-spl:	depend $(START) $(LIBS)

$(obj)u-boot-spl.lds

Quoted 8 lines

spl/Makefile $(obj)u-boot-spl: depend $(START) $(LIBS) $(obj)u-boot-spl.lds

Quoted 6 lines
spl/Makefile +1 -1
 	$(GEN_UBOOT)
 
 $(START):	depend
 
-	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@

Yay recursive make. :-P

Yea ... that's why that START_PATH is needed. We can of course have CONFIG_SPL_START_PATH and CONFIG_SPL_START_FILENAME, but I assume right now, this is enough and when needed, the other one can be added.

Quoted 2 lines

-Scott

#4 lore raw

PATCH 1/2 SPL: Make path to start.S configurable

Quoted 19 lines · Marek Vasut
Quoted 18 lines · Scott Wood

How about:

ifdef CONFIG_SPL_START_FILE
START := $(subst ",,$(CONFIG_SPL_START_FILE))
else
START := $(CPUDIR)/start.o
endif

START_PATH := $(dir $(START))

Quoted 8 lines

LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
LIBS-y += $(CPUDIR)/lib$(CPU).o

(quoted diff) +0 -0
@@ -119,7 +125,7 @@ $(obj)u-boot-spl:	depend $(START) $(LIBS)

$(obj)u-boot-spl.lds

$(GEN_UBOOT)

Quoted 8 lines
Quoted 6 lines

spl/Makefile $(obj)u-boot-spl: depend $(START) $(LIBS) $(obj)u-boot-spl.lds · line 128

Quoted 4 lines

$(START): depend

spl/Makefile +1 -1
-	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@

Yay recursive make. :-P

Yea ... that's why that START_PATH is needed.

Does START_PATH := $(dir $(START)) not work?

-scott

#5 lore raw

PATCH 1/2 SPL: Make path to start.S configurable

Quoted 22 lines · Scott Wood
Quoted 21 lines · Marek Vasut
Quoted 20 lines · Scott Wood

How about:

ifdef CONFIG_SPL_START_FILE
START := $(subst ",,$(CONFIG_SPL_START_FILE))
else
START := $(CPUDIR)/start.o
endif

START_PATH := $(dir $(START))

Quoted 10 lines

LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
LIBS-y += $(CPUDIR)/lib$(CPU).o

(quoted diff) +0 -0
@@ -119,7 +125,7 @@ $(obj)u-boot-spl:	depend $(START) $(LIBS)

$(obj)u-boot-spl.lds

$(GEN_UBOOT)

$(START): depend

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

spl/Makefile $(obj)u-boot-spl: depend $(START) $(LIBS) $(obj)u-boot-spl.lds · line 128

Quoted 2 lines
spl/Makefile +1 -1
-	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+	$(MAKE) -C $(SRCTREE)/$(START_PATH) $@

Yay recursive make. :-P

Yea ... that's why that START_PATH is needed.

Does START_PATH := $(dir $(START)) not work?

What if you then wanted to have start.o for SPL in x/y/spl/start_spl.o with START_PATH=x/y and START=spl/start_spl.o ?

In currect patch, the spl code can be easily extended to support this.

Cheers

#6 lore raw

PATCH 2/2 SPL: Allow user to disable CPU support library

In reply to Marek Vasut

Introduce CONFIG_SPL_NO_CPU_SUPPORT_CODE to avoid compiling the CPU support library. This can be useful on some setups.

---
 spl/Makefile |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
spl/Makefile +6 -1
index 56d8ea1..3967737 100644
@@ -20,6 +20,11 @@ export CONFIG_SPL_BUILD
 
 include $(TOPDIR)/config.mk
 
+# In case we want to avoid the CPU support code, we need to define this:
+ifndef	CONFIG_SPL_NO_CPU_SUPPORT_CODE
+SPL_CPU_SUPPORT_CODE := y
+endif
+
 # We want the final binaries in this directory
 obj := $(OBJTREE)/spl/
 
@@ -35,7 +40,7 @@ endif
 START := $(START_PATH)/start.o
 
 LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
-LIBS-y += $(CPUDIR)/lib$(CPU).o
+LIBS-$(SPL_CPU_SUPPORT_CODE) += $(CPUDIR)/lib$(CPU).o
 ifdef SOC
 LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
 endif
Signature · 1 line
1.7.5.4
#7 lore raw

cover SPL improvements

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

This series introduces a few modifications to the new SPL framework to make it a bit more flexible.

Marek Vasut (2):
SPL: Make path to start.S configurable
SPL: Allow user to disable CPU support library

 spl/Makefile |   17 ++++++++++++++---
 1 files changed, 14 insertions(+), 3 deletions(-)

Please ignore this series, there is a resend of this.