All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2012-11-06 10:51 ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: dedekind1, Matthieu CASTET

- NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
- NAND_CMD_PARAM want 8 bits data

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 drivers/mtd/nand/nand_base.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5894c2c..abeb8e9 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2851,6 +2851,8 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	int i;
 	int val;
 
+	/* ONFI need to be probed in 8 bits mode */
+	WARN_ON(chip->options & NAND_BUSWIDTH_16);
 	/* Try ONFI for unknown chip or LP */
 	chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1);
 	if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||
-- 
1.7.10.4


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

* [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2012-11-06 10:51 ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: Matthieu CASTET, dedekind1

- NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
- NAND_CMD_PARAM want 8 bits data

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 drivers/mtd/nand/nand_base.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 5894c2c..abeb8e9 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2851,6 +2851,8 @@ static int nand_flash_detect_onfi(struct mtd_info *mtd, struct nand_chip *chip,
 	int i;
 	int val;
 
+	/* ONFI need to be probed in 8 bits mode */
+	WARN_ON(chip->options & NAND_BUSWIDTH_16);
 	/* Try ONFI for unknown chip or LP */
 	chip->cmdfunc(mtd, NAND_CMD_READID, 0x20, -1);
 	if (chip->read_byte(mtd) != 'O' || chip->read_byte(mtd) != 'N' ||
-- 
1.7.10.4

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

* [PATCH 2/3] mtd nand : add NAND_BUSWIDTH_AUTO to autodetect bus width
  2012-11-06 10:51 ` Matthieu CASTET
@ 2012-11-06 10:51   ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: dedekind1, Matthieu CASTET

The driver call nand_scan_ident in 8 bit mode, then
readid or onfi detection are done (and detect bus width).
The driver should update its bus width before calling nand_scan_tail.

This work because readid and onfi are read work 8 byte mode.

Note that nand_scan_ident send command (NAND_CMD_RESET, NAND_CMD_READID, NAND_CMD_PARAM), address and read data
The ONFI specificication is not very clear for x16 device if high byte of address should be driven to 0,
but according to [1] it should be ok to not drive it during autodetection.

[1]
3.3.2. Target Initialization

[...]
The Read ID and Read Parameter Page commands only use the lower 8-bits of the data bus.
The host shall not issue commands that use a word data width on x16 devices until the host
determines the device supports a 16-bit data bus width in the parameter page.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 drivers/mtd/nand/nand_base.c |   14 +++++++++-----
 include/linux/mtd/nand.h     |    7 +++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index abeb8e9..c90ef66 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3245,11 +3245,15 @@ ident_done:
 			break;
 	}
 
-	/*
-	 * Check, if buswidth is correct. Hardware drivers should set
-	 * chip correct!
-	 */
-	if (busw != (chip->options & NAND_BUSWIDTH_16)) {
+	if (chip->options & NAND_BUSWIDTH_AUTO) {
+		WARN_ON(chip->options & NAND_BUSWIDTH_16);
+		chip->options |= busw;
+		nand_set_defaults(chip, busw);
+	} else if (busw != (chip->options & NAND_BUSWIDTH_16)) {
+		/*
+		 * Check, if buswidth is correct. Hardware drivers should set
+		 * chip correct!
+		 */
 		pr_info("NAND device: Manufacturer ID:"
 			" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id,
 			*dev_id, nand_manuf_ids[maf_idx].name, mtd->name);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 24e9159..c8518d4 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -219,6 +219,13 @@ typedef enum {
 #define NAND_OWN_BUFFERS	0x00020000
 /* Chip may not exist, so silence any errors in scan */
 #define NAND_SCAN_SILENT_NODEV	0x00040000
+/*
+ * Autodetect nand buswidth with readid/onfi.
+ * This suppose the driver will configure the hardware in 8 bits mode
+ * when calling nand_scan_ident, and update its configuration
+ * before calling nand_scan_tail.
+ */
+#define NAND_BUSWIDTH_AUTO      0x00080000
 
 /* Options set by nand scan */
 /* Nand scan has allocated controller struct */
-- 
1.7.10.4


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

* [PATCH 2/3] mtd nand : add NAND_BUSWIDTH_AUTO to autodetect bus width
@ 2012-11-06 10:51   ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: Matthieu CASTET, dedekind1

The driver call nand_scan_ident in 8 bit mode, then
readid or onfi detection are done (and detect bus width).
The driver should update its bus width before calling nand_scan_tail.

This work because readid and onfi are read work 8 byte mode.

Note that nand_scan_ident send command (NAND_CMD_RESET, NAND_CMD_READID, NAND_CMD_PARAM), address and read data
The ONFI specificication is not very clear for x16 device if high byte of address should be driven to 0,
but according to [1] it should be ok to not drive it during autodetection.

[1]
3.3.2. Target Initialization

[...]
The Read ID and Read Parameter Page commands only use the lower 8-bits of the data bus.
The host shall not issue commands that use a word data width on x16 devices until the host
determines the device supports a 16-bit data bus width in the parameter page.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 drivers/mtd/nand/nand_base.c |   14 +++++++++-----
 include/linux/mtd/nand.h     |    7 +++++++
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index abeb8e9..c90ef66 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -3245,11 +3245,15 @@ ident_done:
 			break;
 	}
 
-	/*
-	 * Check, if buswidth is correct. Hardware drivers should set
-	 * chip correct!
-	 */
-	if (busw != (chip->options & NAND_BUSWIDTH_16)) {
+	if (chip->options & NAND_BUSWIDTH_AUTO) {
+		WARN_ON(chip->options & NAND_BUSWIDTH_16);
+		chip->options |= busw;
+		nand_set_defaults(chip, busw);
+	} else if (busw != (chip->options & NAND_BUSWIDTH_16)) {
+		/*
+		 * Check, if buswidth is correct. Hardware drivers should set
+		 * chip correct!
+		 */
 		pr_info("NAND device: Manufacturer ID:"
 			" 0x%02x, Chip ID: 0x%02x (%s %s)\n", *maf_id,
 			*dev_id, nand_manuf_ids[maf_idx].name, mtd->name);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 24e9159..c8518d4 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -219,6 +219,13 @@ typedef enum {
 #define NAND_OWN_BUFFERS	0x00020000
 /* Chip may not exist, so silence any errors in scan */
 #define NAND_SCAN_SILENT_NODEV	0x00040000
+/*
+ * Autodetect nand buswidth with readid/onfi.
+ * This suppose the driver will configure the hardware in 8 bits mode
+ * when calling nand_scan_ident, and update its configuration
+ * before calling nand_scan_tail.
+ */
+#define NAND_BUSWIDTH_AUTO      0x00080000
 
 /* Options set by nand scan */
 /* Nand scan has allocated controller struct */
-- 
1.7.10.4

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

* [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-06 10:51 ` Matthieu CASTET
@ 2012-11-06 10:51   ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: dedekind1, Matthieu CASTET

This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.

This also make work onfi detection on beagleboard :

Before :
[    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64

After :
[    1.914825] ONFI param page 0 valid
[    1.919158] ONFI flash detected
[    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64

platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 arch/arm/mach-omap2/board-3630sdp.c          |    2 +-
 arch/arm/mach-omap2/board-devkit8000.c       |    2 +-
 arch/arm/mach-omap2/board-flash.c            |    8 ++---
 arch/arm/mach-omap2/board-igep0020.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
 arch/arm/mach-omap2/board-zoom.c             |    2 +-
 arch/arm/mach-omap2/common-board-devices.c   |    2 +-
 arch/arm/mach-omap2/gpmc-nand.c              |    5 ---
 drivers/mtd/nand/omap2.c                     |   42 ++++++++++++++------------
 include/linux/platform_data/mtd-nand-omap2.h |    7 ++++-
 13 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index fc224ad..d7b981b 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -198,7 +198,7 @@ static void __init omap_sdp_init(void)
 				  h8mbx00u0mer0em_sdrc_params);
 	zoom_display_init();
 	board_smc91x_init();
-	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
+	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_OMAP_BUS_16);
 	enable_board_wakeup_source();
 	usbhs_init(&usbhs_bdata);
 }
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 1fd161e..b3487e1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -621,7 +621,7 @@ static void __init devkit8000_init(void)
 
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, devkit8000_nand_partitions,
 			     ARRAY_SIZE(devkit8000_nand_partitions));
 	omap_twl4030_audio_init("omap3beagle");
 
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 0cabe61..488a1fa 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -133,12 +133,12 @@ static struct omap_nand_platform_data board_nand_data = {
 
 void
 __init board_nand_init(struct mtd_partition *nand_parts,
-			u8 nr_parts, u8 cs, int nand_type)
+			u8 nr_parts, u8 cs, int bus_type)
 {
 	board_nand_data.cs		= cs;
 	board_nand_data.parts		= nand_parts;
 	board_nand_data.nr_parts	= nr_parts;
-	board_nand_data.devsize		= nand_type;
+	board_nand_data.bussize		= bus_type;
 
 	board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
 	gpmc_nand_init(&board_nand_data);
@@ -185,7 +185,7 @@ unmap:
  * @return - void.
  */
 void __init board_flash_init(struct flash_partitions partition_info[],
-			char chip_sel_board[][GPMC_CS_NUM], int nand_type)
+			char chip_sel_board[][GPMC_CS_NUM], int bus_type)
 {
 	u8		cs = 0;
 	u8		norcs = GPMC_CS_NUM + 1;
@@ -238,5 +238,5 @@ void __init board_flash_init(struct flash_partitions partition_info[],
 		pr_err("NAND: Unable to find configuration in GPMC\n");
 	else
 		board_nand_init(partition_info[2].parts,
-			partition_info[2].nr_parts, nandcs, nand_type);
+			partition_info[2].nr_parts, nandcs, bus_type);
 }
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 48d5e41..732f183 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -175,7 +175,7 @@ static void __init igep_flash_init(void)
 		pr_info("IGEP: initializing NAND memory device\n");
 		board_nand_init(igep_flash_partitions,
 				ARRAY_SIZE(igep_flash_partitions),
-				0, NAND_BUSWIDTH_16);
+				0, NAND_OMAP_BUS_16);
 	} else if (mux == IGEP_SYSBOOT_ONENAND) {
 		pr_info("IGEP: initializing OneNAND memory device\n");
 		board_onenand_init(igep_flash_partitions,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a08bebc..152b659 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -512,7 +512,7 @@ static void __init omap3_beagle_init(void)
 
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3beagle_nand_partitions,
 			     ARRAY_SIZE(omap3beagle_nand_partitions));
 	omap_twl4030_audio_init("omap3beagle");
 
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index a3959de..830e71b 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -732,7 +732,7 @@ static void __init omap3_evm_init(void)
 	}
 	usb_musb_init(&musb_board_data);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3evm_nand_partitions,
 			     ARRAY_SIZE(omap3evm_nand_partitions));
 
 	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..592fa5d 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -82,7 +82,7 @@ static struct mtd_partition omap3pandora_nand_partitions[] = {
 
 static struct omap_nand_platform_data pandora_nand_data = {
 	.cs		= 0,
-	.devsize	= NAND_BUSWIDTH_16,
+	.bussize	= NAND_OMAP_BUS_16,
 	.xfer_type	= NAND_OMAP_PREFETCH_DMA,
 	.parts		= omap3pandora_nand_partitions,
 	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 944ffc4..7cef1e3 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -365,7 +365,7 @@ static void __init omap3_touchbook_init(void)
 	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3touchbook_nand_partitions,
 			     ARRAY_SIZE(omap3touchbook_nand_partitions));
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4994438..49349e7 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -114,7 +114,7 @@ static void __init omap_zoom_init(void)
 	}
 
 	board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
-						ZOOM_NAND_CS, NAND_BUSWIDTH_16);
+						ZOOM_NAND_CS, NAND_OMAP_BUS_16);
 	zoom_debugboard_init();
 	zoom_peripherals_init();
 
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 48daac2..2189f40 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -128,7 +128,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
 		nand_data.cs = nandcs;
 		nand_data.parts = parts;
 		nand_data.nr_parts = nr_parts;
-		nand_data.devsize = options;
+		nand_data.bussize = options;
 
 		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 		if (gpmc_nand_init(&nand_data) < 0)
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 4acf497..94f622e 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -76,11 +76,6 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
 	t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
 	t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
 
-	/* Configure GPMC */
-	if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
-		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
-	else
-		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
 	gpmc_cs_configure(gpmc_nand_data->cs,
 			GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
 	gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 5b31386..618cf42 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1273,7 +1273,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 	info->mtd.name		= dev_name(&pdev->dev);
 	info->mtd.owner		= THIS_MODULE;
 
-	info->nand.options	= pdata->devsize;
+	info->nand.options	= NAND_BUSWIDTH_AUTO;
 	info->nand.options	|= NAND_SKIP_BBTSCAN;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1325,13 +1325,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		break;
 
 	case NAND_OMAP_POLLED:
-		if (info->nand.options & NAND_BUSWIDTH_16) {
-			info->nand.read_buf   = omap_read_buf16;
-			info->nand.write_buf  = omap_write_buf16;
-		} else {
-			info->nand.read_buf   = omap_read_buf8;
-			info->nand.write_buf  = omap_write_buf8;
-		}
+		info->nand.read_buf   = omap_read_buf8;
+		info->nand.write_buf  = omap_write_buf8;
 		break;
 
 	case NAND_OMAP_PREFETCH_DMA:
@@ -1407,6 +1402,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		goto out_release_mem_region;
 	}
 
+	gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 0);
+	if (nand_scan_ident(&info->mtd, 1, NULL)) {
+		err = -ENXIO;
+		goto out_release_mem_region;
+	}
+
+	/* update for 16 bits device */
+	if (info->nand.options & NAND_BUSWIDTH_16) {
+		if (!(pdata->bussize & NAND_OMAP_BUS_16)) {
+			dev_err(&pdev->dev, "detected x16 flash, but board only support x8 flash\n");
+			err = -ENXIO;
+			goto out_release_mem_region;
+		}
+		gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 1);
+		if (pdata->xfer_type == NAND_OMAP_POLLED) {
+			info->nand.read_buf   = omap_read_buf16;
+			info->nand.write_buf  = omap_write_buf16;
+		}
+	}
+
 	/* select the ecc type */
 	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
 		info->nand.ecc.mode = NAND_ECC_SOFT;
@@ -1428,17 +1443,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* DIP switches on some boards change between 8 and 16 bit
-	 * bus widths for flash.  Try the other width if the first try fails.
-	 */
-	if (nand_scan_ident(&info->mtd, 1, NULL)) {
-		info->nand.options ^= NAND_BUSWIDTH_16;
-		if (nand_scan_ident(&info->mtd, 1, NULL)) {
-			err = -ENXIO;
-			goto out_release_mem_region;
-		}
-	}
-
 	/* rom code layout */
 	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {
 
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e..766815e 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -18,6 +18,11 @@ enum nand_io {
 	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */
 };
 
+enum nand_bussize {
+	NAND_OMAP_BUS_8,
+	NAND_OMAP_BUS_16,
+};
+
 struct omap_nand_platform_data {
 	int			cs;
 	struct mtd_partition	*parts;
@@ -25,7 +30,7 @@ struct omap_nand_platform_data {
 	int			nr_parts;
 	bool			dev_ready;
 	enum nand_io		xfer_type;
-	int			devsize;
+	enum nand_bussize		bussize;
 	enum omap_ecc           ecc_opt;
 	struct gpmc_nand_regs	reg;
 };
-- 
1.7.10.4


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

* [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-06 10:51   ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 10:51 UTC (permalink / raw)
  To: linux-mtd, linux-omap; +Cc: Matthieu CASTET, dedekind1

This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.

This also make work onfi detection on beagleboard :

Before :
[    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64

After :
[    1.914825] ONFI param page 0 valid
[    1.919158] ONFI flash detected
[    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64

platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.

Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
---
 arch/arm/mach-omap2/board-3630sdp.c          |    2 +-
 arch/arm/mach-omap2/board-devkit8000.c       |    2 +-
 arch/arm/mach-omap2/board-flash.c            |    8 ++---
 arch/arm/mach-omap2/board-igep0020.c         |    2 +-
 arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
 arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
 arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
 arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
 arch/arm/mach-omap2/board-zoom.c             |    2 +-
 arch/arm/mach-omap2/common-board-devices.c   |    2 +-
 arch/arm/mach-omap2/gpmc-nand.c              |    5 ---
 drivers/mtd/nand/omap2.c                     |   42 ++++++++++++++------------
 include/linux/platform_data/mtd-nand-omap2.h |    7 ++++-
 13 files changed, 42 insertions(+), 38 deletions(-)

diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
index fc224ad..d7b981b 100644
--- a/arch/arm/mach-omap2/board-3630sdp.c
+++ b/arch/arm/mach-omap2/board-3630sdp.c
@@ -198,7 +198,7 @@ static void __init omap_sdp_init(void)
 				  h8mbx00u0mer0em_sdrc_params);
 	zoom_display_init();
 	board_smc91x_init();
-	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
+	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_OMAP_BUS_16);
 	enable_board_wakeup_source();
 	usbhs_init(&usbhs_bdata);
 }
diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
index 1fd161e..b3487e1 100644
--- a/arch/arm/mach-omap2/board-devkit8000.c
+++ b/arch/arm/mach-omap2/board-devkit8000.c
@@ -621,7 +621,7 @@ static void __init devkit8000_init(void)
 
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, devkit8000_nand_partitions,
 			     ARRAY_SIZE(devkit8000_nand_partitions));
 	omap_twl4030_audio_init("omap3beagle");
 
diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
index 0cabe61..488a1fa 100644
--- a/arch/arm/mach-omap2/board-flash.c
+++ b/arch/arm/mach-omap2/board-flash.c
@@ -133,12 +133,12 @@ static struct omap_nand_platform_data board_nand_data = {
 
 void
 __init board_nand_init(struct mtd_partition *nand_parts,
-			u8 nr_parts, u8 cs, int nand_type)
+			u8 nr_parts, u8 cs, int bus_type)
 {
 	board_nand_data.cs		= cs;
 	board_nand_data.parts		= nand_parts;
 	board_nand_data.nr_parts	= nr_parts;
-	board_nand_data.devsize		= nand_type;
+	board_nand_data.bussize		= bus_type;
 
 	board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
 	gpmc_nand_init(&board_nand_data);
@@ -185,7 +185,7 @@ unmap:
  * @return - void.
  */
 void __init board_flash_init(struct flash_partitions partition_info[],
-			char chip_sel_board[][GPMC_CS_NUM], int nand_type)
+			char chip_sel_board[][GPMC_CS_NUM], int bus_type)
 {
 	u8		cs = 0;
 	u8		norcs = GPMC_CS_NUM + 1;
@@ -238,5 +238,5 @@ void __init board_flash_init(struct flash_partitions partition_info[],
 		pr_err("NAND: Unable to find configuration in GPMC\n");
 	else
 		board_nand_init(partition_info[2].parts,
-			partition_info[2].nr_parts, nandcs, nand_type);
+			partition_info[2].nr_parts, nandcs, bus_type);
 }
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 48d5e41..732f183 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -175,7 +175,7 @@ static void __init igep_flash_init(void)
 		pr_info("IGEP: initializing NAND memory device\n");
 		board_nand_init(igep_flash_partitions,
 				ARRAY_SIZE(igep_flash_partitions),
-				0, NAND_BUSWIDTH_16);
+				0, NAND_OMAP_BUS_16);
 	} else if (mux == IGEP_SYSBOOT_ONENAND) {
 		pr_info("IGEP: initializing OneNAND memory device\n");
 		board_onenand_init(igep_flash_partitions,
diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
index a08bebc..152b659 100644
--- a/arch/arm/mach-omap2/board-omap3beagle.c
+++ b/arch/arm/mach-omap2/board-omap3beagle.c
@@ -512,7 +512,7 @@ static void __init omap3_beagle_init(void)
 
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3beagle_nand_partitions,
 			     ARRAY_SIZE(omap3beagle_nand_partitions));
 	omap_twl4030_audio_init("omap3beagle");
 
diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
index a3959de..830e71b 100644
--- a/arch/arm/mach-omap2/board-omap3evm.c
+++ b/arch/arm/mach-omap2/board-omap3evm.c
@@ -732,7 +732,7 @@ static void __init omap3_evm_init(void)
 	}
 	usb_musb_init(&musb_board_data);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3evm_nand_partitions,
 			     ARRAY_SIZE(omap3evm_nand_partitions));
 
 	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
index 00a1f4a..592fa5d 100644
--- a/arch/arm/mach-omap2/board-omap3pandora.c
+++ b/arch/arm/mach-omap2/board-omap3pandora.c
@@ -82,7 +82,7 @@ static struct mtd_partition omap3pandora_nand_partitions[] = {
 
 static struct omap_nand_platform_data pandora_nand_data = {
 	.cs		= 0,
-	.devsize	= NAND_BUSWIDTH_16,
+	.bussize	= NAND_OMAP_BUS_16,
 	.xfer_type	= NAND_OMAP_PREFETCH_DMA,
 	.parts		= omap3pandora_nand_partitions,
 	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
index 944ffc4..7cef1e3 100644
--- a/arch/arm/mach-omap2/board-omap3touchbook.c
+++ b/arch/arm/mach-omap2/board-omap3touchbook.c
@@ -365,7 +365,7 @@ static void __init omap3_touchbook_init(void)
 	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
 	usb_musb_init(NULL);
 	usbhs_init(&usbhs_bdata);
-	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
+	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3touchbook_nand_partitions,
 			     ARRAY_SIZE(omap3touchbook_nand_partitions));
 
 	/* Ensure SDRC pins are mux'd for self-refresh */
diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
index 4994438..49349e7 100644
--- a/arch/arm/mach-omap2/board-zoom.c
+++ b/arch/arm/mach-omap2/board-zoom.c
@@ -114,7 +114,7 @@ static void __init omap_zoom_init(void)
 	}
 
 	board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
-						ZOOM_NAND_CS, NAND_BUSWIDTH_16);
+						ZOOM_NAND_CS, NAND_OMAP_BUS_16);
 	zoom_debugboard_init();
 	zoom_peripherals_init();
 
diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
index 48daac2..2189f40 100644
--- a/arch/arm/mach-omap2/common-board-devices.c
+++ b/arch/arm/mach-omap2/common-board-devices.c
@@ -128,7 +128,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
 		nand_data.cs = nandcs;
 		nand_data.parts = parts;
 		nand_data.nr_parts = nr_parts;
-		nand_data.devsize = options;
+		nand_data.bussize = options;
 
 		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
 		if (gpmc_nand_init(&nand_data) < 0)
diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
index 4acf497..94f622e 100644
--- a/arch/arm/mach-omap2/gpmc-nand.c
+++ b/arch/arm/mach-omap2/gpmc-nand.c
@@ -76,11 +76,6 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
 	t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
 	t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
 
-	/* Configure GPMC */
-	if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
-		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
-	else
-		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
 	gpmc_cs_configure(gpmc_nand_data->cs,
 			GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
 	gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
index 5b31386..618cf42 100644
--- a/drivers/mtd/nand/omap2.c
+++ b/drivers/mtd/nand/omap2.c
@@ -1273,7 +1273,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 	info->mtd.name		= dev_name(&pdev->dev);
 	info->mtd.owner		= THIS_MODULE;
 
-	info->nand.options	= pdata->devsize;
+	info->nand.options	= NAND_BUSWIDTH_AUTO;
 	info->nand.options	|= NAND_SKIP_BBTSCAN;
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
@@ -1325,13 +1325,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		break;
 
 	case NAND_OMAP_POLLED:
-		if (info->nand.options & NAND_BUSWIDTH_16) {
-			info->nand.read_buf   = omap_read_buf16;
-			info->nand.write_buf  = omap_write_buf16;
-		} else {
-			info->nand.read_buf   = omap_read_buf8;
-			info->nand.write_buf  = omap_write_buf8;
-		}
+		info->nand.read_buf   = omap_read_buf8;
+		info->nand.write_buf  = omap_write_buf8;
 		break;
 
 	case NAND_OMAP_PREFETCH_DMA:
@@ -1407,6 +1402,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		goto out_release_mem_region;
 	}
 
+	gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 0);
+	if (nand_scan_ident(&info->mtd, 1, NULL)) {
+		err = -ENXIO;
+		goto out_release_mem_region;
+	}
+
+	/* update for 16 bits device */
+	if (info->nand.options & NAND_BUSWIDTH_16) {
+		if (!(pdata->bussize & NAND_OMAP_BUS_16)) {
+			dev_err(&pdev->dev, "detected x16 flash, but board only support x8 flash\n");
+			err = -ENXIO;
+			goto out_release_mem_region;
+		}
+		gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 1);
+		if (pdata->xfer_type == NAND_OMAP_POLLED) {
+			info->nand.read_buf   = omap_read_buf16;
+			info->nand.write_buf  = omap_write_buf16;
+		}
+	}
+
 	/* select the ecc type */
 	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
 		info->nand.ecc.mode = NAND_ECC_SOFT;
@@ -1428,17 +1443,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
 		}
 	}
 
-	/* DIP switches on some boards change between 8 and 16 bit
-	 * bus widths for flash.  Try the other width if the first try fails.
-	 */
-	if (nand_scan_ident(&info->mtd, 1, NULL)) {
-		info->nand.options ^= NAND_BUSWIDTH_16;
-		if (nand_scan_ident(&info->mtd, 1, NULL)) {
-			err = -ENXIO;
-			goto out_release_mem_region;
-		}
-	}
-
 	/* rom code layout */
 	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {
 
diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
index 1a68c1e..766815e 100644
--- a/include/linux/platform_data/mtd-nand-omap2.h
+++ b/include/linux/platform_data/mtd-nand-omap2.h
@@ -18,6 +18,11 @@ enum nand_io {
 	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */
 };
 
+enum nand_bussize {
+	NAND_OMAP_BUS_8,
+	NAND_OMAP_BUS_16,
+};
+
 struct omap_nand_platform_data {
 	int			cs;
 	struct mtd_partition	*parts;
@@ -25,7 +30,7 @@ struct omap_nand_platform_data {
 	int			nr_parts;
 	bool			dev_ready;
 	enum nand_io		xfer_type;
-	int			devsize;
+	enum nand_bussize		bussize;
 	enum omap_ecc           ecc_opt;
 	struct gpmc_nand_regs	reg;
 };
-- 
1.7.10.4

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-06 10:51   ` Matthieu CASTET
@ 2012-11-06 12:37     ` Igor Grinberg
  -1 siblings, 0 replies; 40+ messages in thread
From: Igor Grinberg @ 2012-11-06 12:37 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: linux-mtd, linux-omap, dedekind1, Tony Lindgren, Afzal Mohammed

Cc: Tony Lindgren, Afzal Mohammed,

On 11/06/12 12:51, Matthieu CASTET wrote:
> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
> 
> This also make work onfi detection on beagleboard :
> 
> Before :
> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
> 
> After :
> [    1.914825] ONFI param page 0 valid
> [    1.919158] ONFI flash detected
> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
> 
> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

I think, you should base on one of Tony's branches with that kind of patches.
Because, for example the omap_nand_flash_init() function does not exist anymore
in Tony's master and may be several more things will need to have adjustments.
Also, the GPMC related stuff inside the NAND driver
should probably be coordinated with Afzal, as he is reworking the whole
GPMC related code.

> ---
>  arch/arm/mach-omap2/board-3630sdp.c          |    2 +-
>  arch/arm/mach-omap2/board-devkit8000.c       |    2 +-
>  arch/arm/mach-omap2/board-flash.c            |    8 ++---
>  arch/arm/mach-omap2/board-igep0020.c         |    2 +-
>  arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
>  arch/arm/mach-omap2/board-zoom.c             |    2 +-
>  arch/arm/mach-omap2/common-board-devices.c   |    2 +-
>  arch/arm/mach-omap2/gpmc-nand.c              |    5 ---
>  drivers/mtd/nand/omap2.c                     |   42 ++++++++++++++------------
>  include/linux/platform_data/mtd-nand-omap2.h |    7 ++++-
>  13 files changed, 42 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
> index fc224ad..d7b981b 100644
> --- a/arch/arm/mach-omap2/board-3630sdp.c
> +++ b/arch/arm/mach-omap2/board-3630sdp.c
> @@ -198,7 +198,7 @@ static void __init omap_sdp_init(void)
>  				  h8mbx00u0mer0em_sdrc_params);
>  	zoom_display_init();
>  	board_smc91x_init();
> -	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
> +	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_OMAP_BUS_16);
>  	enable_board_wakeup_source();
>  	usbhs_init(&usbhs_bdata);
>  }
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index 1fd161e..b3487e1 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -621,7 +621,7 @@ static void __init devkit8000_init(void)
>  
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, devkit8000_nand_partitions,
>  			     ARRAY_SIZE(devkit8000_nand_partitions));
>  	omap_twl4030_audio_init("omap3beagle");
>  
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 0cabe61..488a1fa 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -133,12 +133,12 @@ static struct omap_nand_platform_data board_nand_data = {
>  
>  void
>  __init board_nand_init(struct mtd_partition *nand_parts,
> -			u8 nr_parts, u8 cs, int nand_type)
> +			u8 nr_parts, u8 cs, int bus_type)
>  {
>  	board_nand_data.cs		= cs;
>  	board_nand_data.parts		= nand_parts;
>  	board_nand_data.nr_parts	= nr_parts;
> -	board_nand_data.devsize		= nand_type;
> +	board_nand_data.bussize		= bus_type;
>  
>  	board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
>  	gpmc_nand_init(&board_nand_data);
> @@ -185,7 +185,7 @@ unmap:
>   * @return - void.
>   */
>  void __init board_flash_init(struct flash_partitions partition_info[],
> -			char chip_sel_board[][GPMC_CS_NUM], int nand_type)
> +			char chip_sel_board[][GPMC_CS_NUM], int bus_type)
>  {
>  	u8		cs = 0;
>  	u8		norcs = GPMC_CS_NUM + 1;
> @@ -238,5 +238,5 @@ void __init board_flash_init(struct flash_partitions partition_info[],
>  		pr_err("NAND: Unable to find configuration in GPMC\n");
>  	else
>  		board_nand_init(partition_info[2].parts,
> -			partition_info[2].nr_parts, nandcs, nand_type);
> +			partition_info[2].nr_parts, nandcs, bus_type);
>  }
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 48d5e41..732f183 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -175,7 +175,7 @@ static void __init igep_flash_init(void)
>  		pr_info("IGEP: initializing NAND memory device\n");
>  		board_nand_init(igep_flash_partitions,
>  				ARRAY_SIZE(igep_flash_partitions),
> -				0, NAND_BUSWIDTH_16);
> +				0, NAND_OMAP_BUS_16);
>  	} else if (mux == IGEP_SYSBOOT_ONENAND) {
>  		pr_info("IGEP: initializing OneNAND memory device\n");
>  		board_onenand_init(igep_flash_partitions,
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index a08bebc..152b659 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -512,7 +512,7 @@ static void __init omap3_beagle_init(void)
>  
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3beagle_nand_partitions,
>  			     ARRAY_SIZE(omap3beagle_nand_partitions));
>  	omap_twl4030_audio_init("omap3beagle");
>  
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index a3959de..830e71b 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -732,7 +732,7 @@ static void __init omap3_evm_init(void)
>  	}
>  	usb_musb_init(&musb_board_data);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3evm_nand_partitions,
>  			     ARRAY_SIZE(omap3evm_nand_partitions));
>  
>  	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
> diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> index 00a1f4a..592fa5d 100644
> --- a/arch/arm/mach-omap2/board-omap3pandora.c
> +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> @@ -82,7 +82,7 @@ static struct mtd_partition omap3pandora_nand_partitions[] = {
>  
>  static struct omap_nand_platform_data pandora_nand_data = {
>  	.cs		= 0,
> -	.devsize	= NAND_BUSWIDTH_16,
> +	.bussize	= NAND_OMAP_BUS_16,
>  	.xfer_type	= NAND_OMAP_PREFETCH_DMA,
>  	.parts		= omap3pandora_nand_partitions,
>  	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
> diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
> index 944ffc4..7cef1e3 100644
> --- a/arch/arm/mach-omap2/board-omap3touchbook.c
> +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
> @@ -365,7 +365,7 @@ static void __init omap3_touchbook_init(void)
>  	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3touchbook_nand_partitions,
>  			     ARRAY_SIZE(omap3touchbook_nand_partitions));
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
> diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
> index 4994438..49349e7 100644
> --- a/arch/arm/mach-omap2/board-zoom.c
> +++ b/arch/arm/mach-omap2/board-zoom.c
> @@ -114,7 +114,7 @@ static void __init omap_zoom_init(void)
>  	}
>  
>  	board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
> -						ZOOM_NAND_CS, NAND_BUSWIDTH_16);
> +						ZOOM_NAND_CS, NAND_OMAP_BUS_16);
>  	zoom_debugboard_init();
>  	zoom_peripherals_init();
>  
> diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
> index 48daac2..2189f40 100644
> --- a/arch/arm/mach-omap2/common-board-devices.c
> +++ b/arch/arm/mach-omap2/common-board-devices.c
> @@ -128,7 +128,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
>  		nand_data.cs = nandcs;
>  		nand_data.parts = parts;
>  		nand_data.nr_parts = nr_parts;
> -		nand_data.devsize = options;
> +		nand_data.bussize = options;
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (gpmc_nand_init(&nand_data) < 0)
> diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
> index 4acf497..94f622e 100644
> --- a/arch/arm/mach-omap2/gpmc-nand.c
> +++ b/arch/arm/mach-omap2/gpmc-nand.c
> @@ -76,11 +76,6 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
>  	t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
>  	t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
>  
> -	/* Configure GPMC */
> -	if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
> -		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
> -	else
> -		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
>  	gpmc_cs_configure(gpmc_nand_data->cs,
>  			GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
>  	gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 5b31386..618cf42 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1273,7 +1273,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  	info->mtd.name		= dev_name(&pdev->dev);
>  	info->mtd.owner		= THIS_MODULE;
>  
> -	info->nand.options	= pdata->devsize;
> +	info->nand.options	= NAND_BUSWIDTH_AUTO;
>  	info->nand.options	|= NAND_SKIP_BBTSCAN;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1325,13 +1325,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		break;
>  
>  	case NAND_OMAP_POLLED:
> -		if (info->nand.options & NAND_BUSWIDTH_16) {
> -			info->nand.read_buf   = omap_read_buf16;
> -			info->nand.write_buf  = omap_write_buf16;
> -		} else {
> -			info->nand.read_buf   = omap_read_buf8;
> -			info->nand.write_buf  = omap_write_buf8;
> -		}
> +		info->nand.read_buf   = omap_read_buf8;
> +		info->nand.write_buf  = omap_write_buf8;
>  		break;
>  
>  	case NAND_OMAP_PREFETCH_DMA:
> @@ -1407,6 +1402,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		goto out_release_mem_region;
>  	}
>  
> +	gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 0);
> +	if (nand_scan_ident(&info->mtd, 1, NULL)) {
> +		err = -ENXIO;
> +		goto out_release_mem_region;
> +	}
> +
> +	/* update for 16 bits device */
> +	if (info->nand.options & NAND_BUSWIDTH_16) {
> +		if (!(pdata->bussize & NAND_OMAP_BUS_16)) {
> +			dev_err(&pdev->dev, "detected x16 flash, but board only support x8 flash\n");
> +			err = -ENXIO;
> +			goto out_release_mem_region;
> +		}
> +		gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 1);
> +		if (pdata->xfer_type == NAND_OMAP_POLLED) {
> +			info->nand.read_buf   = omap_read_buf16;
> +			info->nand.write_buf  = omap_write_buf16;
> +		}
> +	}
> +
>  	/* select the ecc type */
>  	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
>  		info->nand.ecc.mode = NAND_ECC_SOFT;
> @@ -1428,17 +1443,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	/* DIP switches on some boards change between 8 and 16 bit
> -	 * bus widths for flash.  Try the other width if the first try fails.
> -	 */
> -	if (nand_scan_ident(&info->mtd, 1, NULL)) {
> -		info->nand.options ^= NAND_BUSWIDTH_16;
> -		if (nand_scan_ident(&info->mtd, 1, NULL)) {
> -			err = -ENXIO;
> -			goto out_release_mem_region;
> -		}
> -	}
> -
>  	/* rom code layout */
>  	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {
>  
> diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
> index 1a68c1e..766815e 100644
> --- a/include/linux/platform_data/mtd-nand-omap2.h
> +++ b/include/linux/platform_data/mtd-nand-omap2.h
> @@ -18,6 +18,11 @@ enum nand_io {
>  	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */
>  };
>  
> +enum nand_bussize {
> +	NAND_OMAP_BUS_8,
> +	NAND_OMAP_BUS_16,
> +};
> +
>  struct omap_nand_platform_data {
>  	int			cs;
>  	struct mtd_partition	*parts;
> @@ -25,7 +30,7 @@ struct omap_nand_platform_data {
>  	int			nr_parts;
>  	bool			dev_ready;
>  	enum nand_io		xfer_type;
> -	int			devsize;
> +	enum nand_bussize		bussize;
>  	enum omap_ecc           ecc_opt;
>  	struct gpmc_nand_regs	reg;
>  };

-- 
Regards,
Igor.

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-06 12:37     ` Igor Grinberg
  0 siblings, 0 replies; 40+ messages in thread
From: Igor Grinberg @ 2012-11-06 12:37 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Tony Lindgren, Afzal Mohammed, linux-omap, linux-mtd, dedekind1

Cc: Tony Lindgren, Afzal Mohammed,

On 11/06/12 12:51, Matthieu CASTET wrote:
> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
> 
> This also make work onfi detection on beagleboard :
> 
> Before :
> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
> 
> After :
> [    1.914825] ONFI param page 0 valid
> [    1.919158] ONFI flash detected
> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
> 
> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

I think, you should base on one of Tony's branches with that kind of patches.
Because, for example the omap_nand_flash_init() function does not exist anymore
in Tony's master and may be several more things will need to have adjustments.
Also, the GPMC related stuff inside the NAND driver
should probably be coordinated with Afzal, as he is reworking the whole
GPMC related code.

> ---
>  arch/arm/mach-omap2/board-3630sdp.c          |    2 +-
>  arch/arm/mach-omap2/board-devkit8000.c       |    2 +-
>  arch/arm/mach-omap2/board-flash.c            |    8 ++---
>  arch/arm/mach-omap2/board-igep0020.c         |    2 +-
>  arch/arm/mach-omap2/board-omap3beagle.c      |    2 +-
>  arch/arm/mach-omap2/board-omap3evm.c         |    2 +-
>  arch/arm/mach-omap2/board-omap3pandora.c     |    2 +-
>  arch/arm/mach-omap2/board-omap3touchbook.c   |    2 +-
>  arch/arm/mach-omap2/board-zoom.c             |    2 +-
>  arch/arm/mach-omap2/common-board-devices.c   |    2 +-
>  arch/arm/mach-omap2/gpmc-nand.c              |    5 ---
>  drivers/mtd/nand/omap2.c                     |   42 ++++++++++++++------------
>  include/linux/platform_data/mtd-nand-omap2.h |    7 ++++-
>  13 files changed, 42 insertions(+), 38 deletions(-)
> 
> diff --git a/arch/arm/mach-omap2/board-3630sdp.c b/arch/arm/mach-omap2/board-3630sdp.c
> index fc224ad..d7b981b 100644
> --- a/arch/arm/mach-omap2/board-3630sdp.c
> +++ b/arch/arm/mach-omap2/board-3630sdp.c
> @@ -198,7 +198,7 @@ static void __init omap_sdp_init(void)
>  				  h8mbx00u0mer0em_sdrc_params);
>  	zoom_display_init();
>  	board_smc91x_init();
> -	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_BUSWIDTH_16);
> +	board_flash_init(sdp_flash_partitions, chip_sel_sdp, NAND_OMAP_BUS_16);
>  	enable_board_wakeup_source();
>  	usbhs_init(&usbhs_bdata);
>  }
> diff --git a/arch/arm/mach-omap2/board-devkit8000.c b/arch/arm/mach-omap2/board-devkit8000.c
> index 1fd161e..b3487e1 100644
> --- a/arch/arm/mach-omap2/board-devkit8000.c
> +++ b/arch/arm/mach-omap2/board-devkit8000.c
> @@ -621,7 +621,7 @@ static void __init devkit8000_init(void)
>  
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, devkit8000_nand_partitions,
>  			     ARRAY_SIZE(devkit8000_nand_partitions));
>  	omap_twl4030_audio_init("omap3beagle");
>  
> diff --git a/arch/arm/mach-omap2/board-flash.c b/arch/arm/mach-omap2/board-flash.c
> index 0cabe61..488a1fa 100644
> --- a/arch/arm/mach-omap2/board-flash.c
> +++ b/arch/arm/mach-omap2/board-flash.c
> @@ -133,12 +133,12 @@ static struct omap_nand_platform_data board_nand_data = {
>  
>  void
>  __init board_nand_init(struct mtd_partition *nand_parts,
> -			u8 nr_parts, u8 cs, int nand_type)
> +			u8 nr_parts, u8 cs, int bus_type)
>  {
>  	board_nand_data.cs		= cs;
>  	board_nand_data.parts		= nand_parts;
>  	board_nand_data.nr_parts	= nr_parts;
> -	board_nand_data.devsize		= nand_type;
> +	board_nand_data.bussize		= bus_type;
>  
>  	board_nand_data.ecc_opt = OMAP_ECC_HAMMING_CODE_DEFAULT;
>  	gpmc_nand_init(&board_nand_data);
> @@ -185,7 +185,7 @@ unmap:
>   * @return - void.
>   */
>  void __init board_flash_init(struct flash_partitions partition_info[],
> -			char chip_sel_board[][GPMC_CS_NUM], int nand_type)
> +			char chip_sel_board[][GPMC_CS_NUM], int bus_type)
>  {
>  	u8		cs = 0;
>  	u8		norcs = GPMC_CS_NUM + 1;
> @@ -238,5 +238,5 @@ void __init board_flash_init(struct flash_partitions partition_info[],
>  		pr_err("NAND: Unable to find configuration in GPMC\n");
>  	else
>  		board_nand_init(partition_info[2].parts,
> -			partition_info[2].nr_parts, nandcs, nand_type);
> +			partition_info[2].nr_parts, nandcs, bus_type);
>  }
> diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
> index 48d5e41..732f183 100644
> --- a/arch/arm/mach-omap2/board-igep0020.c
> +++ b/arch/arm/mach-omap2/board-igep0020.c
> @@ -175,7 +175,7 @@ static void __init igep_flash_init(void)
>  		pr_info("IGEP: initializing NAND memory device\n");
>  		board_nand_init(igep_flash_partitions,
>  				ARRAY_SIZE(igep_flash_partitions),
> -				0, NAND_BUSWIDTH_16);
> +				0, NAND_OMAP_BUS_16);
>  	} else if (mux == IGEP_SYSBOOT_ONENAND) {
>  		pr_info("IGEP: initializing OneNAND memory device\n");
>  		board_onenand_init(igep_flash_partitions,
> diff --git a/arch/arm/mach-omap2/board-omap3beagle.c b/arch/arm/mach-omap2/board-omap3beagle.c
> index a08bebc..152b659 100644
> --- a/arch/arm/mach-omap2/board-omap3beagle.c
> +++ b/arch/arm/mach-omap2/board-omap3beagle.c
> @@ -512,7 +512,7 @@ static void __init omap3_beagle_init(void)
>  
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3beagle_nand_partitions,
>  			     ARRAY_SIZE(omap3beagle_nand_partitions));
>  	omap_twl4030_audio_init("omap3beagle");
>  
> diff --git a/arch/arm/mach-omap2/board-omap3evm.c b/arch/arm/mach-omap2/board-omap3evm.c
> index a3959de..830e71b 100644
> --- a/arch/arm/mach-omap2/board-omap3evm.c
> +++ b/arch/arm/mach-omap2/board-omap3evm.c
> @@ -732,7 +732,7 @@ static void __init omap3_evm_init(void)
>  	}
>  	usb_musb_init(&musb_board_data);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3evm_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3evm_nand_partitions,
>  			     ARRAY_SIZE(omap3evm_nand_partitions));
>  
>  	omap_ads7846_init(1, OMAP3_EVM_TS_GPIO, 310, NULL);
> diff --git a/arch/arm/mach-omap2/board-omap3pandora.c b/arch/arm/mach-omap2/board-omap3pandora.c
> index 00a1f4a..592fa5d 100644
> --- a/arch/arm/mach-omap2/board-omap3pandora.c
> +++ b/arch/arm/mach-omap2/board-omap3pandora.c
> @@ -82,7 +82,7 @@ static struct mtd_partition omap3pandora_nand_partitions[] = {
>  
>  static struct omap_nand_platform_data pandora_nand_data = {
>  	.cs		= 0,
> -	.devsize	= NAND_BUSWIDTH_16,
> +	.bussize	= NAND_OMAP_BUS_16,
>  	.xfer_type	= NAND_OMAP_PREFETCH_DMA,
>  	.parts		= omap3pandora_nand_partitions,
>  	.nr_parts	= ARRAY_SIZE(omap3pandora_nand_partitions),
> diff --git a/arch/arm/mach-omap2/board-omap3touchbook.c b/arch/arm/mach-omap2/board-omap3touchbook.c
> index 944ffc4..7cef1e3 100644
> --- a/arch/arm/mach-omap2/board-omap3touchbook.c
> +++ b/arch/arm/mach-omap2/board-omap3touchbook.c
> @@ -365,7 +365,7 @@ static void __init omap3_touchbook_init(void)
>  	omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
>  	usb_musb_init(NULL);
>  	usbhs_init(&usbhs_bdata);
> -	omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
> +	omap_nand_flash_init(NAND_OMAP_BUS_16, omap3touchbook_nand_partitions,
>  			     ARRAY_SIZE(omap3touchbook_nand_partitions));
>  
>  	/* Ensure SDRC pins are mux'd for self-refresh */
> diff --git a/arch/arm/mach-omap2/board-zoom.c b/arch/arm/mach-omap2/board-zoom.c
> index 4994438..49349e7 100644
> --- a/arch/arm/mach-omap2/board-zoom.c
> +++ b/arch/arm/mach-omap2/board-zoom.c
> @@ -114,7 +114,7 @@ static void __init omap_zoom_init(void)
>  	}
>  
>  	board_nand_init(zoom_nand_partitions, ARRAY_SIZE(zoom_nand_partitions),
> -						ZOOM_NAND_CS, NAND_BUSWIDTH_16);
> +						ZOOM_NAND_CS, NAND_OMAP_BUS_16);
>  	zoom_debugboard_init();
>  	zoom_peripherals_init();
>  
> diff --git a/arch/arm/mach-omap2/common-board-devices.c b/arch/arm/mach-omap2/common-board-devices.c
> index 48daac2..2189f40 100644
> --- a/arch/arm/mach-omap2/common-board-devices.c
> +++ b/arch/arm/mach-omap2/common-board-devices.c
> @@ -128,7 +128,7 @@ void __init omap_nand_flash_init(int options, struct mtd_partition *parts,
>  		nand_data.cs = nandcs;
>  		nand_data.parts = parts;
>  		nand_data.nr_parts = nr_parts;
> -		nand_data.devsize = options;
> +		nand_data.bussize = options;
>  
>  		printk(KERN_INFO "Registering NAND on CS%d\n", nandcs);
>  		if (gpmc_nand_init(&nand_data) < 0)
> diff --git a/arch/arm/mach-omap2/gpmc-nand.c b/arch/arm/mach-omap2/gpmc-nand.c
> index 4acf497..94f622e 100644
> --- a/arch/arm/mach-omap2/gpmc-nand.c
> +++ b/arch/arm/mach-omap2/gpmc-nand.c
> @@ -76,11 +76,6 @@ static int omap2_nand_gpmc_retime(struct omap_nand_platform_data *gpmc_nand_data
>  	t.cs_wr_off = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->cs_wr_off);
>  	t.wr_cycle  = gpmc_round_ns_to_ticks(gpmc_nand_data->gpmc_t->wr_cycle);
>  
> -	/* Configure GPMC */
> -	if (gpmc_nand_data->devsize == NAND_BUSWIDTH_16)
> -		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 1);
> -	else
> -		gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_DEV_SIZE, 0);
>  	gpmc_cs_configure(gpmc_nand_data->cs,
>  			GPMC_CONFIG_DEV_TYPE, GPMC_DEVICETYPE_NAND);
>  	gpmc_cs_configure(gpmc_nand_data->cs, GPMC_CONFIG_WP, 0);
> diff --git a/drivers/mtd/nand/omap2.c b/drivers/mtd/nand/omap2.c
> index 5b31386..618cf42 100644
> --- a/drivers/mtd/nand/omap2.c
> +++ b/drivers/mtd/nand/omap2.c
> @@ -1273,7 +1273,7 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  	info->mtd.name		= dev_name(&pdev->dev);
>  	info->mtd.owner		= THIS_MODULE;
>  
> -	info->nand.options	= pdata->devsize;
> +	info->nand.options	= NAND_BUSWIDTH_AUTO;
>  	info->nand.options	|= NAND_SKIP_BBTSCAN;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> @@ -1325,13 +1325,8 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		break;
>  
>  	case NAND_OMAP_POLLED:
> -		if (info->nand.options & NAND_BUSWIDTH_16) {
> -			info->nand.read_buf   = omap_read_buf16;
> -			info->nand.write_buf  = omap_write_buf16;
> -		} else {
> -			info->nand.read_buf   = omap_read_buf8;
> -			info->nand.write_buf  = omap_write_buf8;
> -		}
> +		info->nand.read_buf   = omap_read_buf8;
> +		info->nand.write_buf  = omap_write_buf8;
>  		break;
>  
>  	case NAND_OMAP_PREFETCH_DMA:
> @@ -1407,6 +1402,26 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		goto out_release_mem_region;
>  	}
>  
> +	gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 0);
> +	if (nand_scan_ident(&info->mtd, 1, NULL)) {
> +		err = -ENXIO;
> +		goto out_release_mem_region;
> +	}
> +
> +	/* update for 16 bits device */
> +	if (info->nand.options & NAND_BUSWIDTH_16) {
> +		if (!(pdata->bussize & NAND_OMAP_BUS_16)) {
> +			dev_err(&pdev->dev, "detected x16 flash, but board only support x8 flash\n");
> +			err = -ENXIO;
> +			goto out_release_mem_region;
> +		}
> +		gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, 1);
> +		if (pdata->xfer_type == NAND_OMAP_POLLED) {
> +			info->nand.read_buf   = omap_read_buf16;
> +			info->nand.write_buf  = omap_write_buf16;
> +		}
> +	}
> +
>  	/* select the ecc type */
>  	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_DEFAULT)
>  		info->nand.ecc.mode = NAND_ECC_SOFT;
> @@ -1428,17 +1443,6 @@ static int __devinit omap_nand_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	/* DIP switches on some boards change between 8 and 16 bit
> -	 * bus widths for flash.  Try the other width if the first try fails.
> -	 */
> -	if (nand_scan_ident(&info->mtd, 1, NULL)) {
> -		info->nand.options ^= NAND_BUSWIDTH_16;
> -		if (nand_scan_ident(&info->mtd, 1, NULL)) {
> -			err = -ENXIO;
> -			goto out_release_mem_region;
> -		}
> -	}
> -
>  	/* rom code layout */
>  	if (pdata->ecc_opt == OMAP_ECC_HAMMING_CODE_HW_ROMCODE) {
>  
> diff --git a/include/linux/platform_data/mtd-nand-omap2.h b/include/linux/platform_data/mtd-nand-omap2.h
> index 1a68c1e..766815e 100644
> --- a/include/linux/platform_data/mtd-nand-omap2.h
> +++ b/include/linux/platform_data/mtd-nand-omap2.h
> @@ -18,6 +18,11 @@ enum nand_io {
>  	NAND_OMAP_PREFETCH_IRQ		/* prefetch enabled irq mode */
>  };
>  
> +enum nand_bussize {
> +	NAND_OMAP_BUS_8,
> +	NAND_OMAP_BUS_16,
> +};
> +
>  struct omap_nand_platform_data {
>  	int			cs;
>  	struct mtd_partition	*parts;
> @@ -25,7 +30,7 @@ struct omap_nand_platform_data {
>  	int			nr_parts;
>  	bool			dev_ready;
>  	enum nand_io		xfer_type;
> -	int			devsize;
> +	enum nand_bussize		bussize;
>  	enum omap_ecc           ecc_opt;
>  	struct gpmc_nand_regs	reg;
>  };

-- 
Regards,
Igor.

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-06 12:37     ` Igor Grinberg
@ 2012-11-06 16:47       ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 16:47 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: linux-mtd, linux-omap, dedekind1, Tony Lindgren, Afzal Mohammed

Igor Grinberg a écrit :
> Cc: Tony Lindgren, Afzal Mohammed,
> 
> On 11/06/12 12:51, Matthieu CASTET wrote:
>> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
>>
>> This also make work onfi detection on beagleboard :
>>
>> Before :
>> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
>>
>> After :
>> [    1.914825] ONFI param page 0 valid
>> [    1.919158] ONFI flash detected
>> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
>>
>> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
>>
>> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> 
> I think, you should base on one of Tony's branches with that kind of patches.
> Because, for example the omap_nand_flash_init() function does not exist anymore
> in Tony's master and may be several more things will need to have adjustments.
> Also, the GPMC related stuff inside the NAND driver
> should probably be coordinated with Afzal, as he is reworking the whole
> GPMC related code.

Thanks for the info.

Where such tree could be found ?


Matthieu
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-06 16:47       ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-06 16:47 UTC (permalink / raw)
  To: Igor Grinberg
  Cc: Tony Lindgren, Afzal Mohammed, linux-omap, linux-mtd, dedekind1

Igor Grinberg a écrit :
> Cc: Tony Lindgren, Afzal Mohammed,
> 
> On 11/06/12 12:51, Matthieu CASTET wrote:
>> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
>>
>> This also make work onfi detection on beagleboard :
>>
>> Before :
>> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
>>
>> After :
>> [    1.914825] ONFI param page 0 valid
>> [    1.919158] ONFI flash detected
>> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
>>
>> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
>>
>> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> 
> I think, you should base on one of Tony's branches with that kind of patches.
> Because, for example the omap_nand_flash_init() function does not exist anymore
> in Tony's master and may be several more things will need to have adjustments.
> Also, the GPMC related stuff inside the NAND driver
> should probably be coordinated with Afzal, as he is reworking the whole
> GPMC related code.

Thanks for the info.

Where such tree could be found ?


Matthieu

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-06 16:47       ` Matthieu CASTET
@ 2012-11-06 18:40         ` Tony Lindgren
  -1 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2012-11-06 18:40 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Igor Grinberg, linux-mtd, linux-omap, dedekind1, Afzal Mohammed

* Matthieu CASTET <matthieu.castet@parrot.com> [121106 08:49]:
> Igor Grinberg a écrit :
> > Cc: Tony Lindgren, Afzal Mohammed,
> > 
> > On 11/06/12 12:51, Matthieu CASTET wrote:
> >> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
> >>
> >> This also make work onfi detection on beagleboard :
> >>
> >> Before :
> >> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
> >>
> >> After :
> >> [    1.914825] ONFI param page 0 valid
> >> [    1.919158] ONFI flash detected
> >> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
> >>
> >> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
> >>
> >> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> > 
> > I think, you should base on one of Tony's branches with that kind of patches.
> > Because, for example the omap_nand_flash_init() function does not exist anymore
> > in Tony's master and may be several more things will need to have adjustments.
> > Also, the GPMC related stuff inside the NAND driver
> > should probably be coordinated with Afzal, as he is reworking the whole
> > GPMC related code.
> 
> Thanks for the info.
> 
> Where such tree could be found ?

You should be able to use omap-for-v3.8/cleanup-headers-gpmc
branch as a base for your patches [1].

Eventually once when we're done with all the clean up, the MTD
driver should be completely separated from the core omap code
and I'll be out of the way.

Regards,

Tony

[1] http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=shortlog;h=refs/heads/omap-for-v3.8/cleanup-headers-gpmc
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-06 18:40         ` Tony Lindgren
  0 siblings, 0 replies; 40+ messages in thread
From: Tony Lindgren @ 2012-11-06 18:40 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Afzal Mohammed, linux-omap, linux-mtd, Igor Grinberg, dedekind1

* Matthieu CASTET <matthieu.castet@parrot.com> [121106 08:49]:
> Igor Grinberg a écrit :
> > Cc: Tony Lindgren, Afzal Mohammed,
> > 
> > On 11/06/12 12:51, Matthieu CASTET wrote:
> >> This allow to clean the omap nand driver that were trying in x8 and x16 bits mode.
> >>
> >> This also make work onfi detection on beagleboard :
> >>
> >> Before :
> >> [    1.954803] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron NAND 256MiB 1,8V 16-bit), page size: 2048, OOB size: 64
> >>
> >> After :
> >> [    1.914825] ONFI param page 0 valid
> >> [    1.919158] ONFI flash detected
> >> [    1.922515] NAND device: Manufacturer ID: 0x2c, Chip ID: 0xba (Micron MT29F2G16ABD), page size: 2048, OOB size: 64
> >>
> >> platform data devsize is renamed bussize. It now indicate the maximun size of the nand bus.
> >>
> >> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> > 
> > I think, you should base on one of Tony's branches with that kind of patches.
> > Because, for example the omap_nand_flash_init() function does not exist anymore
> > in Tony's master and may be several more things will need to have adjustments.
> > Also, the GPMC related stuff inside the NAND driver
> > should probably be coordinated with Afzal, as he is reworking the whole
> > GPMC related code.
> 
> Thanks for the info.
> 
> Where such tree could be found ?

You should be able to use omap-for-v3.8/cleanup-headers-gpmc
branch as a base for your patches [1].

Eventually once when we're done with all the clean up, the MTD
driver should be completely separated from the core omap code
and I'll be out of the way.

Regards,

Tony

[1] http://git.kernel.org/?p=linux/kernel/git/tmlind/linux-omap.git;a=shortlog;h=refs/heads/omap-for-v3.8/cleanup-headers-gpmc

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-06 18:40         ` Tony Lindgren
@ 2012-11-16  8:22           ` Artem Bityutskiy
  -1 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-11-16  8:22 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Matthieu CASTET, Igor Grinberg, linux-mtd, linux-omap, Afzal Mohammed

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

On Tue, 2012-11-06 at 10:40 -0800, Tony Lindgren wrote:
> > Where such tree could be found ?
> 
> You should be able to use omap-for-v3.8/cleanup-headers-gpmc
> branch as a base for your patches [1].

Is this a stable branch which I may pull into l2-mtd.git? Then I could
merge Matthieu's patches.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-16  8:22           ` Artem Bityutskiy
  0 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-11-16  8:22 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Afzal Mohammed, linux-omap, linux-mtd, Igor Grinberg, Matthieu CASTET

[-- Attachment #1: Type: text/plain, Size: 346 bytes --]

On Tue, 2012-11-06 at 10:40 -0800, Tony Lindgren wrote:
> > Where such tree could be found ?
> 
> You should be able to use omap-for-v3.8/cleanup-headers-gpmc
> branch as a base for your patches [1].

Is this a stable branch which I may pull into l2-mtd.git? Then I could
merge Matthieu's patches.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
  2012-11-16  8:22           ` Artem Bityutskiy
@ 2012-11-22 17:48             ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-22 17:48 UTC (permalink / raw)
  To: dedekind1
  Cc: Tony Lindgren, Afzal Mohammed, linux-omap, linux-mtd, Igor Grinberg

Artem Bityutskiy a écrit :
> On Tue, 2012-11-06 at 10:40 -0800, Tony Lindgren wrote:
>>> Where such tree could be found ?
>> You should be able to use omap-for-v3.8/cleanup-headers-gpmc
>> branch as a base for your patches [1].
> 
> Is this a stable branch which I may pull into l2-mtd.git? Then I could
> merge Matthieu's patches.
> 

patch 1 and 2 are not controller dependent.

I added the support for the omap controller because I can easily test on it (and
 beagleboard got a x16 onfi flash).

What a shame that omap workflow is so complex :
- I think Artem want support for at least one controller before merging generic code
- I can rebase on omap-for-v3.8/cleanup-headers-gpmc, but this is weird to add
generic code for nand that is not specific to omap on it ?


Matthieu


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

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

* Re: [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO
@ 2012-11-22 17:48             ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2012-11-22 17:48 UTC (permalink / raw)
  To: dedekind1
  Cc: Tony Lindgren, Afzal Mohammed, linux-omap, linux-mtd, Igor Grinberg

Artem Bityutskiy a écrit :
> On Tue, 2012-11-06 at 10:40 -0800, Tony Lindgren wrote:
>>> Where such tree could be found ?
>> You should be able to use omap-for-v3.8/cleanup-headers-gpmc
>> branch as a base for your patches [1].
> 
> Is this a stable branch which I may pull into l2-mtd.git? Then I could
> merge Matthieu's patches.
> 

patch 1 and 2 are not controller dependent.

I added the support for the omap controller because I can easily test on it (and
 beagleboard got a x16 onfi flash).

What a shame that omap workflow is so complex :
- I think Artem want support for at least one controller before merging generic code
- I can rebase on omap-for-v3.8/cleanup-headers-gpmc, but this is weird to add
generic code for nand that is not specific to omap on it ?


Matthieu

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

* Re: [PATCH 2/3] mtd nand : add NAND_BUSWIDTH_AUTO to autodetect bus width
  2012-11-06 10:51   ` Matthieu CASTET
@ 2012-11-30 13:21     ` Artem Bityutskiy
  -1 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-11-30 13:21 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> The driver call nand_scan_ident in 8 bit mode, then
> readid or onfi detection are done (and detect bus width).
> The driver should update its bus width before calling nand_scan_tail.
> 
> This work because readid and onfi are read work 8 byte mode.


Pushed this one alone to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 2/3] mtd nand : add NAND_BUSWIDTH_AUTO to autodetect bus width
@ 2012-11-30 13:21     ` Artem Bityutskiy
  0 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-11-30 13:21 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> The driver call nand_scan_ident in 8 bit mode, then
> readid or onfi detection are done (and detect bus width).
> The driver should update its bus width before calling nand_scan_tail.
> 
> This work because readid and onfi are read work 8 byte mode.


Pushed this one alone to l2-mtd.git, thanks!

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2012-11-06 10:51 ` Matthieu CASTET
@ 2012-12-03 10:20   ` Artem Bityutskiy
  -1 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-12-03 10:20 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-mtd, linux-omap

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
> - NAND_CMD_PARAM want 8 bits data
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

Pushed this one to l2-mtd.git, thanks!


-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2012-12-03 10:20   ` Artem Bityutskiy
  0 siblings, 0 replies; 40+ messages in thread
From: Artem Bityutskiy @ 2012-12-03 10:20 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd

[-- Attachment #1: Type: text/plain, Size: 340 bytes --]

On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
> - NAND_CMD_PARAM want 8 bits data
> 
> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>

Pushed this one to l2-mtd.git, thanks!


-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2012-12-03 10:20   ` Artem Bityutskiy
@ 2012-12-24  0:29     ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2012-12-24  0:29 UTC (permalink / raw)
  To: Matthieu CASTET, Artem Bityutskiy; +Cc: linux-mtd, linux-omap

Hi

On Mon, 3 Dec 2012, Artem Bityutskiy wrote:

> On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> > - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
> > - NAND_CMD_PARAM want 8 bits data
> > 
> > Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> 
> Pushed this one to l2-mtd.git, thanks!

This patch (commit ff3206b2450499203532af2505a7f6f8413e92c0 in mainline) 
is causing warnings on OMAP3730 Beagle XM, OMAP3530 Beagle, and DM37xx EVM 
as of v3.8-rc1:

[    1.349456] ------------[ cut here ]------------
[    1.351959] WARNING: at drivers/mtd/nand/nand_base.c:2861 nand_scan_ident+0xdb4/0xf90()
[    1.356292] Modules linked in:
[    1.357971] [<c001bf50>] (unwind_backtrace+0x0/0xf0) from [<c0045cec>] (warn_slowpath_common+0x4c/0x64)
[    1.363037] [<c0045cec>] (warn_slowpath_common+0x4c/0x64) from [<c0045d20>] (warn_slowpath_null+0x1c/0x24)
[    1.368194] [<c0045d20>] (warn_slowpath_null+0x1c/0x24) from [<c039d304>] (nand_scan_ident+0xdb4/0xf90)
[    1.373229] [<c039d304>] (nand_scan_ident+0xdb4/0xf90) from [<c03a2448>] (omap_nand_probe+0x2e8/0x678)
[    1.378234] [<c03a2448>] (omap_nand_probe+0x2e8/0x678) from [<c0357f84>] (platform_drv_probe+0x18/0x1c)
[    1.383239] [<c0357f84>] (platform_drv_probe+0x18/0x1c) from [<c0356b84>] (driver_probe_device+0x84/0x224)
[    1.388458] [<c0356b84>] (driver_probe_device+0x84/0x224) from [<c0356db8>] (__driver_attach+0x94/0x98)
[    1.393493] [<c0356db8>] (__driver_attach+0x94/0x98) from [<c0355330>] (bus_for_each_dev+0x50/0x7c)
[    1.398315] [<c0355330>] (bus_for_each_dev+0x50/0x7c) from [<c0356250>] (bus_add_driver+0xa0/0x2a0)
[    1.403198] [<c0356250>] (bus_add_driver+0xa0/0x2a0) from [<c03572ec>] (driver_register+0x78/0x18c)
[    1.408020] [<c03572ec>] (driver_register+0x78/0x18c) from [<c00086a4>] (do_one_initcall+0x34/0x194)
[    1.412933] [<c00086a4>] (do_one_initcall+0x34/0x194) from [<c0528188>] (kernel_init+0x154/0x2ec)
[    1.417724] [<c0528188>] (kernel_init+0x154/0x2ec) from [<c0013d50>] (ret_from_fork+0x14/0x24)
[    1.422454] ---[ end trace 7f5c9fb048cfa61e ]---

The patch also looks bogus.  The patch states that "ONFI need to be probed 
in 8 bits mode" (sic).  But if that's so, shouldn't 
nand_flash_detect_onfi()  just fail immediately, rather than warn?


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2012-12-24  0:29     ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2012-12-24  0:29 UTC (permalink / raw)
  To: Matthieu CASTET, Artem Bityutskiy; +Cc: linux-omap, linux-mtd

Hi

On Mon, 3 Dec 2012, Artem Bityutskiy wrote:

> On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
> > - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
> > - NAND_CMD_PARAM want 8 bits data
> > 
> > Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
> 
> Pushed this one to l2-mtd.git, thanks!

This patch (commit ff3206b2450499203532af2505a7f6f8413e92c0 in mainline) 
is causing warnings on OMAP3730 Beagle XM, OMAP3530 Beagle, and DM37xx EVM 
as of v3.8-rc1:

[    1.349456] ------------[ cut here ]------------
[    1.351959] WARNING: at drivers/mtd/nand/nand_base.c:2861 nand_scan_ident+0xdb4/0xf90()
[    1.356292] Modules linked in:
[    1.357971] [<c001bf50>] (unwind_backtrace+0x0/0xf0) from [<c0045cec>] (warn_slowpath_common+0x4c/0x64)
[    1.363037] [<c0045cec>] (warn_slowpath_common+0x4c/0x64) from [<c0045d20>] (warn_slowpath_null+0x1c/0x24)
[    1.368194] [<c0045d20>] (warn_slowpath_null+0x1c/0x24) from [<c039d304>] (nand_scan_ident+0xdb4/0xf90)
[    1.373229] [<c039d304>] (nand_scan_ident+0xdb4/0xf90) from [<c03a2448>] (omap_nand_probe+0x2e8/0x678)
[    1.378234] [<c03a2448>] (omap_nand_probe+0x2e8/0x678) from [<c0357f84>] (platform_drv_probe+0x18/0x1c)
[    1.383239] [<c0357f84>] (platform_drv_probe+0x18/0x1c) from [<c0356b84>] (driver_probe_device+0x84/0x224)
[    1.388458] [<c0356b84>] (driver_probe_device+0x84/0x224) from [<c0356db8>] (__driver_attach+0x94/0x98)
[    1.393493] [<c0356db8>] (__driver_attach+0x94/0x98) from [<c0355330>] (bus_for_each_dev+0x50/0x7c)
[    1.398315] [<c0355330>] (bus_for_each_dev+0x50/0x7c) from [<c0356250>] (bus_add_driver+0xa0/0x2a0)
[    1.403198] [<c0356250>] (bus_add_driver+0xa0/0x2a0) from [<c03572ec>] (driver_register+0x78/0x18c)
[    1.408020] [<c03572ec>] (driver_register+0x78/0x18c) from [<c00086a4>] (do_one_initcall+0x34/0x194)
[    1.412933] [<c00086a4>] (do_one_initcall+0x34/0x194) from [<c0528188>] (kernel_init+0x154/0x2ec)
[    1.417724] [<c0528188>] (kernel_init+0x154/0x2ec) from [<c0013d50>] (ret_from_fork+0x14/0x24)
[    1.422454] ---[ end trace 7f5c9fb048cfa61e ]---

The patch also looks bogus.  The patch states that "ONFI need to be probed 
in 8 bits mode" (sic).  But if that's so, shouldn't 
nand_flash_detect_onfi()  just fail immediately, rather than warn?


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2012-12-24  0:29     ` Paul Walmsley
@ 2013-01-02  9:51       ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-01-02  9:51 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

Hi Paul,

Paul Walmsley a écrit :
> Hi
> 
> On Mon, 3 Dec 2012, Artem Bityutskiy wrote:
> 
>> On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
>>> - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
>>> - NAND_CMD_PARAM want 8 bits data
>>>
>>> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
>> Pushed this one to l2-mtd.git, thanks!
> 
> This patch (commit ff3206b2450499203532af2505a7f6f8413e92c0 in mainline) 
> is causing warnings on OMAP3730 Beagle XM, OMAP3530 Beagle, and DM37xx EVM 
> as of v3.8-rc1:
> 
> [    1.349456] ------------[ cut here ]------------
> [    1.351959] WARNING: at drivers/mtd/nand/nand_base.c:2861 nand_scan_ident+0xdb4/0xf90()
> [    1.356292] Modules linked in:
> [    1.357971] [<c001bf50>] (unwind_backtrace+0x0/0xf0) from [<c0045cec>] (warn_slowpath_common+0x4c/0x64)
> [    1.363037] [<c0045cec>] (warn_slowpath_common+0x4c/0x64) from [<c0045d20>] (warn_slowpath_null+0x1c/0x24)
> [    1.368194] [<c0045d20>] (warn_slowpath_null+0x1c/0x24) from [<c039d304>] (nand_scan_ident+0xdb4/0xf90)
> [    1.373229] [<c039d304>] (nand_scan_ident+0xdb4/0xf90) from [<c03a2448>] (omap_nand_probe+0x2e8/0x678)
> [    1.378234] [<c03a2448>] (omap_nand_probe+0x2e8/0x678) from [<c0357f84>] (platform_drv_probe+0x18/0x1c)
> [    1.383239] [<c0357f84>] (platform_drv_probe+0x18/0x1c) from [<c0356b84>] (driver_probe_device+0x84/0x224)
> [    1.388458] [<c0356b84>] (driver_probe_device+0x84/0x224) from [<c0356db8>] (__driver_attach+0x94/0x98)
> [    1.393493] [<c0356db8>] (__driver_attach+0x94/0x98) from [<c0355330>] (bus_for_each_dev+0x50/0x7c)
> [    1.398315] [<c0355330>] (bus_for_each_dev+0x50/0x7c) from [<c0356250>] (bus_add_driver+0xa0/0x2a0)
> [    1.403198] [<c0356250>] (bus_add_driver+0xa0/0x2a0) from [<c03572ec>] (driver_register+0x78/0x18c)
> [    1.408020] [<c03572ec>] (driver_register+0x78/0x18c) from [<c00086a4>] (do_one_initcall+0x34/0x194)
> [    1.412933] [<c00086a4>] (do_one_initcall+0x34/0x194) from [<c0528188>] (kernel_init+0x154/0x2ec)
> [    1.417724] [<c0528188>] (kernel_init+0x154/0x2ec) from [<c0013d50>] (ret_from_fork+0x14/0x24)
> [    1.422454] ---[ end trace 7f5c9fb048cfa61e ]---
> 
> The patch also looks bogus.  The patch states that "ONFI need to be probed 
> in 8 bits mode" (sic).  But if that's so, shouldn't 
> nand_flash_detect_onfi()  just fail immediately, rather than warn?
> 
I put a warning in order we fix drivers instead of a silent failure.

The omap driver was fixed in the same series with
http://article.gmane.org/gmane.linux.ports.arm.omap/88551 and
http://article.gmane.org/gmane.linux.ports.arm.omap/88549

For drivers that can't support ONFI, I don't know what to do.
May we should be replace the WARN_ON by a printk and early return.

Matthieu
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-01-02  9:51       ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-01-02  9:51 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

Hi Paul,

Paul Walmsley a écrit :
> Hi
> 
> On Mon, 3 Dec 2012, Artem Bityutskiy wrote:
> 
>> On Tue, 2012-11-06 at 11:51 +0100, Matthieu CASTET wrote:
>>> - NAND_CMD_READID want an address that it is not scaled on x16 device (it is always 0x20)
>>> - NAND_CMD_PARAM want 8 bits data
>>>
>>> Signed-off-by: Matthieu CASTET <matthieu.castet@parrot.com>
>> Pushed this one to l2-mtd.git, thanks!
> 
> This patch (commit ff3206b2450499203532af2505a7f6f8413e92c0 in mainline) 
> is causing warnings on OMAP3730 Beagle XM, OMAP3530 Beagle, and DM37xx EVM 
> as of v3.8-rc1:
> 
> [    1.349456] ------------[ cut here ]------------
> [    1.351959] WARNING: at drivers/mtd/nand/nand_base.c:2861 nand_scan_ident+0xdb4/0xf90()
> [    1.356292] Modules linked in:
> [    1.357971] [<c001bf50>] (unwind_backtrace+0x0/0xf0) from [<c0045cec>] (warn_slowpath_common+0x4c/0x64)
> [    1.363037] [<c0045cec>] (warn_slowpath_common+0x4c/0x64) from [<c0045d20>] (warn_slowpath_null+0x1c/0x24)
> [    1.368194] [<c0045d20>] (warn_slowpath_null+0x1c/0x24) from [<c039d304>] (nand_scan_ident+0xdb4/0xf90)
> [    1.373229] [<c039d304>] (nand_scan_ident+0xdb4/0xf90) from [<c03a2448>] (omap_nand_probe+0x2e8/0x678)
> [    1.378234] [<c03a2448>] (omap_nand_probe+0x2e8/0x678) from [<c0357f84>] (platform_drv_probe+0x18/0x1c)
> [    1.383239] [<c0357f84>] (platform_drv_probe+0x18/0x1c) from [<c0356b84>] (driver_probe_device+0x84/0x224)
> [    1.388458] [<c0356b84>] (driver_probe_device+0x84/0x224) from [<c0356db8>] (__driver_attach+0x94/0x98)
> [    1.393493] [<c0356db8>] (__driver_attach+0x94/0x98) from [<c0355330>] (bus_for_each_dev+0x50/0x7c)
> [    1.398315] [<c0355330>] (bus_for_each_dev+0x50/0x7c) from [<c0356250>] (bus_add_driver+0xa0/0x2a0)
> [    1.403198] [<c0356250>] (bus_add_driver+0xa0/0x2a0) from [<c03572ec>] (driver_register+0x78/0x18c)
> [    1.408020] [<c03572ec>] (driver_register+0x78/0x18c) from [<c00086a4>] (do_one_initcall+0x34/0x194)
> [    1.412933] [<c00086a4>] (do_one_initcall+0x34/0x194) from [<c0528188>] (kernel_init+0x154/0x2ec)
> [    1.417724] [<c0528188>] (kernel_init+0x154/0x2ec) from [<c0013d50>] (ret_from_fork+0x14/0x24)
> [    1.422454] ---[ end trace 7f5c9fb048cfa61e ]---
> 
> The patch also looks bogus.  The patch states that "ONFI need to be probed 
> in 8 bits mode" (sic).  But if that's so, shouldn't 
> nand_flash_detect_onfi()  just fail immediately, rather than warn?
> 
I put a warning in order we fix drivers instead of a silent failure.

The omap driver was fixed in the same series with
http://article.gmane.org/gmane.linux.ports.arm.omap/88551 and
http://article.gmane.org/gmane.linux.ports.arm.omap/88549

For drivers that can't support ONFI, I don't know what to do.
May we should be replace the WARN_ON by a printk and early return.

Matthieu

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-01-02  9:51       ` Matthieu CASTET
@ 2013-01-03 17:10         ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-03 17:10 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

Hi

On Wed, 2 Jan 2013, Matthieu CASTET wrote:

> I put a warning in order we fix drivers instead of a silent failure.
> 
> The omap driver was fixed in the same series with
> http://article.gmane.org/gmane.linux.ports.arm.omap/88551 and

... which got merged by Artem.

> http://article.gmane.org/gmane.linux.ports.arm.omap/88549

... which did not get merged because Tony requested that it should be 
based on top of his cleanup work (which takes priority over adding new 
features):

http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549

Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
on v3.8-rc2 and repost?

> For drivers that can't support ONFI, I don't know what to do.
> May we should be replace the WARN_ON by a printk and early return.

That sounds like a good idea to me.  The traceback seems excessive, since 
the NAND was usable before this series.


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-01-03 17:10         ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-03 17:10 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

Hi

On Wed, 2 Jan 2013, Matthieu CASTET wrote:

> I put a warning in order we fix drivers instead of a silent failure.
> 
> The omap driver was fixed in the same series with
> http://article.gmane.org/gmane.linux.ports.arm.omap/88551 and

... which got merged by Artem.

> http://article.gmane.org/gmane.linux.ports.arm.omap/88549

... which did not get merged because Tony requested that it should be 
based on top of his cleanup work (which takes priority over adding new 
features):

http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549

Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
on v3.8-rc2 and repost?

> For drivers that can't support ONFI, I don't know what to do.
> May we should be replace the WARN_ON by a printk and early return.

That sounds like a good idea to me.  The traceback seems excessive, since 
the NAND was usable before this series.


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-01-03 17:10         ` Paul Walmsley
@ 2013-01-16 14:28           ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-01-16 14:28 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

Hi,

Paul Walmsley a écrit :
> Hi
> 
> On Wed, 2 Jan 2013, Matthieu CASTET wrote:

> .... which did not get merged because Tony requested that it should be 
> based on top of his cleanup work (which takes priority over adding new 
> features):
> 
> http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> 
> Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> on v3.8-rc2 and repost?

Do you know when this patchset will be submited to mtd ?
I think I will wait it is merged in mtd and redo my patch after that.

> 
>> For drivers that can't support ONFI, I don't know what to do.
>> May we should be replace the WARN_ON by a printk and early return.
> 
> That sounds like a good idea to me.  The traceback seems excessive, since 
> the NAND was usable before this series.
> 
I submited a patch for doing that.

Matthieu
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-01-16 14:28           ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-01-16 14:28 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

Hi,

Paul Walmsley a écrit :
> Hi
> 
> On Wed, 2 Jan 2013, Matthieu CASTET wrote:

> .... which did not get merged because Tony requested that it should be 
> based on top of his cleanup work (which takes priority over adding new 
> features):
> 
> http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> 
> Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> on v3.8-rc2 and repost?

Do you know when this patchset will be submited to mtd ?
I think I will wait it is merged in mtd and redo my patch after that.

> 
>> For drivers that can't support ONFI, I don't know what to do.
>> May we should be replace the WARN_ON by a printk and early return.
> 
> That sounds like a good idea to me.  The traceback seems excessive, since 
> the NAND was usable before this series.
> 
I submited a patch for doing that.

Matthieu

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-01-16 14:28           ` Matthieu CASTET
@ 2013-01-16 17:15             ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-16 17:15 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1119 bytes --]

Hi Matthieu,

On Wed, 16 Jan 2013, Matthieu CASTET wrote:

> Paul Walmsley a écrit :
> > On Wed, 2 Jan 2013, Matthieu CASTET wrote:
> 
> > .... which did not get merged because Tony requested that it should be 
> > based on top of his cleanup work (which takes priority over adding new 
> > features):
> > 
> > http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> > 
> > Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> > on v3.8-rc2 and repost?
> 
> Do you know when this patchset will be submited to mtd ?
> I think I will wait it is merged in mtd and redo my patch after that.

As far as I know, it was merged during the v3.8 merge window.  So it's 
already in mainline.  

> >> For drivers that can't support ONFI, I don't know what to do.
> >> May we should be replace the WARN_ON by a printk and early return.
> > 
> > That sounds like a good idea to me.  The traceback seems excessive, since 
> > the NAND was usable before this series.
> > 
> I submited a patch for doing that.

Thanks for doing this, it's much appreciated!


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-01-16 17:15             ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-16 17:15 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1119 bytes --]

Hi Matthieu,

On Wed, 16 Jan 2013, Matthieu CASTET wrote:

> Paul Walmsley a écrit :
> > On Wed, 2 Jan 2013, Matthieu CASTET wrote:
> 
> > .... which did not get merged because Tony requested that it should be 
> > based on top of his cleanup work (which takes priority over adding new 
> > features):
> > 
> > http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> > 
> > Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> > on v3.8-rc2 and repost?
> 
> Do you know when this patchset will be submited to mtd ?
> I think I will wait it is merged in mtd and redo my patch after that.

As far as I know, it was merged during the v3.8 merge window.  So it's 
already in mainline.  

> >> For drivers that can't support ONFI, I don't know what to do.
> >> May we should be replace the WARN_ON by a printk and early return.
> > 
> > That sounds like a good idea to me.  The traceback seems excessive, since 
> > the NAND was usable before this series.
> > 
> I submited a patch for doing that.

Thanks for doing this, it's much appreciated!


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-01-16 17:15             ` Paul Walmsley
@ 2013-01-22  2:27               ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-22  2:27 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1009 bytes --]

Hi Matthieu,

On Wed, 16 Jan 2013, Paul Walmsley wrote:

> On Wed, 16 Jan 2013, Matthieu CASTET wrote:
> 
> > Paul Walmsley a écrit :
> > > On Wed, 2 Jan 2013, Matthieu CASTET wrote:
> > 
> > > .... which did not get merged because Tony requested that it should be 
> > > based on top of his cleanup work (which takes priority over adding new 
> > > features):
> > > 
> > > http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> > > 
> > > Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> > > on v3.8-rc2 and repost?
> > 
> > Do you know when this patchset will be submited to mtd ?
> > I think I will wait it is merged in mtd and redo my patch after that.
> 
> As far as I know, it was merged during the v3.8 merge window.  So it's 
> already in mainline.  

Any progress on updating and resending your "omap3 nand : use 
NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
window if it takes too much longer.


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-01-22  2:27               ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-01-22  2:27 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1009 bytes --]

Hi Matthieu,

On Wed, 16 Jan 2013, Paul Walmsley wrote:

> On Wed, 16 Jan 2013, Matthieu CASTET wrote:
> 
> > Paul Walmsley a écrit :
> > > On Wed, 2 Jan 2013, Matthieu CASTET wrote:
> > 
> > > .... which did not get merged because Tony requested that it should be 
> > > based on top of his cleanup work (which takes priority over adding new 
> > > features):
> > > 
> > > http://thread.gmane.org/gmane.linux.ports.arm.omap/88550/focus=88549
> > > 
> > > Could you please update this "omap3 nand : use NAND_BUSWIDTH_AUTO" patch 
> > > on v3.8-rc2 and repost?
> > 
> > Do you know when this patchset will be submited to mtd ?
> > I think I will wait it is merged in mtd and redo my patch after that.
> 
> As far as I know, it was merged during the v3.8 merge window.  So it's 
> already in mainline.  

Any progress on updating and resending your "omap3 nand : use 
NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
window if it takes too much longer.


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-01-22  2:27               ` Paul Walmsley
@ 2013-02-06 23:21                 ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-02-06 23:21 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: Artem Bityutskiy, linux-mtd, linux-omap

Hi Matthieu,

On Tue, 22 Jan 2013, Paul Walmsley wrote:

> Any progress on updating and resending your "omap3 nand : use 
> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
> window if it takes too much longer.

Could you let us know if you're planning to update and repost this one?

thanks,

- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-02-06 23:21                 ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-02-06 23:21 UTC (permalink / raw)
  To: Matthieu CASTET; +Cc: linux-omap, linux-mtd, Artem Bityutskiy

Hi Matthieu,

On Tue, 22 Jan 2013, Paul Walmsley wrote:

> Any progress on updating and resending your "omap3 nand : use 
> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
> window if it takes too much longer.

Could you let us know if you're planning to update and repost this one?

thanks,

- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-02-06 23:21                 ` Paul Walmsley
@ 2013-02-07  9:47                   ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-02-07  9:47 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Artem Bityutskiy, linux-mtd, linux-omap, Afzal Mohammed

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

Hi Paul,

Paul Walmsley a écrit :
> Hi Matthieu,
> 
> On Tue, 22 Jan 2013, Paul Walmsley wrote:
> 
>> Any progress on updating and resending your "omap3 nand : use 
>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
>> window if it takes too much longer.
> 
> Could you let us know if you're planning to update and repost this one?
> 
Sorry for the delay I attached an updated version of the patch.

I was not able to test it : with mtd tree and my configuration I have to apply
https://patchwork.kernel.org/patch/1810441/
https://patchwork.kernel.org/patch/1884341/
http://comments.gmane.org/gmane.linux.ports.arm.omap/91096

in order the kernel build.

And after that the kernel doesn't seem to boot on my beagle board. Could you
test the patch ?


I have also a problem : how should I change nand bus size. It is done by
"gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
header is not public anymore.

I have to do a '#include "../gpmc.h"'.


Matthieu

[-- Attachment #2: 0001-omap3-nand-use-NAND_BUSWIDTH_AUTO.patch --]
[-- Type: application/mbox, Size: 11347 bytes --]

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-02-07  9:47                   ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-02-07  9:47 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Afzal Mohammed, linux-omap, linux-mtd, Artem Bityutskiy

[-- Attachment #1: Type: text/plain, Size: 1006 bytes --]

Hi Paul,

Paul Walmsley a écrit :
> Hi Matthieu,
> 
> On Tue, 22 Jan 2013, Paul Walmsley wrote:
> 
>> Any progress on updating and resending your "omap3 nand : use 
>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
>> window if it takes too much longer.
> 
> Could you let us know if you're planning to update and repost this one?
> 
Sorry for the delay I attached an updated version of the patch.

I was not able to test it : with mtd tree and my configuration I have to apply
https://patchwork.kernel.org/patch/1810441/
https://patchwork.kernel.org/patch/1884341/
http://comments.gmane.org/gmane.linux.ports.arm.omap/91096

in order the kernel build.

And after that the kernel doesn't seem to boot on my beagle board. Could you
test the patch ?


I have also a problem : how should I change nand bus size. It is done by
"gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
header is not public anymore.

I have to do a '#include "../gpmc.h"'.


Matthieu

[-- Attachment #2: 0001-omap3-nand-use-NAND_BUSWIDTH_AUTO.patch --]
[-- Type: application/mbox, Size: 11347 bytes --]

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-02-07  9:47                   ` Matthieu CASTET
@ 2013-03-01 14:02                     ` Matthieu CASTET
  -1 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-03-01 14:02 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Artem Bityutskiy, linux-mtd, linux-omap, Afzal Mohammed

Matthieu CASTET a écrit :
> Hi Paul,
> 
> Paul Walmsley a écrit :
>> Hi Matthieu,
>>
>> On Tue, 22 Jan 2013, Paul Walmsley wrote:
>>
>>> Any progress on updating and resending your "omap3 nand : use 
>>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
>>> window if it takes too much longer.
>> Could you let us know if you're planning to update and repost this one?
>>
> Sorry for the delay I attached an updated version of the patch.
> 
> I was not able to test it : with mtd tree and my configuration I have to apply
> https://patchwork.kernel.org/patch/1810441/
> https://patchwork.kernel.org/patch/1884341/
> http://comments.gmane.org/gmane.linux.ports.arm.omap/91096
> 
> in order the kernel build.
> 
> And after that the kernel doesn't seem to boot on my beagle board. Could you
> test the patch ?
> 
> 
> I have also a problem : how should I change nand bus size. It is done by
> "gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
> header is not public anymore.
> 
> I have to do a '#include "../gpmc.h"'.
> 
> 
Any news on this ?


Matthieu
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-03-01 14:02                     ` Matthieu CASTET
  0 siblings, 0 replies; 40+ messages in thread
From: Matthieu CASTET @ 2013-03-01 14:02 UTC (permalink / raw)
  To: Paul Walmsley; +Cc: Afzal Mohammed, linux-omap, linux-mtd, Artem Bityutskiy

Matthieu CASTET a écrit :
> Hi Paul,
> 
> Paul Walmsley a écrit :
>> Hi Matthieu,
>>
>> On Tue, 22 Jan 2013, Paul Walmsley wrote:
>>
>>> Any progress on updating and resending your "omap3 nand : use 
>>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
>>> window if it takes too much longer.
>> Could you let us know if you're planning to update and repost this one?
>>
> Sorry for the delay I attached an updated version of the patch.
> 
> I was not able to test it : with mtd tree and my configuration I have to apply
> https://patchwork.kernel.org/patch/1810441/
> https://patchwork.kernel.org/patch/1884341/
> http://comments.gmane.org/gmane.linux.ports.arm.omap/91096
> 
> in order the kernel build.
> 
> And after that the kernel doesn't seem to boot on my beagle board. Could you
> test the patch ?
> 
> 
> I have also a problem : how should I change nand bus size. It is done by
> "gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
> header is not public anymore.
> 
> I have to do a '#include "../gpmc.h"'.
> 
> 
Any news on this ?


Matthieu

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
  2013-03-01 14:02                     ` Matthieu CASTET
@ 2013-04-02 18:28                       ` Paul Walmsley
  -1 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-04-02 18:28 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Artem Bityutskiy, jon-hunter, linux-mtd, linux-omap, Afzal Mohammed

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1482 bytes --]

Hi Matthieu,

On Fri, 1 Mar 2013, Matthieu CASTET wrote:

> Matthieu CASTET a écrit :
> > Paul Walmsley a écrit :
> >> On Tue, 22 Jan 2013, Paul Walmsley wrote:
> >>
> >>> Any progress on updating and resending your "omap3 nand : use 
> >>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
> >>> window if it takes too much longer.
> >> Could you let us know if you're planning to update and repost this one?
> >>
> > Sorry for the delay I attached an updated version of the patch.
> > 
> > I was not able to test it : with mtd tree and my configuration I have to apply
> > https://patchwork.kernel.org/patch/1810441/
> > https://patchwork.kernel.org/patch/1884341/
> > http://comments.gmane.org/gmane.linux.ports.arm.omap/91096
> > 
> > in order the kernel build.
> > 
> > And after that the kernel doesn't seem to boot on my beagle board. Could you
> > test the patch ?
> > 
> > I have also a problem : how should I change nand bus size. It is done by
> > "gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
> > header is not public anymore.
> > 
> > I have to do a '#include "../gpmc.h"'.
> > 
> > 
> Any news on this ?

Unfortunately, I don't have the time at the moment to track this issue.  
Could you follow up on this with Jon Hunter <jon-hunter@ti.com> ?  He's 
been working on the GPMC code for the last few merge windows and is 
basically the maintainer of it at this point.


- Paul

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

* Re: [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode
@ 2013-04-02 18:28                       ` Paul Walmsley
  0 siblings, 0 replies; 40+ messages in thread
From: Paul Walmsley @ 2013-04-02 18:28 UTC (permalink / raw)
  To: Matthieu CASTET
  Cc: Afzal Mohammed, linux-omap, linux-mtd, jon-hunter, Artem Bityutskiy

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1482 bytes --]

Hi Matthieu,

On Fri, 1 Mar 2013, Matthieu CASTET wrote:

> Matthieu CASTET a écrit :
> > Paul Walmsley a écrit :
> >> On Tue, 22 Jan 2013, Paul Walmsley wrote:
> >>
> >>> Any progress on updating and resending your "omap3 nand : use 
> >>> NAND_BUSWIDTH_AUTO" patch?  We're in danger of missing the 3.9 merge 
> >>> window if it takes too much longer.
> >> Could you let us know if you're planning to update and repost this one?
> >>
> > Sorry for the delay I attached an updated version of the patch.
> > 
> > I was not able to test it : with mtd tree and my configuration I have to apply
> > https://patchwork.kernel.org/patch/1810441/
> > https://patchwork.kernel.org/patch/1884341/
> > http://comments.gmane.org/gmane.linux.ports.arm.omap/91096
> > 
> > in order the kernel build.
> > 
> > And after that the kernel doesn't seem to boot on my beagle board. Could you
> > test the patch ?
> > 
> > I have also a problem : how should I change nand bus size. It is done by
> > "gpmc_cs_configure(info->gpmc_cs, GPMC_CONFIG_DEV_SIZE, ...);", but now gpmc.h
> > header is not public anymore.
> > 
> > I have to do a '#include "../gpmc.h"'.
> > 
> > 
> Any news on this ?

Unfortunately, I don't have the time at the moment to track this issue.  
Could you follow up on this with Jon Hunter <jon-hunter@ti.com> ?  He's 
been working on the GPMC code for the last few merge windows and is 
basically the maintainer of it at this point.


- Paul

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

end of thread, other threads:[~2013-04-02 18:28 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-06 10:51 [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode Matthieu CASTET
2012-11-06 10:51 ` Matthieu CASTET
2012-11-06 10:51 ` [PATCH 2/3] mtd nand : add NAND_BUSWIDTH_AUTO to autodetect bus width Matthieu CASTET
2012-11-06 10:51   ` Matthieu CASTET
2012-11-30 13:21   ` Artem Bityutskiy
2012-11-30 13:21     ` Artem Bityutskiy
2012-11-06 10:51 ` [PATCH 3/3] omap3 nand : use NAND_BUSWIDTH_AUTO Matthieu CASTET
2012-11-06 10:51   ` Matthieu CASTET
2012-11-06 12:37   ` Igor Grinberg
2012-11-06 12:37     ` Igor Grinberg
2012-11-06 16:47     ` Matthieu CASTET
2012-11-06 16:47       ` Matthieu CASTET
2012-11-06 18:40       ` Tony Lindgren
2012-11-06 18:40         ` Tony Lindgren
2012-11-16  8:22         ` Artem Bityutskiy
2012-11-16  8:22           ` Artem Bityutskiy
2012-11-22 17:48           ` Matthieu CASTET
2012-11-22 17:48             ` Matthieu CASTET
2012-12-03 10:20 ` [PATCH 1/3] mtd nand : onfi need to be probed in 8 bits mode Artem Bityutskiy
2012-12-03 10:20   ` Artem Bityutskiy
2012-12-24  0:29   ` Paul Walmsley
2012-12-24  0:29     ` Paul Walmsley
2013-01-02  9:51     ` Matthieu CASTET
2013-01-02  9:51       ` Matthieu CASTET
2013-01-03 17:10       ` Paul Walmsley
2013-01-03 17:10         ` Paul Walmsley
2013-01-16 14:28         ` Matthieu CASTET
2013-01-16 14:28           ` Matthieu CASTET
2013-01-16 17:15           ` Paul Walmsley
2013-01-16 17:15             ` Paul Walmsley
2013-01-22  2:27             ` Paul Walmsley
2013-01-22  2:27               ` Paul Walmsley
2013-02-06 23:21               ` Paul Walmsley
2013-02-06 23:21                 ` Paul Walmsley
2013-02-07  9:47                 ` Matthieu CASTET
2013-02-07  9:47                   ` Matthieu CASTET
2013-03-01 14:02                   ` Matthieu CASTET
2013-03-01 14:02                     ` Matthieu CASTET
2013-04-02 18:28                     ` Paul Walmsley
2013-04-02 18:28                       ` Paul Walmsley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.