]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: nand: don't use {read,write}_buf for 8-bit transfers
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thu, 5 Dec 2013 21:22:04 +0000 (22:22 +0100)
committerBrian Norris <computersforpeace@gmail.com>
Wed, 15 Jan 2014 01:22:37 +0000 (17:22 -0800)
commit3144dd6f0633942b7f35787530d657cef8e6ccc7
treeed86b42f8dc1c6a5704728c075abb92f6a1e4bf0
parent85166d0d5e47cdb3cb4729903cf32375c3dd9ca6
mtd: nand: don't use {read,write}_buf for 8-bit transfers

According to the Open NAND Flash Interface Specification (ONFI) Revision
3.1 "Parameters are always transferred on the lower 8-bits of the data
bus." for the Get Features and Set Features commands.

So using read_buf and write_buf is wrong for 16-bit wide nand chips as
they use I/O[15:0]. The Get Features command is easily fixed using 4
times the read_byte callback. For Set Features implement a new
overwritable callback "write_byte". Still I expect the default to work
just fine for all controllers and making it overwriteable was just done
for symmetry.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
[Brian: fixed warning]
Tested-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/nand/nand_base.c
include/linux/mtd/nand.h