From patchwork Mon Oct 31 16:23:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Schwarz X-Patchwork-Id: 122881 X-Patchwork-Delegate: trini@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 0BFA8B6F81 for ; Tue, 1 Nov 2011 03:24:23 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 853942929A; Mon, 31 Oct 2011 17:24:12 +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 PNnYyaG32-VS; Mon, 31 Oct 2011 17:24:12 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6F12E2929B; Mon, 31 Oct 2011 17:23:47 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 93E0929247 for ; Mon, 31 Oct 2011 17:23:43 +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 pA3saS6vlTyt for ; Mon, 31 Oct 2011 17:23:42 +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 mail-fx0-f44.google.com (mail-fx0-f44.google.com [209.85.161.44]) by theia.denx.de (Postfix) with ESMTPS id D7CC729276 for ; Mon, 31 Oct 2011 17:23:38 +0100 (CET) Received: by mail-fx0-f44.google.com with SMTP id s12so5809338faa.3 for ; Mon, 31 Oct 2011 09:23:38 -0700 (PDT) Received: by 10.223.5.82 with SMTP id 18mr12067721fau.27.1320078218189; Mon, 31 Oct 2011 09:23:38 -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 j5sm38783162faf.14.2011.10.31.09.23.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 31 Oct 2011 09:23:37 -0700 (PDT) From: Simon Schwarz To: u-boot@lists.denx.de Date: Mon, 31 Oct 2011 17:23:06 +0100 Message-Id: <1320078187-28423-5-git-send-email-simonschwarzcor@gmail.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com> References: <1317284033-16188-1-git-send-email-simonschwarzcor@gmail.com> <1320078187-28423-1-git-send-email-simonschwarzcor@gmail.com> Organization: Corscience GmbH & Co. KG Cc: Simon Schwarz Subject: [U-Boot] [PATCH V7 4/5] devkit8000/spl: init GPMC for dm9000 in SPL 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 From: Simon Schwarz Linux crashes if the GPMC isn't configured for the dm9000. Signed-off-by: Simon Schwarz --- V2 changes: nothing V3 changes: nothing V4 changes: noting V5 changes: nothing V6 changes: nothing V7 changes: FIX multiline comment style (http://article.gmane.org/gmane.comp.boot-loaders.u-boot/113500) --- arch/arm/include/asm/omap_common.h | 2 ++ board/timll/devkit8000/devkit8000.c | 33 +++++++++++++++++++++++++-------- 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h index 3f2f004..ab86774 100644 --- a/arch/arm/include/asm/omap_common.h +++ b/arch/arm/include/asm/omap_common.h @@ -78,6 +78,8 @@ u32 omap_boot_mode(void); /* SPL common function s*/ void spl_parse_image_header(const struct image_header *header); void omap_rev_string(char *omap_rev_string); +int spl_uboot_key(void); +void spl_board_prepare_for_linux(void); /* NAND SPL functions */ void spl_nand_load_image(void); diff --git a/board/timll/devkit8000/devkit8000.c b/board/timll/devkit8000/devkit8000.c index fee0dff..11c8671 100644 --- a/board/timll/devkit8000/devkit8000.c +++ b/board/timll/devkit8000/devkit8000.c @@ -63,6 +63,18 @@ int board_init(void) return 0; } +/* Configure GPMC registers for DM9000 */ +static void gpmc_dm9000_config(void) +{ + writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1); + writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2); + writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3); + writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4); + writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5); + writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6); + writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7); +} + /* * Routine: misc_init_r * Description: Configure board specific parts @@ -81,14 +93,7 @@ int misc_init_r(void) #endif #ifdef CONFIG_DRIVER_DM9000 - /* Configure GPMC registers for DM9000 */ - writel(NET_GPMC_CONFIG1, &gpmc_cfg->cs[6].config1); - writel(NET_GPMC_CONFIG2, &gpmc_cfg->cs[6].config2); - writel(NET_GPMC_CONFIG3, &gpmc_cfg->cs[6].config3); - writel(NET_GPMC_CONFIG4, &gpmc_cfg->cs[6].config4); - writel(NET_GPMC_CONFIG5, &gpmc_cfg->cs[6].config5); - writel(NET_GPMC_CONFIG6, &gpmc_cfg->cs[6].config6); - writel(NET_GPMC_CONFIG7, &gpmc_cfg->cs[6].config7); + gpmc_dm9000_config(); /* Use OMAP DIE_ID as MAC address */ if (!eth_getenv_enetaddr("ethaddr", enetaddr)) { @@ -138,3 +143,15 @@ int board_eth_init(bd_t *bis) return dm9000_initialize(bis); } #endif + +#ifdef CONFIG_SPL_OS_BOOT +/* + * Do board specific preperation before SPL + * Linux boot + */ +void spl_board_prepare_for_linux(void) +{ + gpmc_dm9000_config(); +} + +#endif