From 2a06c7b1fd2389aed2a308db8de803603d592444 Mon Sep 17 00:00:00 2001 From: Mika Westerberg Date: Thu, 27 Aug 2015 12:52:19 +0300 Subject: mtd: spi-nor: Add support for Micron n25q064a serial flash Add Micron (n25q064a) 8MB flash to the list of supported chips. Signed-off-by: Mika Westerberg Reviewed-by: Jagan Teki [Brian: fixup context] Signed-off-by: Brian Norris --- drivers/mtd/spi-nor/spi-nor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index c27d427fead4..2adf35bd5cd2 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -586,6 +586,7 @@ static const struct flash_info spi_nor_ids[] = { /* Micron */ { "n25q032", INFO(0x20ba16, 0, 64 * 1024, 64, SPI_NOR_QUAD_READ) }, { "n25q064", INFO(0x20ba17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, + { "n25q064a", INFO(0x20bb17, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_QUAD_READ) }, { "n25q128a11", INFO(0x20bb18, 0, 64 * 1024, 256, SPI_NOR_QUAD_READ) }, { "n25q128a13", INFO(0x20ba18, 0, 64 * 1024, 256, SPI_NOR_QUAD_READ) }, { "n25q256a", INFO(0x20ba19, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_QUAD_READ) }, -- cgit v1.2.3 From a1d97ef96e3899ad9d4ec0024f9b4927e0490689 Mon Sep 17 00:00:00 2001 From: Alexis Ballier Date: Fri, 14 Aug 2015 19:35:39 +0200 Subject: mtd: spi-nor: Add support for sst25wf020a It is a 256KiB flash with 4 KiB erase sectors and 64KiB overlay blocks. This is the one available on Hardkernel's Odroid U3 shield. Signed-off-by: Alexis Ballier [Brian: seems like this does NOT require the usual SST_WRITE hacks] Signed-off-by: Brian Norris --- drivers/mtd/spi-nor/spi-nor.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 2adf35bd5cd2..984f6f404935 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -634,6 +634,7 @@ static const struct flash_info spi_nor_ids[] = { { "sst25wf512", INFO(0xbf2501, 0, 64 * 1024, 1, SECT_4K | SST_WRITE) }, { "sst25wf010", INFO(0xbf2502, 0, 64 * 1024, 2, SECT_4K | SST_WRITE) }, { "sst25wf020", INFO(0xbf2503, 0, 64 * 1024, 4, SECT_4K | SST_WRITE) }, + { "sst25wf020a", INFO(0x621612, 0, 64 * 1024, 4, SECT_4K) }, { "sst25wf040", INFO(0xbf2504, 0, 64 * 1024, 8, SECT_4K | SST_WRITE) }, { "sst25wf080", INFO(0xbf2505, 0, 64 * 1024, 16, SECT_4K | SST_WRITE) }, -- cgit v1.2.3 From 092f05c3eccbd616a0cfa21945412a3e82a9fb6c Mon Sep 17 00:00:00 2001 From: Roger Quadros Date: Fri, 21 Aug 2015 13:45:35 +0300 Subject: mtd: nand: omap2: Rename shippable module to omap2_nand As both omap2 onenand and omap2 nand driver modules are named the same i.e. "omap2.ko", only one of them gets shipped during MODPOST if both are configured as loadable modules. To avoid this ambiguity let's ship the omap2 nand driver as "omap2_nand.ko" Reported by Pierre Neyron via github https://github.com/beagleboard/linux/issues/40 Cc: Robert Nelson Signed-off-by: Roger Quadros Signed-off-by: Brian Norris --- drivers/mtd/nand/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile index 1f897ec3c242..075a027632b5 100644 --- a/drivers/mtd/nand/Makefile +++ b/drivers/mtd/nand/Makefile @@ -26,7 +26,8 @@ obj-$(CONFIG_MTD_NAND_CS553X) += cs553x_nand.o obj-$(CONFIG_MTD_NAND_NDFC) += ndfc.o obj-$(CONFIG_MTD_NAND_ATMEL) += atmel_nand.o obj-$(CONFIG_MTD_NAND_GPIO) += gpio.o -obj-$(CONFIG_MTD_NAND_OMAP2) += omap2.o +omap2_nand-objs := omap2.o +obj-$(CONFIG_MTD_NAND_OMAP2) += omap2_nand.o obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD) += omap_elm.o obj-$(CONFIG_MTD_NAND_CM_X270) += cmx270_nand.o obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o -- cgit v1.2.3 From c1752086796bafaf0c933240642ed1cf21ddab4f Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Wed, 26 Aug 2015 14:56:53 +0200 Subject: mtd: spi-nor: allow dual/quad reads on S25FL129P According to the datasheet[1], both S25FL129P0 (256kB sectors) and S25FL129P1 (64kB sectors) support dual read, quad read, dual i/o read and quad i/o read. I have verified dual read to be working for S25FL129P1 on a dual capable spi controller. Quad as well as S25FL129P0 is untested, lacking hardware to verify. [1] http://www.spansion.com/Support/Datasheets/S25FL129P_00.pdf Signed-off-by: Jonas Gorski Reviewed-by: Marek Vasut Signed-off-by: Brian Norris --- drivers/mtd/spi-nor/spi-nor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 984f6f404935..295e56e8173a 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -611,8 +611,8 @@ static const struct flash_info spi_nor_ids[] = { { "s25sl12800", INFO(0x012018, 0x0300, 256 * 1024, 64, 0) }, { "s25sl12801", INFO(0x012018, 0x0301, 64 * 1024, 256, 0) }, { "s25fl128s", INFO6(0x012018, 0x4d0180, 64 * 1024, 256, SECT_4K | SPI_NOR_QUAD_READ) }, - { "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, 0) }, - { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, 0) }, + { "s25fl129p0", INFO(0x012018, 0x4d00, 256 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { "s25fl129p1", INFO(0x012018, 0x4d01, 64 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25sl004a", INFO(0x010212, 0, 64 * 1024, 8, 0) }, { "s25sl008a", INFO(0x010213, 0, 64 * 1024, 16, 0) }, { "s25sl016a", INFO(0x010214, 0, 64 * 1024, 32, 0) }, -- cgit v1.2.3 From 0f12a27b47284e86eaa4a5ad3877ec3018463178 Mon Sep 17 00:00:00 2001 From: Joachim Eastwood Date: Fri, 14 Aug 2015 18:42:32 +0200 Subject: mtd: spi-nor: s25sl064p supports both dual and quad I/O This chip can be found on Hitex LPC4350 Evaluation Board. Signed-off-by: Joachim Eastwood Signed-off-by: Brian Norris --- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 295e56e8173a..25372f9b534e 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -603,7 +603,7 @@ static const struct flash_info spi_nor_ids[] = { * for the chips listed here (without boot sectors). */ { "s25sl032p", INFO(0x010215, 0x4d00, 64 * 1024, 64, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, - { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, 0) }, + { "s25sl064p", INFO(0x010216, 0x4d00, 64 * 1024, 128, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25fl256s0", INFO(0x010219, 0x4d00, 256 * 1024, 128, 0) }, { "s25fl256s1", INFO(0x010219, 0x4d01, 64 * 1024, 512, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { "s25fl512s", INFO(0x010220, 0x4d00, 256 * 1024, 256, SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, -- cgit v1.2.3 From 2ff46e6fea6254ac8fa97aeb9c14e51436ab95f6 Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Wed, 2 Sep 2015 16:34:35 -0700 Subject: mtd: spi-nor: fix NULL dereference when no match found in spi_nor_ids[] Commit 06bb6f5a69df ("mtd: spi-nor: stop (ab)using struct spi_device_id") converted an array into a pointer, which means that we should be checking if the pointer goes anywhere, not whether the C string is empty. To do the latter means we dereference a NULL pointer when we reach the terminating entry, for which 'name' is now NULL instead of an array { 0, 0, ... }. Sample crash: [ 1.101371] Unable to handle kernel NULL pointer dereference at virtual address 00000000 [ 1.109457] pgd = c0004000 [ 1.112157] [00000000] *pgd=00000000 [ 1.115736] Internal error: Oops: 5 [#1] SMP ARM [ 1.120345] Modules linked in: [ 1.123405] CPU: 3 PID: 1 Comm: swapper/0 Not tainted 4.2.0-next-20150902+ #61 [ 1.130611] Hardware name: Rockchip (Device Tree) [ 1.135306] task: ee0b8d40 ti: ee0ba000 task.ti: ee0ba000 [ 1.140697] PC is at spi_nor_scan+0x90/0x8c4 [ 1.144958] LR is at spi_nor_scan+0xa4/0x8c4 ... [ 1.504112] [] (spi_nor_scan) from [] (m25p_probe+0xc8/0x11c) [ 1.511583] [] (m25p_probe) from [] (spi_drv_probe+0x60/0x7c) [ 1.519055] [] (spi_drv_probe) from [] (driver_probe_device+0x1a0/0x444) [ 1.527478] [] (driver_probe_device) from [] (__device_attach_driver+0x94/0xa0) [ 1.536507] [] (__device_attach_driver) from [] (bus_for_each_drv+0x94/0xa4) [ 1.545277] [] (bus_for_each_drv) from [] (__device_attach+0xa4/0x144) [ 1.553526] [] (__device_attach) from [] (device_initial_probe+0x1c/0x20) [ 1.562035] [] (device_initial_probe) from [] (bus_probe_device+0x38/0x94) [ 1.570631] [] (bus_probe_device) from [] (device_add+0x430/0x558) [ 1.578534] [] (device_add) from [] (spi_add_device+0xe4/0x174) [ 1.586178] [] (spi_add_device) from [] (spi_register_master+0x698/0x7d4) [ 1.594688] [] (spi_register_master) from [] (devm_spi_register_master+0x40/0x7c) [ 1.603892] [] (devm_spi_register_master) from [] (rockchip_spi_probe+0x360/0x3f4) [ 1.613182] [] (rockchip_spi_probe) from [] (platform_drv_probe+0x58/0xa8) [ 1.621779] [] (platform_drv_probe) from [] (driver_probe_device+0x1a0/0x444) [ 1.630635] [] (driver_probe_device) from [] (__driver_attach+0x80/0xa4) [ 1.639058] [] (__driver_attach) from [] (bus_for_each_dev+0x98/0xac) [ 1.647221] [] (bus_for_each_dev) from [] (driver_attach+0x28/0x30) [ 1.655210] [] (driver_attach) from [] (bus_add_driver+0x128/0x250) [ 1.663200] [] (bus_add_driver) from [] (driver_register+0xac/0xf0) [ 1.671191] [] (driver_register) from [] (__platform_driver_register+0x58/0x6c) [ 1.680221] [] (__platform_driver_register) from [] (rockchip_spi_driver_init+0x18/0x20) [ 1.690033] [] (rockchip_spi_driver_init) from [] (do_one_initcall+0x124/0x1dc) [ 1.699063] [] (do_one_initcall) from [] (kernel_init_freeable+0x218/0x2ec) [ 1.707748] [] (kernel_init_freeable) from [] (kernel_init+0x1c/0xf4) [ 1.715912] [] (kernel_init) from [] (ret_from_fork+0x14/0x24) [ 1.723460] Code: e3510000 159f67c0 0a00000c e5961000 (e5d13000) [ 1.729564] ---[ end trace 95baa6b3b861ce25 ]--- Fixes: 06bb6f5a69df ("mtd: spi-nor: stop (ab)using struct spi_device_id") Signed-off-by: Brian Norris Cc: Rafał Miłecki --- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 25372f9b534e..f59aedfe1462 100644 --- a/drivers/mtd/spi-nor/spi-nor.c +++ b/drivers/mtd/spi-nor/spi-nor.c @@ -1218,7 +1218,7 @@ static const struct flash_info *spi_nor_match_id(const char *name) { const struct flash_info *id = spi_nor_ids; - while (id->name[0]) { + while (id->name) { if (!strcmp(name, id->name)) return id; id++; -- cgit v1.2.3