Skip to content

Commit a69ad11

Browse files
committed
mtd: rawnand: Get rid of the default ONFI timing mode
The ->choose_interface() hook is here for manufacturer drivers to provide a better timing interface than the default one, this field is not needed anymore. Signed-off-by: Miquel Raynal <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 6d469f8 commit a69ad11

File tree

2 files changed

+4
-24
lines changed

2 files changed

+4
-24
lines changed

drivers/mtd/nand/raw/nand_base.c

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,10 +1012,8 @@ static int nand_setup_interface(struct nand_chip *chip, int chipnr)
10121012
* @iface: the interface configuration (can eventually be updated)
10131013
* @spec_timings: specific timings, when not fitting the ONFI specification
10141014
*
1015-
* If specific timings are provided, use them. Otherwise, try to retrieve
1016-
* supported timing modes from ONFI information. Finally, if the NAND chip does
1017-
* not follow the ONFI specification, rely on the ->default_timing_mode
1018-
* specified in the nand_ids table.
1015+
* If specific timings are provided, use them. Otherwise, retrieve supported
1016+
* timing modes from ONFI information.
10191017
*/
10201018
int nand_choose_best_sdr_timings(struct nand_chip *chip,
10211019
struct nand_interface_config *iface,
@@ -1038,15 +1036,8 @@ int nand_choose_best_sdr_timings(struct nand_chip *chip,
10381036

10391037
/* Fallback to slower modes */
10401038
best_mode = iface->timings.mode;
1041-
} else {
1042-
if (chip->parameters.onfi) {
1043-
unsigned int onfi_modes;
1044-
1045-
onfi_modes = chip->parameters.onfi->async_timing_mode;
1046-
best_mode = fls(onfi_modes) - 1;
1047-
} else {
1048-
best_mode = chip->onfi_timing_mode_default;
1049-
}
1039+
} else if (chip->parameters.onfi) {
1040+
best_mode = fls(chip->parameters.onfi->async_timing_mode) - 1;
10501041
}
10511042

10521043
for (mode = best_mode; mode >= 0; mode--) {
@@ -4767,8 +4758,6 @@ static bool find_full_id_nand(struct nand_chip *chip,
47674758
chip->options |= type->options;
47684759
chip->base.eccreq.strength = NAND_ECC_STRENGTH(type);
47694760
chip->base.eccreq.step_size = NAND_ECC_STEP(type);
4770-
chip->onfi_timing_mode_default =
4771-
type->onfi_timing_mode_default;
47724761

47734762
chip->parameters.model = kstrdup(type->name, GFP_KERNEL);
47744763
if (!chip->parameters.model)

include/linux/mtd/rawnand.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,9 +1069,6 @@ struct nand_manufacturer {
10691069
* @options: Various chip options. They can partly be set to inform nand_scan
10701070
* about special functionality. See the defines for further
10711071
* explanation.
1072-
* @onfi_timing_mode_default: Default ONFI timing mode. This field is set to the
1073-
* actually used ONFI mode if the chip is ONFI
1074-
* compliant or deduced from the datasheet otherwise
10751072
* @interface_config: NAND interface timing information
10761073
* @bbt_erase_shift: Number of address bits in a bbt entry
10771074
* @bbt_options: Bad block table specific options. All options used here must
@@ -1119,7 +1116,6 @@ struct nand_chip {
11191116
unsigned int options;
11201117

11211118
/* Data interface */
1122-
int onfi_timing_mode_default;
11231119
struct nand_interface_config interface_config;
11241120

11251121
/* Bad block information */
@@ -1268,10 +1264,6 @@ nand_get_interface_config(struct nand_chip *chip)
12681264
* @ecc_step_ds in nand_chip{}, also from the datasheet.
12691265
* For example, the "4bit ECC for each 512Byte" can be set with
12701266
* NAND_ECC_INFO(4, 512).
1271-
* @onfi_timing_mode_default: the default ONFI timing mode entered after a NAND
1272-
* reset. Should be deduced from timings described
1273-
* in the datasheet.
1274-
*
12751267
*/
12761268
struct nand_flash_dev {
12771269
char *name;
@@ -1292,7 +1284,6 @@ struct nand_flash_dev {
12921284
uint16_t strength_ds;
12931285
uint16_t step_ds;
12941286
} ecc;
1295-
int onfi_timing_mode_default;
12961287
};
12971288

12981289
int nand_create_bbt(struct nand_chip *chip);

0 commit comments

Comments
 (0)