[PATCH v1 1/3] mtd: rawnand: nand_base: support for 'NAND_IS_BOOT_MEDIUM' flag
Arseniy Krasnov
avkrasnov at salutedevices.com
Tue Jun 25 12:16:07 CEST 2024
On 24.06.2024 12:14, Alexander Dahl wrote:
> Hello Arseniy,
>
> Am Sun, Jun 02, 2024 at 11:08:34PM +0300 schrieb Arseniy Krasnov:
>> 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 at salutedevices.com>
>> ---
>> drivers/mtd/nand/raw/nand_base.c | 3 +++
>> include/linux/mtd/rawnand.h | 6 ++++++
>> 2 files changed, 9 insertions(+)
>>
>> diff --git a/drivers/mtd/nand/raw/nand_base.c b/drivers/mtd/nand/raw/nand_base.c
>> index c40a0f23d7..ed605b4af5 100644
>> --- a/drivers/mtd/nand/raw/nand_base.c
>> +++ b/drivers/mtd/nand/raw/nand_base.c
>> @@ -4458,6 +4458,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;
>>
>> diff --git a/include/linux/mtd/rawnand.h b/include/linux/mtd/rawnand.h
>> index fb002ae641..4eb880d8fb 100644
>> --- a/include/linux/mtd/rawnand.h
>> +++ b/include/linux/mtd/rawnand.h
>> @@ -218,6 +218,12 @@ enum nand_ecc_algo {
>> /* Device needs 3rd row address cycle */
>> #define NAND_ROW_ADDR_3 0x00004000
>>
>> +/*
>> + * 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
>> +
>> /* Options valid for Samsung large page devices */
>> #define NAND_SAMSUNG_LP_OPTIONS NAND_CACHEPRG
>
> The entries in that file are ordered numerically. Comparing with the
> same file in Linux this should go before NAND_KEEP_TIMINGS, not
> anywhere in between. Makes later diffs and ports from Linux easier.
Ok, I'll update this in the next version.
Thanks
>
> Greets
> Alex
>
>>
>> --
>> 2.35.0
>>
More information about the U-Boot
mailing list