From patchwork Wed Jan 19 07:39:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dipen Dudhat X-Patchwork-Id: 79423 X-Patchwork-Delegate: galak@kernel.crashing.org 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 47A70B70CC for ; Wed, 19 Jan 2011 18:39:17 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EFC7C280CB; Wed, 19 Jan 2011 08:39:15 +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 NsrEYY6inI6g; Wed, 19 Jan 2011 08:39:15 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3F1E2809D; Wed, 19 Jan 2011 08:39:13 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 1D9492809D for ; Wed, 19 Jan 2011 08:39:11 +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 qeA36PsgbvnY for ; Wed, 19 Jan 2011 08:39:09 +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 VA3EHSOBE004.bigfish.com (va3ehsobe004.messaging.microsoft.com [216.32.180.14]) by theia.denx.de (Postfix) with ESMTPS id 05A5928099 for ; Wed, 19 Jan 2011 08:39:07 +0100 (CET) Received: from mail131-va3-R.bigfish.com (10.7.14.239) by VA3EHSOBE004.bigfish.com (10.7.40.24) with Microsoft SMTP Server id 14.1.225.8; Wed, 19 Jan 2011 07:39:06 +0000 Received: from mail131-va3 (localhost.localdomain [127.0.0.1]) by mail131-va3-R.bigfish.com (Postfix) with ESMTP id B4DEFC381F3 for ; Wed, 19 Jan 2011 07:39:05 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bh8275dhz2dh2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:de01egw01.freescale.net; RD:de01egw01.freescale.net; EFVD:NLI Received: from mail131-va3 (localhost.localdomain [127.0.0.1]) by mail131-va3 (MessageSwitch) id 1295422745361987_23808; Wed, 19 Jan 2011 07:39:05 +0000 (UTC) Received: from VA3EHSMHS017.bigfish.com (unknown [10.7.14.252]) by mail131-va3.bigfish.com (Postfix) with ESMTP id 4BF264F8058 for ; Wed, 19 Jan 2011 07:39:05 +0000 (UTC) Received: from de01egw01.freescale.net (192.88.165.102) by VA3EHSMHS017.bigfish.com (10.7.99.27) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 19 Jan 2011 07:39:05 +0000 Received: from az33smr02.freescale.net (az33smr02.freescale.net [10.64.34.200]) by de01egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p0J7d3Eg000627 for ; Wed, 19 Jan 2011 00:39:04 -0700 (MST) Received: from lc1104.zin33.ap.freescale.net (lc1104.zin33.ap.freescale.net [10.232.3.104]) by az33smr02.freescale.net (8.13.1/8.13.0) with ESMTP id p0J7d1P5009880; Wed, 19 Jan 2011 01:39:02 -0600 (CST) Received: by lc1104.zin33.ap.freescale.net (Postfix, from userid 4889) id 233834065; Wed, 19 Jan 2011 13:09:00 +0530 (IST) From: Dipen Dudhat To: Date: Wed, 19 Jan 2011 13:09:00 +0530 Message-ID: <1295422740-14142-1-git-send-email-Dipen.Dudhat@freescale.com> X-Mailer: git-send-email 1.5.6.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.net Cc: Dipen Dudhat Subject: [U-Boot] [PATCH ] powerpc/85xx: Protect all LBC code with CONFIG_FSL_LBC 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Future SoC (like the P1010) replace the LBC controller with the new IFC (Integrated Flash Controller) so ensure we properly protect code that is related to the LBC. Signed-off-by: Dipen Dudhat Acked-by: Kumar Gala --- arch/powerpc/cpu/mpc85xx/cpu.c | 9 ++++++++- arch/powerpc/cpu/mpc85xx/speed.c | 6 +++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c index 2f5a505..700e292 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu.c +++ b/arch/powerpc/cpu/mpc85xx/cpu.c @@ -1,5 +1,5 @@ /* - * Copyright 2004,2007-2010 Freescale Semiconductor, Inc. + * Copyright 2004,2007-2011 Freescale Semiconductor, Inc. * (C) Copyright 2002, 2003 Motorola Inc. * Xianghua Xiao (X.Xiao@motorola.com) * @@ -166,12 +166,14 @@ int checkcpu (void) } #endif +#if defined(CONFIG_FSL_LBC) if (sysinfo.freqLocalBus > LCRR_CLKDIV) { printf("LBC:%-4s MHz\n", strmhz(buf1, sysinfo.freqLocalBus)); } else { printf("LBC: unknown (LCRR[CLKDIV] = 0x%02lx)\n", sysinfo.freqLocalBus); } +#endif #ifdef CONFIG_CPM2 printf("CPM: %s MHz\n", strmhz(buf1, sysinfo.freqSystemBus)); @@ -284,7 +286,10 @@ void mpc85xx_reginfo(void) { print_tlbcam(); print_laws(); +#if defined(CONFIG_FSL_LBC) print_lbc_regs(); +#endif + } /* Common ddr init for non-corenet fsl 85xx platforms */ @@ -330,8 +335,10 @@ phys_size_t initdram(int board_type) ddr_enable_ecc(dram_size); #endif +#if defined(CONFIG_FSL_LBC) /* Some boards also have sdram on the lbc */ lbc_sdram_init(); +#endif puts("DDR: "); return dram_size; diff --git a/arch/powerpc/cpu/mpc85xx/speed.c b/arch/powerpc/cpu/mpc85xx/speed.c index dd4c6b3..f2aa8d0 100644 --- a/arch/powerpc/cpu/mpc85xx/speed.c +++ b/arch/powerpc/cpu/mpc85xx/speed.c @@ -1,5 +1,5 @@ /* - * Copyright 2004, 2007-2010 Freescale Semiconductor, Inc. + * Copyright 2004, 2007-2011 Freescale Semiconductor, Inc. * * (C) Copyright 2003 Motorola Inc. * Xianghua Xiao, (X.Xiao@motorola.com) @@ -131,7 +131,9 @@ void get_sys_info (sys_info_t * sysInfo) #else uint plat_ratio,e500_ratio,half_freqSystemBus; +#if defined(CONFIG_FSL_LBC) uint lcrr_div; +#endif int i; #ifdef CONFIG_QE u32 qe_ratio; @@ -168,6 +170,7 @@ void get_sys_info (sys_info_t * sysInfo) sysInfo->freqQE = qe_ratio * CONFIG_SYS_CLK_FREQ; #endif +#if defined(CONFIG_FSL_LBC) #if defined(CONFIG_SYS_LBC_LCRR) /* We will program LCRR to this value later */ lcrr_div = CONFIG_SYS_LBC_LCRR & LCRR_CLKDIV; @@ -193,6 +196,7 @@ void get_sys_info (sys_info_t * sysInfo) /* In case anyone cares what the unknown value is */ sysInfo->freqLocalBus = lcrr_div; } +#endif }