From patchwork Mon Feb 28 11:46:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aneesh V X-Patchwork-Id: 84820 X-Patchwork-Delegate: s-paulraj@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id B8766B7106 for ; Mon, 28 Feb 2011 22:51:30 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 52DAA2809E; Mon, 28 Feb 2011 12:49:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 4QypxJ0gpb0g; Mon, 28 Feb 2011 12:49:21 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F12C128114; Mon, 28 Feb 2011 12:47:26 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 183DF2809C for ; Mon, 28 Feb 2011 12:46:55 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bqfOrlwvp58u for ; Mon, 28 Feb 2011 12:46:54 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from devils.ext.ti.com (devils.ext.ti.com [198.47.26.153]) by theia.denx.de (Postfix) with ESMTPS id 0A0022808D for ; Mon, 28 Feb 2011 12:46:34 +0100 (CET) Received: from dbdp31.itg.ti.com ([172.24.170.98]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p1SBkUkY005958 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Feb 2011 05:46:32 -0600 Received: from localhost (localhost [127.0.0.1]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p1SBkTvB011830; Mon, 28 Feb 2011 17:16:29 +0530 (IST) From: Aneesh V To: u-boot@lists.denx.de Date: Mon, 28 Feb 2011 17:16:31 +0530 Message-Id: <1298893591-17636-23-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> Cc: x-loader@googlegroups.com, patches@linaro.org Subject: [U-Boot] [PATCH 22/22] omap4: add spl support for OMAP4 Panda X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Signed-off-by: Aneesh V --- arch/arm/include/asm/arch-omap4/emif.h | 10 +- include/configs/omap4_panda.h | 24 ++++ spl/board/ti/panda/Makefile | 219 ++++++++++++++++++++++++++++++++ 3 files changed, 248 insertions(+), 5 deletions(-) create mode 100644 spl/board/ti/panda/Makefile diff --git a/arch/arm/include/asm/arch-omap4/emif.h b/arch/arm/include/asm/arch-omap4/emif.h index 8cc3230..b95e545 100644 --- a/arch/arm/include/asm/arch-omap4/emif.h +++ b/arch/arm/include/asm/arch-omap4/emif.h @@ -520,11 +520,11 @@ /* Trap for invalid TILER PAT entries */ #define DMM_LISA_MAP_0_INVAL_ADDR_TRAP (\ - (0 << OMAP44XX_SDRC_ADDR_SHIFT) |\ - (DMM_SDRC_MAP_EMIF1_ONLY << OMAP44XX_SDRC_MAP_SHIFT)|\ - (DMM_SDRC_ADDR_SPC_INVALID << OMAP44XX_SDRC_ADDRSPC_SHIFT)|\ - (DMM_SDRC_INTL_NONE << OMAP44XX_SDRC_INTL_SHIFT)|\ - (0xFF << OMAP44XX_SYS_ADDR_SHIFT)) + (0 << OMAP44XX_SDRC_ADDR_SHIFT) |\ + (DMM_SDRC_MAP_EMIF1_ONLY << OMAP44XX_SDRC_MAP_SHIFT)|\ + (DMM_SDRC_ADDR_SPC_INVALID << OMAP44XX_SDRC_ADDRSPC_SHIFT)|\ + (DMM_SDRC_INTL_NONE << OMAP44XX_SDRC_INTL_SHIFT)|\ + (0xFF << OMAP44XX_SYS_ADDR_SHIFT)) /* Reg mapping structure */ diff --git a/include/configs/omap4_panda.h b/include/configs/omap4_panda.h index 2b03b0f..b389035 100644 --- a/include/configs/omap4_panda.h +++ b/include/configs/omap4_panda.h @@ -117,7 +117,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 */ @@ -234,4 +236,26 @@ CONFIG_SYS_INIT_RAM_SIZE - \ GENERATED_GBL_DATA_SIZE) +/* Defines for Clock init */ +#define CONFIG_SYS_OMAP4_ABE_SYSCK + +/* Defines for SDRAM init */ +#ifndef CONFIG_SYS_EMIF_PRECALCULATED_TIMING_REGS +#define CONFIG_SYS_AUTOMATIC_SDRAM_DETECTION 1 +#define CONFIG_SYS_DEFAULT_LPDDR2_TIMINGS 1 +#endif + +/* 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_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */ +#define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */ +#define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1 + +#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/panda/Makefile b/spl/board/ti/panda/Makefile new file mode 100644 index 0000000..8310db9 --- /dev/null +++ b/spl/board/ti/panda/Makefile @@ -0,0 +1,219 @@ +# +# (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 = + +# serial console +$(obj)eabi_compat.c: + @rm -f $@ + @ln -s $(TOPDIR)/arch/arm/lib/eabi_compat.c $@ + +$(obj)string.c: + @rm -f $@ + @ln -s $(TOPDIR)/lib/string.c $@ + +$(obj)vsprintf.c: + @rm -f $@ + @ln -s $(TOPDIR)/lib/vsprintf.c $@ + +$(obj)console.c: + @rm -f $@ + @ln -s $(TOPDIR)/common/console.c $@ + +$(obj)stdio.c: + @rm -f $@ + @ln -s $(TOPDIR)/common/stdio.c $@ + +$(obj)serial.c: + @rm -f $@ + @ln -s $(TOPDIR)/drivers/serial/serial.c $@ + +$(obj)ns16550.c: + @rm -f $@ + @ln -s $(TOPDIR)/drivers/serial/ns16550.c $@ + +$(obj)div64.c: + @rm -f $@ + @ln -s $(TOPDIR)/lib/div64.c $@ + +$(obj)ctype.c: + @rm -f $@ + @ln -s $(TOPDIR)/lib/ctype.c $@ + +COBJS += serial.o ns16550.o string.o vsprintf.o console.o stdio.o +COBJS += ctype.o eabi_compat.o div64.o + + +# mmc +$(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 $@ + +$(obj)omap24xx_i2c.c: $(obj)omap24xx_i2c.h + @rm -f $@ + @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.c $@ + +$(obj)omap24xx_i2c.h: + @rm -f $@ + @ln -s $(TOPDIR)/drivers/i2c/omap24xx_i2c.h $@ + +$(obj)time.c: + @rm -f $@ + @ln -s $(TOPDIR)/lib/time.c $@ + +$(obj)part.c: + @rm -f $@ + @ln -s $(TOPDIR)/disk/part.c $@ + +$(obj)part_dos.c: $(obj)part_dos.h + @rm -f $@ + @ln -s $(TOPDIR)/disk/part_dos.c $@ + +$(obj)part_dos.h: + @rm -f $@ + @ln -s $(TOPDIR)/disk/part_dos.h $@ + +COBJS += omap_hsmmc.o omap24xx_i2c.o mmc.o time.o part.o part_dos.o + +# fat +$(obj)fat.c: + @rm -f $@ + @ln -s $(TOPDIR)/fs/fat/fat.c $@ + +COBJS += fat.o + +# 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)utils.c: + @rm -f $@ + @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap-common/utils.c $@ + +$(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 += utils.o 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 $@ + +$(obj)emif.c: + @rm -f $@ + @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/emif.c $@ + +$(obj)sdram_elpida.c: + @rm -f $@ + @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/sdram_elpida.c $@ + +$(obj)clocks.c: + @rm -f $@ + @ln -s $(TOPDIR)/arch/arm/cpu/armv7/omap4/clocks.c $@ + +SOBJS += lowlevel_init.o +COBJS += board.o clocks.o emif.o sdram_elpida.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