linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
@ 2022-05-01 18:55 Biju Das
  2022-05-02 11:29 ` Michael Walle
  0 siblings, 1 reply; 7+ messages in thread
From: Biju Das @ 2022-05-01 18:55 UTC (permalink / raw)
  To: Tudor Ambarus, Pratyush Yadav, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra
  Cc: Biju Das, Michael Walle, linux-mtd, Geert Uytterhoeven,
	Chris Paterson, Biju Das, Prabhakar Mahadev Lad,
	linux-renesas-soc

Add support for Renesas AT25QL128A serial nor flash.
Details of flash chip can be found here [1]

[1] https://www.dialog-semiconductor.com/sites/default/files/2022-04/DS-AT25QL128A-129F-022022.pdf

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
---
Hi All,
 AT25QL128A serial nor flash is connected to RZ/G2UL SMARC EVK.
But with the current mtd support in mainline, I get the below error
[    3.928906] spi-nor spi1.0: unrecognized JEDEC id bytes: 1f 42 18 1f 42 18
[    3.937312] spi-nor: probe of spi1.0 failed with error -2

Then, I created a patch and the issue gone, It can detect the flash
[    3.937168] spi-nor spi1.0: at25ql128a (16384 Kbytes)
[    3.942902] 2 fixed-partitions partitions found on MTD device spi1.0
[    3.949459] Creating 2 MTD partitions on "spi1.0":
[    3.957540] 0x000000000000-0x000000200000 : "boot"
[    3.973740] 0x000000200000-0x000001000000 : "user"


Able to do read/write/format the partition with this patch.
So please provide your feedback on this patch.

&sbc {
	pinctrl-0 = <&qspi0_pins>;
	pinctrl-names = "default";
	status = "okay";

	flash@0 {
		compatible = "jedec,spi-nor";
		reg = <0>;
		spi-max-frequency = <50000000>;
		spi-tx-bus-width = <1>;
		spi-rx-bus-width = <4>;

		spi-cpol;
		spi-cpha;
		m25p,fast-read;

		partitions {
			compatible = "fixed-partitions";
			#address-cells = <1>;
			#size-cells = <1>;

			boot@0 {
				reg = <0x00000000 0x200000>;
				read-only;
			};
			user@200000 {
				reg = <0x200000 0xE00000>;
			};
		};
	};
};
---
 drivers/mtd/spi-nor/Makefile  |  1 +
 drivers/mtd/spi-nor/core.c    |  1 +
 drivers/mtd/spi-nor/core.h    |  1 +
 drivers/mtd/spi-nor/renesas.c | 57 +++++++++++++++++++++++++++++++++++
 4 files changed, 60 insertions(+)
 create mode 100644 drivers/mtd/spi-nor/renesas.c

diff --git a/drivers/mtd/spi-nor/Makefile b/drivers/mtd/spi-nor/Makefile
index 6b904e439372..2c2fce8e6132 100644
--- a/drivers/mtd/spi-nor/Makefile
+++ b/drivers/mtd/spi-nor/Makefile
@@ -12,6 +12,7 @@ spi-nor-objs			+= intel.o
 spi-nor-objs			+= issi.o
 spi-nor-objs			+= macronix.o
 spi-nor-objs			+= micron-st.o
+spi-nor-objs			+= renesas.o
 spi-nor-objs			+= spansion.o
 spi-nor-objs			+= sst.o
 spi-nor-objs			+= winbond.o
diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c
index b4f141ad9c9c..ba9f222da00b 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -1621,6 +1621,7 @@ static const struct spi_nor_manufacturer *manufacturers[] = {
 	&spi_nor_issi,
 	&spi_nor_macronix,
 	&spi_nor_micron,
+	&spi_nor_renesas,
 	&spi_nor_st,
 	&spi_nor_spansion,
 	&spi_nor_sst,
diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index b7fd760e3b47..3d2e39329079 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -511,6 +511,7 @@ extern const struct spi_nor_manufacturer spi_nor_intel;
 extern const struct spi_nor_manufacturer spi_nor_issi;
 extern const struct spi_nor_manufacturer spi_nor_macronix;
 extern const struct spi_nor_manufacturer spi_nor_micron;
+extern const struct spi_nor_manufacturer spi_nor_renesas;
 extern const struct spi_nor_manufacturer spi_nor_st;
 extern const struct spi_nor_manufacturer spi_nor_spansion;
 extern const struct spi_nor_manufacturer spi_nor_sst;
diff --git a/drivers/mtd/spi-nor/renesas.c b/drivers/mtd/spi-nor/renesas.c
new file mode 100644
index 000000000000..091542c8c088
--- /dev/null
+++ b/drivers/mtd/spi-nor/renesas.c
@@ -0,0 +1,57 @@
+// 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 renesas_nor_parts[] = {
+	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) },
+};
+
+/**
+ * renesas_nor_set_4byte_addr_mode() - Set 4-byte address mode for Renesas
+ * flashes.
+ * @nor:	pointer to 'struct spi_nor'.
+ * @enable:	true to enter the 4-byte address mode, false to exit the 4-byte
+ *		address mode.
+ *
+ * Return: 0 on success, -errno otherwise.
+ */
+static int renesas_nor_set_4byte_addr_mode(struct spi_nor *nor, bool enable)
+{
+	int ret;
+
+	ret = spi_nor_write_enable(nor);
+	if (ret)
+		return ret;
+
+	ret = spi_nor_set_4byte_addr_mode(nor, enable);
+	if (ret)
+		return ret;
+
+	return spi_nor_write_disable(nor);
+}
+
+static void renesas_nor_default_init(struct spi_nor *nor)
+{
+	nor->flags |= SNOR_F_HAS_LOCK;
+	nor->flags &= ~SNOR_F_HAS_16BIT_SR;
+	nor->params->quad_enable = NULL;
+	nor->params->set_4byte_addr_mode = renesas_nor_set_4byte_addr_mode;
+}
+
+static const struct spi_nor_fixups renesas_nor_fixups = {
+	.default_init = renesas_nor_default_init,
+};
+
+const struct spi_nor_manufacturer spi_nor_renesas = {
+	.name = "renesas",
+	.parts = renesas_nor_parts,
+	.nparts = ARRAY_SIZE(renesas_nor_parts),
+	.fixups = &renesas_nor_fixups,
+};
-- 
2.25.1


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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-01 18:55 [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash Biju Das
@ 2022-05-02 11:29 ` Michael Walle
  2022-05-02 11:49   ` Michael Walle
  2022-05-02 12:57   ` Biju Das
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Walle @ 2022-05-02 11:29 UTC (permalink / raw)
  To: biju.das.jz
  Cc: Chris.Paterson2, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, michael, miquel.raynal, p.yadav,
	prabhakar.mahadev-lad.rj, richard, tudor.ambarus, vigneshr

>  drivers/mtd/spi-nor/Makefile  |  1 +
>  drivers/mtd/spi-nor/core.c    |  1 +
>  drivers/mtd/spi-nor/core.h    |  1 +
>  drivers/mtd/spi-nor/renesas.c | 57 +++++++++++++++++++++++++++++++++++

Please put the flash in atmel.c. There are all the Atmel/Adesto/now Renesas
flashes.

> +static const struct flash_info renesas_nor_parts[] = {
> +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
> +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) },
> +};

I suppose this flash supports SFDP. Therefore,
	{ "at25ql128a", PARSE_SFDP },
should be enough.

I see that the 0x1f42xx IDs are also used for the at25sl series.
Could you shed some light to what the differences are? Are they
compatible, do we have to distiguish between them?

Last, for a new flash submission we require a SFDP dump. See [1].

[1] https://lore.kernel.org/linux-mtd/4304e19f3399a0a6e856119d01ccabe0@walle.cc/

> +static void renesas_nor_default_init(struct spi_nor *nor)
> +{
> +	nor->flags |= SNOR_F_HAS_LOCK;

Did you test locking?

-michael

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-02 11:29 ` Michael Walle
@ 2022-05-02 11:49   ` Michael Walle
  2022-05-02 12:57   ` Biju Das
  1 sibling, 0 replies; 7+ messages in thread
From: Michael Walle @ 2022-05-02 11:49 UTC (permalink / raw)
  To: biju.das.jz
  Cc: Chris.Paterson2, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, miquel.raynal, p.yadav,
	prabhakar.mahadev-lad.rj, richard, tudor.ambarus, vigneshr

Am 2022-05-02 13:29, schrieb Michael Walle:
>>  drivers/mtd/spi-nor/Makefile  |  1 +
>>  drivers/mtd/spi-nor/core.c    |  1 +
>>  drivers/mtd/spi-nor/core.h    |  1 +
>>  drivers/mtd/spi-nor/renesas.c | 57 
>> +++++++++++++++++++++++++++++++++++
> 
> Please put the flash in atmel.c. There are all the Atmel/Adesto/now 
> Renesas
> flashes.
> 
>> +static const struct flash_info renesas_nor_parts[] = {
>> +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
>> +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) },
>> +};
> 
> I suppose this flash supports SFDP. Therefore,
> 	{ "at25ql128a", PARSE_SFDP },

The id is missing. Sorry. Seems like we need a new macro.

#define SNOR_ID3(_jedec_id) \
     .id = { \
         ((_jedec_id) >> 16) & 0xff, \
          ((_jedec_id) >> 8) & 0xff, \
           (_jedec_id) & 0xff, \
     } \
     .id_len = 3,

Then it would be
	{ "at25ql128a", SNOR_ID3(0x1f4218) PARSE_SFDP },

Now we'll get bitten by that missing comma (or the additional
comma in the defines).. I'd love to see that one removed, so
we can have the usual declarations:
	{ "at25ql128a", SNOR_ID3(0x1f4218), PARSE_SFDP },

Also it might make sense to have the PARSE_SFDP in the
SNOR_ID3() macro, because without SFDP, that macro cannot
be used. Tudor, Pratyush, what do you think about:

#define SNOR_ID3(_jedec_id) \
     .id = { \
         ((_jedec_id) >> 16) & 0xff, \
          ((_jedec_id) >> 8) & 0xff, \
           (_jedec_id) & 0xff, \
     } \
     .id_len = 3, \
     .parse_sfdp = true


-michael

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-02 11:29 ` Michael Walle
  2022-05-02 11:49   ` Michael Walle
@ 2022-05-02 12:57   ` Biju Das
  2022-05-02 13:10     ` Biju Das
  1 sibling, 1 reply; 7+ messages in thread
From: Biju Das @ 2022-05-02 12:57 UTC (permalink / raw)
  To: Michael Walle
  Cc: Chris Paterson, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, miquel.raynal, p.yadav, Prabhakar Mahadev Lad,
	richard, tudor.ambarus, vigneshr

Hi Michael Walle,

Thanks for the feedback.

> Subject: Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
> 
> >  drivers/mtd/spi-nor/Makefile  |  1 +
> >  drivers/mtd/spi-nor/core.c    |  1 +
> >  drivers/mtd/spi-nor/core.h    |  1 +
> >  drivers/mtd/spi-nor/renesas.c | 57
> > +++++++++++++++++++++++++++++++++++
> 
> Please put the flash in atmel.c. There are all the Atmel/Adesto/now
> Renesas flashes.

OK.

> 
> > +static const struct flash_info renesas_nor_parts[] = {
> > +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
> > +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) }, };
> 
> I suppose this flash supports SFDP. Therefore,
> 	{ "at25ql128a", PARSE_SFDP },
> should be enough.

OK. I see some changes related to this in your next mail.

> 
> I see that the 0x1f42xx IDs are also used for the at25sl series.
> Could you shed some light to what the differences are? Are they
> compatible, do we have to distiguish between them?
> 
> Last, for a new flash submission we require a SFDP dump. See [1].
> 
> [1]

Please find the output, I did n't have xxd installed on my rootFS, so used hexdump.

root@smarc-rzg2ul:~# hexdump /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp
0000000 4653 5044 0106 ff01 0600 1001 0030 ff00
0000010 001f 0201 0080 0100 ffff ffff ffff ffff
0000020 ffff ffff ffff ffff ffff ffff ffff ffff
0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb80
0000040 fffe ffff ffff ff00 ffff eb42 200c 520f
0000050 d810 ff00 6233 00d5 2984 ce01 a1ec 3d07
0000060 757a 757a a2f7 5cd5 f619 ff1c 10e8 80c0
0000070 ffff ffff ffff ffff ffff ffff ffff ffff
0000080 1650 1950 0000 ffff
0000088
root@smarc-rzg2ul:~# md5sum /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp
23e3ec56b5b8f986d0488ba4727239dd  /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp

root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/jedec_id
1f4218
root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/partname
at25ql128a
root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-spi/spi_master/spi1/spi1.0/spi-nor/manufacturer
renesas
root@smarc-rzg2ul:~#


> 
> > +static void renesas_nor_default_init(struct spi_nor *nor) {
> > +	nor->flags |= SNOR_F_HAS_LOCK;
> 
> Did you test locking?

No, I haven't tested locking. Will remove it.

Cheers,
Biju

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-02 12:57   ` Biju Das
@ 2022-05-02 13:10     ` Biju Das
  2022-05-02 18:48       ` Biju Das
  0 siblings, 1 reply; 7+ messages in thread
From: Biju Das @ 2022-05-02 13:10 UTC (permalink / raw)
  To: Biju Das, Michael Walle
  Cc: Chris Paterson, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, miquel.raynal, p.yadav, Prabhakar Mahadev Lad,
	richard, tudor.ambarus, vigneshr

> Subject: RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
> 
> Hi Michael Walle,
> 
> Thanks for the feedback.
> 
> > Subject: Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > flash
> >
> > >  drivers/mtd/spi-nor/Makefile  |  1 +
> > >  drivers/mtd/spi-nor/core.c    |  1 +
> > >  drivers/mtd/spi-nor/core.h    |  1 +
> > >  drivers/mtd/spi-nor/renesas.c | 57
> > > +++++++++++++++++++++++++++++++++++
> >
> > Please put the flash in atmel.c. There are all the Atmel/Adesto/now
> > Renesas flashes.
> 
> OK.
> 
> >
> > > +static const struct flash_info renesas_nor_parts[] = {
> > > +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
> > > +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) }, };
> >
> > I suppose this flash supports SFDP. Therefore,
> > 	{ "at25ql128a", PARSE_SFDP },
> > should be enough.
> 
> OK. I see some changes related to this in your next mail.
> 
> >
> > I see that the 0x1f42xx IDs are also used for the at25sl series.
> > Could you shed some light to what the differences are? Are they
> > compatible, do we have to distiguish between them?
> >
> > Last, for a new flash submission we require a SFDP dump. See [1].
> >
> > [1]
> 

Please find xxd output.

biju@biju-VirtualBox:/tftpboot/RZ-G2UL$  xxd -p sfdp 
53464450060101ff00060110300000ff1f00010280000001ffffffffffff
ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
083b80bbfeffffffffff00ffffff42eb0c200f5210d800ff3362d5008429
01ceeca1073d7a757a75f7a2d55c19f61cffe810c080ffffffffffffffff
ffffffffffffffff501650190000ffff

> Please find the output, I did n't have xxd installed on my rootFS, so used
> hexdump.
> 
> root@smarc-rzg2ul:~# hexdump /sys/devices/platform/soc/10060000.spi/rpc-
> if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> 0000000 4653 5044 0106 ff01 0600 1001 0030 ff00
> 0000010 001f 0201 0080 0100 ffff ffff ffff ffff
> 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> 0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb80
> 0000040 fffe ffff ffff ff00 ffff eb42 200c 520f
> 0000050 d810 ff00 6233 00d5 2984 ce01 a1ec 3d07
> 0000060 757a 757a a2f7 5cd5 f619 ff1c 10e8 80c0
> 0000070 ffff ffff ffff ffff ffff ffff ffff ffff
> 0000080 1650 1950 0000 ffff
> 0000088
> root@smarc-rzg2ul:~# md5sum /sys/devices/platform/soc/10060000.spi/rpc-if-
> spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> 23e3ec56b5b8f986d0488ba4727239dd
> /sys/devices/platform/soc/10060000.spi/rpc-if-
> spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> 
> root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-
> spi/spi_master/spi1/spi1.0/spi-nor/jedec_id
> 1f4218
> root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-
> spi/spi_master/spi1/spi1.0/spi-nor/partname
> at25ql128a
> root@smarc-rzg2ul:~# cat /sys/devices/platform/soc/10060000.spi/rpc-if-
> spi/spi_master/spi1/spi1.0/spi-nor/manufacturer
> renesas
> root@smarc-rzg2ul:~#
> 
> 
> >
> > > +static void renesas_nor_default_init(struct spi_nor *nor) {
> > > +	nor->flags |= SNOR_F_HAS_LOCK;
> >
> > Did you test locking?
> 
> No, I haven't tested locking. Will remove it.
> 
> Cheers,
> Biju

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-02 13:10     ` Biju Das
@ 2022-05-02 18:48       ` Biju Das
  2022-05-03  6:12         ` Biju Das
  0 siblings, 1 reply; 7+ messages in thread
From: Biju Das @ 2022-05-02 18:48 UTC (permalink / raw)
  To: Michael Walle
  Cc: Chris Paterson, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, miquel.raynal, p.yadav, Prabhakar Mahadev Lad,
	richard, tudor.ambarus, vigneshr



> -----Original Message-----
> From: Biju Das
> Sent: 02 May 2022 14:10
> To: Biju Das <biju.das.jz@bp.renesas.com>; Michael Walle
> <michael@walle.cc>
> Cc: Chris Paterson <Chris.Paterson2@renesas.com>; biju.das@bp.renesas.com;
> geert+renesas@glider.be; linux-mtd@lists.infradead.org; linux-renesas-
> soc@vger.kernel.org; miquel.raynal@bootlin.com; p.yadav@ti.com; Prabhakar
> Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>; richard@nod.at;
> tudor.ambarus@microchip.com; vigneshr@ti.com
> Subject: RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
> 
> > Subject: RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > flash
> >
> > Hi Michael Walle,
> >
> > Thanks for the feedback.
> >
> > > Subject: Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > > flash
> > >
> > > >  drivers/mtd/spi-nor/Makefile  |  1 +
> > > >  drivers/mtd/spi-nor/core.c    |  1 +
> > > >  drivers/mtd/spi-nor/core.h    |  1 +
> > > >  drivers/mtd/spi-nor/renesas.c | 57
> > > > +++++++++++++++++++++++++++++++++++
> > >
> > > Please put the flash in atmel.c. There are all the Atmel/Adesto/now
> > > Renesas flashes.
> >
> > OK.
> >
> > >
> > > > +static const struct flash_info renesas_nor_parts[] = {
> > > > +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
> > > > +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) }, };
> > >
> > > I suppose this flash supports SFDP. Therefore,
> > > 	{ "at25ql128a", PARSE_SFDP },
> > > should be enough.
> >
> > OK. I see some changes related to this in your next mail.
> >
> > >
> > > I see that the 0x1f42xx IDs are also used for the at25sl series.
> > > Could you shed some light to what the differences are? Are they
> > > compatible, do we have to distiguish between them?

For AT25QL128A flash,

0x1F:- Manufaturer
0x42:- Memory Type
0x18:- Capacity

I guess, if there is any at25sl128 flash chip, then the Capacity will be same for both the flash.

Cheers,
Biju


> > >
> > > Last, for a new flash submission we require a SFDP dump. See [1].
> > >
> > > [1]
> >
> 
> Please find xxd output.
> 
> biju@biju-VirtualBox:/tftpboot/RZ-G2UL$  xxd -p sfdp
> 53464450060101ff00060110300000ff1f00010280000001ffffffffffff
> ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
> 083b80bbfeffffffffff00ffffff42eb0c200f5210d800ff3362d5008429
> 01ceeca1073d7a757a75f7a2d55c19f61cffe810c080ffffffffffffffff
> ffffffffffffffff501650190000ffff
> 
> > Please find the output, I did n't have xxd installed on my rootFS, so
> > used hexdump.
> >
> > root@smarc-rzg2ul:~# hexdump
> > /sys/devices/platform/soc/10060000.spi/rpc-
> > if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> > 0000000 4653 5044 0106 ff01 0600 1001 0030 ff00
> > 0000010 001f 0201 0080 0100 ffff ffff ffff ffff
> > 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> > 0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb80
> > 0000040 fffe ffff ffff ff00 ffff eb42 200c 520f
> > 0000050 d810 ff00 6233 00d5 2984 ce01 a1ec 3d07
> > 0000060 757a 757a a2f7 5cd5 f619 ff1c 10e8 80c0
> > 0000070 ffff ffff ffff ffff ffff ffff ffff ffff
> > 0000080 1650 1950 0000 ffff
> > 0000088
> > root@smarc-rzg2ul:~# md5sum
> > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> > 23e3ec56b5b8f986d0488ba4727239dd
> > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> >
> > root@smarc-rzg2ul:~# cat
> > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > spi/spi_master/spi1/spi1.0/spi-nor/jedec_id
> > 1f4218
> > root@smarc-rzg2ul:~# cat
> > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > spi/spi_master/spi1/spi1.0/spi-nor/partname
> > at25ql128a
> > root@smarc-rzg2ul:~# cat
> > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > spi/spi_master/spi1/spi1.0/spi-nor/manufacturer
> > renesas
> > root@smarc-rzg2ul:~#
> >
> >
> > >
> > > > +static void renesas_nor_default_init(struct spi_nor *nor) {
> > > > +	nor->flags |= SNOR_F_HAS_LOCK;
> > >
> > > Did you test locking?
> >
> > No, I haven't tested locking. Will remove it.
> >
> > Cheers,
> > Biju

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash
  2022-05-02 18:48       ` Biju Das
@ 2022-05-03  6:12         ` Biju Das
  0 siblings, 0 replies; 7+ messages in thread
From: Biju Das @ 2022-05-03  6:12 UTC (permalink / raw)
  To: Michael Walle
  Cc: Chris Paterson, biju.das, geert+renesas, linux-mtd,
	linux-renesas-soc, miquel.raynal, p.yadav, Prabhakar Mahadev Lad,
	richard, tudor.ambarus, vigneshr

Hi Michael Walle,

> > Subject: RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > flash
> >
> > > Subject: RE: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > > flash
> > >
> > > Hi Michael Walle,
> > >
> > > Thanks for the feedback.
> > >
> > > > Subject: Re: [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor
> > > > flash
> > > >
> > > > >  drivers/mtd/spi-nor/Makefile  |  1 +
> > > > >  drivers/mtd/spi-nor/core.c    |  1 +
> > > > >  drivers/mtd/spi-nor/core.h    |  1 +
> > > > >  drivers/mtd/spi-nor/renesas.c | 57
> > > > > +++++++++++++++++++++++++++++++++++
> > > >
> > > > Please put the flash in atmel.c. There are all the
> > > > Atmel/Adesto/now Renesas flashes.
> > >
> > > OK.
> > >
> > > >
> > > > > +static const struct flash_info renesas_nor_parts[] = {
> > > > > +	{ "at25ql128a", INFO(0x1f4218, 0, 64 * 1024, 256)
> > > > > +		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_QUAD_READ) }, };
> > > >
> > > > I suppose this flash supports SFDP. Therefore,
> > > > 	{ "at25ql128a", PARSE_SFDP },
> > > > should be enough.
> > >
> > > OK. I see some changes related to this in your next mail.
> > >
> > > >
> > > > I see that the 0x1f42xx IDs are also used for the at25sl series.
> > > > Could you shed some light to what the differences are? Are they
> > > > compatible, do we have to distiguish between them?
> 
> For AT25QL128A flash,
> 
> 0x1F:- Manufaturer
> 0x42:- Memory Type
> 0x18:- Capacity
> 
> I guess, if there is any at25sl128 flash chip, then the Capacity will be
> same for both the flash.

I don't have the md5sum value for at25sl128 flash chip. I believe these values will be different for at25sl128
And AT25QL128A.

Probably we could use md5sum value, if at all we need to distinguish them for at25sl128 if JEDECID is same??

Cheers,
Biju

> 
> Cheers,
> Biju
> 
> 
> > > >
> > > > Last, for a new flash submission we require a SFDP dump. See [1].
> > > >
> > > > [1]
> > >
> >
> > Please find xxd output.
> >
> > biju@biju-VirtualBox:/tftpboot/RZ-G2UL$  xxd -p sfdp
> > 53464450060101ff00060110300000ff1f00010280000001ffffffffffff
> > ffffffffffffffffffffffffffffffffffffe520f1ffffffff0744eb086b
> > 083b80bbfeffffffffff00ffffff42eb0c200f5210d800ff3362d5008429
> > 01ceeca1073d7a757a75f7a2d55c19f61cffe810c080ffffffffffffffff
> > ffffffffffffffff501650190000ffff
> >
> > > Please find the output, I did n't have xxd installed on my rootFS,
> > > so used hexdump.
> > >
> > > root@smarc-rzg2ul:~# hexdump
> > > /sys/devices/platform/soc/10060000.spi/rpc-
> > > if-spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> > > 0000000 4653 5044 0106 ff01 0600 1001 0030 ff00
> > > 0000010 001f 0201 0080 0100 ffff ffff ffff ffff
> > > 0000020 ffff ffff ffff ffff ffff ffff ffff ffff
> > > 0000030 20e5 fff1 ffff 07ff eb44 6b08 3b08 bb80
> > > 0000040 fffe ffff ffff ff00 ffff eb42 200c 520f
> > > 0000050 d810 ff00 6233 00d5 2984 ce01 a1ec 3d07
> > > 0000060 757a 757a a2f7 5cd5 f619 ff1c 10e8 80c0
> > > 0000070 ffff ffff ffff ffff ffff ffff ffff ffff
> > > 0000080 1650 1950 0000 ffff
> > > 0000088
> > > root@smarc-rzg2ul:~# md5sum
> > > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > > spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> > > 23e3ec56b5b8f986d0488ba4727239dd
> > > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > > spi/spi_master/spi1/spi1.0/spi-nor/sfdp
> > >
> > > root@smarc-rzg2ul:~# cat
> > > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > > spi/spi_master/spi1/spi1.0/spi-nor/jedec_id
> > > 1f4218
> > > root@smarc-rzg2ul:~# cat
> > > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > > spi/spi_master/spi1/spi1.0/spi-nor/partname
> > > at25ql128a
> > > root@smarc-rzg2ul:~# cat
> > > /sys/devices/platform/soc/10060000.spi/rpc-if-
> > > spi/spi_master/spi1/spi1.0/spi-nor/manufacturer
> > > renesas
> > > root@smarc-rzg2ul:~#
> > >
> > >
> > > >
> > > > > +static void renesas_nor_default_init(struct spi_nor *nor) {
> > > > > +	nor->flags |= SNOR_F_HAS_LOCK;
> > > >
> > > > Did you test locking?
> > >
> > > No, I haven't tested locking. Will remove it.
> > >
> > > Cheers,
> > > Biju

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-03  6:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-01 18:55 [RFC] mtd: spi-nor: Add Renesas AT25QL128A serial nor flash Biju Das
2022-05-02 11:29 ` Michael Walle
2022-05-02 11:49   ` Michael Walle
2022-05-02 12:57   ` Biju Das
2022-05-02 13:10     ` Biju Das
2022-05-02 18:48       ` Biju Das
2022-05-03  6:12         ` Biju Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).