kernel: update 4.1 to 4.1.5
[openwrt.git] / target / linux / sunxi / patches-4.1 / 128-2-mtd-nand-support-non-ONFI-timings.patch
1 --- a/drivers/mtd/nand/nand_base.c
2 +++ b/drivers/mtd/nand/nand_base.c
3 @@ -4262,8 +4262,13 @@ static bool find_full_id_nand(struct mtd
4                 chip->ecc_strength_ds = NAND_ECC_STRENGTH(type);
5                 chip->ecc_step_ds = NAND_ECC_STEP(type);
6  
7 -               mode = type->onfi_timing_mode_default;
8 -               chip->sdr_timings = onfi_async_timing_mode_to_sdr_timings(mode);
9 +               if (type->custom_sdr_timing) {
10 +                       chip->sdr_timings = type->custom_sdr_timing;
11 +               } else {
12 +                       mode = type->onfi_timing_mode_default;
13 +                       chip->sdr_timings =
14 +                               onfi_async_timing_mode_to_sdr_timings(mode);
15 +               }
16  
17                 *busw = type->options & NAND_BUSWIDTH_16;
18  
19 --- a/include/linux/mtd/nand.h
20 +++ b/include/linux/mtd/nand.h
21 @@ -988,6 +988,7 @@ struct nand_flash_dev {
22                 uint16_t step_ds;
23         } ecc;
24         int onfi_timing_mode_default;
25 +       const struct nand_sdr_timings *custom_sdr_timing;
26  };
27  
28  /**