public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: macronix: Add support for mx66u1g45g
@ 2022-01-24  6:02 Ley Foon Tan
  2022-01-25 10:01 ` Pratyush Yadav
  0 siblings, 1 reply; 6+ messages in thread
From: Ley Foon Tan @ 2022-01-24  6:02 UTC (permalink / raw)
  To: Tudor Ambarus, Pratyush Yadav
  Cc: Michael Walle, Miquel Raynal, Richard Weinberger,
	Vignesh Raghavendra, linux-mtd, linux-kernel, Ley Foon Tan

The Macronix mx66u1g45g [1] is a 1.8V, 1Gbit (128MB) flash device that
supports x1, x2, or x4 operation.

The mx66u1g45g is the smaller sibling of the mx66u2g45g that is
already supported.

Tested on StarFive Dubhe hardware on FPGA.
Validated by erase and read back, write and read back.

[1] https://www.macronix.com/Lists/Datasheet/Attachments/7877/MX66U1G45G,%201.8V,%201Gb,%20v1.4.pdf

Signed-off-by: Ley Foon Tan <leyfoon.tan@linux.starfivetech.com>
---
 drivers/mtd/spi-nor/macronix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index 97dba1ae7fb1..79ee808c5442 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -97,6 +97,9 @@ static const struct flash_info macronix_parts[] = {
 			      SPI_NOR_QUAD_READ) },
 	{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048)
 		NO_SFDP_FLAGS(SPI_NOR_QUAD_READ) },
+	{ "mx66u1g45g",  INFO(0xc2253b, 0, 64 * 1024, 2048)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
 	{ "mx66u2g45g",	 INFO(0xc2253c, 0, 64 * 1024, 4096)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] mtd: spi-nor: macronix: Add support for mx66u1g45g
@ 2022-09-16  8:22 niravkumar.l.rabara
  0 siblings, 0 replies; 6+ messages in thread
From: niravkumar.l.rabara @ 2022-09-16  8:22 UTC (permalink / raw)
  To: Tudor Ambarus, Pratyush Yadav, Michael Walle, Miquel Raynal,
	Richard Weinberger, Vignesh Raghavendra, niravkumar.l.rabara
  Cc: linux-mtd, linux-kernel

From: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>

The MX66U1G45G is the smaller sibling (128MB) of the MX66U2G45G (256MB)
that is already supported.

Tested on Intel N5X socdk board,
- random data write, erase, read   - verified erase operations
- random data write, read and compare  - verified write/read operations

Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
---
root@n5x:~# find / -iname spi-nor
/sys/kernel/debug/spi-nor
/sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor
/sys/bus/spi/drivers/spi-nor
root@n5x:~# ls -al /sys/devices/platform/soc/
driver/                      ffd00200.watchdog/
driver_override              ffd10000.clock-controller/
f8011100.sdr/                ffd11000.rstmgr/
f87f8000.memory-controller/  ffd12000.sysmgr/
ff800000.ethernet/           ffda0000.dma-controller/
ff808000.mmc/                ffe00000.sram/
ff8d2000.spi/                modalias
ffb00000.usb/                of_node/
ffc02000.serial/             power/
ffc03000.timer0/             soc:base_fpga_region/
ffc03100.timer1/             soc:eccmgr/
ffd00000.timer2/             subsystem/
ffd00100.timer3/             uevent
root@n5x:~# ls -al /sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor/
drwxr-xr-x    2 root     root             0 Dec 16 17:27 .
drwxr-xr-x    6 root     root             0 Dec 16 17:25 ..
-r--r--r--    1 root     root          4096 Dec 16 17:27 jedec_id
-r--r--r--    1 root     root          4096 Dec 16 17:27 manufacturer
-r--r--r--    1 root     root          4096 Dec 16 17:27 partname
-r--r--r--    1 root     root             0 Dec 16 17:27 sfdp
root@n5x:~# cat  /sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor/jedec_id
c2253b
root@n5x:~# cat  /sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor/manufacturer
macronix
root@n5x:~# cat  /sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor/partname
mx66u1g45g
root@n5x:~# cat  /sys/devices/platform/soc/ff8d2000.spi/spi_master/spi0/spi0.0/spi-nor/sfdp > mx66u1g45g-sfdp
root@n5x:~# hexdump mx66u1g45g-sfdp
0000000 4653 5044 0106 ff02 0600 1001 0030 ff00
0000010 00c2 0401 0110 ff00 0084 0201 00c0 ff00
0000020 ffff ffff ffff ffff ffff ffff ffff ffff
0000030 20e5 fffb ffff 3fff eb44 6b08 3b08 bb04
0000040 fffe ffff ffff ff00 ffff eb44 200c 520f
0000050 d810 ff00 4987 00b5 d282 e204 0344 3867
0000060 b030 b030 bdf7 5cd5 9e4a ff29 50f0 85f9
0000070 ffff ffff ffff ffff ffff ffff ffff ffff
*
00000c0 8f7f ffff 5c21 ffdc ffff ffff ffff ffff
00000d0 ffff ffff ffff ffff ffff ffff ffff ffff
*
0000110 2000 1600 f99d 64c0 cb85 ffff ffff ffff
0000120
---
 drivers/mtd/spi-nor/macronix.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index d81a4cb2812b..723efe4ca57e 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -97,6 +97,9 @@ static const struct flash_info macronix_nor_parts[] = {
 			      SPI_NOR_QUAD_READ) },
 	{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048)
 		NO_SFDP_FLAGS(SPI_NOR_QUAD_READ) },
+	{ "mx66u1g45g",  INFO(0xc2253b, 0, 64 * 1024, 2048)
+		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
 	{ "mx66u2g45g",	 INFO(0xc2253c, 0, 64 * 1024, 4096)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread
* [PATCH] mtd: spi-nor: macronix: Add support for mx66u1g45g
@ 2022-11-09 20:23 Dinh Nguyen
  2022-11-09 20:23 ` Dinh Nguyen
  0 siblings, 1 reply; 6+ messages in thread
From: Dinh Nguyen @ 2022-11-09 20:23 UTC (permalink / raw)
  To: linux-mtd
  Cc: dinguyen, tudor.ambarus, pratyush, michael, linux-kernel,
	Niravkumar L Rabara

The MX66U1G45G is the smaller sibling (128MB) of the MX66U2G45G (256MB)
that is already supported.

Tested on Intel N5X socdk board,
  - random data write, erase, read   - verified erase operations
  - random data write, read and compare  - verified write/read operations

Signed-off-by: Niravkumar L Rabara <niravkumar.l.rabara@intel.com>
Signed-off-by: Dinh Nguyen <dinguyen@kernel.org>
---
 drivers/mtd/spi-nor/macronix.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index d81a4cb2812b..46ba898f3dd0 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -97,6 +97,10 @@ static const struct flash_info macronix_nor_parts[] = {
 			      SPI_NOR_QUAD_READ) },
 	{ "mx66l1g55g",  INFO(0xc2261b, 0, 64 * 1024, 2048)
 		NO_SFDP_FLAGS(SPI_NOR_QUAD_READ) },
+	{ "mx66u1g45g",  INFO(0xc2253b, 0, 64 * 1024, 2048)
+		PARSE_SFDP,
+		FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
+		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
 	{ "mx66u2g45g",	 INFO(0xc2253c, 0, 64 * 1024, 4096)
 		NO_SFDP_FLAGS(SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ)
 		FIXUP_FLAGS(SPI_NOR_4B_OPCODES) },
-- 
2.25.1


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

end of thread, other threads:[~2022-11-10 17:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-24  6:02 [PATCH] mtd: spi-nor: macronix: Add support for mx66u1g45g Ley Foon Tan
2022-01-25 10:01 ` Pratyush Yadav
  -- strict thread matches above, loose matches on Subject: below --
2022-09-16  8:22 niravkumar.l.rabara
2022-11-09 20:23 Dinh Nguyen
2022-11-09 20:23 ` Dinh Nguyen
2022-11-10 17:38   ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox