[linux-sunxi] Re: [PATCH v3 2/9] mtd: nand: add ONFI timing mode to nand_timings converter

2014-07-09 Thread Brian Norris
Hi Boris,

Since I think you were planning on revisiting this soon, I have one more
comment:

On Wed, Mar 12, 2014 at 07:07:37PM +0100, Boris BREZILLON wrote:
 diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
 index c970ce7..0b8a822 100644
 --- a/drivers/mtd/nand/Makefile
 +++ b/drivers/mtd/nand/Makefile
 @@ -2,7 +2,7 @@
  # linux/drivers/nand/Makefile
  #
  
 -obj-$(CONFIG_MTD_NAND)   += nand.o
 +obj-$(CONFIG_MTD_NAND)   += nand.o nand_timings.o

This is not the right place, as it will generate a new module
'nand_timings' (nand_timings.ko, if CONFIG_MTD_NAND=m). You probably
want to just add nand_timings.o to the 'nand-objs' list at the bottom of
the Makefile, like this:

nand-objs := nand_base.o nand_bbt.o nand_timings.o

  obj-$(CONFIG_MTD_NAND_ECC)   += nand_ecc.o
  obj-$(CONFIG_MTD_NAND_BCH)   += nand_bch.o
  obj-$(CONFIG_MTD_NAND_IDS)   += nand_ids.o nand_hynix.o

Thanks,
Brian

-- 
You received this message because you are subscribed to the Google Groups 
linux-sunxi group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v3 2/9] mtd: nand: add ONFI timing mode to nand_timings converter

2014-04-30 Thread Brian Norris
Hi,

On Wed, Mar 12, 2014 at 07:07:37PM +0100, Boris BREZILLON wrote:
 Add a converter to retrieve NAND timings from an ONFI NAND timing mode.
 This only support SDR NAND timings for now.
 
 Signed-off-by: Boris BREZILLON b.brezillon@gmail.com
 ---
  drivers/mtd/nand/Makefile   |2 +-
  drivers/mtd/nand/nand_timings.c |  248 
 +++
  include/linux/mtd/nand.h|4 +
  3 files changed, 253 insertions(+), 1 deletion(-)
  create mode 100644 drivers/mtd/nand/nand_timings.c
 
 diff --git a/drivers/mtd/nand/Makefile b/drivers/mtd/nand/Makefile
 index c970ce7..0b8a822 100644
 --- a/drivers/mtd/nand/Makefile
 +++ b/drivers/mtd/nand/Makefile
 @@ -2,7 +2,7 @@
  # linux/drivers/nand/Makefile
  #
  
 -obj-$(CONFIG_MTD_NAND)   += nand.o
 +obj-$(CONFIG_MTD_NAND)   += nand.o nand_timings.o
  obj-$(CONFIG_MTD_NAND_ECC)   += nand_ecc.o
  obj-$(CONFIG_MTD_NAND_BCH)   += nand_bch.o
  obj-$(CONFIG_MTD_NAND_IDS)   += nand_ids.o nand_hynix.o

This patch doesn't apply to l2-mtd.git. Are you basing this on your
Hynix patches? I thought some (all?) of them were determined
unnecessary. Anyway, please rebase on l2-mtd.git, since there are a
couple of other bits that don't apply properly.

 diff --git a/drivers/mtd/nand/nand_timings.c b/drivers/mtd/nand/nand_timings.c
 new file mode 100644
 index 000..f66fe95
 --- /dev/null
 +++ b/drivers/mtd/nand/nand_timings.c
 @@ -0,0 +1,248 @@
 +/*
 + *  Copyright (C) 2014 Boris BREZILLON b.brezillon@gmail.com
 + *
 + * This program is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + */
 +#include linux/mtd/nand.h
 +
 +static const struct nand_sdr_timings onfi_sdr_timings[] = {
 + /* Mode 0 */
 + {
 + .tADL_min = 20,
 + .tALH_min = 2,
 + .tALS_min = 5,
 + .tAR_min = 25000,
 + .tCEA_max = 10,
 + .tCEH_min = 2,
 + .tCH_min = 2,
 + .tCHZ_max = 10,
 + .tCLH_min = 2,
 + .tCLR_min = 2,
 + .tCLS_min = 5,
 + .tCOH_min = 0,
 + .tCS_min = 7,
 + .tDH_min = 2,
 + .tDS_min = 4,
 + .tFEAT_max = 100,
 + .tIR_min = 1,
 + .tITC_max = 100,
 + .tRC_min = 10,
 + .tREA_max = 4,
 + .tREH_min = 3,
 + .tRHOH_min = 0,
 + .tRHW_min = 20,
 + .tRHZ_max = 20,
 + .tRLOH_min = 0,
 + .tRP_min = 5,
 + .tRST_max = 2500,

I was initially wary of potential overflow here, but apparently the C
standard (section 6.4.4.1) ensures that literal constants like this will
be promoted to a sufficiently-large type.

 + .tWB_max = 20,
 + .tRR_min = 4,
 + .tWC_min = 10,
 + .tWH_min = 3,
 + .tWHR_min = 12,
 + .tWP_min = 5,
 + .tWW_min = 10,
 + },
 + /* Mode 1 */
 + {
 + .tADL_min = 10,
 + .tALH_min = 1,
 + .tALS_min = 25000,
 + .tAR_min = 1,
 + .tCEA_max = 45000,
 + .tCEH_min = 2,
 + .tCH_min = 1,
 + .tCHZ_max = 5,
 + .tCLH_min = 1,
 + .tCLR_min = 1,
 + .tCLS_min = 25000,
 + .tCOH_min = 15000,
 + .tCS_min = 35000,
 + .tDH_min = 1,
 + .tDS_min = 2,
 + .tFEAT_max = 100,
 + .tIR_min = 0,
 + .tITC_max = 100,
 + .tRC_min = 5,
 + .tREA_max = 3,
 + .tREH_min = 15000,
 + .tRHOH_min = 15000,
 + .tRHW_min = 10,
 + .tRHZ_max = 10,
 + .tRLOH_min = 0,
 + .tRP_min = 25000,
 + .tRR_min = 2,
 + .tRST_max = 5,
 + .tWB_max = 10,
 + .tWC_min = 45000,
 + .tWH_min = 15000,
 + .tWHR_min = 8,
 + .tWP_min = 25000,
 + .tWW_min = 10,
 + },
 + /* Mode 2 */
 + {
 + .tADL_min = 10,
 + .tALH_min = 1,
 + .tALS_min = 15000,
 + .tAR_min = 1,
 + .tCEA_max = 3,
 + .tCEH_min = 2,
 + .tCH_min = 1,
 + .tCHZ_max = 5,
 + .tCLH_min = 1,
 + .tCLR_min = 1,
 + .tCLS_min = 15000,
 + .tCOH_min = 15000,
 + .tCS_min = 25000,
 + .tDH_min = 5000,
 + .tDS_min = 15000,
 +