summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Mosberger <davidm@egauge.net>2014-05-06 00:46:18 +0530
committerTom Rini <trini@ti.com>2014-06-06 17:46:05 -0400
commit6e1899e633c2ac3f6da7101d4990361c6ff2a9d2 (patch)
tree705be533d6618bf18017295df3fd18a45329b71e /include
parent27ce9e4290b168a1241699d411678959aaf9649b (diff)
downloadu-boot-imx-6e1899e633c2ac3f6da7101d4990361c6ff2a9d2.zip
u-boot-imx-6e1899e633c2ac3f6da7101d4990361c6ff2a9d2.tar.gz
u-boot-imx-6e1899e633c2ac3f6da7101d4990361c6ff2a9d2.tar.bz2
mtd: nand: fix GET/SET_FEATURES address on 16-bit devices
As per following Sections in ONFI Spec, GET_FEATURES and SET_FEATURES also need byte-addressing on 16-bit devices. *Section: Target Initialization" "The Read ID and Read Parameter Page commands only use the lower 8-bits of the data bus. The host shall not issue commands that use a word data width on x16 devices until the host determines the device supports a 16-bit data bus width in the parameter page." *Section: Bus Width Requirements* "When the host supports a 16-bit bus width, only data is transferred at the 16-bit width. All address and command line transfers shall use only the lower 8-bits of the data bus. During command transfers, the host may place any value on the upper 8-bits of the data bus. During address transfers, the host shall set the upper 8-bits of the data bus to 00h." So porting following commit from linux kernel commit e34fcb07a6d57411de6e15a47724fbe92c5caa42 Author: David Mosberger <davidm@egauge.net> (preserving authorship) mtd: nand: fix GET/SET_FEATURES address on 16-bit devices Signed-off-by: Pekon Gupta <pekon@ti.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mtd/nand.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 4be8858..991bd8e 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -725,7 +725,16 @@ static inline int onfi_get_sync_timing_mode(struct nand_chip *chip)
*/
static inline int nand_opcode_8bits(unsigned int command)
{
- return command == NAND_CMD_READID;
+ 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;
}