mtd: rawnand: nand_base: support for 'NAND_IS_BOOT_MEDIUM' flag
Based on Linux kernel: commit f922bd798bb9 ("mtd: rawnand: add an option to specify NAND chip as a boot device") Allow to define a NAND chip as a boot device. This can be helpful for the selection of the ECC algorithm and strength in case the boot ROM supports only a subset of controller provided options. Signed-off-by: Arseniy Krasnov <avkrasnov@salutedevices.com> Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com> Link: https://lore.kernel.org/r/20240826131710.29746-2-avkrasnov@salutedevices.com Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
This commit is contained in:

committed by
Neil Armstrong

parent
ee2af844ba
commit
9905e77eda
@@ -4454,6 +4454,9 @@ static int nand_dt_init(struct mtd_info *mtd, struct nand_chip *chip, ofnode nod
|
||||
if (ret == 16)
|
||||
chip->options |= NAND_BUSWIDTH_16;
|
||||
|
||||
if (ofnode_read_bool(node, "nand-is-boot-medium"))
|
||||
chip->options |= NAND_IS_BOOT_MEDIUM;
|
||||
|
||||
if (ofnode_read_bool(node, "nand-on-flash-bbt"))
|
||||
chip->bbt_options |= NAND_BBT_USE_FLASH;
|
||||
|
||||
|
@@ -247,6 +247,11 @@ enum nand_ecc_algo {
|
||||
* kmap'ed, vmalloc'ed highmem buffers being passed from upper layers
|
||||
*/
|
||||
#define NAND_USE_BOUNCE_BUFFER 0x00100000
|
||||
/*
|
||||
* Whether the NAND chip is a boot medium. Drivers might use this information
|
||||
* to select ECC algorithms supported by the boot ROM or similar restrictions.
|
||||
*/
|
||||
#define NAND_IS_BOOT_MEDIUM 0x00400000
|
||||
|
||||
/*
|
||||
* Do not try to tweak the timings at runtime. This is needed when the
|
||||
|
Reference in New Issue
Block a user