From patchwork Sat Feb 2 10:06:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Robert P. J. Day" X-Patchwork-Id: 217646 X-Patchwork-Delegate: macpaul@andestech.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 7D02B2C0296 for ; Sat, 2 Feb 2013 21:06:24 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EA1EA4A08E; Sat, 2 Feb 2013 11:06:18 +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 rqp1t71iC91Q; Sat, 2 Feb 2013 11:06:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B9D264A052; Sat, 2 Feb 2013 11:06:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0DB944A052 for ; Sat, 2 Feb 2013 11:06:16 +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 9W3Tl0sICfMQ for ; Sat, 2 Feb 2013 11:06:14 +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 astoria.ccjclearline.com (astoria.ccjclearline.com [64.235.106.9]) by theia.denx.de (Postfix) with ESMTPS id 10B994A050 for ; Sat, 2 Feb 2013 11:06:13 +0100 (CET) Received: from cpec03f0ed08c7f-cm001ac318e826.cpe.net.cable.rogers.com ([174.115.5.73]:49687 helo=crashcourse.ca) by astoria.ccjclearline.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.80) (envelope-from ) id 1U1Zz8-0005Kj-D3; Sat, 02 Feb 2013 05:06:10 -0500 Date: Sat, 2 Feb 2013 05:06:04 -0500 (EST) From: "Robert P. J. Day" X-X-Sender: rpjday@oneiric To: U-Boot list In-Reply-To: Message-ID: References: User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - astoria.ccjclearline.com X-AntiAbuse: Original Domain - lists.denx.de X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - crashcourse.ca X-Source: X-Source-Args: X-Source-Dir: Cc: smcnutt@psyent.com Subject: Re: [U-Boot] some dead code and redundant files for nios? 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 On Fri, 1 Feb 2013, Robert P. J. Day wrote: > ... the same source file -- AMDLV065D.c -- is in two different > directories, and they differ slightly: > > $ diff board/{altera,psyent}/common/AMDLV065D.c > 175c175 > < writeb (b, dst); > --- > > writeb (dst, b); > $ > > that looks kind of weird, doesn't it? i haven't looked any more > closely but for two source files with the same name to have that > single, subtle difference just looks strange. i took a couple minutes with "git blame" to discover this: $ git show 3d22d0b8 $ i don't know what the above is doing, but it would certainly seem that if a flash write bug was being fixed in one of those files, it would be fixed in the other. beyond that, i cannot say. rday diff --git a/board/psyent/common/AMDLV065D.c b/board/psyent/common/AMDLV065D.c ... snip ... - *cmd = 0xaa; - *cmd = 0x55; - *cmd = 0xa0; - *dst = b; + writeb (cmd, 0xaa); + writeb (cmd, 0x55); + writeb (cmd, 0xa0); + writeb (dst, b); ... snip ... while over in the (almost) identical file: git show 9e486ab1 commit 9e486ab1c98ea7ab357520307fe5d5a0847cd1bb Author: Scott McNutt Date: Tue Mar 30 20:26:15 2010 -0400 nios2: Fix AMDLV065D flash write bug in altera board common tree. Signed-off-by: Scott McNutt diff --git a/board/altera/common/AMDLV065D.c b/board/altera/common/AMDLV065D.c index 72b0a9f..7a1b4d3 100644 --- a/board/altera/common/AMDLV065D.c +++ b/board/altera/common/AMDLV065D.c @@ -172,7 +172,7 @@ int write_buff (flash_info_t * info, uchar * src, ulong addr, ulong cnt) writeb (0xaa, cmd); writeb (0x55, cmd); writeb (0xa0, cmd); - writeb (dst, b); + writeb (b, dst); /* Verify write */ start = get_timer (0);