From patchwork Fri Jan 4 18:13:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: York Sun X-Patchwork-Id: 209513 X-Patchwork-Delegate: afleming@freescale.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 DD0622C0086 for ; Sat, 5 Jan 2013 05:29:42 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D46D64A04A; Fri, 4 Jan 2013 19:29:40 +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 wxLLR82fWKK4; Fri, 4 Jan 2013 19:29:40 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 519124A051; Fri, 4 Jan 2013 19:29:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EAC8A4A04E for ; Fri, 4 Jan 2013 19:29:35 +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 krrz7r4EaSX8 for ; Fri, 4 Jan 2013 19:29:35 +0100 (CET) X-Greylist: delayed 905 seconds by postgrey-1.27 at theia; Fri, 04 Jan 2013 19:29:33 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 am1outboundpool.messaging.microsoft.com (am1ehsobe002.messaging.microsoft.com [213.199.154.205]) by theia.denx.de (Postfix) with ESMTPS id 155384A04A for ; Fri, 4 Jan 2013 19:29:33 +0100 (CET) Received: from mail53-am1-R.bigfish.com (10.3.201.232) by AM1EHSOBE018.bigfish.com (10.3.207.140) with Microsoft SMTP Server id 14.1.225.23; Fri, 4 Jan 2013 18:14:26 +0000 Received: from mail53-am1 (localhost [127.0.0.1]) by mail53-am1-R.bigfish.com (Postfix) with ESMTP id 9093F180110 for ; Fri, 4 Jan 2013 18:14:26 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1de0h1202h1e76h1d1ah1d2ahzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1155h) Received: from mail53-am1 (localhost.localdomain [127.0.0.1]) by mail53-am1 (MessageSwitch) id 1357323265100236_20403; Fri, 4 Jan 2013 18:14:25 +0000 (UTC) Received: from AM1EHSMHS016.bigfish.com (unknown [10.3.201.232]) by mail53-am1.bigfish.com (Postfix) with ESMTP id 0B66C4600DF for ; Fri, 4 Jan 2013 18:14:25 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by AM1EHSMHS016.bigfish.com (10.3.207.154) with Microsoft SMTP Server (TLS) id 14.1.225.23; Fri, 4 Jan 2013 18:14:24 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-004.039d.mgd.msft.net (10.84.1.14) with Microsoft SMTP Server (TLS) id 14.2.318.3; Fri, 4 Jan 2013 18:14:22 +0000 Received: from oslab-l1.am.freescale.net ([10.214.81.109]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id r04IEKm7022122; Fri, 4 Jan 2013 11:14:21 -0700 From: York Sun To: Date: Fri, 4 Jan 2013 10:13:59 -0800 Message-ID: <1357323245-12455-1-git-send-email-yorksun@freescale.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: afleming@freescale.com, York Sun Subject: [U-Boot] [PATCH 1/7] powerpc/mpc8xxx: Enable entering DDR debugging by key press X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Using environmental variable "ddr_interactive" to activate interactive DDR debugging seomtiems is not enough. For example, after updating SPD with a valid but wrong image, u-boot won't come up due to wrong DDR configuration. By enabling key press method, we can enter debug mode to have a chance to boot without using other tools to recover the board. CONFIG_FSL_DDR_INTERACTIVE needs to be defined in header file. To enter the debug mode by key press, press key 'd' shortly after reset, like one would do to abort auto booting. It is fixed to lower case 'd' at this moment. Signed-off-by: York Sun --- arch/powerpc/cpu/mpc8xxx/ddr/main.c | 6 ++++-- doc/README.fsl-ddr | 7 +++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/main.c b/arch/powerpc/cpu/mpc8xxx/ddr/main.c index d6b73c7..a33c9e2 100644 --- a/arch/powerpc/cpu/mpc8xxx/ddr/main.c +++ b/arch/powerpc/cpu/mpc8xxx/ddr/main.c @@ -532,9 +532,11 @@ phys_size_t fsl_ddr_sdram(void) /* Compute it once normally. */ #ifdef CONFIG_FSL_DDR_INTERACTIVE - if (getenv("ddr_interactive")) + if (getenv("ddr_interactive")) { total_memory = fsl_ddr_interactive(&info); - else + } else if (tstc() && (getc() == 'd')) { /* we got a key press of 'd' */ + total_memory = fsl_ddr_interactive(&info); + } else #endif total_memory = fsl_ddr_compute(&info, STEP_GET_SPD, 0); diff --git a/doc/README.fsl-ddr b/doc/README.fsl-ddr index 3992640..59583b3 100644 --- a/doc/README.fsl-ddr +++ b/doc/README.fsl-ddr @@ -268,6 +268,13 @@ be activated by saving an environment variable "ddr_interactive". The value doesn't matter. Once activated, U-boot prompts "FSL DDR>" before enabling DDR controller. The available commands can be seen by typing "help". +Another way to enter debug mode without using environment variable is to send +a key press during boot, like one would do to abort auto boot. To save booting +time, no additioal delay is added so the window to send the key press is very +short. For example, user can send the key press using reset command followed by +hitting enter key twice. In case of power on reset, user can keep hitting any +key while applying the power. + The example flow of using interactive debugging is type command "compute" to calculate the parameters from the default type command "print" with arguments to show SPD, options, registers