Skip to contentSkip to conversation

mtd: spi-nor: Add support for BoHong bh25q128as

PATCH In review David Bauer 4 participants 13 messages May 9, 2021 – Jul 3, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mtd: spi-nor: Add support for BoHong bh25q128as

Add MTD support for the BoHong bh25q128as SPI NOR chip. The chip has 16MB of total capacity, divided into a total of 256 sectors, each 64KB sized. The chip also supports 4KB sectors. Additionally, it supports dual and quad read modes.

Functionality was verified on an Tenbay WR1800K / MTK MT7621 board.

---
 drivers/mtd/spi-nor/Makefile |  1 +
 drivers/mtd/spi-nor/bohong.c | 21 +++++++++++++++++++++
 drivers/mtd/spi-nor/core.c   |  1 +
 drivers/mtd/spi-nor/core.h   |  1 +
 4 files changed, 24 insertions(+)
 create mode 100644 drivers/mtd/spi-nor/bohong.c
drivers/mtd/spi-nor/Makefile +1 -0
index 653923896205..de0b2d3bcb1c 100644
@@ -2,6 +2,7 @@
 
 spi-nor-objs			:= core.o sfdp.o
 spi-nor-objs			+= atmel.o
+spi-nor-objs			+= bohong.o
 spi-nor-objs			+= catalyst.o
 spi-nor-objs			+= eon.o
 spi-nor-objs			+= esmt.o
drivers/mtd/spi-nor/bohong.c new file +21 -0
new file mode 100644
index 000000000000..20aeceb1b2d1
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2005, Intec Automation Inc.
+ * Copyright (C) 2014, Freescale Semiconductor, Inc.
+ */
+
+#include <linux/mtd/spi-nor.h>
+
+#include "core.h"
+
+static const struct flash_info bohong_parts[] = {
+	/* BoHong Microelectronics */
+	{ "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
+			    SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+};
+
+const struct spi_nor_manufacturer spi_nor_bohong = {
+	.name = "bohong",
+	.parts = bohong_parts,
+	.nparts = ARRAY_SIZE(bohong_parts),
+};
drivers/mtd/spi-nor/core.c +1 -0
index 0522304f52fa..03a05bce6231 100644
@@ -2199,6 +2199,7 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor)
 
 static const struct spi_nor_manufacturer *manufacturers[] = {
 	&spi_nor_atmel,
+	&spi_nor_bohong,
 	&spi_nor_catalyst,
 	&spi_nor_eon,
 	&spi_nor_esmt,
drivers/mtd/spi-nor/core.h +1 -0
index 4a3f7f150b5d..b71323317235 100644
@@ -409,6 +409,7 @@ struct spi_nor_manufacturer {
 
 /* Manufacturer drivers. */
 extern const struct spi_nor_manufacturer spi_nor_atmel;
+extern const struct spi_nor_manufacturer spi_nor_bohong;
 extern const struct spi_nor_manufacturer spi_nor_catalyst;
 extern const struct spi_nor_manufacturer spi_nor_eon;
 extern const struct spi_nor_manufacturer spi_nor_esmt;
Signature · 6 lines
2.31.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#1 lore raw

Hi David,

Am 2021-05-09 16:47, schrieb David Bauer:

Quoted 34 lines

Add MTD support for the BoHong bh25q128as SPI NOR chip. The chip has 16MB of total capacity, divided into a total of 256 sectors, each 64KB sized. The chip also supports 4KB sectors. Additionally, it supports dual and quad read modes.

Functionality was verified on an Tenbay WR1800K / MTK MT7621 board.

---
 drivers/mtd/spi-nor/Makefile |  1 +
 drivers/mtd/spi-nor/bohong.c | 21 +++++++++++++++++++++
 drivers/mtd/spi-nor/core.c   |  1 +
 drivers/mtd/spi-nor/core.h   |  1 +
 4 files changed, 24 insertions(+)
 create mode 100644 drivers/mtd/spi-nor/bohong.c
drivers/mtd/spi-nor/Makefile +1 -0
index 653923896205..de0b2d3bcb1c 100644
@@ -2,6 +2,7 @@
 
 spi-nor-objs			:= core.o sfdp.o
 spi-nor-objs			+= atmel.o
+spi-nor-objs			+= bohong.o
 spi-nor-objs			+= catalyst.o
 spi-nor-objs			+= eon.o
 spi-nor-objs			+= esmt.o
drivers/mtd/spi-nor/bohong.c new file +0 -0
new file mode 100644
index 000000000000..20aeceb1b2d1

drivers/mtd/spi-nor/bohong.c line 4

Quoted 4 lines
drivers/mtd/spi-nor/bohong.c new file +4 -0
@@ -0,0 +1,21 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (C) 2005, Intec Automation Inc.
+ * Copyright (C) 2014, Freescale Semiconductor, Inc.

I guess this could be dropped. There is no much left from these in this file.

drivers/mtd/spi-nor/bohong.c line 13

Quoted 9 lines
drivers/mtd/spi-nor/bohong.c new file +9 -0
+ */
+
+#include <linux/mtd/spi-nor.h>
+
+#include "core.h"
+
+static const struct flash_info bohong_parts[] = {
+	/* BoHong Microelectronics */
+	{ "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

See also:
https://lkml.org/lkml/2021/2/7/223
https://www.spinics.net/lists/kernel/msg3808260.html

Quoted 33 lines
drivers/mtd/spi-nor/bohong.c new file +8 -0
+			    SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },
+};
+
+const struct spi_nor_manufacturer spi_nor_bohong = {
+	.name = "bohong",
+	.parts = bohong_parts,
+	.nparts = ARRAY_SIZE(bohong_parts),
+};
drivers/mtd/spi-nor/core.c +1 -0
index 0522304f52fa..03a05bce6231 100644
@@ -2199,6 +2199,7 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor 
 *nor)
 
 static const struct spi_nor_manufacturer *manufacturers[] = {
 	&spi_nor_atmel,
+	&spi_nor_bohong,
 	&spi_nor_catalyst,
 	&spi_nor_eon,
drivers/mtd/spi-nor/core.c +0 -0
 	&spi_nor_esmt,
drivers/mtd/spi-nor/core.h +1 -0
index 4a3f7f150b5d..b71323317235 100644
@@ -409,6 +409,7 @@ struct spi_nor_manufacturer {
 
 /* Manufacturer drivers. */
 extern const struct spi_nor_manufacturer spi_nor_atmel;
+extern const struct spi_nor_manufacturer spi_nor_bohong;
 extern const struct spi_nor_manufacturer spi_nor_catalyst;
 extern const struct spi_nor_manufacturer spi_nor_eon;
 extern const struct spi_nor_manufacturer spi_nor_esmt;
Signature · 5 lines
-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
#2 lore raw

Hi Michael,

thanks for your review.

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I? The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Best
David

Quoted 31 lines

See also:
https://lkml.org/lkml/2021/2/7/223
https://www.spinics.net/lists/kernel/msg3808260.html

Quoted 26 lines

+                SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) },

drivers/mtd/spi-nor/bohong.c new file +7 -0
+};
+
+const struct spi_nor_manufacturer spi_nor_bohong = {
+    .name = "bohong",
+    .parts = bohong_parts,
+    .nparts = ARRAY_SIZE(bohong_parts),
+};
drivers/mtd/spi-nor/core.c +1 -0
index 0522304f52fa..03a05bce6231 100644
@@ -2199,6 +2199,7 @@ int spi_nor_sr2_bit7_quad_enable(struct spi_nor *nor)
 
  static const struct spi_nor_manufacturer *manufacturers[] = {
      &spi_nor_atmel,
+    &spi_nor_bohong,
      &spi_nor_catalyst,
      &spi_nor_eon,
      &spi_nor_esmt,
drivers/mtd/spi-nor/core.h +0 -0
index 4a3f7f150b5d..b71323317235 100644
@@ -409,6 +409,7 @@ struct spi_nor_manufacturer {
 
Quoted 7 lines

drivers/mtd/spi-nor/core.h struct spi_nor_manufacturer { · line 415

Quoted 6 lines
drivers/mtd/spi-nor/core.h +1 -0
  /* Manufacturer drivers. */
  extern const struct spi_nor_manufacturer spi_nor_atmel;
+extern const struct spi_nor_manufacturer spi_nor_bohong;
  extern const struct spi_nor_manufacturer spi_nor_catalyst;
  extern const struct spi_nor_manufacturer spi_nor_eon;
  extern const struct spi_nor_manufacturer spi_nor_esmt;

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#3 lore raw

Hi David,

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

We still need to come up with a solution for this problem.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#4 lore raw

Hi Michael,

Quoted 27 lines · Michael Walle

Hi David,

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

Quoted 7 lines

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

Best
David

Quoted 4 lines

We still need to come up with a solution for this problem.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#5 lore raw

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 31 lines · Michael Walle
Quoted 30 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Quoted 7 lines
Quoted 2 lines

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Quoted 8 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

Quoted 6 lines

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

There is another problem: shared device ids per vendor. Some (most?) flash vendor share device ids on "similar" flashes, which we still need tell apart in the kernel. So technically, this is the same problem as with non-existing continuation bytes. Two different flashes sharing the same id. For now, we look for differences in the SFDP.

Right now, the flash is probed first by its id and the the SFDP is read and parsed. There are ideas to first read the SFDP. Having this might come in handy here, too. Eg. we could fingerprint the flash by its SFDP.

I know Vingesh is working on the continuation bytes stuff. So I might be late to the party ;)

Regarding the device tree compatibles, the maintainers doesn't like that very much. Maybe as a last resort method.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#6 lore raw

Hi Michael,

Quoted 35 lines · Michael Walle

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 14 lines
Quoted 14 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

Quoted 5 lines
Quoted 1 line

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Okay, I'll resend a v2 with the removed copyright then.

Quoted 11 lines

There is another problem: shared device ids per vendor. Some (most?) flash vendor share device ids on "similar" flashes, which we still need tell apart in the kernel. So technically, this is the same problem as with non-existing continuation bytes. Two different flashes sharing the same id. For now, we look for differences in the SFDP.

Right now, the flash is probed first by its id and the the SFDP is read and parsed. There are ideas to first read the SFDP. Having this might come in handy here, too. Eg. we could fingerprint the flash by its SFDP.

I was also thinking about that and we're also already bitten by identical JEDEC IDs for different models. It's really a pity that there is no real unique model identifier for us to use, which is not hacked to support legacy implementations like with this chip :(

Best
David

Quoted 8 lines

I know Vingesh is working on the continuation bytes stuff. So I might be late to the party ;)

Regarding the device tree compatibles, the maintainers doesn't like that very much. Maybe as a last resort method.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#7 lore raw

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 60 lines · Michael Walle
Quoted 35 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 14 lines
Quoted 14 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that along with the patch and if this in some way regarded as copyrighted material. So feel free to send it to me privately. I'm starting to build a database.

Quoted 11 lines
Quoted 10 lines

There is another problem: shared device ids per vendor. Some (most?) flash vendor share device ids on "similar" flashes, which we still need tell apart in the kernel. So technically, this is the same problem as with non-existing continuation bytes. Two different flashes sharing the same id. For now, we look for differences in the SFDP.

Right now, the flash is probed first by its id and the the SFDP is read and parsed. There are ideas to first read the SFDP. Having this might come in handy here, too. Eg. we could fingerprint the flash by its SFDP.

Quoted 4 lines

I was also thinking about that and we're also already bitten by identical JEDEC IDs for different models. It's really a pity that there is no real unique model identifier for us to use, which is not hacked to support legacy implementations like with this chip :(

Unfortunately, they aren't legacy and new chips still have this behavior..

-michael

[1] https://lore.kernel.org/linux-mtd/[email protected]/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#8 lore raw

Hi Michael,

Sorry for the late reply, was not feeling well past week.

Quoted 69 lines · Michael Walle

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 66 lines · Michael Walle
Quoted 35 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines
Quoted 3 lines

+static const struct flash_info bohong_parts[] = { +    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 19 lines
Quoted 9 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

Quoted 6 lines

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Quoted 7 lines
Quoted 1 line

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that along with the patch and if this in some way regarded as copyrighted material. So feel free to send it to me privately. I'm starting to build a database.

Bad news, I'm not able to get a SFDP with your patches, as the SFDP extraction fails at the version check.

Is there anything else I can try?

Best
David

Quoted 17 lines
Quoted 12 lines
Quoted 11 lines

There is another problem: shared device ids per vendor. Some (most?) flash vendor share device ids on "similar" flashes, which we still need tell apart in the kernel. So technically, this is the same problem as with non-existing continuation bytes. Two different flashes sharing the same id. For now, we look for differences in the SFDP.

Right now, the flash is probed first by its id and the the SFDP is read and parsed. There are ideas to first read the SFDP. Having this might come in handy here, too. Eg. we could fingerprint the flash by its SFDP.

Quoted 4 lines

I was also thinking about that and we're also already bitten by identical JEDEC IDs for different models. It's really a pity that there is no real unique model identifier for us to use, which is not hacked to support legacy implementations like with this chip :(

Quoted 6 lines

Unfortunately, they aren't legacy and new chips still have this behavior..

-michael

[1] https://lore.kernel.org/linux-mtd/[email protected]/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#9 lore raw
Quoted 84 lines · David Bauer

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi Michael,

Sorry for the late reply, was not feeling well past week.

Quoted 69 lines · Michael Walle

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 66 lines · Michael Walle
Quoted 35 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+static const struct flash_info bohong_parts[] = {
+    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 19 lines
Quoted 9 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

Quoted 6 lines

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Quoted 7 lines
Quoted 1 line

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that along with the patch and if this in some way regarded as copyrighted material. So feel free to send it to me privately. I'm starting to build a database.

Quoted 5 lines

Bad news, I'm not able to get a SFDP with your patches, as the SFDP extraction fails at the version check.

Is there anything else I can try?

So no SFDP data?
Have you tried to read more of ID bytes, maybe there's an extended ID? Please dump 15 bytes of ID.
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#10 lore raw
Quoted 90 lines · On 6/28/21 8:48 AM, [email protected] wrote:

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 87 lines · David Bauer

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi Michael,

Sorry for the late reply, was not feeling well past week.

Quoted 69 lines · Michael Walle

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 66 lines · Michael Walle
Quoted 35 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+static const struct flash_info bohong_parts[] = {
+    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 19 lines
Quoted 9 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

Quoted 6 lines

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Quoted 7 lines
Quoted 1 line

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that along with the patch and if this in some way regarded as copyrighted material. So feel free to send it to me privately. I'm starting to build a database.

Bad news, I'm not able to get a SFDP with your patches, as the SFDP extraction fails at the version check.

Quoted 6 lines
Quoted 2 lines

Is there anything else I can try?

So no SFDP data?
Have you tried to read more of ID bytes, maybe there's an extended ID? Please dump 15 bytes of ID.

what's the difference between by25q128as and bh25q128as? I see they share the same flash ID.

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#11 lore raw

Hi Tudor,

Quoted 94 lines · [email protected] writes:
Quoted 93 lines · On 6/28/21 8:48 AM, [email protected] wrote:

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Quoted 89 lines · David Bauer

EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe

Hi Michael,

Sorry for the late reply, was not feeling well past week.

Quoted 69 lines · Michael Walle

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 66 lines · Michael Walle
Quoted 35 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 34 lines · Michael Walle
Quoted 32 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 17 lines

On 5/10/21 10:00 AM, Michael Walle wrote

[...]

Quoted 4 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+static const struct flash_info bohong_parts[] = {
+    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,
Quoted 8 lines

I couldn't find "BoHong" in JEP106BC. 0x68 (without continuation codes) is "Convex Computer". So this is wrong. OTOH I'm not sure, how many SPI flashes "convex computer" have, if any ;) This company was brought by HP in the end.

In any case, this patch depends on how we handle continuation codes or if we can handle them at all. Or if this flash just lie about its manufacturer id and don't and CC.

Quoted 6 lines

First of all, BoHong and Boya microelectronics seems to be the same company, as their datasheets seem to copy each other. There's not much information about either of both, so I'd say that's a fair assumption.

Regarding the continuation codes, Boya is listed in bank nine, however in this case I should currently read an all 0x7f ID shouldn't I?

I'd guess so, yes.

Quoted 2 lines

The datasheet also only specifies 3 bytes as a return value for register 0x9fh :(

Yeah. So, this flash falls into the same category "simply hijacks a manuf id" as all the other flashes.

Quoted 7 lines
Quoted 4 lines

From a quick check, this is also be the case for GigaDevices and XMC.

My spontaneous idea would be to extend support for JEDEC IDs to read the up to 9 banks of the vendor ID and fix up the existing offenders.

you mean gigadevices and xmc? I'd presume they are also lacking the continuation bytes.

Correct, same story with them.

Quoted 19 lines
Quoted 9 lines

To not break existing boards, we could either skip the continuation bytes of the kernel ID definitions for all flash chips or flag the already existing ones and only perform this on such flagged chips.

Personally, I'd say that only performing this on existing chips would be better, as new vendors with this violation scheme might probably appear and cause conflicts.

Quoted 6 lines

As we still lack auto detection for new chips with that, configuring the flash chip used with the chip name via DT would allow to set the exact chip used and also validate if the manufacturer / product after the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just go ahead and add them as is. If there is a conflict we'd need to find a per device resolution for it.

Quoted 7 lines
Quoted 1 line

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that along with the patch and if this in some way regarded as copyrighted material. So feel free to send it to me privately. I'm starting to build a database.

Bad news, I'm not able to get a SFDP with your patches, as the SFDP extraction fails at the version check.

Is there anything else I can try?

Quoted 7 lines
Quoted 3 lines

So no SFDP data?
Have you tried to read more of ID bytes, maybe there's an extended ID? Please dump 15 bytes of ID.

what's the difference between by25q128as and bh25q128as? I see they share the same flash ID.

I've got the by25q128as, so I compiled the SFDP and sysfs patch kernel to read it out.

figgyc@figgyc-pi:~ $ ls /sys/class/spi_master/spi0/spi0.0/spi-nor/ jedec_id manufacturer partname

$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/jedec_id
684018
$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/manufacturer
boya
$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/partname
by25q128as
(this is using my patch for the chip support)

There was no sfdp file for me either, failed the version check like David's chip (I added a dev_dbg to check).

One thing I noticed reading the datasheet[1] again was this line:
"Security Register 0 can be used to store the Flash Discoverable Parameters, The feature is upon special order, please contact Boya Microelectronics for details."
The same line is also present in the BoHong datasheet but it says HuaHong instead of Boya. That makes me wonder if the meaning of "Discoverable Parameters (SFDP) register" in the datasheet does not actually mean that it has SFDP data programmed in by default, which would be quite strange, but if true then that would be quite annoying because then I don't think there are any differences between Boya and BoHong. Very strange design decision in my opinion but it is what it is.

The only other explanation I could think of is that erasing the chip might erase security register 0? Unfortunately I only have one chip so I can't test that. Even if that were the case it would still be unhelpful.

I dumped extra ID in a previous email thread, IIRC it just loops, no extra 7f bytes like there should be.

In conclusion it seems to me as though the two chips behave identically, there's probably no way to know for certain though without asking the manufacturer.

[1] http://www.bmsemi.com/upload/file/20180425/15246261557309416.pdf

Quoted 3 lines

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

#12 lore raw

Am 3. Juli 2021 17:58:57 MESZ schrieb George Brooke <[email protected]>:

Quoted 152 lines

Hi Tudor,

Quoted 2 lines · [email protected] writes:
Quoted 1 line · On 6/28/21 8:48 AM, [email protected] wrote:

EXTERNAL EMAIL: Do not click links or open attachments unless you

know the content is safe

Quoted 3 lines
Quoted 3 lines · David Bauer
Quoted 1 line

EXTERNAL EMAIL: Do not click links or open attachments unless you

know the content is safe

Quoted 15 lines
Quoted 15 lines
Quoted 15 lines

Hi Michael,

Sorry for the late reply, was not feeling well past week.

Quoted 9 lines · Michael Walle

Hi David,

Am 2021-05-10 13:04, schrieb David Bauer:

Quoted 6 lines · Michael Walle
Quoted 5 lines

Am 2021-05-10 12:27, schrieb David Bauer:

Quoted 4 lines · Michael Walle
Quoted 3 lines

Am 2021-05-10 11:28, schrieb David Bauer:

Quoted 2 lines

On 5/10/21 10:00 AM, Michael Walle wrote

Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

[...]

Quoted 5 lines

Review

Quoted 3 lines
(quoted diff) +3 -0
+static const struct flash_info bohong_parts[] = {
+    /* BoHong Microelectronics */
+    { "bh25q128as", INFO(0x684018, 0, 64 * 1024, 256,

I couldn't find "BoHong" in JEP106BC. 0x68 (without

continuation codes)

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

is "Convex Computer". So this is wrong. OTOH I'm not sure,

how many

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

SPI flashes "convex computer" have, if any ;) This company

was brought

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

by HP in the end.

In any case, this patch depends on how we handle

continuation codes or

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

if we can handle them at all. Or if this flash just lie

about its

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

manufacturer id and don't and CC.

First of all, BoHong and Boya microelectronics seems to be

the same

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

company, as their datasheets seem to copy each other. There's

not much

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

information about either of both, so I'd say that's a fair

assumption.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Regarding the continuation codes, Boya is listed in bank

nine, however

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

in this case I should currently read an all 0x7f ID shouldn't

I?

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines

I'd guess so, yes.

Quoted 1 line

The datasheet also only specifies 3 bytes as a return value

for

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

register 0x9fh :(

Yeah. So, this flash falls into the same category "simply

hijacks

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 1 line

a manuf id" as all the other flashes.

From a quick check, this is also be the case for GigaDevices

and XMC.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

My spontaneous idea would be to extend support for JEDEC IDs to

read

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the up to 9 banks of the vendor ID and fix up the existing

offenders.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

you mean gigadevices and xmc? I'd presume they are also lacking

the

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 1 line

continuation bytes.

Correct, same story with them.

Quoted 2 lines
Quoted 2 lines

To not break existing boards, we could either skip the

continuation

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

bytes of the kernel ID definitions for all flash chips or flag

the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

already existing ones and only perform this on such flagged

chips.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Personally, I'd say that only performing this on existing chips

would

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

be better, as new vendors with this violation scheme might

probably

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

appear and cause conflicts.

As we still lack auto detection for new chips with that,

configuring

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

the flash chip used with the chip name via DT would allow to

set the

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

exact chip used and also validate if the manufacturer / product

after

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 3 lines

the continuation bits matches the one read from the chip.

What do you think?

If you'd ask me, unless there is a real world conflict, I'd just

go

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

ahead and add them as is. If there is a conflict we'd need to

find

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 3 lines
Quoted 1 line

a per device resolution for it.

Okay, I'll resend a v2 with the removed copyright then.

Could you also apply my SFDP patch [1] and send the dump (if there is any)? Unfortunately, I can't think of a good way to do that

along

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

with the patch and if this in some way regarded as copyrighted

material.

Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
Quoted 2 lines

So feel free to send it to me privately. I'm starting to build a database.

Bad news, I'm not able to get a SFDP with your patches, as the SFDP

extraction

Quoted 7 lines
Quoted 7 lines
Quoted 4 lines

fails at the version check.

Is there anything else I can try?

So no SFDP data?
Have you tried to read more of ID bytes, maybe there's an extended

ID? Please

Quoted 3 lines
Quoted 1 line

dump 15 bytes of ID.

what's the difference between by25q128as and bh25q128as? I see they

share the

Quoted 2 lines

same flash ID.

I've got the by25q128as, so I compiled the SFDP and sysfs patch kernel to read it out.

figgyc@figgyc-pi:~ $ ls /sys/class/spi_master/spi0/spi0.0/spi-nor/ jedec_id manufacturer partname

$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/jedec_id
684018
$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/manufacturer
boya
$ cat /sys/class/spi_master/spi0/spi0.0/spi-nor/partname
by25q128as
(this is using my patch for the chip support)
Quoted 2 lines

There was no sfdp file for me either, failed the version check like David's chip (I added a dev_dbg to check).

Then it seems it doesn't have SFDP.

Quoted 4 lines

One thing I noticed reading the datasheet[1] again was this line:
"Security Register 0 can be used to store the Flash Discoverable Parameters, The feature is upon special order, please contact Boya Microelectronics for details."

Quoted 8 lines

The same line is also present in the BoHong datasheet but it says HuaHong instead of Boya. That makes me wonder if the meaning of "Discoverable Parameters (SFDP) register" in the datasheet does not actually mean that it has SFDP data programmed in by default, which would be quite strange, but if true then that would be quite annoying because then I don't think there are any differences between Boya and BoHong. Very strange design decision in my opinion but it is what it is.

I'd say it is exactly this. There is no SFDP. only on "special request", I guess that means "we were too lazy and if there is a client big enough we'll do it".

Quoted 4 lines

The only other explanation I could think of is that erasing the chip might erase security register 0? Unfortunately I only have one chip so I can't test that. Even if that were the case it would still be unhelpful.

There should be a special command to erase security registers, aka OTP. Winbond does the same, just return the first security register content if you send a RDSFDP. Just that it's programmed by default and the data sheet doesn't mention security register 0 (and treat it as reserved).

-michael

Quoted 12 lines

I dumped extra ID in a previous email thread, IIRC it just loops, no extra 7f bytes like there should be.

In conclusion it seems to me as though the two chips behave identically, there's probably no way to know for certain though without asking the manufacturer.

[1] http://www.bmsemi.com/upload/file/20180425/15246261557309416.pdf

Quoted 3 lines

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/