From patchwork Fri Jul 29 16:53:40 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Schwarz X-Patchwork-Id: 107435 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 DBA14B6EE8 for ; Sat, 30 Jul 2011 02:55:38 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DA29B280CA; Fri, 29 Jul 2011 18:55:27 +0200 (CEST) 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 Og3sT7maRIHY; Fri, 29 Jul 2011 18:55:27 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 95055280D2; Fri, 29 Jul 2011 18:55:13 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 009C3280AE for ; Fri, 29 Jul 2011 18:55:05 +0200 (CEST) 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 6YmeetN0isRz for ; Fri, 29 Jul 2011 18:55:01 +0200 (CEST) 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 mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTPS id E835E280B3 for ; Fri, 29 Jul 2011 18:54:50 +0200 (CEST) Received: by mail-fx0-f44.google.com with SMTP id 6so2567133fxe.3 for ; Fri, 29 Jul 2011 09:54:50 -0700 (PDT) Received: by 10.223.14.204 with SMTP id h12mr1941305faa.89.1311958490720; Fri, 29 Jul 2011 09:54:50 -0700 (PDT) Received: from localhost.localdomain (DSL01.212.114.252.242.ip-pool.NEFkom.net [212.114.252.242]) by mx.google.com with ESMTPS id 9sm1194463far.37.2011.07.29.09.54.47 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 29 Jul 2011 09:54:48 -0700 (PDT) From: Simon Schwarz To: u-boot@lists.denx.de Date: Fri, 29 Jul 2011 18:53:40 +0200 Message-Id: <1311958421-9607-7-git-send-email-simonschwarzcor@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1311958421-9607-1-git-send-email-simonschwarzcor@gmail.com> References: <1311842291-24837-1-git-send-email-simonschwarzcor@gmail.com> <1311958421-9607-1-git-send-email-simonschwarzcor@gmail.com> Organization: Corscience GmbH & Co. KG Cc: scottwood@freescale.com, albert.u.boot@aribaud.net Subject: [U-Boot] [PATCH V7 6/7] omap3: new SPL structure support 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 Support for the new spl structure. Using the interface defined by Aneesh V for OMAP4 Signed-off-by: Simon Schwarz --- V1 changes: ADD support for early console output in SPL V2 changes: ADD include omap_common.h in board.c ADD implement new omap common interface omap_boot_device, omap_boot_mode and omap_rev_string (very basic) CHG cosmetic CHG Don't add ecc switch command in SPL ADD save_boot_params stump with warning to implement it V3 changes: none V4 changes: CHG cosmetic - corrected style problem V5 changes: nothing V6 changes: nothing V7 changes: ADD copied config.mk from OMAP4 to OMAP3 Transition from V1 to V2 also includes that this patch is now based on - the new SPL layout by Aneesh V and Daniel Schwierzeck - the OMAP4 SPL patches by Aneesh V This is in some parts a anccesstor of "[U-Boot,2/5] devkit8000 nand_spl: omap3 support nand_spl boot" (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102114) in V1 --- arch/arm/cpu/armv7/omap3/board.c | 37 +++++++++++++++++++++++++- arch/arm/cpu/armv7/omap3/config.mk | 30 +++++++++++++++++++++ arch/arm/cpu/armv7/omap3/lowlevel_init.S | 5 +++ arch/arm/include/asm/arch-omap3/sys_proto.h | 1 + 4 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 arch/arm/cpu/armv7/omap3/config.mk diff --git a/arch/arm/cpu/armv7/omap3/board.c b/arch/arm/cpu/armv7/omap3/board.c index 4aaf97b..ee3285f 100644 --- a/arch/arm/cpu/armv7/omap3/board.c +++ b/arch/arm/cpu/armv7/omap3/board.c @@ -39,6 +39,7 @@ #include #include #include +#include /* Declarations */ extern omap3_sysinfo sysinfo; @@ -56,6 +57,28 @@ static const struct gpio_bank gpio_bank_34xx[6] = { const struct gpio_bank *const omap_gpio_bank = gpio_bank_34xx; +#ifdef CONFIG_SPL_BUILD +/* +* We use static variables because global data is not ready yet. +* Initialized data is available in SPL right from the beginning. +* We would not typically need to save these parameters in regular +* U-Boot. This is needed only in SPL at the moment. +*/ +u32 omap3_boot_device = BOOT_DEVICE_NAND; +u32 omap3_boot_mode = NAND_MODE_HW_ECC; + +u32 omap_boot_device(void) +{ + return omap3_boot_device; +} + +u32 omap_boot_mode(void) +{ + return omap3_boot_mode; +} +#endif /* CONFIG_SPL_BUILD */ + + /****************************************************************************** * Routine: delay * Description: spinning delay to use before udelay works @@ -197,6 +220,10 @@ void s_init(void) per_clocks_enable(); +#ifdef CONFIG_SPL_BUILD + preloader_console_init(); +#endif + if (!in_sdram) mem_init(); } @@ -245,7 +272,7 @@ void abort(void) { } -#ifdef CONFIG_NAND_OMAP_GPMC +#if defined(CONFIG_NAND_OMAP_GPMC) & !defined(CONFIG_SPL_BUILD) /****************************************************************************** * OMAP3 specific command to switch between NAND HW and SW ecc *****************************************************************************/ @@ -273,7 +300,7 @@ U_BOOT_CMD( "[hw/sw] - Switch between NAND hardware (hw) or software (sw) ecc algorithm" ); -#endif /* CONFIG_NAND_OMAP_GPMC */ +#endif /* CONFIG_NAND_OMAP_GPMC & !CONFIG_SPL_BUILD */ #ifdef CONFIG_DISPLAY_BOARDINFO /** @@ -402,3 +429,9 @@ void v7_outer_cache_disable(void) omap3_update_aux_cr(0, 0x2); } #endif + +void omap_rev_string(char *omap_rev_string) +{ + sprintf(omap_rev_string, "OMAP3, sorry revision detection" \ + " unimplemented"); +} diff --git a/arch/arm/cpu/armv7/omap3/config.mk b/arch/arm/cpu/armv7/omap3/config.mk new file mode 100644 index 0000000..b34fa64 --- /dev/null +++ b/arch/arm/cpu/armv7/omap3/config.mk @@ -0,0 +1,30 @@ +# +# Copyright 2011 Linaro Limited +# See file CREDITS for list of people who contributed to this +# project. +# +# (C) Copyright 2010 +# Texas Instruments, +# +# Aneesh V +# +# 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 +# +ifdef CONFIG_SPL_BUILD +ALL-y += $(OBJTREE)/MLO +else +ALL-y += $(obj)u-boot.img +endif diff --git a/arch/arm/cpu/armv7/omap3/lowlevel_init.S b/arch/arm/cpu/armv7/omap3/lowlevel_init.S index 67e8ceb..48a7ec6 100644 --- a/arch/arm/cpu/armv7/omap3/lowlevel_init.S +++ b/arch/arm/cpu/armv7/omap3/lowlevel_init.S @@ -35,6 +35,11 @@ _TEXT_BASE: .word CONFIG_SYS_TEXT_BASE /* sdram load addr from config.mk */ +.global save_boot_params +save_boot_params: + #warning "Please implement save_boot_params for OMAP3" + bx lr + .global omap3_gp_romcode_call omap3_gp_romcode_call: PUSH {r4-r12, lr} @ Save all registers from ROM code! diff --git a/arch/arm/include/asm/arch-omap3/sys_proto.h b/arch/arm/include/asm/arch-omap3/sys_proto.h index 995e7cb..7b60051 100644 --- a/arch/arm/include/asm/arch-omap3/sys_proto.h +++ b/arch/arm/include/asm/arch-omap3/sys_proto.h @@ -71,4 +71,5 @@ void power_init_r(void); void dieid_num_r(void); void do_omap3_emu_romcode_call(u32 service_id, u32 parameters); void omap3_gp_romcode_call(u32 service_id, u32 parameter); +void omap_rev_string(char *omap_rev_string); #endif