From patchwork Wed Jan 26 01:56:30 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Williams X-Patchwork-Id: 80425 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 BC703B70EC for ; Wed, 26 Jan 2011 12:56:41 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 2D98F2808F; Wed, 26 Jan 2011 02:56:40 +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 t9yAkEHI7vHa; Wed, 26 Jan 2011 02:56:39 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E4AB28090; Wed, 26 Jan 2011 02:56:38 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 21B9528090 for ; Wed, 26 Jan 2011 02:56:36 +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 tKZI50uDQTGq for ; Wed, 26 Jan 2011 02:56:34 +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 mail3.caviumnetworks.com (mail3.caviumnetworks.com [12.108.191.235]) by theia.denx.de (Postfix) with ESMTP id 0A6732808F for ; Wed, 26 Jan 2011 02:56:32 +0100 (CET) Received: from caexch01.caveonetworks.com (Not Verified[192.168.16.9]) by mail3.caviumnetworks.com with MailMarshal (v6, 7, 2, 8378) id ; Tue, 25 Jan 2011 17:57:20 -0800 Received: from caexch01.caveonetworks.com ([192.168.16.9]) by caexch01.caveonetworks.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Jan 2011 17:56:30 -0800 Received: from awilliams-suse.localnet ([12.108.191.236]) by caexch01.caveonetworks.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 25 Jan 2011 17:56:30 -0800 From: Aaron Williams To: u-boot@lists.denx.de Date: Tue, 25 Jan 2011 17:56:30 -0800 User-Agent: KMail/1.13.5 (Linux/2.6.34.7-0.7-desktop; KDE/4.5.5; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201101251756.30586.Aaron.Williams@caviumnetworks.com> X-OriginalArrivalTime: 26 Jan 2011 01:56:30.0755 (UTC) FILETIME=[40590F30:01CBBCFC] Subject: [U-Boot] [PATCH 1/1] cfi fix for Spansion and MB->MiB 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: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de I ran into a problem with the Spansion S29GL064N flash chip in that it returns a manufacturer ID of 0 and it also requires the AMD geometry fixup. Additionally, I modified a few print statements to use KiB/MiB instead of kB/MB. -Aaron Williams diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index dd394a8..105eb3f 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1162,10 +1162,10 @@ void flash_print_info (flash_info_t * info) info->name, (info->portwidth << 3), (info->chipwidth << 3)); if (info->size < 1024*1024) - printf (" Size: %ld kB in %d Sectors\n", + printf (" Size: %ld KiB in %d Sectors\n", info->size >> 10, info->sector_count); else - printf (" Size: %ld MB in %d Sectors\n", + printf (" Size: %ld MiB in %d Sectors\n", info->size >> 20, info->sector_count); printf (" "); switch (info->vendor) { @@ -1924,6 +1924,7 @@ ulong flash_get_size (phys_addr_t base, int banknum) /* Do manufacturer-specific fixups */ switch (info->manufacturer_id) { + case 0x0000: case 0x0001: flash_fixup_amd(info, &qry); break;