From patchwork Fri Mar 18 08:04:57 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87497 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 920A3B6FDE for ; Fri, 18 Mar 2011 19:06:56 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 79FED281DE; Fri, 18 Mar 2011 09:06:14 +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 BuLVyBhVaImA; Fri, 18 Mar 2011 09:06:14 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8732D281C6; Fri, 18 Mar 2011 09:05:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 08EE72817D for ; Fri, 18 Mar 2011 09:05:45 +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 LVOeILLmT8Cf for ; Fri, 18 Mar 2011 09:05:44 +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 mail-ww0-f52.google.com (mail-ww0-f52.google.com [74.125.82.52]) by theia.denx.de (Postfix) with ESMTPS id 231B2281AC for ; Fri, 18 Mar 2011 09:05:34 +0100 (CET) Received: by wwj40 with SMTP id 40so4640967wwj.9 for ; Fri, 18 Mar 2011 01:05:34 -0700 (PDT) Received: by 10.216.62.67 with SMTP id x45mr1924038wec.92.1300435533926; Fri, 18 Mar 2011 01:05:33 -0700 (PDT) Received: from localhost.localdomain (196-215-42-15.dynamic.isadsl.co.za [196.215.42.15]) by mx.google.com with ESMTPS id y12sm260049wby.25.2011.03.18.01.05.31 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:05:33 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:04:57 +0200 Message-Id: <1300435500-4909-9-git-send-email-rogan@dawes.za.net> X-Mailer: git-send-email 1.7.1 In-Reply-To: <4D81FE7F.8090002@dawes.za.net> References: <4D81FE7F.8090002@dawes.za.net> Subject: [U-Boot] [PATCH 08/11] DNS323 CFI driver changes (hacks, testing only) 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Rogan Dawes --- drivers/mtd/cfi_flash.c | 22 +++++++++++++++++++++- 1 files changed, 21 insertions(+), 1 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 44ebb9d..7ee4f90 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -262,6 +262,9 @@ static inline uchar flash_read_uchar (flash_info_t * info, uint offset) uchar *cp; uchar retval; +#if 1 // test-only + offset = offset * 2; +#endif cp = flash_map (info, 0, offset); #if defined(__LITTLE_ENDIAN) || defined(CONFIG_SYS_WRITE_SWAPPED_DATA) retval = flash_read8(cp); @@ -279,6 +282,9 @@ static inline ushort flash_read_word (flash_info_t * info, uint offset) { ushort *addr, retval; +#if 1 // test-only + offset = offset * 2; +#endif addr = flash_map (info, 0, offset); retval = flash_read16 (addr); flash_unmap (info, 0, offset, addr); @@ -299,6 +305,9 @@ static ulong flash_read_long (flash_info_t * info, flash_sect_t sect, #ifdef DEBUG int x; #endif +#if 1 // test-only + offset = offset * 2; +#endif addr = flash_map (info, sect, offset); #ifdef DEBUG @@ -334,6 +343,9 @@ void flash_write_cmd (flash_info_t * info, flash_sect_t sect, void *addr; cfiword_t cword; +#if 1 // test-only + offset = offset * 2; +#endif addr = flash_map (info, sect, offset); flash_make_cmd (info, cmd, &cword); switch (info->portwidth) { @@ -391,6 +403,9 @@ static int flash_isequal (flash_info_t * info, flash_sect_t sect, cfiword_t cword; int retval; +#if 1 // test-only + offset = offset * 2; +#endif addr = flash_map (info, sect, offset); flash_make_cmd (info, cmd, &cword); @@ -1728,6 +1743,7 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry) info->addr_unlock1 = 0x555; info->addr_unlock2 = 0x2aa; +#if 0 // test-only /* * modify the unlock address if we are * in compatibility mode @@ -1742,6 +1758,7 @@ static int __flash_detect_cfi (flash_info_t * info, struct cfi_qry *qry) info->addr_unlock1 = 0xaaa; info->addr_unlock2 = 0x555; } +#endif info->name = "CFI conformant"; return 1; @@ -1907,11 +1924,13 @@ ulong flash_get_size (phys_addr_t base, int banknum) debug ("cfi version is 0x%04x\n", info->cfi_version); size_ratio = info->portwidth / info->chipwidth; +#if 0 // test-only /* if the chip is x8/x16 reduce the ratio by half */ if ((info->interface == FLASH_CFI_X8X16) && (info->chipwidth == FLASH_CFI_BY8)) { size_ratio >>= 1; } +#endif debug ("size_ratio %d port %d bits chip %d bits\n", size_ratio, info->portwidth << CFI_FLASH_SHIFT_WIDTH, info->chipwidth << CFI_FLASH_SHIFT_WIDTH); @@ -1985,12 +2004,13 @@ ulong flash_get_size (phys_addr_t base, int banknum) /* round up when converting to ms */ info->write_tout = (tmp + 999) / 1000; info->flash_id = FLASH_MAN_CFI; +#if 0 if ((info->interface == FLASH_CFI_X8X16) && (info->chipwidth == FLASH_CFI_BY8)) { /* XXX - Need to test on x8/x16 in parallel. */ info->portwidth >>= 1; } - +#endif flash_write_cmd (info, 0, 0, info->cmd_reset); }