From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JuDGK-0002Bj-JY for qemu-devel@nongnu.org; Thu, 08 May 2008 17:02:48 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JuDGI-0002B0-3G for qemu-devel@nongnu.org; Thu, 08 May 2008 17:02:47 -0400 Received: from [199.232.76.173] (port=38098 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JuDGH-0002Av-Tj for qemu-devel@nongnu.org; Thu, 08 May 2008 17:02:45 -0400 Received: from savannah.gnu.org ([199.232.41.3]:60933 helo=sv.gnu.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JuDGH-0005zC-MR for qemu-devel@nongnu.org; Thu, 08 May 2008 17:02:45 -0400 Received: from cvs.savannah.gnu.org ([199.232.41.69]) by sv.gnu.org with esmtp (Exim 4.63) (envelope-from ) id 1JuDGG-0000cz-6x for qemu-devel@nongnu.org; Thu, 08 May 2008 21:02:44 +0000 Received: from edgar_igl by cvs.savannah.gnu.org with local (Exim 4.63) (envelope-from ) id 1JuDGG-0000cv-00 for qemu-devel@nongnu.org; Thu, 08 May 2008 21:02:44 +0000 MIME-Version: 1.0 Errors-To: edgar_igl Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: "Edgar E. Iglesias" Message-Id: Date: Thu, 08 May 2008 21:02:44 +0000 Subject: [Qemu-devel] [4387] CFI-0002 linux MTD compatibility. Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Revision: 4387 http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4387 Author: edgar_igl Date: 2008-05-08 21:02:43 +0000 (Thu, 08 May 2008) Log Message: ----------- CFI-0002 linux MTD compatibility. * Add an extended table area. * Clear buffer write timeouts to indicate that we dont support it. * Correct device size. Modified Paths: -------------- trunk/hw/pflash_cfi02.c Modified: trunk/hw/pflash_cfi02.c =================================================================== --- trunk/hw/pflash_cfi02.c 2008-05-08 12:21:27 UTC (rev 4386) +++ trunk/hw/pflash_cfi02.c 2008-05-08 21:02:43 UTC (rev 4387) @@ -608,8 +608,8 @@ /* Command set (AMD/Fujitsu) */ pfl->cfi_table[0x13] = 0x02; pfl->cfi_table[0x14] = 0x00; - /* Primary extended table address (none) */ - pfl->cfi_table[0x15] = 0x00; + /* Primary extended table address */ + pfl->cfi_table[0x15] = 0x31; pfl->cfi_table[0x16] = 0x00; /* Alternate command set (none) */ pfl->cfi_table[0x17] = 0x00; @@ -627,22 +627,22 @@ pfl->cfi_table[0x1E] = 0x00; /* Reserved */ pfl->cfi_table[0x1F] = 0x07; - /* Timeout for min size buffer write (16 \xB5s) */ - pfl->cfi_table[0x20] = 0x04; + /* Timeout for min size buffer write (NA) */ + pfl->cfi_table[0x20] = 0x00; /* Typical timeout for block erase (512 ms) */ pfl->cfi_table[0x21] = 0x09; /* Typical timeout for full chip erase (4096 ms) */ pfl->cfi_table[0x22] = 0x0C; /* Reserved */ pfl->cfi_table[0x23] = 0x01; - /* Max timeout for buffer write */ - pfl->cfi_table[0x24] = 0x04; + /* Max timeout for buffer write (NA) */ + pfl->cfi_table[0x24] = 0x00; /* Max timeout for block erase */ pfl->cfi_table[0x25] = 0x0A; /* Max timeout for chip erase */ pfl->cfi_table[0x26] = 0x0D; /* Device size */ - pfl->cfi_table[0x27] = ctz32(chip_len) + 1; + pfl->cfi_table[0x27] = ctz32(chip_len); /* Flash device interface (8 & 16 bits) */ pfl->cfi_table[0x28] = 0x02; pfl->cfi_table[0x29] = 0x00; @@ -659,5 +659,23 @@ pfl->cfi_table[0x2F] = sector_len >> 8; pfl->cfi_table[0x30] = sector_len >> 16; + /* Extended */ + pfl->cfi_table[0x31] = 'P'; + pfl->cfi_table[0x32] = 'R'; + pfl->cfi_table[0x33] = 'I'; + + pfl->cfi_table[0x34] = '1'; + pfl->cfi_table[0x35] = '0'; + + pfl->cfi_table[0x36] = 0x00; + pfl->cfi_table[0x37] = 0x00; + pfl->cfi_table[0x38] = 0x00; + pfl->cfi_table[0x39] = 0x00; + + pfl->cfi_table[0x3a] = 0x00; + + pfl->cfi_table[0x3b] = 0x00; + pfl->cfi_table[0x3c] = 0x00; + return pfl; }