From patchwork Mon Apr 11 11:01:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Schocher X-Patchwork-Id: 90587 X-Patchwork-Delegate: sr@denx.de 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 5BC50B6F16 for ; Mon, 11 Apr 2011 21:08:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8C587280F4; Mon, 11 Apr 2011 13:08:24 +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 RouW1-RpzA9x; Mon, 11 Apr 2011 13:08:24 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A9E94280F3; Mon, 11 Apr 2011 13:08:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 34BFB280CA for ; Mon, 11 Apr 2011 13:08:20 +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 DL15WJic0DPK for ; Mon, 11 Apr 2011 13:08:16 +0200 (CEST) X-Greylist: delayed 413 seconds by postgrey-1.27 at theia; Mon, 11 Apr 2011 13:08:07 CEST X-policyd-weight: IN_SBL_XBL_SPAMHAUS=4.35 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from pollux.denx.de (p4FD639C6.dip.t-dialin.net [79.214.57.198]) by theia.denx.de (Postfix) with ESMTP id 04023280EC for ; Mon, 11 Apr 2011 13:08:07 +0200 (CEST) Received: by pollux.denx.de (Postfix, from userid 515) id 67D6218563702; Mon, 11 Apr 2011 13:01:14 +0200 (CEST) From: Heiko Schocher To: u-boot@lists.denx.de Date: Mon, 11 Apr 2011 13:01:12 +0200 Message-Id: <1302519672-10648-1-git-send-email-hs@denx.de> X-Mailer: git-send-email 1.7.4 Cc: Stefan Roese , Heiko Schocher Subject: [U-Boot] [PATCH] mtd, cfi: read AMD 3-byte (expanded) device ids on 16bit devices 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 Signed-off-by: Heiko Schocher --- drivers/mtd/cfi_flash.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 5788328..7617e0e 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1202,8 +1202,9 @@ void flash_print_info (flash_info_t * info) info->manufacturer_id); printf (info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X", info->device_id); - if (info->device_id == 0x7E) { - printf("%04X", info->device_id2); + if ((info->device_id & 0xff) == 0x7E) { + printf(info->chipwidth == FLASH_CFI_16BIT ? "%04X" : "%02X", + info->device_id2); } printf ("\n Erase timeout: %ld ms, write timeout: %ld ms\n", info->erase_blk_tout, @@ -1599,6 +1600,14 @@ static void cmdset_amd_read_jedec_ids(flash_info_t *info) case FLASH_CFI_16BIT: info->device_id = flash_read_word (info, FLASH_OFFSET_DEVICE_ID); + if ((info->device_id & 0xff) == 0x7E) { + /* AMD 3-byte (expanded) device ids */ + info->device_id2 = flash_read_uchar (info, + FLASH_OFFSET_DEVICE_ID2); + info->device_id2 <<= 8; + info->device_id2 |= flash_read_uchar (info, + FLASH_OFFSET_DEVICE_ID3); + } break; default: break;