* [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
@ 2009-07-16 21:59 nsnehaprabha
2009-09-14 19:40 ` Narnakaje, Snehaprabha
0 siblings, 1 reply; 8+ messages in thread
From: nsnehaprabha @ 2009-07-16 21:59 UTC (permalink / raw)
To: linux-mtd, davinci-linux-open-source, dwmw2, tglx, akpm
Cc: Sneha Narnakaje, Sandeep Paulraj
From: Sneha Narnakaje <nsnehaprabha@ti.com>
This patch new "page" parameter to all NAND read_page/read_page_raw APIs.
The read_page API for the new mode ECC_HW_OOB_FIRST requires the page
information to send the READOOB command and read the OOB area before the
data area.
This patch series applies to linux-mtd next (mmotm) GIT tree.
This patch is the same as v2 version of this patch.
Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
---
drivers/mtd/nand/atmel_nand.c | 2 +-
drivers/mtd/nand/cafe_nand.c | 2 +-
drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
drivers/mtd/nand/nand_base.c | 18 ++++++++++--------
drivers/mtd/nand/sh_flctl.c | 2 +-
include/linux/mtd/nand.h | 4 ++--
6 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
index 20c828b..f8e9975 100644
--- a/drivers/mtd/nand/atmel_nand.c
+++ b/drivers/mtd/nand/atmel_nand.c
@@ -218,7 +218,7 @@ static int atmel_nand_calculate(struct mtd_info *mtd,
* buf: buffer to store read data
*/
static int atmel_nand_read_page(struct mtd_info *mtd,
- struct nand_chip *chip, uint8_t *buf)
+ struct nand_chip *chip, uint8_t *buf, int page)
{
int eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
index 1b4690b..c828d9a 100644
--- a/drivers/mtd/nand/cafe_nand.c
+++ b/drivers/mtd/nand/cafe_nand.c
@@ -381,7 +381,7 @@ static int cafe_nand_read_oob(struct mtd_info *mtd, struct nand_chip *chip,
* we need a special oob layout and handling.
*/
static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
struct cafe_priv *cafe = mtd->priv;
diff --git a/drivers/mtd/nand/fsl_elbc_nand.c b/drivers/mtd/nand/fsl_elbc_nand.c
index 1f6eb25..ddd37d2 100644
--- a/drivers/mtd/nand/fsl_elbc_nand.c
+++ b/drivers/mtd/nand/fsl_elbc_nand.c
@@ -739,7 +739,8 @@ static int fsl_elbc_chip_init_tail(struct mtd_info *mtd)
static int fsl_elbc_read_page(struct mtd_info *mtd,
struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf,
+ int page)
{
fsl_elbc_read_buf(mtd, buf, mtd->writesize);
fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 8c21b89..979988a 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -766,7 +766,7 @@ static int nand_wait(struct mtd_info *mtd, struct nand_chip *chip)
* Not for syndrome calculating ecc controllers, which use a special oob layout
*/
static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
chip->read_buf(mtd, buf, mtd->writesize);
chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
@@ -782,7 +782,7 @@ static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip *chip,
* We need a special oob layout and handling even when OOB isn't used.
*/
static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
int eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
@@ -821,7 +821,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct nand_chip *c
* @buf: buffer to store read data
*/
static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
@@ -831,7 +831,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip *chip,
uint8_t *ecc_code = chip->buffers->ecccode;
uint32_t *eccpos = chip->ecc.layout->eccpos;
- chip->ecc.read_page_raw(mtd, chip, buf);
+ chip->ecc.read_page_raw(mtd, chip, buf, page);
for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
chip->ecc.calculate(mtd, p, &ecc_calc[i]);
@@ -944,7 +944,7 @@ static int nand_read_subpage(struct mtd_info *mtd, struct nand_chip *chip, uint3
* Not for syndrome calculating ecc controllers which need a special oob layout
*/
static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
@@ -989,7 +989,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
* we need a special oob layout and handling.
*/
static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
@@ -1131,11 +1131,13 @@ static int nand_do_read_ops(struct mtd_info *mtd, loff_t from,
/* Now read the page into the buffer */
if (unlikely(ops->mode == MTD_OOB_RAW))
- ret = chip->ecc.read_page_raw(mtd, chip, bufpoi);
+ ret = chip->ecc.read_page_raw(mtd, chip,
+ bufpoi, page);
else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
ret = chip->ecc.read_subpage(mtd, chip, col, bytes, bufpoi);
else
- ret = chip->ecc.read_page(mtd, chip, bufpoi);
+ ret = chip->ecc.read_page(mtd, chip, bufpoi,
+ page);
if (ret < 0)
break;
diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
index 2bc8966..c5df285 100644
--- a/drivers/mtd/nand/sh_flctl.c
+++ b/drivers/mtd/nand/sh_flctl.c
@@ -329,7 +329,7 @@ static void set_cmd_regs(struct mtd_info *mtd, uint32_t cmd, uint32_t flcmcdr_va
}
static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip *chip,
- uint8_t *buf)
+ uint8_t *buf, int page)
{
int i, eccsize = chip->ecc.size;
int eccbytes = chip->ecc.bytes;
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 4030eba..686f370 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -271,13 +271,13 @@ struct nand_ecc_ctrl {
uint8_t *calc_ecc);
int (*read_page_raw)(struct mtd_info *mtd,
struct nand_chip *chip,
- uint8_t *buf);
+ uint8_t *buf, int page);
void (*write_page_raw)(struct mtd_info *mtd,
struct nand_chip *chip,
const uint8_t *buf);
int (*read_page)(struct mtd_info *mtd,
struct nand_chip *chip,
- uint8_t *buf);
+ uint8_t *buf, int page);
int (*read_subpage)(struct mtd_info *mtd,
struct nand_chip *chip,
uint32_t offs, uint32_t len,
--
1.6.0.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
@ 2009-07-17 7:11 vimal singh
0 siblings, 0 replies; 8+ messages in thread
From: vimal singh @ 2009-07-17 7:11 UTC (permalink / raw)
To: nsnehaprabha
Cc: davinci-linux-open-source, Sandeep Paulraj, linux-mtd, tglx,
dwmw2, akpm
On Fri, Jul 17, 2009 at 3:29 AM, <nsnehaprabha@ti.com> wrote:
> From: Sneha Narnakaje <nsnehaprabha@ti.com>
>
> This patch new "page" parameter to all NAND read_page/read_page_raw APIs.
> The read_page API for the new mode ECC_HW_OOB_FIRST requires the page
> information to send the READOOB command and read the OOB area before the
> data area.
>
> This patch series applies to linux-mtd next (mmotm) GIT tree.
> This patch is the same as v2 version of this patch.
>
> Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
> ---
> drivers/mtd/nand/atmel_nand.c | 2 +-
> drivers/mtd/nand/cafe_nand.c | 2 +-
> drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
> drivers/mtd/nand/nand_base.c | 18 ++++++++++--------
> drivers/mtd/nand/sh_flctl.c | 2 +-
> include/linux/mtd/nand.h | 4 ++--
> 6 files changed, 17 insertions(+), 14 deletions(-)
>
Why not just adding 'page' or 'cur_page' parameter to 'mtd_info' structure and
populate the same in 'nand_do_read_ops' and 'nand_do_write_ops' as soon as you
calculate 'page' for every read and write access respectivily. And then this
info can be used by any one who has knowledge of 'mtd_info'.
-vimal
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
[not found] <42655.192.168.10.89.1247812404.squirrel@dbdmail.itg.ti.com>
@ 2009-07-17 14:35 ` Narnakaje, Snehaprabha
2009-07-17 14:45 ` Singh, Vimal
0 siblings, 1 reply; 8+ messages in thread
From: Narnakaje, Snehaprabha @ 2009-07-17 14:35 UTC (permalink / raw)
To: vimal singh
Cc: davinci-linux-open-source@linux.davincidsp.com, Paulraj, Sandeep,
linux-mtd@lists.infradead.org, tglx@linutronix.de,
dwmw2@infradead.org, akpm@linux-foundation.org
> -----Original Message-----
> From: vimal singh [mailto:vimalsingh@ti.com]
> Sent: Friday, July 17, 2009 2:33 AM
> To: Narnakaje, Snehaprabha
> Cc: linux-mtd@lists.infradead.org; davinci-linux-open-
> source@linux.davincidsp.com; dwmw2@infradead.org; tglx@linutronix.de;
> akpm@linux-foundation.org; Paulraj, Sandeep
> Subject: Re: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all
> read_page/read_page_raw APIs
>
> On Fri, Jul 17, 2009 at 3:29 AM, <nsnehaprabha@ti.com> wrote:
> > From: Sneha Narnakaje <nsnehaprabha@ti.com>
> >
> > This patch new "page" parameter to all NAND read_page/read_page_raw
> APIs.
> > The read_page API for the new mode ECC_HW_OOB_FIRST requires the page
> > information to send the READOOB command and read the OOB area before the
> > data area.
> >
> > This patch series applies to linux-mtd next (mmotm) GIT tree.
> > This patch is the same as v2 version of this patch.
> >
> > Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
> > Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
> > Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
> > ---
> > drivers/mtd/nand/atmel_nand.c | 2 +-
> > drivers/mtd/nand/cafe_nand.c | 2 +-
> > drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
> > drivers/mtd/nand/nand_base.c | 18 ++++++++++--------
> > drivers/mtd/nand/sh_flctl.c | 2 +-
> > include/linux/mtd/nand.h | 4 ++--
> > 6 files changed, 17 insertions(+), 14 deletions(-)
> >
>
> Why not just adding 'page' or 'cur_page' parameter to 'mtd_info' structure
> and
> populate the same in 'nand_do_read_ops' and 'nand_do_write_ops' as soon as
> you
> calculate 'page' for every read and write access respectivily. And then
> this
> info can be used by any one who has knowledge of 'mtd_info'.
Yes, that was one option. This meant, some of the existing handlers for read_oob and write_oob required changes to get rid of "page", if we decide to use the page from mtd_info structure.
Thanks
Sneha
>
> -vimal
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
2009-07-17 14:35 ` Narnakaje, Snehaprabha
@ 2009-07-17 14:45 ` Singh, Vimal
2009-07-17 14:48 ` Narnakaje, Snehaprabha
0 siblings, 1 reply; 8+ messages in thread
From: Singh, Vimal @ 2009-07-17 14:45 UTC (permalink / raw)
To: Narnakaje, Snehaprabha
Cc: davinci-linux-open-source@linux.davincidsp.com, Paulraj, Sandeep,
linux-mtd@lists.infradead.org, tglx@linutronix.de,
dwmw2@infradead.org, akpm@linux-foundation.org
> > Why not just adding 'page' or 'cur_page' parameter to 'mtd_info' structure and
> > populate the same in 'nand_do_read_ops' and 'nand_do_write_ops' as soon as you
> > calculate 'page' for every read and write access respectivily. And then this
> > info can be used by any one who has knowledge of 'mtd_info'.
> >
> Yes, that was one option. This meant, some of the existing handlers for read_oob and write_oob required changes to get rid of "page", if we decide to use the page from mtd_info structure.
But that would have taken less changes.
-vimal
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
2009-07-17 14:45 ` Singh, Vimal
@ 2009-07-17 14:48 ` Narnakaje, Snehaprabha
2009-07-17 15:12 ` Singh, Vimal
0 siblings, 1 reply; 8+ messages in thread
From: Narnakaje, Snehaprabha @ 2009-07-17 14:48 UTC (permalink / raw)
To: Singh, Vimal
Cc: davinci-linux-open-source@linux.davincidsp.com, Paulraj, Sandeep,
linux-mtd@lists.infradead.org, tglx@linutronix.de,
dwmw2@infradead.org, akpm@linux-foundation.org
> -----Original Message-----
> From: Singh, Vimal
> Sent: Friday, July 17, 2009 10:45 AM
> To: Narnakaje, Snehaprabha
> Cc: linux-mtd@lists.infradead.org; davinci-linux-open-
> source@linux.davincidsp.com; dwmw2@infradead.org; tglx@linutronix.de;
> akpm@linux-foundation.org; Paulraj, Sandeep
> Subject: RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all
> read_page/read_page_raw APIs
>
> > > Why not just adding 'page' or 'cur_page' parameter to 'mtd_info'
> structure and
> > > populate the same in 'nand_do_read_ops' and 'nand_do_write_ops' as
> soon as you
> > > calculate 'page' for every read and write access respectivily. And
> then this
> > > info can be used by any one who has knowledge of 'mtd_info'.
> > >
> > Yes, that was one option. This meant, some of the existing handlers for
> read_oob and write_oob required changes to get rid of "page", if we decide
> to use the page from mtd_info structure.
>
> But that would have taken less changes.
The change in read_oob/write_oob handlers would be minimal.
But the API definitions should change all over the place, similar to the way read_page API had to change in all NAND files (in this patch).
Thanks
Sneha
>
> -vimal
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
2009-07-17 14:48 ` Narnakaje, Snehaprabha
@ 2009-07-17 15:12 ` Singh, Vimal
0 siblings, 0 replies; 8+ messages in thread
From: Singh, Vimal @ 2009-07-17 15:12 UTC (permalink / raw)
To: Narnakaje, Snehaprabha
Cc: davinci-linux-open-source@linux.davincidsp.com, Paulraj, Sandeep,
linux-mtd@lists.infradead.org, tglx@linutronix.de,
dwmw2@infradead.org, akpm@linux-foundation.org
On Fri, Jul 17, 2009 at 8:18 PM, Narnakaje, Snehaprabha<nsnehaprabha@ti.com> wrote:
>> -----Original Message-----
>> From: Singh, Vimal
>> Sent: Friday, July 17, 2009 10:45 AM
>> To: Narnakaje, Snehaprabha
>> Cc: linux-mtd@lists.infradead.org; davinci-linux-open-
>> source@linux.davincidsp.com; dwmw2@infradead.org; tglx@linutronix.de;
>> akpm@linux-foundation.org; Paulraj, Sandeep
>> Subject: RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all
>> read_page/read_page_raw APIs
>>
>> > > Why not just adding 'page' or 'cur_page' parameter to 'mtd_info'
>> structure and
>> > > populate the same in 'nand_do_read_ops' and 'nand_do_write_ops' as
>> soon as you
>> > > calculate 'page' for every read and write access respectivily. And
>> then this
>> > > info can be used by any one who has knowledge of 'mtd_info'.
>> > >
>> > Yes, that was one option. This meant, some of the existing handlers for
>> read_oob and write_oob required changes to get rid of "page", if we decide
>> to use the page from mtd_info structure.
>>
>> But that would have taken less changes.
>
> The change in read_oob/write_oob handlers would be minimal.
>
> But the API definitions should change all over the place, similar to the way read_page API had to change in all NAND files (in this patch).
AFAIK 'drivers/mtd/nand/cafe_nand.c' is only driver which over rides read_oob/write_oob APIs.
-vimal
^ permalink raw reply [flat|nested] 8+ messages in thread
* RE: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
2009-07-16 21:59 [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs nsnehaprabha
@ 2009-09-14 19:40 ` Narnakaje, Snehaprabha
2009-09-14 20:54 ` Kevin Hilman
0 siblings, 1 reply; 8+ messages in thread
From: Narnakaje, Snehaprabha @ 2009-09-14 19:40 UTC (permalink / raw)
To: linux-mtd@lists.infradead.org,
davinci-linux-open-source@linux.davincidsp.com,
dwmw2@infradead.org, tglx@linutronix.de,
akpm@linux-foundation.org
Cc: Paulraj, Sandeep
Kevin,
All the NAND 4-bit ECC patches are approved and now in -mm tree (mmotm) queued up for the MTD tree.
Could you please pick up these patches from -mm tree (with Andrew's signoff) and apply them to linux-davinci?
[PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-page-parameter-to-all-read_page-read_page_raw-apis.patch
[PATCH v3 2/3] mtd-nand: Add new ECC mode - ECC_HW_OOB_FIRST
http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-new-ecc-mode-ecc_hw_oob_first.patch
[PATCH v3 and v4 3/3] mtd-nand: DaVinci: Add 4-bit ECC support for large page NAND chips
http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-davinci-add-4-bit-ecc-support-for-large-page-nand-chips.patch
http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-davinci-add-4-bit-ecc-support-for-large-page-nand-chips-update.patch
I will send the patch to use this new ECC mode from DM355 and DM365 NAND platform data structures.
Thanks
Sneha
> -----Original Message-----
> From: Narnakaje, Snehaprabha
> Sent: Thursday, July 16, 2009 6:00 PM
> To: linux-mtd@lists.infradead.org; davinci-linux-open-
> source@linux.davincidsp.com; dwmw2@infradead.org; tglx@linutronix.de;
> akpm@linux-foundation.org
> Cc: Narnakaje, Snehaprabha; Paulraj, Sandeep
> Subject: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all
> read_page/read_page_raw APIs
>
> From: Sneha Narnakaje <nsnehaprabha@ti.com>
>
> This patch new "page" parameter to all NAND read_page/read_page_raw APIs.
> The read_page API for the new mode ECC_HW_OOB_FIRST requires the page
> information to send the READOOB command and read the OOB area before the
> data area.
>
> This patch series applies to linux-mtd next (mmotm) GIT tree.
> This patch is the same as v2 version of this patch.
>
> Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
> Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
> ---
> drivers/mtd/nand/atmel_nand.c | 2 +-
> drivers/mtd/nand/cafe_nand.c | 2 +-
> drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
> drivers/mtd/nand/nand_base.c | 18 ++++++++++--------
> drivers/mtd/nand/sh_flctl.c | 2 +-
> include/linux/mtd/nand.h | 4 ++--
> 6 files changed, 17 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
> index 20c828b..f8e9975 100644
> --- a/drivers/mtd/nand/atmel_nand.c
> +++ b/drivers/mtd/nand/atmel_nand.c
> @@ -218,7 +218,7 @@ static int atmel_nand_calculate(struct mtd_info *mtd,
> * buf: buffer to store read data
> */
> static int atmel_nand_read_page(struct mtd_info *mtd,
> - struct nand_chip *chip, uint8_t *buf)
> + struct nand_chip *chip, uint8_t *buf, int page)
> {
> int eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
> index 1b4690b..c828d9a 100644
> --- a/drivers/mtd/nand/cafe_nand.c
> +++ b/drivers/mtd/nand/cafe_nand.c
> @@ -381,7 +381,7 @@ static int cafe_nand_read_oob(struct mtd_info *mtd,
> struct nand_chip *chip,
> * we need a special oob layout and handling.
> */
> static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> struct cafe_priv *cafe = mtd->priv;
>
> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c
> b/drivers/mtd/nand/fsl_elbc_nand.c
> index 1f6eb25..ddd37d2 100644
> --- a/drivers/mtd/nand/fsl_elbc_nand.c
> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
> @@ -739,7 +739,8 @@ static int fsl_elbc_chip_init_tail(struct mtd_info
> *mtd)
>
> static int fsl_elbc_read_page(struct mtd_info *mtd,
> struct nand_chip *chip,
> - uint8_t *buf)
> + uint8_t *buf,
> + int page)
> {
> fsl_elbc_read_buf(mtd, buf, mtd->writesize);
> fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
> index 8c21b89..979988a 100644
> --- a/drivers/mtd/nand/nand_base.c
> +++ b/drivers/mtd/nand/nand_base.c
> @@ -766,7 +766,7 @@ static int nand_wait(struct mtd_info *mtd, struct
> nand_chip *chip)
> * Not for syndrome calculating ecc controllers, which use a special oob
> layout
> */
> static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> chip->read_buf(mtd, buf, mtd->writesize);
> chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
> @@ -782,7 +782,7 @@ static int nand_read_page_raw(struct mtd_info *mtd,
> struct nand_chip *chip,
> * We need a special oob layout and handling even when OOB isn't used.
> */
> static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct
> nand_chip *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> int eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> @@ -821,7 +821,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info
> *mtd, struct nand_chip *c
> * @buf: buffer to store read data
> */
> static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> int i, eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> @@ -831,7 +831,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd,
> struct nand_chip *chip,
> uint8_t *ecc_code = chip->buffers->ecccode;
> uint32_t *eccpos = chip->ecc.layout->eccpos;
>
> - chip->ecc.read_page_raw(mtd, chip, buf);
> + chip->ecc.read_page_raw(mtd, chip, buf, page);
>
> for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
> chip->ecc.calculate(mtd, p, &ecc_calc[i]);
> @@ -944,7 +944,7 @@ static int nand_read_subpage(struct mtd_info *mtd,
> struct nand_chip *chip, uint3
> * Not for syndrome calculating ecc controllers which need a special oob
> layout
> */
> static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> int i, eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> @@ -989,7 +989,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd,
> struct nand_chip *chip,
> * we need a special oob layout and handling.
> */
> static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> int i, eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> @@ -1131,11 +1131,13 @@ static int nand_do_read_ops(struct mtd_info *mtd,
> loff_t from,
>
> /* Now read the page into the buffer */
> if (unlikely(ops->mode == MTD_OOB_RAW))
> - ret = chip->ecc.read_page_raw(mtd, chip, bufpoi);
> + ret = chip->ecc.read_page_raw(mtd, chip,
> + bufpoi, page);
> else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
> ret = chip->ecc.read_subpage(mtd, chip, col,
> bytes, bufpoi);
> else
> - ret = chip->ecc.read_page(mtd, chip, bufpoi);
> + ret = chip->ecc.read_page(mtd, chip, bufpoi,
> + page);
> if (ret < 0)
> break;
>
> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
> index 2bc8966..c5df285 100644
> --- a/drivers/mtd/nand/sh_flctl.c
> +++ b/drivers/mtd/nand/sh_flctl.c
> @@ -329,7 +329,7 @@ static void set_cmd_regs(struct mtd_info *mtd,
> uint32_t cmd, uint32_t flcmcdr_va
> }
>
> static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip
> *chip,
> - uint8_t *buf)
> + uint8_t *buf, int page)
> {
> int i, eccsize = chip->ecc.size;
> int eccbytes = chip->ecc.bytes;
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 4030eba..686f370 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -271,13 +271,13 @@ struct nand_ecc_ctrl {
> uint8_t *calc_ecc);
> int (*read_page_raw)(struct mtd_info *mtd,
> struct nand_chip *chip,
> - uint8_t *buf);
> + uint8_t *buf, int page);
> void (*write_page_raw)(struct mtd_info *mtd,
> struct nand_chip *chip,
> const uint8_t *buf);
> int (*read_page)(struct mtd_info *mtd,
> struct nand_chip *chip,
> - uint8_t *buf);
> + uint8_t *buf, int page);
> int (*read_subpage)(struct mtd_info *mtd,
> struct nand_chip *chip,
> uint32_t offs, uint32_t len,
> --
> 1.6.0.4
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
2009-09-14 19:40 ` Narnakaje, Snehaprabha
@ 2009-09-14 20:54 ` Kevin Hilman
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2009-09-14 20:54 UTC (permalink / raw)
To: Narnakaje, Snehaprabha
Cc: dwmw2@infradead.org,
davinci-linux-open-source@linux.davincidsp.com,
linux-mtd@lists.infradead.org, tglx@linutronix.de,
akpm@linux-foundation.org
"Narnakaje, Snehaprabha" <nsnehaprabha@ti.com> writes:
> Kevin,
>
> All the NAND 4-bit ECC patches are approved and now in -mm tree (mmotm) queued up for the MTD tree.
>
> Could you please pick up these patches from -mm tree (with Andrew's signoff) and apply them to linux-davinci?
Sneha,
Yes, I'll pull these into my 'davinci-backports' branch that is then
merged with the master branch.
Thanks,
Kevin
> [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs
> http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-page-parameter-to-all-read_page-read_page_raw-apis.patch
>
> [PATCH v3 2/3] mtd-nand: Add new ECC mode - ECC_HW_OOB_FIRST
> http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-add-new-ecc-mode-ecc_hw_oob_first.patch
>
> [PATCH v3 and v4 3/3] mtd-nand: DaVinci: Add 4-bit ECC support for large page NAND chips
> http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-davinci-add-4-bit-ecc-support-for-large-page-nand-chips.patch
> http://userweb.kernel.org/~akpm/mmotm/broken-out/mtd-nand-davinci-add-4-bit-ecc-support-for-large-page-nand-chips-update.patch
>
> I will send the patch to use this new ECC mode from DM355 and DM365 NAND platform data structures.
>
>
>
>> -----Original Message-----
>> From: Narnakaje, Snehaprabha
>> Sent: Thursday, July 16, 2009 6:00 PM
>> To: linux-mtd@lists.infradead.org; davinci-linux-open-
>> source@linux.davincidsp.com; dwmw2@infradead.org; tglx@linutronix.de;
>> akpm@linux-foundation.org
>> Cc: Narnakaje, Snehaprabha; Paulraj, Sandeep
>> Subject: [PATCH v3 1/3] mtd-nand: Add "page" parameter to all
>> read_page/read_page_raw APIs
>>
>> From: Sneha Narnakaje <nsnehaprabha@ti.com>
>>
>> This patch new "page" parameter to all NAND read_page/read_page_raw APIs.
>> The read_page API for the new mode ECC_HW_OOB_FIRST requires the page
>> information to send the READOOB command and read the OOB area before the
>> data area.
>>
>> This patch series applies to linux-mtd next (mmotm) GIT tree.
>> This patch is the same as v2 version of this patch.
>>
>> Reviewed-by: David Brownell <dbrownell@users.sourceforge.net>
>> Signed-off-by: Sneha Narnakaje <nsnehaprabha@ti.com>
>> Signed-off-by: Sandeep Paulraj <s-paulraj@ti.com>
>> ---
>> drivers/mtd/nand/atmel_nand.c | 2 +-
>> drivers/mtd/nand/cafe_nand.c | 2 +-
>> drivers/mtd/nand/fsl_elbc_nand.c | 3 ++-
>> drivers/mtd/nand/nand_base.c | 18 ++++++++++--------
>> drivers/mtd/nand/sh_flctl.c | 2 +-
>> include/linux/mtd/nand.h | 4 ++--
>> 6 files changed, 17 insertions(+), 14 deletions(-)
>>
>> diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
>> index 20c828b..f8e9975 100644
>> --- a/drivers/mtd/nand/atmel_nand.c
>> +++ b/drivers/mtd/nand/atmel_nand.c
>> @@ -218,7 +218,7 @@ static int atmel_nand_calculate(struct mtd_info *mtd,
>> * buf: buffer to store read data
>> */
>> static int atmel_nand_read_page(struct mtd_info *mtd,
>> - struct nand_chip *chip, uint8_t *buf)
>> + struct nand_chip *chip, uint8_t *buf, int page)
>> {
>> int eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> diff --git a/drivers/mtd/nand/cafe_nand.c b/drivers/mtd/nand/cafe_nand.c
>> index 1b4690b..c828d9a 100644
>> --- a/drivers/mtd/nand/cafe_nand.c
>> +++ b/drivers/mtd/nand/cafe_nand.c
>> @@ -381,7 +381,7 @@ static int cafe_nand_read_oob(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> * we need a special oob layout and handling.
>> */
>> static int cafe_nand_read_page(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> struct cafe_priv *cafe = mtd->priv;
>>
>> diff --git a/drivers/mtd/nand/fsl_elbc_nand.c
>> b/drivers/mtd/nand/fsl_elbc_nand.c
>> index 1f6eb25..ddd37d2 100644
>> --- a/drivers/mtd/nand/fsl_elbc_nand.c
>> +++ b/drivers/mtd/nand/fsl_elbc_nand.c
>> @@ -739,7 +739,8 @@ static int fsl_elbc_chip_init_tail(struct mtd_info
>> *mtd)
>>
>> static int fsl_elbc_read_page(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> - uint8_t *buf)
>> + uint8_t *buf,
>> + int page)
>> {
>> fsl_elbc_read_buf(mtd, buf, mtd->writesize);
>> fsl_elbc_read_buf(mtd, chip->oob_poi, mtd->oobsize);
>> diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
>> index 8c21b89..979988a 100644
>> --- a/drivers/mtd/nand/nand_base.c
>> +++ b/drivers/mtd/nand/nand_base.c
>> @@ -766,7 +766,7 @@ static int nand_wait(struct mtd_info *mtd, struct
>> nand_chip *chip)
>> * Not for syndrome calculating ecc controllers, which use a special oob
>> layout
>> */
>> static int nand_read_page_raw(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> chip->read_buf(mtd, buf, mtd->writesize);
>> chip->read_buf(mtd, chip->oob_poi, mtd->oobsize);
>> @@ -782,7 +782,7 @@ static int nand_read_page_raw(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> * We need a special oob layout and handling even when OOB isn't used.
>> */
>> static int nand_read_page_raw_syndrome(struct mtd_info *mtd, struct
>> nand_chip *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> int eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> @@ -821,7 +821,7 @@ static int nand_read_page_raw_syndrome(struct mtd_info
>> *mtd, struct nand_chip *c
>> * @buf: buffer to store read data
>> */
>> static int nand_read_page_swecc(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> int i, eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> @@ -831,7 +831,7 @@ static int nand_read_page_swecc(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> uint8_t *ecc_code = chip->buffers->ecccode;
>> uint32_t *eccpos = chip->ecc.layout->eccpos;
>>
>> - chip->ecc.read_page_raw(mtd, chip, buf);
>> + chip->ecc.read_page_raw(mtd, chip, buf, page);
>>
>> for (i = 0; eccsteps; eccsteps--, i += eccbytes, p += eccsize)
>> chip->ecc.calculate(mtd, p, &ecc_calc[i]);
>> @@ -944,7 +944,7 @@ static int nand_read_subpage(struct mtd_info *mtd,
>> struct nand_chip *chip, uint3
>> * Not for syndrome calculating ecc controllers which need a special oob
>> layout
>> */
>> static int nand_read_page_hwecc(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> int i, eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> @@ -989,7 +989,7 @@ static int nand_read_page_hwecc(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> * we need a special oob layout and handling.
>> */
>> static int nand_read_page_syndrome(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> int i, eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> @@ -1131,11 +1131,13 @@ static int nand_do_read_ops(struct mtd_info *mtd,
>> loff_t from,
>>
>> /* Now read the page into the buffer */
>> if (unlikely(ops->mode == MTD_OOB_RAW))
>> - ret = chip->ecc.read_page_raw(mtd, chip, bufpoi);
>> + ret = chip->ecc.read_page_raw(mtd, chip,
>> + bufpoi, page);
>> else if (!aligned && NAND_SUBPAGE_READ(chip) && !oob)
>> ret = chip->ecc.read_subpage(mtd, chip, col,
>> bytes, bufpoi);
>> else
>> - ret = chip->ecc.read_page(mtd, chip, bufpoi);
>> + ret = chip->ecc.read_page(mtd, chip, bufpoi,
>> + page);
>> if (ret < 0)
>> break;
>>
>> diff --git a/drivers/mtd/nand/sh_flctl.c b/drivers/mtd/nand/sh_flctl.c
>> index 2bc8966..c5df285 100644
>> --- a/drivers/mtd/nand/sh_flctl.c
>> +++ b/drivers/mtd/nand/sh_flctl.c
>> @@ -329,7 +329,7 @@ static void set_cmd_regs(struct mtd_info *mtd,
>> uint32_t cmd, uint32_t flcmcdr_va
>> }
>>
>> static int flctl_read_page_hwecc(struct mtd_info *mtd, struct nand_chip
>> *chip,
>> - uint8_t *buf)
>> + uint8_t *buf, int page)
>> {
>> int i, eccsize = chip->ecc.size;
>> int eccbytes = chip->ecc.bytes;
>> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
>> index 4030eba..686f370 100644
>> --- a/include/linux/mtd/nand.h
>> +++ b/include/linux/mtd/nand.h
>> @@ -271,13 +271,13 @@ struct nand_ecc_ctrl {
>> uint8_t *calc_ecc);
>> int (*read_page_raw)(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> - uint8_t *buf);
>> + uint8_t *buf, int page);
>> void (*write_page_raw)(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> const uint8_t *buf);
>> int (*read_page)(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> - uint8_t *buf);
>> + uint8_t *buf, int page);
>> int (*read_subpage)(struct mtd_info *mtd,
>> struct nand_chip *chip,
>> uint32_t offs, uint32_t len,
>> --
>> 1.6.0.4
>
> _______________________________________________
> Davinci-linux-open-source mailing list
> Davinci-linux-open-source@linux.davincidsp.com
> http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2009-09-14 20:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-16 21:59 [PATCH v3 1/3] mtd-nand: Add "page" parameter to all read_page/read_page_raw APIs nsnehaprabha
2009-09-14 19:40 ` Narnakaje, Snehaprabha
2009-09-14 20:54 ` Kevin Hilman
-- strict thread matches above, loose matches on Subject: below --
2009-07-17 7:11 vimal singh
[not found] <42655.192.168.10.89.1247812404.squirrel@dbdmail.itg.ti.com>
2009-07-17 14:35 ` Narnakaje, Snehaprabha
2009-07-17 14:45 ` Singh, Vimal
2009-07-17 14:48 ` Narnakaje, Snehaprabha
2009-07-17 15:12 ` Singh, Vimal
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).