* [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize
@ 2011-06-22 5:16 Kyungmin Park
2011-06-24 12:16 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Kyungmin Park @ 2011-06-22 5:16 UTC (permalink / raw)
To: linux-mtd, roman.tereshonkov; +Cc: m.szyprowski, dwmw2, dedekind1
From: Kyungmin Park <kyungmin.park@samsung.com>
There are two different 4KiB pagesize chips
KFM4G16Q4M series have NOP 4 with version ID 0x0131
But KFM4G16Q5M has NOP 1 with versoin ID 0x013e
Note that Q5M means that it has NOP 1.
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 ac9e959..51800a7 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -3429,6 +3429,19 @@ static void onenand_check_features(struct mtd_info *mtd)
else if (numbufs == 1) {
this->options |= ONENAND_HAS_4KB_PAGE;
this->options |= ONENAND_HAS_CACHE_PROGRAM;
+ /*
+ * There are two different 4KiB pagesize chips
+ * and no way to detect it by H/W config values.
+ *
+ * To detect the correct NOP for each chips,
+ * It should check the version ID as workaround.
+ *
+ * Now it has as following
+ * KFM4G16Q4M has NOP 4 with version ID 0x0131
+ * KFM4G16Q5M has NOP 1 with versoin ID 0x013e
+ */
+ if ((this->version_id & 0xf) == 0xe)
+ this->options |= ONENAND_HAS_NOP_1;
}
case ONENAND_DEVICE_DENSITY_2Gb:
@@ -4054,6 +4067,8 @@ int onenand_scan(struct mtd_info *mtd, int maxchips)
this->ecclayout = &onenand_oob_128;
mtd->subpage_sft = 2;
}
+ if (ONENAND_IS_NOP_1(this))
+ mtd->subpage_sft = 0;
break;
case 64:
this->ecclayout = &onenand_oob_64;
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 52b6f18..4596503 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -184,6 +184,9 @@ struct onenand_chip {
#define ONENAND_IS_CACHE_PROGRAM(this) \
(this->options & ONENAND_HAS_CACHE_PROGRAM)
+#define ONENAND_IS_NOP_1(this) \
+ (this->options & ONENAND_HAS_NOP_1)
+
/* Check byte access in OneNAND */
#define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1)
@@ -195,6 +198,7 @@ struct onenand_chip {
#define ONENAND_HAS_2PLANE (0x0004)
#define ONENAND_HAS_4KB_PAGE (0x0008)
#define ONENAND_HAS_CACHE_PROGRAM (0x0010)
+#define ONENAND_HAS_NOP_1 (0x0020)
#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
#define ONENAND_PAGEBUF_ALLOC (0x1000)
#define ONENAND_OOBBUF_ALLOC (0x2000)
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize
2011-06-22 5:16 [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize Kyungmin Park
@ 2011-06-24 12:16 ` Artem Bityutskiy
2011-06-24 12:20 ` Kyungmin Park
0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2011-06-24 12:16 UTC (permalink / raw)
To: Kyungmin Park; +Cc: dwmw2, linux-mtd, roman.tereshonkov, m.szyprowski
On Wed, 2011-06-22 at 14:16 +0900, Kyungmin Park wrote:
> From: Kyungmin Park <kyungmin.park@samsung.com>
>
> There are two different 4KiB pagesize chips
> KFM4G16Q4M series have NOP 4 with version ID 0x0131
> But KFM4G16Q5M has NOP 1 with versoin ID 0x013e
>
> Note that Q5M means that it has NOP 1.
>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Pushed to l2-mtd-2.6.git, thanks.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize
2011-06-24 12:16 ` Artem Bityutskiy
@ 2011-06-24 12:20 ` Kyungmin Park
2011-06-24 18:46 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: Kyungmin Park @ 2011-06-24 12:20 UTC (permalink / raw)
To: dedekind1; +Cc: dwmw2, linux-mtd, roman.tereshonkov, m.szyprowski
On Fri, Jun 24, 2011 at 9:16 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Wed, 2011-06-22 at 14:16 +0900, Kyungmin Park wrote:
>> From: Kyungmin Park <kyungmin.park@samsung.com>
>>
>> There are two different 4KiB pagesize chips
>> KFM4G16Q4M series have NOP 4 with version ID 0x0131
>> But KFM4G16Q5M has NOP 1 with versoin ID 0x013e
>>
>> Note that Q5M means that it has NOP 1.
>>
>> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
>
> Pushed to l2-mtd-2.6.git, thanks.
Hi Artem,
It's required for s5pc110 series and supported at previous kernel, I
mean it's bug fixed.
So please merge it 3.0-rc periods
Thank you,
Kyungmin Park
>
> --
> Best Regards,
> Artem Bityutskiy (Битюцкий Артём)
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize
2011-06-24 12:20 ` Kyungmin Park
@ 2011-06-24 18:46 ` Artem Bityutskiy
0 siblings, 0 replies; 4+ messages in thread
From: Artem Bityutskiy @ 2011-06-24 18:46 UTC (permalink / raw)
To: Kyungmin Park; +Cc: dwmw2, linux-mtd, roman.tereshonkov, m.szyprowski
On Fri, 2011-06-24 at 21:20 +0900, Kyungmin Park wrote:
> On Fri, Jun 24, 2011 at 9:16 PM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> > On Wed, 2011-06-22 at 14:16 +0900, Kyungmin Park wrote:
> >> From: Kyungmin Park <kyungmin.park@samsung.com>
> >>
> >> There are two different 4KiB pagesize chips
> >> KFM4G16Q4M series have NOP 4 with version ID 0x0131
> >> But KFM4G16Q5M has NOP 1 with versoin ID 0x013e
> >>
> >> Note that Q5M means that it has NOP 1.
> >>
> >> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
> >
> > Pushed to l2-mtd-2.6.git, thanks.
>
> Hi Artem,
>
> It's required for s5pc110 series and supported at previous kernel, I
> mean it's bug fixed.
> So please merge it 3.0-rc periods
Only dwmw2 does this, so please, ask him.
--
Best Regards,
Artem Bityutskiy (Битюцкий Артём)
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-06-24 18:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22 5:16 [PATCH v2] mtd: OneNAND: Detect the correct NOP when 4KiB pagesize Kyungmin Park
2011-06-24 12:16 ` Artem Bityutskiy
2011-06-24 12:20 ` Kyungmin Park
2011-06-24 18:46 ` Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox