5544c1b
From a53ed08e1f8ee2a235213e802f3d5bb3342adaf3 Mon Sep 17 00:00:00 2001
5544c1b
From: Aurelien Jarno <aurelien@aurel32.net>
5544c1b
Date: Mon, 3 Sep 2012 22:47:03 +0200
5544c1b
Subject: [PATCH] pflash_cfi01: fix vendor specific extended query
5544c1b
5544c1b
pflash_cfi01 announces a version number of 1.1, which implies
5544c1b
"Protection Register Information" and "Burst Read information"
5544c1b
sections, which are not provided.
5544c1b
5544c1b
Decrease the version number to 1.0 so that only the "Protection
5544c1b
Register Information" section is needed.
5544c1b
5544c1b
Set the number of protection fields (0x3f) to 0x01, as 0x00 means 256
5544c1b
protections field, which makes the CFI table bigger than the current
5544c1b
implementation, causing some kernels to fail to read it.
5544c1b
5544c1b
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
5544c1b
(cherry picked from commit 262e1eaafabf32d33a9fa0b03b3c8ea426c5ae1b)
5544c1b
5544c1b
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
5544c1b
---
5544c1b
 hw/pflash_cfi01.c | 4 +++-
5544c1b
 1 file changed, 3 insertions(+), 1 deletion(-)
5544c1b
5544c1b
diff --git a/hw/pflash_cfi01.c b/hw/pflash_cfi01.c
5544c1b
index d1c7423..d56b51a 100644
5544c1b
--- a/hw/pflash_cfi01.c
5544c1b
+++ b/hw/pflash_cfi01.c
5544c1b
@@ -711,7 +711,7 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base,
5544c1b
     pfl->cfi_table[0x33] = 'I';
5544c1b
 
5544c1b
     pfl->cfi_table[0x34] = '1';
5544c1b
-    pfl->cfi_table[0x35] = '1';
5544c1b
+    pfl->cfi_table[0x35] = '0';
5544c1b
 
5544c1b
     pfl->cfi_table[0x36] = 0x00;
5544c1b
     pfl->cfi_table[0x37] = 0x00;
5544c1b
@@ -723,6 +723,8 @@ pflash_t *pflash_cfi01_register(target_phys_addr_t base,
5544c1b
     pfl->cfi_table[0x3b] = 0x00;
5544c1b
     pfl->cfi_table[0x3c] = 0x00;
5544c1b
 
5544c1b
+    pfl->cfi_table[0x3f] = 0x01; /* Number of protection fields */
5544c1b
+
5544c1b
     return pfl;
5544c1b
 }
5544c1b
 
5544c1b
-- 
5544c1b
1.7.12.1
5544c1b