Skip to contentSkip to conversation

nand/denali: Adding Denali NAND driver support

PATCH New Chin Liang See 4 participants 10 messages Aug 19, 2014 – Sep 12, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT Changes for v8
- Applied Masahiro's patch as below
- Replaced "denali->foo" with "denali.foo"
- Fixed denali_write_oob() handler
- Made denali_read_oob() 10x faster
Changes for v7
- Adding Masahiro's code to support 64bit version controller
- Removed unused stub functions
- Enhanced the ECC calculation
Changes for v6
- Remove chip_delay as its unused
- Remove ECC bit assignment in nand_para functions Changes for v5
- Rename denali_nand to denali only
- Rename the macro for ctrl and data address
Changes for v4
- Added cache flush to handle dcache enabled
- Used standard return where 0 for pass
- Removed unnecessary casting
- Used standard readl and writel
Changes for v3
- Fixed coding style
Changes for v2
- Enable this driver support for SOCFPGA

---
 drivers/mtd/nand/Makefile |    1 +
 drivers/mtd/nand/denali.c | 1209 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/mtd/nand/denali.h |  469 ++++++++++++++++++
 3 files changed, 1679 insertions(+)
 create mode 100644 drivers/mtd/nand/denali.c
 create mode 100644 drivers/mtd/nand/denali.h
drivers/mtd/nand/Makefile +1 -0
index bf1312a..f298f84 100644
@@ -42,6 +42,7 @@ obj-$(CONFIG_NAND_ECC_BCH) += nand_bch.o
 obj-$(CONFIG_NAND_ATMEL) += atmel_nand.o
 obj-$(CONFIG_DRIVER_NAND_BFIN) += bfin_nand.o
 obj-$(CONFIG_NAND_DAVINCI) += davinci_nand.o
+obj-$(CONFIG_NAND_DENALI) += denali.o
 obj-$(CONFIG_NAND_FSL_ELBC) += fsl_elbc_nand.o
 obj-$(CONFIG_NAND_FSL_IFC) += fsl_ifc_nand.o
 obj-$(CONFIG_NAND_FSL_UPM) += fsl_upm.o
drivers/mtd/nand/denali.c new file +1209 -0

1,209 lines not on this page · raw message

drivers/mtd/nand/denali.h new file +469 -0

469 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Hi Chin,

drivers/mtd/nand/denali.c line 165

Quoted 8 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:
drivers/mtd/nand/denali.c new file +8 -0
+
+/* We need to buffer some data for some of the NAND core routines.
+ * The operations manage buffering that data. */
+static void reset_buf(struct denali_nand_info *denali)
+{
+	denali->buf.head = 0;
+	denali->buf.tail = 0;
+}

I compared v8 and v9.
I noticed you changed this part

from

    denali->buf.head = denali->buf.tail = 0;

to

    denali->buf.head = 0;
    denali->buf.tail = 0;

where nobody pointed out.

My question is,
foo = bar = 0 violates the codying style?

Anyway, this version worked on my board.

Scott,
Could you do a quick review on this, please?

Best Regards
Masahiro Yamada

#2 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

In reply to Chin Liang See

Hi Scott,

Quoted 6 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>
Quoted 6 lines

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Any comments?

If nothing, please apply this patch.

Best Regards
Masahiro Yamada

#3 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 6 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>
Quoted 6 lines

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

Signature · 8 lines
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20140830/343e3274/attachment.pgp>
#4 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Hi Tom,

Quoted 21 lines · On Sat, 30 Aug 2014 07:45:49 -0400 Tom Rini <[email protected]> wrote:
Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 12 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 9 lines
Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

This driver cannot build
since commit ff94bc40af3481d47546595ba73c136de6af6929 (mtd, ubi, ubifs: resync with Linux-3.14),

I posted a question last week:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/194367/match=nand_cmd_lock_tight

No reply so far.

Best Regards
Masahiro Yamada

#5 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Quoted 43 lines · Masahiro Yamada

Hi Tom,

Quoted 21 lines · On Sat, 30 Aug 2014 07:45:49 -0400 Tom Rini <[email protected]> wrote:
Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 12 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 9 lines
Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

This driver cannot build
since commit ff94bc40af3481d47546595ba73c136de6af6929 (mtd, ubi, ubifs: resync with Linux-3.14),

Quoted 4 lines

I posted a question last week:
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/194367/match=nand_cmd_lock_tight

No reply so far.

The patch that broke things didn't go through me. As I noted in
http://lists.denx.de/pipermail/u-boot/2014-May/180399.html I'm trying to get someone else to take over the NAND custodian role.

Heiko, can you respond? It looks like your patch partially reverted commit 33b1d5cae3defdbeb30333ffac41bcbff85c5019 "nand: consolidate duplicated constants".

-Scott

#6 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

In reply to Tom Rini
Quoted 21 lines · Tom Rini
Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 12 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 8 lines
Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

I still don't see a reference to the SHA of the corresponding Linux driver.

#define MODE5_WORKAROUND 0 still exists even though it's never used.

I still see (void *) casts in memcpy -- v8 comments said "removed" but not all instances were removed.

It still introduces CONFIG_SYS_NAND_DENALI_64BIT without documenting it.

-scott

#7 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Hi Chin,

Are you planning to send v10
with the fixes suggested by Scott?

Best Regards
Masahiro Yamada

Quoted 43 lines · On Tue, 2 Sep 2014 21:15:52 -0500 Scott Wood <[email protected]> wrote:
Quoted 21 lines · Tom Rini
Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 12 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 8 lines
Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

I still don't see a reference to the SHA of the corresponding Linux driver.

#define MODE5_WORKAROUND 0 still exists even though it's never used.

I still see (void *) casts in memcpy -- v8 comments said "removed" but not all instances were removed.

It still introduces CONFIG_SYS_NAND_DENALI_64BIT without documenting it.

-scott

#8 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

Hi Masahiro,

Quoted 5 lines · Masahiro Yamada

Hi Chin,

Are you planning to send v10
with the fixes suggested by Scott?

I am out of office and I will look into the comments by mid of this week. Thanks

Chin Liang

Quoted 55 lines

Best Regards
Masahiro Yamada

Quoted 43 lines · On Tue, 2 Sep 2014 21:15:52 -0500 Scott Wood <[email protected]> wrote:
Quoted 21 lines · Tom Rini
Quoted 20 lines · Masahiro Yamada

Hi Scott,

Quoted 12 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Quoted 8 lines
Quoted 3 lines

Any comments?

If nothing, please apply this patch.

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

I still don't see a reference to the SHA of the corresponding Linux driver.

#define MODE5_WORKAROUND 0 still exists even though it's never used.

I still see (void *) casts in memcpy -- v8 comments said "removed" but not all instances were removed.

It still introduces CONFIG_SYS_NAND_DENALI_64BIT without documenting it.

-scott

#9 lore raw

PATCH 1/1 nand/denali: Adding Denali NAND driver support

In reply to Scott Wood
Quoted 26 lines · Scott Wood
Quoted 25 lines · Tom Rini
Quoted 23 lines · Masahiro Yamada

Hi Scott,

Quoted 6 lines · On Tue, 19 Aug 2014 04:47:40 -0500 Chin Liang See <[email protected]> wrote:

To add the Denali NAND driver support into U-Boot. This driver is leveraged from Linux.

Cc Scott Wood <[email protected]>
Cc Masahiro Yamada <[email protected]>
Quoted 6 lines

---
Changes for v9
- Updated the commit messageb
- Removed macro kern_xx
- Removed debug macro
- Changed CONFIG_NAND_DENALI_64BIT to CONFIG_SYS_NAND_DENALI_64BIT

Any comments?

If nothing, please apply this patch.

Quoted 8 lines
Quoted 4 lines

I don't see anything obviously wrong here, but since Scott has reviewed previous versions I want to give him a little more time to ack. I'm OK pulling this into master with Scott's ack or lets say Wednesday next week and we'll ask Chin Liang to address any late feedback. Thanks all!

I still don't see a reference to the SHA of the corresponding Linux driver.

I will add it in commit message. Its
fdbad98dff8007f2b8bee6698b5d25ebba0471c9

Quoted 2 lines

#define MODE5_WORKAROUND 0 still exists even though it's never used.

Sorry as forget to update the header file. Done

Quoted 3 lines

I still see (void *) casts in memcpy -- v8 comments said "removed" but not all instances were removed.

Done

Quoted 1 line

It still introduces CONFIG_SYS_NAND_DENALI_64BIT without documenting it.

I already added into comments of the code. Let me add it into commit message.

Thanks
Chin Liang

Quoted 4 lines

-scott