From patchwork Mon Feb 28 11:46:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aneesh V X-Patchwork-Id: 228 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:41:03 -0000 Delivered-To: patches@linaro.org Received: by 10.224.19.208 with SMTP id c16cs91649qab; Mon, 28 Feb 2011 03:46:29 -0800 (PST) Received: by 10.91.208.19 with SMTP id k19mr7406457agq.86.1298893589792; Mon, 28 Feb 2011 03:46:29 -0800 (PST) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by mx.google.com with ESMTPS id t39si8144961ano.92.2011.02.28.03.46.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Feb 2011 03:46:29 -0800 (PST) Received-SPF: pass (google.com: domain of aneesh@ti.com designates 198.47.26.153 as permitted sender) client-ip=198.47.26.153; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aneesh@ti.com designates 198.47.26.153 as permitted sender) smtp.mail=aneesh@ti.com Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1SBkQ18005940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Feb 2011 05:46:28 -0600 Received: from localhost (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1SBkPLq011791; Mon, 28 Feb 2011 17:16:25 +0530 (IST) From: Aneesh V To: u-boot@lists.denx.de Cc: aneesh@ti.com, x-loader@googlegroups.com, patches@linaro.org, john.rigby@linaro.org Subject: [PATCH 10/22] omap4: add spl support for OMAP4 SDP Date: Mon, 28 Feb 2011 17:16:19 +0530 Message-Id: <1298893591-17636-11-git-send-email-aneesh@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1298893591-17636-1-git-send-email-aneesh@ti.com> References: <1298893591-17636-1-git-send-email-aneesh@ti.com> 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 --- board/ti/sdp4430/config.mk | 3 +- include/configs/omap4_sdp4430.h | 19 ++++++ spl/board/ti/sdp4430/Makefile | 120 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+), 1 deletions(-) create mode 100644 spl/board/ti/sdp4430/Makefile 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 9a8bb73..5b20841 100644 --- a/include/configs/omap4_sdp4430.h +++ b/include/configs/omap4_sdp4430.h @@ -122,7 +122,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 */ @@ -240,4 +242,21 @@ CONFIG_SYS_INIT_RAM_SIZE - \ GENERATED_GBL_DATA_SIZE) +/* 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 0x40304360 +#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/sdp4430/Makefile b/spl/board/ti/sdp4430/Makefile new file mode 100644 index 0000000..dd56a40 --- /dev/null +++ b/spl/board/ti/sdp4430/Makefile @@ -0,0 +1,120 @@ +# +# (C) Copyright 2006-2007 +# Stefan Roese, DENX Software Engineering, sr@denx.de. +# +# (C) Copyright 2008 +# Guennadi Liakhovetki, DENX Software Engineering, +# +# 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 + +$(OBJTREE)/MLO: $(splobj)u-boot-spl.bin + $(OBJTREE)/tools/mkimage -T omapimage \ + -a $(CONFIG_SYS_SPL_TEXT_BASE) -d $< $@ + +LDSCRIPT_SOURCE = $(TOPDIR)/spl/board/ti/spl-omap.lds + +# 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 + +# rules +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 -Os -ffixed-r8 +CFLAGS += -DCONFIG_PRELOADER -Os -ffixed-r8 -ffunction-sections \ + -fdata-sections -march=armv7-a -mthumb +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 + +ALL = $(OBJTREE)/MLO +all: $(obj).depend $(ALL) + +# defines $(obj).depend target +include $(SRCTREE)/rules.mk + +sinclude $(obj).depend