* [PATCH] mtd: onenand: fix 4KB page onenand chip recognition
@ 2010-10-11 11:47 Roman Tereshonkov
2010-10-11 12:04 ` Kyungmin Park
2010-10-12 9:42 ` Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Roman Tereshonkov @ 2010-10-11 11:47 UTC (permalink / raw)
To: linux-mtd; +Cc: rohit.hs, kyungmin.park, Roman Tereshonkov
For 4Gb non-DDP chip it does not follow that it is always 4KB page chip.
The number of data buffers is checked and if it is equal to 1
we suppose that it is 4KB page onenand chip.
Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
---
drivers/mtd/onenand/onenand_base.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index a2bb520..3684313 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -3365,18 +3365,19 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
static void onenand_check_features(struct mtd_info *mtd)
{
struct onenand_chip *this = mtd->priv;
- unsigned int density, process;
+ unsigned int density, process, numbufs;
/* Lock scheme depends on density and process */
density = onenand_get_density(this->device_id);
process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT;
+ numbufs = this->read_word(this->base + ONENAND_REG_NUM_BUFFERS) >> 8;
/* Lock scheme */
switch (density) {
case ONENAND_DEVICE_DENSITY_4Gb:
if (ONENAND_IS_DDP(this))
this->options |= ONENAND_HAS_2PLANE;
- else
+ else if (numbufs == 1)
this->options |= ONENAND_HAS_4KB_PAGE;
case ONENAND_DEVICE_DENSITY_2Gb:
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: onenand: fix 4KB page onenand chip recognition
2010-10-11 11:47 [PATCH] mtd: onenand: fix 4KB page onenand chip recognition Roman Tereshonkov
@ 2010-10-11 12:04 ` Kyungmin Park
2010-10-12 9:42 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Kyungmin Park @ 2010-10-11 12:04 UTC (permalink / raw)
To: Roman Tereshonkov; +Cc: rohit.hs, linux-mtd
Hi,
Good catch. I didn't know that.
My 4KiB pagesize has 0x0102
and 2KiB pagesize has 0x0202
Acked-by: Kyungmin Park <kyungmin.park@samsung.com>
On Mon, Oct 11, 2010 at 8:47 PM, Roman Tereshonkov
<roman.tereshonkov@nokia.com> wrote:
> For 4Gb non-DDP chip it does not follow that it is always 4KB page chip.
> The number of data buffers is checked and if it is equal to 1
> we suppose that it is 4KB page onenand chip.
>
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> ---
> drivers/mtd/onenand/onenand_base.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
> index a2bb520..3684313 100644
> --- a/drivers/mtd/onenand/onenand_base.c
> +++ b/drivers/mtd/onenand/onenand_base.c
> @@ -3365,18 +3365,19 @@ static int onenand_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
> static void onenand_check_features(struct mtd_info *mtd)
> {
> struct onenand_chip *this = mtd->priv;
> - unsigned int density, process;
> + unsigned int density, process, numbufs;
>
> /* Lock scheme depends on density and process */
> density = onenand_get_density(this->device_id);
> process = this->version_id >> ONENAND_VERSION_PROCESS_SHIFT;
> + numbufs = this->read_word(this->base + ONENAND_REG_NUM_BUFFERS) >> 8;
>
> /* Lock scheme */
> switch (density) {
> case ONENAND_DEVICE_DENSITY_4Gb:
> if (ONENAND_IS_DDP(this))
> this->options |= ONENAND_HAS_2PLANE;
> - else
> + else if (numbufs == 1)
> this->options |= ONENAND_HAS_4KB_PAGE;
>
> case ONENAND_DEVICE_DENSITY_2Gb:
> --
> 1.7.0.4
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mtd: onenand: fix 4KB page onenand chip recognition
2010-10-11 11:47 [PATCH] mtd: onenand: fix 4KB page onenand chip recognition Roman Tereshonkov
2010-10-11 12:04 ` Kyungmin Park
@ 2010-10-12 9:42 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2010-10-12 9:42 UTC (permalink / raw)
To: Roman Tereshonkov; +Cc: rohit.hs, kyungmin.park, linux-mtd
On Mon, 2010-10-11 at 14:47 +0300, Roman Tereshonkov wrote:
> For 4Gb non-DDP chip it does not follow that it is always 4KB page chip.
> The number of data buffers is checked and if it is equal to 1
> we suppose that it is 4KB page onenand chip.
>
> Signed-off-by: Roman Tereshonkov <roman.tereshonkov@nokia.com>
> ---
> drivers/mtd/onenand/onenand_base.c | 5 +++--
> 1 files changed, 3 insertions(+), 2 deletions(-)
Pushed to l2-mtd-2.6.git, thanks!
--
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-12 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-11 11:47 [PATCH] mtd: onenand: fix 4KB page onenand chip recognition Roman Tereshonkov
2010-10-11 12:04 ` Kyungmin Park
2010-10-12 9:42 ` 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).