linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
@ 2014-03-21 22:05 David Mosberger
  2014-03-22  0:20 ` Brian Norris
  2014-03-26  6:33 ` Brian Norris
  0 siblings, 2 replies; 3+ messages in thread
From: David Mosberger @ 2014-03-21 22:05 UTC (permalink / raw)
  To: linux-mtd; +Cc: David Mosberger

linux-next almost works out of the box for us except that GET_FEATURES
and SET_FEATURES also need byte-addressing.  With the attached patch,
our board boots fine (save for on-die ECC patch, which I'll submit
separately).  The only oddity is that the devices is reported as being
SLC, when it's most definitely not:

nand: 512MiB, SLC, page size: 2048, OOB size: 64

   --david



GET_FEATURES and SET_FEATURES also need byte-addressing on 16-bit devices.

Signed-off-by: David Mosberger <davidm@egauge.net>

diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 0747fef..29a23bb 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -925,7 +929,16 @@ static inline bool nand_is_slc(struct nand_chip *chip)
  */
 static inline int nand_opcode_8bits(unsigned int command)
 {
-	return command == NAND_CMD_READID || command == NAND_CMD_PARAM;
+	switch (command) {
+	case NAND_CMD_READID:
+	case NAND_CMD_PARAM:
+	case NAND_CMD_GET_FEATURES:
+	case NAND_CMD_SET_FEATURES:
+		return 1;
+	default:
+		break;
+	}
+	return 0;
 }
 
 /* return the supported JEDEC features. */

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
  2014-03-21 22:05 mtd: nand: fix GET/SET_FEATURES address on 16-bit devices David Mosberger
@ 2014-03-22  0:20 ` Brian Norris
  2014-03-26  6:33 ` Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-03-22  0:20 UTC (permalink / raw)
  To: David Mosberger; +Cc: linux-mtd

Hi David,

(BTW, it's nice if $SUBJECT begins with the text '[PATCH]'. I actually
filter mail based on this!)

On Fri, Mar 21, 2014 at 04:05:10PM -0600, David Mosberger wrote:
> linux-next almost works out of the box for us except that GET_FEATURES
> and SET_FEATURES also need byte-addressing.

Thanks a lot for testing linux-next for this! Our recent fixes for x16
buswidths really haven't gotten wide testing.

> With the attached patch,
> our board boots fine (save for on-die ECC patch, which I'll submit
> separately).  The only oddity is that the devices is reported as being
> SLC, when it's most definitely not:
> 
> nand: 512MiB, SLC, page size: 2048, OOB size: 64

Hmm. What's the part number + vendor? (And the ID bytes, if possible?)

>    --david
> 
> 
> 
> GET_FEATURES and SET_FEATURES also need byte-addressing on 16-bit devices.
> 
> Signed-off-by: David Mosberger <davidm@egauge.net>
> 
> diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
> index 0747fef..29a23bb 100644
> --- a/include/linux/mtd/nand.h
> +++ b/include/linux/mtd/nand.h
> @@ -925,7 +929,16 @@ static inline bool nand_is_slc(struct nand_chip *chip)
>   */
>  static inline int nand_opcode_8bits(unsigned int command)
>  {
> -	return command == NAND_CMD_READID || command == NAND_CMD_PARAM;
> +	switch (command) {
> +	case NAND_CMD_READID:
> +	case NAND_CMD_PARAM:
> +	case NAND_CMD_GET_FEATURES:
> +	case NAND_CMD_SET_FEATURES:
> +		return 1;
> +	default:
> +		break;
> +	}
> +	return 0;
>  }
>  
>  /* return the supported JEDEC features. */
> 

Patch looks good. I'll come back to this to test and apply for 3.15, I
hope (feel free to bug me if I don't reply back by 3.15-rc1). But:

Acked-by: Brian Norris <computersforpeace@gmail.com>

Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
  2014-03-21 22:05 mtd: nand: fix GET/SET_FEATURES address on 16-bit devices David Mosberger
  2014-03-22  0:20 ` Brian Norris
@ 2014-03-26  6:33 ` Brian Norris
  1 sibling, 0 replies; 3+ messages in thread
From: Brian Norris @ 2014-03-26  6:33 UTC (permalink / raw)
  To: David Mosberger; +Cc: linux-mtd

On Fri, Mar 21, 2014 at 04:05:10PM -0600, David Mosberger wrote:
> GET_FEATURES and SET_FEATURES also need byte-addressing on 16-bit devices.
> 
> Signed-off-by: David Mosberger <davidm@egauge.net>

Pushed to l2-mtd.git. Thanks!

Brian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-26  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-03-21 22:05 mtd: nand: fix GET/SET_FEATURES address on 16-bit devices David Mosberger
2014-03-22  0:20 ` Brian Norris
2014-03-26  6:33 ` Brian Norris

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).