From patchwork Mon Feb 7 21:14:15 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Haiying Wang X-Patchwork-Id: 82149 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 BCAD7B70B3 for ; Tue, 8 Feb 2011 08:14:47 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E3D3228190; Mon, 7 Feb 2011 22:14:42 +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 QMxaNFpxf9WX; Mon, 7 Feb 2011 22:14:42 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 297A1281E4; Mon, 7 Feb 2011 22:14:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0C20628190 for ; Mon, 7 Feb 2011 22:14:39 +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 R9jhWG+7ukdx for ; Mon, 7 Feb 2011 22:14:37 +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 AM1EHSOBE003.bigfish.com (am1ehsobe003.messaging.microsoft.com [213.199.154.206]) by theia.denx.de (Postfix) with ESMTPS id 1B80128206 for ; Mon, 7 Feb 2011 22:14:35 +0100 (CET) Received: from mail50-am1-R.bigfish.com (10.3.201.244) by AM1EHSOBE003.bigfish.com (10.3.204.23) with Microsoft SMTP Server id 14.1.225.8; Mon, 7 Feb 2011 21:14:34 +0000 Received: from mail50-am1 (localhost.localdomain [127.0.0.1]) by mail50-am1-R.bigfish.com (Postfix) with ESMTP id CFBDB5015F for ; Mon, 7 Feb 2011 21:14:34 +0000 (UTC) X-SpamScore: 0 X-BigFish: VS0(zzzz1202hzz8275bhz2dh2a8h668h62h) X-Spam-TCS-SCL: 1:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:az33egw01.freescale.net; RD:az33egw01.freescale.net; EFVD:NLI Received: from mail50-am1 (localhost.localdomain [127.0.0.1]) by mail50-am1 (MessageSwitch) id 1297113274662611_6080; Mon, 7 Feb 2011 21:14:34 +0000 (UTC) Received: from AM1EHSMHS008.bigfish.com (unknown [10.3.201.252]) by mail50-am1.bigfish.com (Postfix) with ESMTP id 95D6A8B804C for ; Mon, 7 Feb 2011 21:14:34 +0000 (UTC) Received: from az33egw01.freescale.net (192.88.158.102) by AM1EHSMHS008.bigfish.com (10.3.207.108) with Microsoft SMTP Server (TLS) id 14.1.225.8; Mon, 7 Feb 2011 21:14:30 +0000 Received: from az33smr01.freescale.net (az33smr01.freescale.net [10.64.34.199]) by az33egw01.freescale.net (8.14.3/8.14.3) with ESMTP id p17LEIUu014310 for ; Mon, 7 Feb 2011 14:14:28 -0700 (MST) Received: from haiying-laptop.am.freescale.net (haiying-laptop.am.freescale.net [10.29.200.208]) by az33smr01.freescale.net (8.13.1/8.13.0) with ESMTP id p17LEE3P007395; Mon, 7 Feb 2011 15:14:17 -0600 (CST) From: To: Date: Mon, 7 Feb 2011 16:14:15 -0500 Message-ID: <1297113256-7665-3-git-send-email-Haiying.Wang@freescale.com> X-Mailer: git-send-email 1.7.3.1.50.g1e633 In-Reply-To: <1297113256-7665-1-git-send-email-Haiying.Wang@freescale.com> References: <1297113256-7665-1-git-send-email-Haiying.Wang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com Subject: [U-Boot] [PATCH 3/4] powerpc/85xx: load ucode from nand flash before qe_init 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 From: Haiying Wang In the case the QE's microcode is stored in nand flash, we need to load it from NAND flash to ddr first then the qe_init can get the ucode correctly. Signed-off-by: Haiying Wang --- arch/powerpc/cpu/mpc85xx/cpu_init.c | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/cpu/mpc85xx/cpu_init.c b/arch/powerpc/cpu/mpc85xx/cpu_init.c index 215b7b3..5642cd7 100644 --- a/arch/powerpc/cpu/mpc85xx/cpu_init.c +++ b/arch/powerpc/cpu/mpc85xx/cpu_init.c @@ -37,6 +37,10 @@ #include #include #include "mp.h" +#ifdef CONFIG_SYS_QE_FW_IN_NAND +#include +#include +#endif DECLARE_GLOBAL_DATA_PTR; @@ -448,6 +452,19 @@ void cpu_secondary_init_r(void) { #ifdef CONFIG_QE uint qe_base = CONFIG_SYS_IMMR + 0x00080000; /* QE immr base */ +#ifdef CONFIG_SYS_QE_FW_IN_NAND + int ret; + size_t fw_length = CONFIG_SYS_QE_FW_LENGTH; + + /* load QE firmware from NAND flash to DDR first */ + ret = nand_read(&nand_info[0], (loff_t)CONFIG_SYS_QE_FW_IN_NAND, + &fw_length, (u_char *)CONFIG_SYS_QE_FW_ADDR); + + if (ret && ret == -EUCLEAN) { + printf ("NAND read for QE firmware at offset %x failed %d\n", + CONFIG_SYS_QE_FW_IN_NAND, ret); + } +#endif qe_init(qe_base); qe_reset(); #endif