[flashrom] [PATCH] add support for Pm25LQ032

Steven Honeyman stevenhoneyman at gmail.com
Sat Apr 4 11:57:24 CEST 2015


On 4 April 2015 at 00:05, Stefan Tauner
<stefan.tauner at alumni.tuwien.ac.at> wrote:
> On Sat, 14 Mar 2015 15:00:10 +0000
> Steven Honeyman <stevenhoneyman at gmail.com> wrote:
>
>> I found this in a Chinese router, read tested (twice, successful) but
>> not yet write/erase tested.
>> Based on information from the datasheet at
>> http://www.chingistek.com/img/Product_Files/Pm25LQ032C%20datasheet%20v1.6.1.pdf
>>
>> Signed-off-by: Steven Honeyman <stevenhoneyman at gmail.com>
>
> Hi Steven,
>
> thanks for your patch. There are a number of similar chips (Pm25LQ020,
> Pm25LQ040, Pm25LQ080, Pm25LQ016). Do you want to add support for them too?

Hi,

Thanks for the feedback. I've made the changes and added support for
the rest of the Pm25LQ family, new patch is below.
The "C" part number thing is a bit strange - the *032 datasheet is the
only one to have a C at the end, and has a smaller voltage range and
smaller OTP size than the rest.

On 4 April 2015 at 00:05, Stefan Tauner
<stefan.tauner at alumni.tuwien.ac.at> wrote:
>> +                .block_erase = spi_block_erase_20,    /* sector erase */
>
> All these comments are redundant. Experienced flashrom hacker will
> instantly deduce that from the erase block size(s).

Maybe... but that doesn't mean newbies will!

---

Add support for Pm25LQ020, Pm25LQ040, Pm25LQ080, Pm25LQ016, Pm25LQ032
Based on information from the datasheets at:

http://www.chingistek.com/img/Product_Files/Pm25LQ020-040%20datasheet%20v04.pdf
http://www.chingistek.com/img/Product_Files/Pm25LQ080%20datasheet%20v0.4.4.pdf
http://www.chingistek.com/img/Product_Files/Pm25LQ016%20datasheet-final.pdf
http://www.chingistek.com/img/Product_Files/Pm25LQ032C%20datasheet%20v1.6.1.pdf

Signed-off-by: Steven Honeyman <stevenhoneyman at gmail.com>

Index: flashchips.c
===================================================================
diff --git a/trunk/flashchips.c b/trunk/flashchips.c
--- a/trunk/flashchips.c    (revision 1889)
+++ b/trunk/flashchips.c    (working copy)
@@ -9903,8 +9903,203 @@
         .voltage    = {2700, 3600}, /* 2.3-3.6V for Pm25LD040 */
     },

-{
+    {
         .vendor        = "PMC",
+        .name        = "Pm25LQ020",
+        .bustype    = BUS_SPI,
+        .manufacture_id    = PMC_ID,
+        .model_id    = PMC_PM25LQ020,
+        .total_size    = 256,
+        .page_size    = 256,
+        /* OTP: 256B total; read 0x4B, write 0xB1 */
+        .feature_bits    = FEATURE_WRSR_WREN | FEATURE_OTP,
+        .tested        = TEST_UNTESTED,
+        .probe        = probe_spi_rdid,
+        .probe_timing    = TIMING_ZERO,
+        .block_erasers    =
+        {
+            {
+                .eraseblocks = { {4 * 1024, 64} },
+                .block_erase = spi_block_erase_20,
+            }, {
+                .eraseblocks = { {4 * 1024, 64} },
+                .block_erase = spi_block_erase_d7,
+            }, {
+                .eraseblocks = { {64 * 1024, 4} },
+                .block_erase = spi_block_erase_d8,
+            }, {
+                .eraseblocks = { {256 * 1024, 1} },
+                .block_erase = spi_block_erase_60,
+            }, {
+                .eraseblocks = { {256 * 1024, 1} },
+                .block_erase = spi_block_erase_c7,
+            }
+        },
+        .printlock    = spi_prettyprint_status_register_bp3_srwd, /*
bit6 is quad enable */
+        .unlock        = spi_disable_blockprotect_bp3_srwd,
+        .write        = spi_chip_write_256,
+        .read        = spi_chip_read,
+        .voltage    = {2300, 3600},
+    },
+
+    {
+        .vendor        = "PMC",
+        .name        = "Pm25LQ040",
+        .bustype    = BUS_SPI,
+        .manufacture_id    = PMC_ID,
+        .model_id    = PMC_PM25LQ040,
+        .total_size    = 512,
+        .page_size    = 256,
+        /* OTP: 256B total; read 0x4B, write 0xB1 */
+        .feature_bits    = FEATURE_WRSR_WREN | FEATURE_OTP,
+        .tested        = TEST_UNTESTED,
+        .probe        = probe_spi_rdid,
+        .probe_timing    = TIMING_ZERO,
+        .block_erasers    =
+        {
+            {
+                .eraseblocks = { {4 * 1024, 128} },
+                .block_erase = spi_block_erase_20,
+            }, {
+                .eraseblocks = { {4 * 1024, 128} },
+                .block_erase = spi_block_erase_d7,
+            }, {
+                .eraseblocks = { {64 * 1024, 8} },
+                .block_erase = spi_block_erase_d8,
+            }, {
+                .eraseblocks = { {512 * 1024, 1} },
+                .block_erase = spi_block_erase_60,
+            }, {
+                .eraseblocks = { {512 * 1024, 1} },
+                .block_erase = spi_block_erase_c7,
+            }
+        },
+        .printlock    = spi_prettyprint_status_register_bp3_srwd, /*
bit6 is quad enable */
+        .unlock        = spi_disable_blockprotect_bp3_srwd,
+        .write        = spi_chip_write_256,
+        .read        = spi_chip_read,
+        .voltage    = {2300, 3600},
+    },
+
+    {
+        .vendor        = "PMC",
+        .name        = "Pm25LQ080",
+        .bustype    = BUS_SPI,
+        .manufacture_id    = PMC_ID,
+        .model_id    = PMC_PM25LQ080,
+        .total_size    = 1024,
+        .page_size    = 256,
+        /* OTP: 64B total; read 0x4B, write 0xB1 */
+        .feature_bits    = FEATURE_WRSR_WREN | FEATURE_OTP,
+        .tested        = TEST_UNTESTED,
+        .probe        = probe_spi_rdid,
+        .probe_timing    = TIMING_ZERO,
+        .block_erasers    =
+        {
+            {
+                .eraseblocks = { {4 * 1024, 256} },
+                .block_erase = spi_block_erase_20,
+            }, {
+                .eraseblocks = { {4 * 1024, 256} },
+                .block_erase = spi_block_erase_d7,
+            }, {
+                .eraseblocks = { {64 * 1024, 16} },
+                .block_erase = spi_block_erase_d8,
+            }, {
+                .eraseblocks = { {1024 * 1024, 1} },
+                .block_erase = spi_block_erase_60,
+            }, {
+                .eraseblocks = { {1024 * 1024, 1} },
+                .block_erase = spi_block_erase_c7,
+            }
+        },
+        .printlock    = spi_prettyprint_status_register_bp3_srwd, /*
bit6 is quad enable */
+        .unlock        = spi_disable_blockprotect_bp3_srwd,
+        .write        = spi_chip_write_256,
+        .read        = spi_chip_read,
+        .voltage    = {2300, 3600},
+    },
+
+    {
+        .vendor        = "PMC",
+        .name        = "Pm25LQ016",
+        .bustype    = BUS_SPI,
+        .manufacture_id    = PMC_ID,
+        .model_id    = PMC_PM25LQ016,
+        .total_size    = 2048,
+        .page_size    = 256,
+        /* OTP: 256B total; read 0x4B, write 0xB1 */
+        .feature_bits    = FEATURE_WRSR_WREN | FEATURE_OTP,
+        .tested        = TEST_UNTESTED,
+        .probe        = probe_spi_rdid,
+        .probe_timing    = TIMING_ZERO,
+        .block_erasers    =
+        {
+            {
+                .eraseblocks = { {4 * 1024, 512} },
+                .block_erase = spi_block_erase_20,
+            }, {
+                .eraseblocks = { {4 * 1024, 512} },
+                .block_erase = spi_block_erase_d7,
+            }, {
+                .eraseblocks = { {64 * 1024, 32} },
+                .block_erase = spi_block_erase_d8,
+            }, {
+                .eraseblocks = { {2048 * 1024, 1} },
+                .block_erase = spi_block_erase_60,
+            }, {
+                .eraseblocks = { {2048 * 1024, 1} },
+                .block_erase = spi_block_erase_c7,
+            }
+        },
+        .printlock    = spi_prettyprint_status_register_bp3_srwd, /*
bit6 is quad enable */
+        .unlock        = spi_disable_blockprotect_bp3_srwd,
+        .write        = spi_chip_write_256,
+        .read        = spi_chip_read,
+        .voltage    = {2300, 3600},
+    },
+
+    {
+        .vendor        = "PMC",
+        .name        = "Pm25LQ032C",
+        .bustype    = BUS_SPI,
+        .manufacture_id    = PMC_ID,
+        .model_id    = PMC_PM25LQ032C,
+        .total_size    = 4096,
+        .page_size    = 256,
+        /* OTP: 64B total; read 0x4B, write 0xB1 */
+        .feature_bits    = FEATURE_WRSR_WREN | FEATURE_OTP,
+        .tested        = TEST_OK_PR,
+        .probe        = probe_spi_rdid,
+        .probe_timing    = TIMING_ZERO,
+        .block_erasers    =
+        {
+            {
+                .eraseblocks = { {4 * 1024, 1024} },
+                .block_erase = spi_block_erase_20,
+            }, {
+                .eraseblocks = { {4 * 1024, 1024} },
+                .block_erase = spi_block_erase_d7,
+            }, {
+                .eraseblocks = { {64 * 1024, 64} },
+                .block_erase = spi_block_erase_d8,
+            }, {
+                .eraseblocks = { {4096 * 1024, 1} },
+                .block_erase = spi_block_erase_60,
+            }, {
+                .eraseblocks = { {4096 * 1024, 1} },
+                .block_erase = spi_block_erase_c7,
+            }
+        },
+        .printlock    = spi_prettyprint_status_register_bp3_srwd, /*
bit6 is quad enable */
+        .unlock        = spi_disable_blockprotect_bp3_srwd,
+        .write        = spi_chip_write_256,
+        .read        = spi_chip_read,
+        .voltage    = {2700, 3600},
+    },
+
+    {
+        .vendor        = "PMC",
         .name        = "Pm25LV512(A)",
         .bustype    = BUS_SPI,
         .manufacture_id    = PMC_ID_NOPREFIX,
@@ -15105,7 +15300,7 @@
         .read        = read_memmapped,
         .voltage    = {3000, 3600}, /* Also has 12V fast program */
     },
-
+
     {
         .vendor        = "Unknown",
         .name        = "SFDP-capable chip",
Index: flashchips.h
===================================================================
diff --git a/trunk/flashchips.h b/trunk/flashchips.h
--- a/trunk/flashchips.h    (revision 1889)
+++ b/trunk/flashchips.h    (working copy)
@@ -560,6 +560,11 @@
 #define PMC_PM25LD512        0x20    /* Same as Pm25LD512C, but the
latter has more locking options. */
 #define PMC_PM25LD010        0x21    /* Same as Pm25LD010C, but the
latter has more locking options. */
 #define PMC_PM25LD020        0x22    /* Same as Pm25LD020C, but the
latter has more locking options. */
+#define PMC_PM25LQ020        0x42
+#define PMC_PM25LQ040        0x43
+#define PMC_PM25LQ080        0x44
+#define PMC_PM25LQ016        0x45
+#define PMC_PM25LQ032C        0x46
 #define PMC_PM25LV512        0x7B    /* Same as Pm25LV512A */
 #define PMC_PM25LV010        0x7C    /* Same as Pm25LV010A, but the
former does not support RDID but RES3 only. */
 #define PMC_PM25LV020        0x7D




More information about the flashrom mailing list