openwrtv3/target/linux/sunxi/patches-4.1/128-2-mtd-nand-support-non-ONFI-timings.patch
Jonas Gorski 6be2305da8 kernel: update 4.1 to 4.1.5
Changelog:
 * https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.5

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 46598
2015-08-14 13:06:33 +00:00

28 lines
839 B
Diff

--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -4262,8 +4262,13 @@ static bool find_full_id_nand(struct mtd
chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
chip->ecc_step_ds = NAND_ECC_STEP(type);
- mode = type->onfi_timing_mode_default;
- chip->sdr_timings = onfi_async_timing_mode_to_sdr_timings(mode);
+ if (type->custom_sdr_timing) {
+ chip->sdr_timings = type->custom_sdr_timing;
+ } else {
+ mode = type->onfi_timing_mode_default;
+ chip->sdr_timings =
+ onfi_async_timing_mode_to_sdr_timings(mode);
+ }
*busw = type->options & NAND_BUSWIDTH_16;
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -988,6 +988,7 @@ struct nand_flash_dev {
uint16_t step_ds;
} ecc;
int onfi_timing_mode_default;
+ const struct nand_sdr_timings *custom_sdr_timing;
};
/**