linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] OneNAND: Introduce chip_probe function
@ 2010-05-28  2:03 Kyungmin Park
  2010-06-12 14:26 ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Kyungmin Park @ 2010-05-28  2:03 UTC (permalink / raw)
  To: linux-mtd

Samsung SoCs use the own OneNAND controler and detect OneNAND chip at power on.
To use this feature, introduce the chip_probe function.

Also remove workaround for Samsung SoCs.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index 26caf25..0b12102 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -3730,17 +3730,16 @@ out:
 }
 
 /**
- * onenand_probe - [OneNAND Interface] Probe the OneNAND device
+ * onenand_chip_probe - [OneNAND Interface] The generic chip probe
  * @param mtd		MTD device structure
  *
  * OneNAND detection method:
  *   Compare the values from command with ones from register
  */
-static int onenand_probe(struct mtd_info *mtd)
+static int onenand_chip_probe(struct mtd_info *mtd)
 {
 	struct onenand_chip *this = mtd->priv;
-	int bram_maf_id, bram_dev_id, maf_id, dev_id, ver_id;
-	int density;
+	int bram_maf_id, bram_dev_id, maf_id, dev_id;
 	int syscfg;
 
 	/* Save system configuration 1 */
@@ -3763,12 +3762,6 @@ static int onenand_probe(struct mtd_info *mtd)
 	/* Restore system configuration 1 */
 	this->write_word(syscfg, this->base + ONENAND_REG_SYS_CFG1);
 
-	/* Workaround */
-	if (syscfg & ONENAND_SYS_CFG1_SYNC_WRITE) {
-		bram_maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
-		bram_dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
-	}
-
 	/* Check manufacturer ID */
 	if (onenand_check_maf(bram_maf_id))
 		return -ENXIO;
@@ -3776,13 +3769,35 @@ static int onenand_probe(struct mtd_info *mtd)
 	/* Read manufacturer and device IDs from Register */
 	maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
 	dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
-	ver_id = this->read_word(this->base + ONENAND_REG_VERSION_ID);
-	this->technology = this->read_word(this->base + ONENAND_REG_TECHNOLOGY);
 
 	/* Check OneNAND device */
 	if (maf_id != bram_maf_id || dev_id != bram_dev_id)
 		return -ENXIO;
 
+	return 0;
+}
+
+/**
+ * onenand_probe - [OneNAND Interface] Probe the OneNAND device
+ * @param mtd		MTD device structure
+ */
+static int onenand_probe(struct mtd_info *mtd)
+{
+	struct onenand_chip *this = mtd->priv;
+	int maf_id, dev_id, ver_id;
+	int density;
+	int ret;
+
+	ret = this->chip_probe(mtd);
+	if (ret)
+		return ret;
+
+	/* Read manufacturer and device IDs from Register */
+	maf_id = this->read_word(this->base + ONENAND_REG_MANUFACTURER_ID);
+	dev_id = this->read_word(this->base + ONENAND_REG_DEVICE_ID);
+	ver_id = this->read_word(this->base + ONENAND_REG_VERSION_ID);
+	this->technology = this->read_word(this->base + ONENAND_REG_TECHNOLOGY);
+
 	/* Flash device information */
 	onenand_print_device_info(dev_id, ver_id);
 	this->device_id = dev_id;
@@ -3909,6 +3924,9 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
 	if (!this->unlock_all)
 		this->unlock_all = onenand_unlock_all;
 
+	if (!this->chip_probe)
+		this->chip_probe = onenand_chip_probe;
+
 	if (!this->read_bufferram)
 		this->read_bufferram = onenand_read_bufferram;
 	if (!this->write_bufferram)
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index c26ff86..0c8815b 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -68,6 +68,7 @@ struct onenand_bufferram {
  * @write_word:		[REPLACEABLE] hardware specific function for write
  *			register of OneNAND
  * @mmcontrol:		sync burst read function
+ * @chip_probe:		[REPLACEABLE] hardware specific function for chip probe
  * @block_markbad:	function to mark a block as bad
  * @scan_bbt:		[REPLACEALBE] hardware specific function for scanning
  *			Bad block Table
@@ -114,6 +115,7 @@ struct onenand_chip {
 	unsigned short (*read_word)(void __iomem *addr);
 	void (*write_word)(unsigned short value, void __iomem *addr);
 	void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
+	int (*chip_probe)(struct mtd_info *mtd);
 	int (*block_markbad)(struct mtd_info *mtd, loff_t ofs);
 	int (*scan_bbt)(struct mtd_info *mtd);
 

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-05-28  2:03 [PATCH] OneNAND: Introduce chip_probe function Kyungmin Park
@ 2010-06-12 14:26 ` Artem Bityutskiy
  2010-07-08  0:50   ` Kyungmin Park
  0 siblings, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2010-06-12 14:26 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-mtd

On Fri, 2010-05-28 at 11:03 +0900, Kyungmin Park wrote:
> Samsung SoCs use the own OneNAND controler and detect OneNAND chip at power on.
> To use this feature, introduce the chip_probe function.
> 
> Also remove workaround for Samsung SoCs.
> 
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>

Pushed both to my l2-mtd-2.6.git / dunno.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-06-12 14:26 ` Artem Bityutskiy
@ 2010-07-08  0:50   ` Kyungmin Park
  2010-07-08  4:41     ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Kyungmin Park @ 2010-07-08  0:50 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

Hi Artem,

Can merge it next merge window. It's clean method for samsung socs and
no functional changes for others.

Thank you,
Kyungmin Park

On Sat, Jun 12, 2010 at 11:26 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Fri, 2010-05-28 at 11:03 +0900, Kyungmin Park wrote:
>> Samsung SoCs use the own OneNAND controler and detect OneNAND chip at power on.
>> To use this feature, introduce the chip_probe function.
>>
>> Also remove workaround for Samsung SoCs.
>>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> Pushed both to my l2-mtd-2.6.git / dunno.
>
> --
> Best Regards,
> Artem Bityutskiy (Артём Битюцкий)
>
>

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-07-08  0:50   ` Kyungmin Park
@ 2010-07-08  4:41     ` Artem Bityutskiy
  2010-07-08  4:43       ` Kyungmin Park
  0 siblings, 1 reply; 7+ messages in thread
From: Artem Bityutskiy @ 2010-07-08  4:41 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-mtd

On Thu, 2010-07-08 at 09:50 +0900, Kyungmin Park wrote:
> Hi Artem,
> 
> Can merge it next merge window. It's clean method for samsung socs and
> no functional changes for others.

Hi,

I do not merge things, I'm just a "secretary" who picks up patches
and passes them to dwmw2. He merges those he approves. So, closer
to the merge window he should look at my l2 tree (he usually does)
and pick up your stuff.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-07-08  4:41     ` Artem Bityutskiy
@ 2010-07-08  4:43       ` Kyungmin Park
  2010-08-03  3:44         ` Kyungmin Park
  0 siblings, 1 reply; 7+ messages in thread
From: Kyungmin Park @ 2010-07-08  4:43 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

On Thu, Jul 8, 2010 at 1:41 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Thu, 2010-07-08 at 09:50 +0900, Kyungmin Park wrote:
>> Hi Artem,
>>
>> Can merge it next merge window. It's clean method for samsung socs and
>> no functional changes for others.
>
> Hi,
>
> I do not merge things, I'm just a "secretary" who picks up patches
> and passes them to dwmw2. He merges those he approves. So, closer
> to the merge window he should look at my l2 tree (he usually does)
> and pick up your stuff.

I see
At that time, I will notice again if it's missing.

Thank you,
Kyungmin Park

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-07-08  4:43       ` Kyungmin Park
@ 2010-08-03  3:44         ` Kyungmin Park
  2010-08-05  4:59           ` Artem Bityutskiy
  0 siblings, 1 reply; 7+ messages in thread
From: Kyungmin Park @ 2010-08-03  3:44 UTC (permalink / raw)
  To: dedekind1; +Cc: linux-mtd

Hi,

Can you check it again?
It seems not merged at linux-next tree.

Thank you,
Kyungmin Park

On Thu, Jul 8, 2010 at 1:43 PM, Kyungmin Park <kmpark@infradead.org> wrote:
> On Thu, Jul 8, 2010 at 1:41 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>> On Thu, 2010-07-08 at 09:50 +0900, Kyungmin Park wrote:
>>> Hi Artem,
>>>
>>> Can merge it next merge window. It's clean method for samsung socs and
>>> no functional changes for others.
>>
>> Hi,
>>
>> I do not merge things, I'm just a "secretary" who picks up patches
>> and passes them to dwmw2. He merges those he approves. So, closer
>> to the merge window he should look at my l2 tree (he usually does)
>> and pick up your stuff.
>
> I see
> At that time, I will notice again if it's missing.
>
> Thank you,
> Kyungmin Park
>

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

* Re: [PATCH] OneNAND: Introduce chip_probe function
  2010-08-03  3:44         ` Kyungmin Park
@ 2010-08-05  4:59           ` Artem Bityutskiy
  0 siblings, 0 replies; 7+ messages in thread
From: Artem Bityutskiy @ 2010-08-05  4:59 UTC (permalink / raw)
  To: Kyungmin Park; +Cc: linux-mtd

On Tue, 2010-08-03 at 12:44 +0900, Kyungmin Park wrote:
> Hi,
> 
> Can you check it again?
> It seems not merged at linux-next tree.

It is now in the mtd tree.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

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

end of thread, other threads:[~2010-08-05  4:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-28  2:03 [PATCH] OneNAND: Introduce chip_probe function Kyungmin Park
2010-06-12 14:26 ` Artem Bityutskiy
2010-07-08  0:50   ` Kyungmin Park
2010-07-08  4:41     ` Artem Bityutskiy
2010-07-08  4:43       ` Kyungmin Park
2010-08-03  3:44         ` Kyungmin Park
2010-08-05  4:59           ` Artem Bityutskiy

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