From patchwork Fri Mar 18 08:10:00 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rogan Dawes X-Patchwork-Id: 87503 X-Patchwork-Delegate: prafulla@marvell.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 04A45B6FC0 for ; Fri, 18 Mar 2011 19:14:52 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9AD752822E; Fri, 18 Mar 2011 09:14:33 +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 5-mP-eVF4kL2; Fri, 18 Mar 2011 09:14:33 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0A50F28231; Fri, 18 Mar 2011 09:14:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A6C0B281FE for ; Fri, 18 Mar 2011 09:14:17 +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 I0kacJ21W+uH for ; Fri, 18 Mar 2011 09:14:17 +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-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by theia.denx.de (Postfix) with ESMTPS id ED5CA281D1 for ; Fri, 18 Mar 2011 09:14:06 +0100 (CET) Received: by mail-iy0-f172.google.com with SMTP id 12so3490009iyi.3 for ; Fri, 18 Mar 2011 01:14:06 -0700 (PDT) Received: by 10.42.174.131 with SMTP id v3mr1277273icz.21.1300436046556; Fri, 18 Mar 2011 01:14:06 -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 uf10sm1721078icb.17.2011.03.18.01.14.04 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 18 Mar 2011 01:14:06 -0700 (PDT) From: rogan@dawes.za.net To: u-boot@lists.denx.de Date: Fri, 18 Mar 2011 10:10:00 +0200 Message-Id: <1300435803-4940-5-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 4/7] 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 dd394a8..74e9ade 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -291,6 +291,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); @@ -308,6 +311,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); @@ -328,6 +334,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 @@ -363,6 +372,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) { @@ -420,6 +432,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); @@ -1762,6 +1777,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 @@ -1776,6 +1792,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; @@ -1942,11 +1959,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); @@ -2034,12 +2053,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); }