Skip to contentSkip to conversation

pflash_cfi01: Suppress warning when Linux probes for AMD flash

PATCH Applied Stefan Weil 3 participants 4 messages Nov 24, 2012 – Jan 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pflash_cfi01: Suppress warning when Linux probes for AMD flash

There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory.

The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation:

pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0)
pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0)

These warnings confuse users, so suppress them.

---

This is strictly speaking not a bug fix, but it fixes a warning which confuses QEMU users since a long time (see previous mails on qemu-devel and bug report).

It is also safe. Therefore I think it can be applied to 1.3.

Regards
Stefan

 hw/pflash_cfi01.c |    3 +++
 1 file changed, 3 insertions(+)
hw/pflash_cfi01.c +3 -0
index 7d040b5..a4dbe19 100644
@@ -319,6 +319,9 @@ static void pflash_write(pflash_t *pfl, hwaddr offset,
             DPRINTF("%s: Write to buffer\n", __func__);
             pfl->status |= 0x80; /* Ready! */
             break;
+        case 0xf0: /* Probe for AMD flash */
+            DPRINTF("%s: Probe for AMD flash\n", __func__);
+            goto reset_flash;
         case 0xff: /* Read array mode */
             DPRINTF("%s: Read array mode\n", __func__);
             goto reset_flash;
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 8 lines · Stefan Weil

There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory.

The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation:

pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0)
pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0)

Hi Stefan,

I ever submited a similar patch to mailing list:
http://patchwork.ozlabs.org/patch/147886/

Do you have a look at that patch to see whether it's sane for the different parts between mine and yours?

Thanks,
Liming Wang

Quoted 36 lines

These warnings confuse users, so suppress them.

---

This is strictly speaking not a bug fix, but it fixes a warning which confuses QEMU users since a long time (see previous mails on qemu-devel and bug report).

It is also safe. Therefore I think it can be applied to 1.3.

Regards
Stefan

hw/pflash_cfi01.c | 3 +++

1 file changed, 3 insertions(+)
hw/pflash_cfi01.c +3 -0
index 7d040b5..a4dbe19 100644
@@ -319,6 +319,9 @@ static void pflash_write(pflash_t *pfl, hwaddr offset,
            DPRINTF("%s: Write to buffer\n", __func__);
            pfl->status |= 0x80; /* Ready! */
            break;
+        case 0xf0: /* Probe for AMD flash */
+            DPRINTF("%s: Probe for AMD flash\n", __func__);
+            goto reset_flash;
        case 0xff: /* Read array mode */
            DPRINTF("%s: Read array mode\n", __func__);
            goto reset_flash;
Signature · 1 line
1.7.10.4
#2 lore raw

Am 26.11.2012 06:31, schrieb walimis:

Quoted 11 lines · Stefan Weil
Quoted 8 lines

There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory.

The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation:

pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0)
pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0)

Hi Stefan,

Quoted 8 lines

I ever submited a similar patch to mailing list:
http://patchwork.ozlabs.org/patch/147886/

Do you have a look at that patch to see whether it's sane for the different parts between mine and yours?

Thanks,
Liming Wang

Hi,

your patch is technically identical, but I think that your commit message
ismisleading: it implies that 0xff and 0xf0 are both specified in the CFI specification for Intel flash memory (CFI 01). As far as I could see, 0xf0 is only a specified flash command sequence for AMD flash memory (CFI 02). That's why Linux uses it to detect that kind of flash memory.

If you resend your patch with a commit message and a comment in the code which explains why 0xf0 needs handling in pflash_cfi01.c, it can be committed IMHO.

Regards

Stefan

#3 lore raw
In reply to Stefan Weil
Quoted 31 lines · Stefan Weil

There are several ARM and MIPS boards which are manufactured with either Intel (pflash_cfi01.c) or AMD (pflash_cfi02.c) flash memory.

The Linux kernel supports both and first probes for AMD flash which resulted in one or two warnings from the Intel flash emulation:

pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf000f0)
pflash_write: Unimplemented flash cmd sequence (offset 0000000000000000, wcycle 0x0 cmd 0x0 value 0xf0)

These warnings confuse users, so suppress them.

---

This is strictly speaking not a bug fix, but it fixes a warning which confuses QEMU users since a long time (see previous mails on qemu-devel and bug report).

It is also safe. Therefore I think it can be applied to 1.3.

Regards
Stefan

 hw/pflash_cfi01.c |    3 +++
 1 file changed, 3 insertions(+)
hw/pflash_cfi01.c +0 -0
index 7d040b5..a4dbe19 100644

hw/pflash_cfi01.c static void pflash_write(pflash_t *pfl, hwaddr offset, · line 327

Quoted 9 lines
hw/pflash_cfi01.c +3 -0
@@ -319,6 +319,9 @@ static void pflash_write(pflash_t *pfl, hwaddr offset,
             DPRINTF("%s: Write to buffer\n", __func__);
             pfl->status |= 0x80; /* Ready! */
             break;
+        case 0xf0: /* Probe for AMD flash */
+            DPRINTF("%s: Probe for AMD flash\n", __func__);
+            goto reset_flash;
         case 0xff: /* Read array mode */
             DPRINTF("%s: Read array mode\n", __func__);
             goto reset_flash;

Thanks, applied.

Signature · 2 lines
Aurelien Jarno                          GPG: 1024D/F1BCDB73
[email protected]                 http://www.aurel32.net