diff options
| author | Brian Norris <computersforpeace@gmail.com> | 2014-01-29 17:08:12 -0500 |
|---|---|---|
| committer | Brian Norris <computersforpeace@gmail.com> | 2014-03-11 01:42:22 -0400 |
| commit | 3dad2344e92c6e1aeae42df1c4824f307c51bcc7 (patch) | |
| tree | ca71a7005c582cd98eebf5e16049b125564925f5 /include/linux/mtd | |
| parent | 55e571bd0707fb6516d0e38598c9e51683e03ee9 (diff) | |
mtd: nand: force NAND_CMD_READID onto 8-bit bus
The NAND command helpers tend to automatically shift the column address
for x16 bus devices, since most commands expect a word address, not a
byte address. The Read ID command, however, expects an 8-bit address
(i.e., 0x00, 0x20, or 0x40 should not be translated to 0x00, 0x10, or
0x20).
This fixes the column address for a few drivers which imitate the
nand_base defaults. Note that I don't touch sh_flctl.c, since it already
handles this problem slightly differently (note its comment "READID is
always performed using an 8-bit bus").
I have not tested this patch, as I only have x8 parts up for testing at
this point. Hopefully that can change soon...
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Tested-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Tested-By: Pekon Gupta <pekon@ti.com>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/nand.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index a719686c9cce..c034dc4224cb 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
| @@ -832,4 +832,14 @@ static inline bool nand_is_slc(struct nand_chip *chip) | |||
| 832 | { | 832 | { |
| 833 | return chip->bits_per_cell == 1; | 833 | return chip->bits_per_cell == 1; |
| 834 | } | 834 | } |
| 835 | |||
| 836 | /** | ||
| 837 | * Check if the opcode's address should be sent only on the lower 8 bits | ||
| 838 | * @command: opcode to check | ||
| 839 | */ | ||
| 840 | static inline int nand_opcode_8bits(unsigned int command) | ||
| 841 | { | ||
| 842 | return command == NAND_CMD_READID; | ||
| 843 | } | ||
| 844 | |||
| 835 | #endif /* __LINUX_MTD_NAND_H */ | 845 | #endif /* __LINUX_MTD_NAND_H */ |
