All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aneesh V <aneesh@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] SPL framework re-design
Date: Tue, 21 Jun 2011 16:29:38 +0530	[thread overview]
Message-ID: <4E00799A.5040302@ti.com> (raw)
In-Reply-To: <4DFB8579.1020309@ti.com>

Dear Wolfgang,

On Friday 17 June 2011 10:18 PM, Aneesh V wrote:
> Dear Wolfgang,
>
> Here is a crude implementation of the top-down approach you had been
> suggesting (or my interpretation of it). This is not complete yet and
> serves only as a material for further discussions on this topic.

Here is an updated version of my prototype implementation with fixes
for some issues pointed out by Scott. Please let me know your views
about this.

---
  Makefile                        |    5 ++
  include/configs/omap4_sdp4430.h |    1 +
  spl/Makefile                    |   94 
+++++++++++++++++++++++++++++++++++++++
  spl/mmc/Makefile                |   55 +++++++++++++++++++++++
  4 files changed, 155 insertions(+), 0 deletions(-)
  create mode 100644 spl/Makefile
  create mode 100644 spl/mmc/Makefile

diff --git a/Makefile b/Makefile
index 8540e39..0321634 100644
--- a/Makefile
+++ b/Makefile
@@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
  endif

  # Always append ALL so that arch config.mk's can add custom ones
+ALL += spl
  ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map

  ifeq ($(CONFIG_NAND_U_BOOT),y)
@@ -428,6 +429,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
  mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
  		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all

+spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
+	$(MAKE) -C spl/ all
+
  $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl

  $(VERSION_FILE):
@@ -1142,6 +1146,7 @@ clean:
  	@rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
  	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
  	@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
+	@rm -f 
$(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
  	@rm -f $(ONENAND_BIN)
  	@rm -f $(obj)onenand_ipl/u-boot.lds
  	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
diff --git a/include/configs/omap4_sdp4430.h 
b/include/configs/omap4_sdp4430.h
index c424951..c9adc3c 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -257,4 +257,5 @@
  /* 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM */
  #define CONFIG_SYS_TEXT_BASE		0x80100000

+#define CONFIG_SYS_SPL_MMC_SUPPORT
  #endif /* __CONFIG_H */
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..9e3a5b1
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,94 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for 
details.
+#
+
+include $(TOPDIR)/config.mk
+LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
+LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
+LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
+LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o
+
+LIBS-y += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
+	"$(ARCH)/lib$(ARCH).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ]; 
then echo \
+	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)
+
+LIBS-y := $(addprefix $(obj),$(sort $(LIBS-y)))
+
+__LIBS := $(subst $(obj),,$(LIBS-y))
+
+ifndef SPL_LDSCRIPT
+	ifdef CONFIG_SYS_SPL_LDSCRIPT
+		# need to strip off double quotes
+		SPL_LDSCRIPT := $(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT))
+	endif
+endif
+
+ifndef SPL_LDSCRIPT
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := 
$(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/$(BOARDDIR)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+$(error could not find linker script)
+	endif
+endif
+LNDIR		:= $(OBJTREE)/spl
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS-y) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM \
+		--start-group $(__LIBS) --end-group \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl: 	depend $(LIBS-y) $(SPL_LDSCRIPT) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(OBJS):	depend
+		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+
+$(LIBS-y):	depend
+		$(MAKE) -C $(dir $(subst $(obj),,$@)) all
+
+$(SPL_LDSCRIPT): depend
+	$(MAKE) -C $(dir $@) $(notdir $@)
+
+$(obj)u-boot-spl.lds: $(SPL_LDSCRIPT)
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+clean:
+	# TODO: implement clean to support in-tree builds
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
new file mode 100644
index 0000000..b4f7efd
--- /dev/null
+++ b/spl/mmc/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)libmmc.o
+
+$(obj)mmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
+
+$(obj)omap_hsmmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
+
+
+COBJS			:= mmc.o
+COBJS			+= omap_hsmmc.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
-- 
1.7.0.4

  parent reply	other threads:[~2011-06-21 10:59 UTC|newest]

Thread overview: 172+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
2011-06-16 10:47 ` Wolfgang Denk
2011-06-16 11:50   ` Aneesh V
2011-06-16 12:15     ` Wolfgang Denk
2011-06-16 13:38       ` Aneesh V
2011-06-16 21:52         ` Wolfgang Denk
2011-06-16 12:55   ` Daniel Schwierzeck
2011-06-16 13:10     ` Andreas Bießmann
2011-06-26 23:17       ` Ilya Yanok
2011-06-27  4:29         ` Aneesh V
2011-06-27  8:24           ` Ilya Yanok
2011-06-27  9:08             ` Aneesh V
2011-06-27  8:42           ` Simon Schwarz
2011-06-27  9:36           ` Wolfgang Denk
2011-06-27 18:42             ` Scott Wood
2011-06-27 20:54               ` Wolfgang Denk
2011-06-27  9:27         ` Wolfgang Denk
2011-06-27 13:42           ` Daniel Schwierzeck
2011-06-27 20:48             ` Wolfgang Denk
2011-06-27 18:34           ` Scott Wood
2011-06-27 20:50             ` Wolfgang Denk
2011-06-27 20:55               ` Scott Wood
2011-06-27 21:10                 ` Wolfgang Denk
2011-06-27 21:18                   ` Scott Wood
2011-06-27 21:22                     ` Wolfgang Denk
2011-06-28  6:54                       ` Aneesh V
2011-06-28 16:18                         ` Scott Wood
2011-06-29  7:27                           ` Aneesh V
2011-06-16 13:57     ` Aneesh V
2011-06-16 14:27       ` Daniel Schwierzeck
2011-06-16 21:55       ` Wolfgang Denk
2011-06-16 21:47     ` Wolfgang Denk
2011-06-17 18:45       ` Daniel Schwierzeck
2011-06-17 18:51         ` Scott Wood
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
2011-07-01  5:20       ` Aneesh V
2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
2011-07-05 17:52           ` Mike Frysinger
2011-07-06  8:07           ` Aneesh V
2011-07-08  9:08           ` Wolfgang Denk
2011-07-08 10:20             ` Aneesh V
2011-07-08 11:19               ` Wolfgang Denk
2011-07-08 11:40                 ` Aneesh V
2011-07-08 12:37                   ` Wolfgang Denk
2011-07-08 11:34             ` Daniel Schwierzeck
2011-07-08 12:25               ` Wolfgang Denk
2011-07-08 13:33                 ` Aneesh V
2011-07-08 13:44                   ` Wolfgang Denk
2011-07-08 13:52                     ` Aneesh V
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
2011-07-05 17:53           ` Mike Frysinger
2011-07-08  9:12           ` Wolfgang Denk
2011-07-08 10:28             ` Aneesh V
2011-07-08 11:20               ` Wolfgang Denk
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL Daniel Schwierzeck
2011-07-08  9:17           ` Wolfgang Denk
2011-07-08 11:32             ` Aneesh V
2011-07-08 12:32               ` Wolfgang Denk
2011-07-08 12:51                 ` Aneesh V
2011-07-08 13:04                   ` Wolfgang Denk
2011-07-08 13:28                     ` Aneesh V
2011-07-08 13:41                       ` Wolfgang Denk
2011-07-08 13:50                         ` Aneesh V
2011-07-08 11:57             ` Daniel Schwierzeck
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile Daniel Schwierzeck
2011-07-08  9:18           ` Wolfgang Denk
2011-07-08  4:40         ` [U-Boot] [RFC PATCH 0/4] spl framework prototype Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile Aneesh V
2011-06-29 18:52       ` Mike Frysinger
2011-06-30  5:12         ` Aneesh V
2011-06-30 11:09           ` Daniel Schwierzeck
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Aneesh V
2011-06-29 18:54       ` Mike Frysinger
2011-06-30  5:14         ` Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4 Aneesh V
2011-06-30  6:01       ` Heiko Schocher
2011-06-30  6:12         ` Aneesh V
2011-06-30  7:08           ` Andreas Bießmann
2011-07-01  9:27             ` Aneesh V
2011-07-01  9:55               ` Andreas Bießmann
2011-07-01 11:48                 ` Aneesh V
2011-07-01 19:51                   ` Albert ARIBAUD
2011-07-03  4:47                     ` Aneesh V
2011-07-03  6:56                       ` Albert ARIBAUD
2011-07-03  7:31                         ` Andreas Bießmann
2011-07-03  7:48                           ` Albert ARIBAUD
2011-07-03  8:39                         ` Aneesh V
2011-06-30  7:53           ` Heiko Schocher
2011-06-30  8:21             ` Simon Schwarz
2011-06-30 10:05               ` Aneesh V
2011-06-30 11:09               ` Albert ARIBAUD
2011-06-30 11:18                 ` Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building Aneesh V
2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
2011-06-17 22:28     ` Scott Wood
2011-06-19 10:22       ` V, Aneesh
2011-06-20 16:19         ` Scott Wood
2011-06-21  3:22           ` Aneesh V
2011-06-21 10:59     ` Aneesh V [this message]
2011-06-25  8:06       ` Aneesh V
2011-06-25 12:10       ` Wolfgang Denk
2011-06-25 16:11         ` Daniel Schwierzeck
2011-06-27  4:19         ` Aneesh V
2011-06-27  9:27           ` Wolfgang Denk
2011-06-27 14:56             ` Aneesh V
2011-06-27 20:49               ` Wolfgang Denk
2011-06-16 16:45 ` Scott Wood
2011-06-16 22:09   ` Wolfgang Denk
2011-06-16 22:22     ` Scott Wood
2011-06-17  7:02     ` Aneesh V
2011-06-17  7:00   ` Aneesh V
2011-06-28  0:55 ` Graeme Russ
2011-06-28  4:10   ` Wolfgang Denk
2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
2011-07-15 16:22     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
2011-07-18 16:06       ` Wolfgang Denk
2011-07-18 16:22         ` Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
2011-07-14  5:37     ` Aneesh V
2011-07-14  9:45       ` Wolfgang Denk
2011-07-14 10:02         ` Aneesh V
2011-07-15 16:24     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries " Daniel Schwierzeck
2011-07-15 12:31     ` Simon Schwarz
2011-07-15 12:41       ` Aneesh V
2011-07-15 13:10         ` Simon Schwarz
2011-07-15 13:35           ` Aneesh V
2011-07-15 14:43         ` Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
2011-07-13 15:17   ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Albert ARIBAUD
2011-07-14 20:06   ` Wolfgang Denk
2011-07-14 20:25   ` Wolfgang Denk
2011-07-15  7:57     ` Aneesh V
2011-07-15  8:35       ` Wolfgang Denk
2011-07-15 15:02     ` Daniel Schwierzeck
2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
2011-07-19  3:51       ` Vipin Kumar
2011-07-26 12:41       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
2011-07-18 17:48       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
2011-07-26 12:42         ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 3/9] Extend build-system for " Daniel Schwierzeck
2011-07-26 12:42       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
2011-07-26 12:43       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
2011-07-19  9:21       ` Albert ARIBAUD
2011-07-19 10:38         ` Aneesh V
2011-07-19 11:03           ` Albert ARIBAUD
2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
2011-07-20  7:59         ` Aneesh V
2011-07-26 12:44         ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries " Daniel Schwierzeck
2011-07-26 12:44       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-20 21:12     ` [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework Paulraj, Sandeep

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E00799A.5040302@ti.com \
    --to=aneesh@ti.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.