[U-Boot] [PATCH v2 09/22] omap4: add spl support for OMAP4 SDP

Aneesh V aneesh at ti.com
Sun May 15 17:21:27 CEST 2011


Adapted from: nand_spl/board/samsung/smdk6400/Makefile

- Add the SPL makefile for OMAP4430 SDP
- Add the necessary CONFIG flags in the board config file

Signed-off-by: Aneesh V <aneesh at ti.com>
---
V2:
 * Changed CONFIG_SYS_SPL_TEXT_BASE to 0x40304350 from
   0x40304360. This exact address is needed for EMU
   devices.
 * Removed un-necessary compiler options from CFLAGS and AFLAGS.
   These are already set by .mk files in U-Boot
 * Reorganize the make files to re-use common rules between
   boards
---
 board/ti/sdp4430/config.mk                         |    3 +-
 include/configs/omap4_sdp4430.h                    |   19 +++++
 spl/board/ti/omap4.mk                              |   77 ++++++++++++++++++++
 spl/board/ti/rules-omap.mk                         |   74 +++++++++++++++++++
 .../config.mk => spl/board/ti/sdp4430/Makefile     |   21 +++---
 5 files changed, 183 insertions(+), 11 deletions(-)
 create mode 100644 spl/board/ti/omap4.mk
 create mode 100644 spl/board/ti/rules-omap.mk
 copy board/ti/sdp4430/config.mk => spl/board/ti/sdp4430/Makefile (63%)

diff --git a/board/ti/sdp4430/config.mk b/board/ti/sdp4430/config.mk
index 33901a7..c62965d 100644
--- a/board/ti/sdp4430/config.mk
+++ b/board/ti/sdp4430/config.mk
@@ -28,4 +28,5 @@
 # Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
 # (mem base + reserved)
 
-CONFIG_SYS_TEXT_BASE = 0x80e80000
+# 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
+CONFIG_SYS_TEXT_BASE = 0x80100000
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 0fd08b3..99247df 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -121,7 +121,9 @@
 
 /* USB device configuration */
 #define CONFIG_USB_DEVICE		1
+#ifndef CONFIG_PRELOADER
 #define CONFIG_USB_TTY			1
+#endif
 #define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
 
 /* Flash */
@@ -244,4 +246,21 @@
 #define CONFIG_SYS_PL310_BASE	0x48242000
 #endif
 
+/* Defines for Clock init */
+#define CONFIG_SYS_OMAP4_ABE_SYSCK
+
+/* Defines for SDRAM init */
+#define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION	1
+#define CONFIG_SYS_EMIF_UPDATE_TIMINGS		1
+#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS	1
+
+/* Defines for SPL */
+#define CONFIG_SPL
+#define CONFIG_SYS_SPL_TEXT_BASE	0x40304350
+#define CONFIG_SYS_SPL_MAX_SIZE		0x7800	/* 30 K */
+#define CONFIG_SYS_SPL_STACK		LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR	0x80000000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE	0x80000		/* 512 KB */
+
 #endif /* __CONFIG_H */
diff --git a/spl/board/ti/omap4.mk b/spl/board/ti/omap4.mk
new file mode 100644
index 0000000..dffb53b
--- /dev/null
+++ b/spl/board/ti/omap4.mk
@@ -0,0 +1,77 @@
+#
+# (C) Copyright 2006-2007
+# Stefan Roese, DENX Software Engineering, sr at denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <lg at denx.de>
+#
+# (C) Copyright 2010
+# Texas Instruments, <www.ti.com>
+# Aneesh V <aneesh at ti.com>
+#
+# 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
+#
+splobj	:= $(OBJTREE)/spl/
+include $(TOPDIR)/config.mk
+SOBJS =
+COBJS =
+
+# armv7
+$(obj)start.S:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/start.S $@
+
+$(obj)syslib.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/syslib.c $@
+
+SOBJS	+= start.o
+COBJS	+= syslib.o
+
+# omap-common
+$(obj)timer.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/timer.c $@
+
+$(obj)reset.S:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/reset.S $@
+
+$(obj)spl-omap.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/spl/board/ti/spl-omap.c $@
+
+SOBJS	+= reset.o
+COBJS	+= timer.o spl-omap.o
+
+# omap4
+$(obj)lowlevel_init.S:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/lowlevel_init.S $@
+
+$(obj)omap4_mux_data.h:
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/omap4_mux_data.h $@
+
+$(obj)board.c:$(obj)omap4_mux_data.h
+	@rm -f $@
+	@ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/board.c $@
+
+SOBJS	+= lowlevel_init.o
+COBJS	+= board.o
diff --git a/spl/board/ti/rules-omap.mk b/spl/board/ti/rules-omap.mk
new file mode 100644
index 0000000..b1d0ae6
--- /dev/null
+++ b/spl/board/ti/rules-omap.mk
@@ -0,0 +1,74 @@
+#
+# (C) Copyright 2006-2007
+# Stefan Roese, DENX Software Engineering, sr at denx.de.
+#
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <lg at denx.de>
+#
+# (C) Copyright 2010
+# Texas Instruments, <www.ti.com>
+# Aneesh V <aneesh at ti.com>
+#
+# 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
+#
+
+LDSCRIPT_SOURCE = $(TOPDIR)/spl/board/ti/spl-omap.lds
+LDPPFLAGS += -include $(TOPDIR)/include/config.h
+LDSCRIPT = $(splobj)u-boot-spl-generated.lds
+$(LDSCRIPT): $(LDSCRIPT_SOURCE)
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - <$^ >$@
+LDFLAGS	= -Bstatic -T $(LDSCRIPT) \
+	$(PLATFORM_LDFLAGS) --gc-sections
+AFLAGS	+= -DCONFIG_PRELOADER
+CFLAGS	+= -DCONFIG_PRELOADER -ffunction-sections -fdata-sections \
+	   $(call cc-option,-march=armv7-a -mthumb -mthumb-interwork,)
+PLATFORM_LIBGCC = -L $(shell dirname `$(CC) $(CFLAGS) \
+		-print-libgcc-file-name`) -lgcc
+
+$(obj)%.o:	$(obj)%.S
+	$(CC) $(AFLAGS) -c -o $@ $<
+
+$(obj)%.o:	$(obj)%.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+SRCS	:= $(addprefix $(obj),$(SOBJS:.o=.S) $(COBJS:.o=.c))
+OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+__OBJS	:= $(SOBJS) $(COBJS)
+LNDIR	:= $(OBJTREE)/spl/board/$(BOARDDIR)
+
+$(splobj)u-boot-spl.bin:	$(splobj)u-boot-spl
+	$(OBJCOPY) ${OBJCFLAGS} -O binary $< $@
+
+$(splobj)u-boot-spl:	$(OBJS) $(LDSCRIPT)
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(__OBJS) \
+		$(PLATFORM_LIBGCC) \
+		-Map $(splobj)u-boot-spl.map \
+		-o $(splobj)u-boot-spl
+
+$(OBJTREE)/MLO:	$(splobj)u-boot-spl.bin
+	$(OBJTREE)/tools/mkimage -T omapimage \
+		-a $(CONFIG_SYS_SPL_TEXT_BASE) -d $< $@
+
+ALL	= $(OBJTREE)/MLO
+all:	$(obj).depend $(ALL)
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
diff --git a/board/ti/sdp4430/config.mk b/spl/board/ti/sdp4430/Makefile
similarity index 63%
copy from board/ti/sdp4430/config.mk
copy to spl/board/ti/sdp4430/Makefile
index 33901a7..81bf51c 100644
--- a/board/ti/sdp4430/config.mk
+++ b/spl/board/ti/sdp4430/Makefile
@@ -1,9 +1,13 @@
 #
-# (C) Copyright 2006-2009
-# Texas Instruments Incorporated, <www.ti.com>
+# (C) Copyright 2006-2007
+# Stefan Roese, DENX Software Engineering, sr at denx.de.
 #
-# OMAP 4430 SDP
-# see http://www.ti.com/ for more information on Texas Instruments
+# (C) Copyright 2008
+# Guennadi Liakhovetki, DENX Software Engineering, <lg at denx.de>
+#
+# (C) Copyright 2010
+# Texas Instruments, <www.ti.com>
+# Aneesh V <aneesh at ti.com>
 #
 # See file CREDITS for list of people who contributed to this
 # project.
@@ -15,7 +19,7 @@
 #
 # 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
+# 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
@@ -23,9 +27,6 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 # MA 02111-1307 USA
 #
-# SDRAM Address Space:
-# 8000'0000 - 9fff'ffff (512 MB)
-# Linux-Kernel is expected to be at 8000'8000, entry 8000'8000
-# (mem base + reserved)
 
-CONFIG_SYS_TEXT_BASE = 0x80e80000
+include $(SRCTREE)/spl/board/$(VENDOR)/omap4.mk
+include $(SRCTREE)/spl/board/$(VENDOR)/rules-omap.mk
-- 
1.7.0.4



More information about the U-Boot mailing list