From patchwork Fri Jun 15 12:01:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 165098 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 0FB74B705D for ; Fri, 15 Jun 2012 22:01:43 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0FC8428102; Fri, 15 Jun 2012 14:01:40 +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 v1cEBCxd4YQZ; Fri, 15 Jun 2012 14:01:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E1F5B280FA; Fri, 15 Jun 2012 14:01:36 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 951B9280FA for ; Fri, 15 Jun 2012 14:01:32 +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 Ygt12unWP-Jt for ; Fri, 15 Jun 2012 14:01:30 +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 a.relay.invitel.net (a.relay.invitel.net [62.77.203.3]) by theia.denx.de (Postfix) with ESMTP id 09027280F0 for ; Fri, 15 Jun 2012 14:01:28 +0200 (CEST) Received: from mail.invitel.hu (mail.invitel.hu [213.163.59.4]) by a.relay.invitel.net (Invitel Core SMTP Transmitter) with ESMTP id E2C9711A0FB; Fri, 15 Jun 2012 14:01:27 +0200 (CEST) Received: from [192.168.1.110] ([82.131.235.212]) by mail.invitel.hu (Invitel Messaging Server) with ESMTPA id <0M5N001D6QQE6Y60@invitel.hu>; Fri, 15 Jun 2012 14:01:27 +0200 (CEST) Date: Fri, 15 Jun 2012 14:01:26 +0200 From: Heiko Schocher To: Scott Wood Message-id: <4FDB2416.2060809@denx.de> Organization: DENX Software Engineering MIME-version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:12.0) Gecko/20120421 Thunderbird/12.0 Cc: Tom Rini , U-Boot user list Subject: [U-Boot] am35xx, twister: could not write nand flash X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list Reply-To: hs@denx.de 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 Hello Scott, I currently tried current U-Boot HEAD commit fedab338f3459315cb69627fcf46032ec8df1753 Merge: 74b5b5d f6b690e Author: Wolfgang Denk Date: Thu Jun 7 23:42:17 2012 +0200 Merge branch 'master' of git://git.denx.de/u-boot-video on the twister board, and detected that a "run update" fails with: twister => run update SW ECC selected NAND erase: device 0 offset 0x80000, size 0x100000 Erasing at 0x160000 -- 100% complete. OK NAND write: (board hangs ...) Environment var: update=nandecc sw;nand erase ${uboot_addr} 100000;nand write ${loadaddr} ${uboot_addr} 80000 So I started "git bisection": [hs@pollux u-boot]$ git bisect start [hs@pollux u-boot]$ git bisect bad [hs@pollux u-boot]$ git bisect good 415d386877df49eb051b85ef74fa59a16dc17c7d Bisecting: 211 revisions left to test after this (roughly 8 steps) [...] [hs@pollux u-boot]$ git bisect bad 418396e212b59bf907dbccad997ff50f7eb61b16 is the first bad commit commit 418396e212b59bf907dbccad997ff50f7eb61b16 Author: Scott Wood Date: Fri Mar 2 14:01:57 2012 -0600 nand: extend .raw accesses to work on multiple pages A use for this is to read, modify, erase, and write an entire block as a single unit, as a replacement for the biterr command. This way gives more flexibility in that you can also test multiple bit errors, errors in the ECC, etc. Signed-off-by: Scott Wood :040000 040000 ad5ce55a0fdf3a40e1aaae0546aae68bf7a0b480 f57e87a8630715e37170b5bb3a109a58b6b89333 M common :040000 040000 83834ae80a73f20357132875078f643b4064f9dd ed0004e44b4da8b2734168a3950733afba0a0b64 M doc [hs@pollux u-boot]$ following patch helps: What do you think? Is this a correct fix, and I should sent this as a real patch, or did I overlook something? bye, Heiko diff --git a/common/cmd_nand.c b/common/cmd_nand.c index fa44295..edeb093 100644 --- a/common/cmd_nand.c +++ b/common/cmd_nand.c @@ -617,7 +617,7 @@ int do_nand(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) s = strchr(cmd, '.'); - if (!strcmp(s, ".raw")) { + if ((s != NULL) && (!strcmp(s, ".raw"))) { raw = 1; if (arg_off(argv[3], &dev, &off, &size))