Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-10 Thread Tom Rini
On Wed, Jan 10, 2024 at 06:06:45PM +0200, Roger Quadros wrote:
> +Lukasz & Mattijs
> 
> On 10/01/2024 11:34, Roger Quadros wrote:
> > 
> > 
> > On 09/01/2024 22:00, Francesco Dolcini wrote:
> >> On Tue, Jan 09, 2024 at 02:54:00PM -0500, Tom Rini wrote:
> >>> On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
>  On 14:26-20240109, Roger Quadros wrote:
> >  CONFIG_CMD_PMIC=y
> >  CONFIG_CMD_REGULATOR=y
> > +CONFIG_CMD_MTDPARTS=y
> > +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> > +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> 
>  Why not handle this as device tree partitions?
> >>>
> >>> I honestly forget what the preferred way of defining and passing NAND
> >>> partition information is these days. It might even be the funny case
> >>> that passing as cmdline args is "best" rather than fixed-partitions
> >>> binding?
> >>
> >> According to past discussions [1] doing the fixup in U-Boot is not advised.
> >>
> >> Using the command line or having the partition fixed in the DT are both
> >> valid options.
> >>
> >> [1] 
> >> https://lore.kernel.org/all/20230206224838.75963-1-france...@dolcini.it/
> >>
> >> Francesco
> >>
> > 
> > This was not about passing mtdparts to kernel but about getting 'mtdparts' 
> > command
> > to work at u-boot. I need to figure out why OF partition parser didn't work 
> > here.
> > 
> > For a start I didn't have CONFIG_MTD_PARTITIONS set. Maybe I'm missing 
> > something more.
> > 
> 
> The issue was the NAND driver was not setting chip->dev and chip->ofnode 
> correctly.
> Now 'mtd list' shows partitions from the DT.
> But, 'dfu 0 nand list' still fails like so.
>   "mtdparts variable not set, see 'help mtdparts'"
> 
> Looks like dfu_nand driver doesn't fall back to OF partitions if mtdparts 
> environment
> is not defined.
> 
> Should we add OF partitions support to dfu_nand driver or is it deprecated
> in favor of dfu_mtd driver?

I would rather not have to populate the env variable as that will lead
to confusion later on I fear (make a change and it's not populated
onward).

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-10 Thread Roger Quadros
+Lukasz & Mattijs

On 10/01/2024 11:34, Roger Quadros wrote:
> 
> 
> On 09/01/2024 22:00, Francesco Dolcini wrote:
>> On Tue, Jan 09, 2024 at 02:54:00PM -0500, Tom Rini wrote:
>>> On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
 On 14:26-20240109, Roger Quadros wrote:
>  CONFIG_CMD_PMIC=y
>  CONFIG_CMD_REGULATOR=y
> +CONFIG_CMD_MTDPARTS=y
> +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"

 Why not handle this as device tree partitions?
>>>
>>> I honestly forget what the preferred way of defining and passing NAND
>>> partition information is these days. It might even be the funny case
>>> that passing as cmdline args is "best" rather than fixed-partitions
>>> binding?
>>
>> According to past discussions [1] doing the fixup in U-Boot is not advised.
>>
>> Using the command line or having the partition fixed in the DT are both
>> valid options.
>>
>> [1] https://lore.kernel.org/all/20230206224838.75963-1-france...@dolcini.it/
>>
>> Francesco
>>
> 
> This was not about passing mtdparts to kernel but about getting 'mtdparts' 
> command
> to work at u-boot. I need to figure out why OF partition parser didn't work 
> here.
> 
> For a start I didn't have CONFIG_MTD_PARTITIONS set. Maybe I'm missing 
> something more.
> 

The issue was the NAND driver was not setting chip->dev and chip->ofnode 
correctly.
Now 'mtd list' shows partitions from the DT.
But, 'dfu 0 nand list' still fails like so.
"mtdparts variable not set, see 'help mtdparts'"

Looks like dfu_nand driver doesn't fall back to OF partitions if mtdparts 
environment
is not defined.

Should we add OF partitions support to dfu_nand driver or is it deprecated
in favor of dfu_mtd driver?

-- 
cheers,
-roger


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-10 Thread Roger Quadros



On 09/01/2024 22:00, Francesco Dolcini wrote:
> On Tue, Jan 09, 2024 at 02:54:00PM -0500, Tom Rini wrote:
>> On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
>>> On 14:26-20240109, Roger Quadros wrote:
  CONFIG_CMD_PMIC=y
  CONFIG_CMD_REGULATOR=y
 +CONFIG_CMD_MTDPARTS=y
 +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
 +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
>>>
>>> Why not handle this as device tree partitions?
>>
>> I honestly forget what the preferred way of defining and passing NAND
>> partition information is these days. It might even be the funny case
>> that passing as cmdline args is "best" rather than fixed-partitions
>> binding?
> 
> According to past discussions [1] doing the fixup in U-Boot is not advised.
> 
> Using the command line or having the partition fixed in the DT are both
> valid options.
> 
> [1] https://lore.kernel.org/all/20230206224838.75963-1-france...@dolcini.it/
> 
> Francesco
> 

This was not about passing mtdparts to kernel but about getting 'mtdparts' 
command
to work at u-boot. I need to figure out why OF partition parser didn't work 
here.

For a start I didn't have CONFIG_MTD_PARTITIONS set. Maybe I'm missing 
something more.

-- 
cheers,
-roger


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Tom Rini
On Tue, Jan 09, 2024 at 02:00:14PM -0600, Nishanth Menon wrote:
> On 14:48-20240109, Tom Rini wrote:
> [...]
> > > > -- 
> > > > 2.34.1
> > > > 
> > > 
> > > Why not a config fragment?
> > 
> > To me, this makes sense to keep in the main config. It can be turned off
> > as needed, and at run time if it's not present, it's safe.
> 
> Three reasons:
> * There is going to be duplication across multiple boards
> * It confuses the affair of trying to find the minimal configuration needed
>   to boot the board.
> * SRAM is limited already - we have been playing all kind of dances
>   around this - NAND is a daughter card addon - while I am not trying to
>   diminish NAND support, we are in a constant struggle to keep SRAM
>   viable and adding additional boot modes to a single config, IMHO is
>   the wrong direction to go.

At the end of the day, I'll leave it to TI folks. I see that
drivers/mtd/Kconfig needs a whole lot of help as while I would have
hoped that turning off just CONFIG_MTD would undo most of the changes
here, it does not.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Nishanth Menon
On 21:00-20240109, Francesco Dolcini wrote:
> On Tue, Jan 09, 2024 at 02:54:00PM -0500, Tom Rini wrote:
> > On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
> > > On 14:26-20240109, Roger Quadros wrote:
> > > >  CONFIG_CMD_PMIC=y
> > > >  CONFIG_CMD_REGULATOR=y
> > > > +CONFIG_CMD_MTDPARTS=y
> > > > +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> > > > +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> > > 
> > > Why not handle this as device tree partitions?
> > 
> > I honestly forget what the preferred way of defining and passing NAND
> > partition information is these days. It might even be the funny case
> > that passing as cmdline args is "best" rather than fixed-partitions
> > binding?
> 
> According to past discussions [1] doing the fixup in U-Boot is not advised.
> 
> Using the command line or having the partition fixed in the DT are both
> valid options.
> 
> [1] https://lore.kernel.org/all/20230206224838.75963-1-france...@dolcini.it/

yup - also why I wonder why we cant depend on DT.

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Francesco Dolcini
On Tue, Jan 09, 2024 at 02:54:00PM -0500, Tom Rini wrote:
> On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
> > On 14:26-20240109, Roger Quadros wrote:
> > >  CONFIG_CMD_PMIC=y
> > >  CONFIG_CMD_REGULATOR=y
> > > +CONFIG_CMD_MTDPARTS=y
> > > +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> > > +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> > 
> > Why not handle this as device tree partitions?
> 
> I honestly forget what the preferred way of defining and passing NAND
> partition information is these days. It might even be the funny case
> that passing as cmdline args is "best" rather than fixed-partitions
> binding?

According to past discussions [1] doing the fixup in U-Boot is not advised.

Using the command line or having the partition fixed in the DT are both
valid options.

[1] https://lore.kernel.org/all/20230206224838.75963-1-france...@dolcini.it/

Francesco



Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Nishanth Menon
On 14:48-20240109, Tom Rini wrote:
[...]
> > > -- 
> > > 2.34.1
> > > 
> > 
> > Why not a config fragment?
> 
> To me, this makes sense to keep in the main config. It can be turned off
> as needed, and at run time if it's not present, it's safe.

Three reasons:
* There is going to be duplication across multiple boards
* It confuses the affair of trying to find the minimal configuration needed
  to boot the board.
* SRAM is limited already - we have been playing all kind of dances
  around this - NAND is a daughter card addon - while I am not trying to
  diminish NAND support, we are in a constant struggle to keep SRAM
  viable and adding additional boot modes to a single config, IMHO is
  the wrong direction to go.


-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Tom Rini
On Tue, Jan 09, 2024 at 01:18:59PM -0600, Nishanth Menon wrote:
> On 14:26-20240109, Roger Quadros wrote:
> > Enables configuration required for NAND in SPL and u-boot.
> > 
> > Enable MTD Driver model and MTD + UBI command line utilities.
> > 
> > Add mtdids/mtdparts for NAND as it is required for u-boot's
> > MTD subsystem commands to recognize NAND partitions.
> > 
> > Add u-boot partition location.
> > 
> > Signed-off-by: Roger Quadros 
> > ---
> >  configs/am64x_evm_a53_defconfig | 32 
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/configs/am64x_evm_a53_defconfig 
> > b/configs/am64x_evm_a53_defconfig
> > index 05e35a8db6..e22153a958 100644
> > --- a/configs/am64x_evm_a53_defconfig
> > +++ b/configs/am64x_evm_a53_defconfig
> > @@ -66,10 +66,15 @@ CONFIG_CMD_DFU=y
> >  CONFIG_CMD_GPT=y
> >  CONFIG_CMD_I2C=y
> >  CONFIG_CMD_MMC=y
> > +CONFIG_CMD_MTD=y
> >  CONFIG_CMD_USB=y
> >  CONFIG_CMD_TIME=y
> >  CONFIG_CMD_PMIC=y
> >  CONFIG_CMD_REGULATOR=y
> > +CONFIG_CMD_MTDPARTS=y
> > +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> > +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> 
> Why not handle this as device tree partitions?

I honestly forget what the preferred way of defining and passing NAND
partition information is these days. It might even be the funny case
that passing as cmdline args is "best" rather than fixed-partitions
binding?

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Tom Rini
On Tue, Jan 09, 2024 at 01:16:27PM -0600, Nishanth Menon wrote:
> On 14:26-20240109, Roger Quadros wrote:
> > Enables configuration required for NAND in SPL and u-boot.
> > 
> > Enable MTD Driver model and MTD + UBI command line utilities.
> > 
> > Add mtdids/mtdparts for NAND as it is required for u-boot's
> > MTD subsystem commands to recognize NAND partitions.
> > 
> > Add u-boot partition location.
> > 
> > Signed-off-by: Roger Quadros 
> > ---
> >  configs/am64x_evm_a53_defconfig | 32 
> >  1 file changed, 32 insertions(+)
> > 
> > diff --git a/configs/am64x_evm_a53_defconfig 
> > b/configs/am64x_evm_a53_defconfig
> > index 05e35a8db6..e22153a958 100644
> > --- a/configs/am64x_evm_a53_defconfig
> > +++ b/configs/am64x_evm_a53_defconfig
> > @@ -66,10 +66,15 @@ CONFIG_CMD_DFU=y
> >  CONFIG_CMD_GPT=y
> >  CONFIG_CMD_I2C=y
> >  CONFIG_CMD_MMC=y
> > +CONFIG_CMD_MTD=y
> >  CONFIG_CMD_USB=y
> >  CONFIG_CMD_TIME=y
> >  CONFIG_CMD_PMIC=y
> >  CONFIG_CMD_REGULATOR=y
> > +CONFIG_CMD_MTDPARTS=y
> > +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> > +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> > +CONFIG_CMD_UBI=y
> >  CONFIG_OF_CONTROL=y
> >  CONFIG_SPL_OF_CONTROL=y
> >  CONFIG_OF_LIST="k3-am642-evm k3-am642-sk"
> > @@ -107,6 +112,9 @@ CONFIG_MMC_SDHCI=y
> >  CONFIG_MMC_SDHCI_ADMA=y
> >  CONFIG_SPL_MMC_SDHCI_ADMA=y
> >  CONFIG_MMC_SDHCI_AM654=y
> > +CONFIG_MTD=y
> > +CONFIG_SPL_MTD=y
> > +CONFIG_DM_MTD=y
> >  CONFIG_DM_SPI_FLASH=y
> >  CONFIG_SPI_FLASH_SPANSION=y
> >  CONFIG_SPI_FLASH_STMICRO=y
> > @@ -161,3 +169,27 @@ CONFIG_USB_GADGET_DOWNLOAD=y
> >  CONFIG_USB_FUNCTION_MASS_STORAGE=y
> >  CONFIG_SPL_DFU=y
> >  CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
> > +CONFIG_MEMORY=y
> > +CONFIG_SPL_MEMORY=y
> > +CONFIG_TI_GPMC=y
> > +CONFIG_MTD_RAW_NAND=y
> > +CONFIG_NAND_OMAP_GPMC=y
> > +CONFIG_CMD_NAND=y
> > +CONFIG_NAND_OMAP_ELM=y
> > +CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW=y
> > +CONFIG_SYS_NAND_BLOCK_SIZE=0x4
> > +CONFIG_SYS_NAND_ONFI_DETECTION=y
> > +CONFIG_SYS_NAND_PAGE_SIZE=0x1000
> > +CONFIG_SYS_NAND_PAGE_COUNT=0x40
> > +CONFIG_SYS_NAND_OOBSIZE=0x100
> > +CONFIG_SPL_NAND_SUPPORT=y
> > +CONFIG_SPL_NAND_DRIVERS=y
> > +CONFIG_SPL_NAND_BASE=y
> > +CONFIG_SPL_NAND_IDENT=y
> > +CONFIG_SPL_NAND_ECC=y
> > +CONFIG_SYS_NAND_MAX_CHIPS=1
> > +CONFIG_SYS_MAX_NAND_DEVICE=1
> > +# CONFIG_SPL_NAND_AM33XX_BCH is not set
> > +CONFIG_SPL_MTD_SUPPORT=y
> > +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
> > +CONFIG_SYS_NAND_U_BOOT_OFFS=0x60
> > -- 
> > 2.34.1
> > 
> 
> Why not a config fragment?

To me, this makes sense to keep in the main config. It can be turned off
as needed, and at run time if it's not present, it's safe.

-- 
Tom


signature.asc
Description: PGP signature


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Nishanth Menon
On 14:26-20240109, Roger Quadros wrote:
> Enables configuration required for NAND in SPL and u-boot.
> 
> Enable MTD Driver model and MTD + UBI command line utilities.
> 
> Add mtdids/mtdparts for NAND as it is required for u-boot's
> MTD subsystem commands to recognize NAND partitions.
> 
> Add u-boot partition location.
> 
> Signed-off-by: Roger Quadros 
> ---
>  configs/am64x_evm_a53_defconfig | 32 
>  1 file changed, 32 insertions(+)
> 
> diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
> index 05e35a8db6..e22153a958 100644
> --- a/configs/am64x_evm_a53_defconfig
> +++ b/configs/am64x_evm_a53_defconfig
> @@ -66,10 +66,15 @@ CONFIG_CMD_DFU=y
>  CONFIG_CMD_GPT=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_MTD=y
>  CONFIG_CMD_USB=y
>  CONFIG_CMD_TIME=y
>  CONFIG_CMD_PMIC=y
>  CONFIG_CMD_REGULATOR=y
> +CONFIG_CMD_MTDPARTS=y
> +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"

Why not handle this as device tree partitions?

> +CONFIG_CMD_UBI=y
>  CONFIG_OF_CONTROL=y
>  CONFIG_SPL_OF_CONTROL=y
>  CONFIG_OF_LIST="k3-am642-evm k3-am642-sk"
> @@ -107,6 +112,9 @@ CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_ADMA=y
>  CONFIG_SPL_MMC_SDHCI_ADMA=y
>  CONFIG_MMC_SDHCI_AM654=y
> +CONFIG_MTD=y
> +CONFIG_SPL_MTD=y
> +CONFIG_DM_MTD=y
>  CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> @@ -161,3 +169,27 @@ CONFIG_USB_GADGET_DOWNLOAD=y
>  CONFIG_USB_FUNCTION_MASS_STORAGE=y
>  CONFIG_SPL_DFU=y
>  CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
> +CONFIG_MEMORY=y
> +CONFIG_SPL_MEMORY=y
> +CONFIG_TI_GPMC=y
> +CONFIG_MTD_RAW_NAND=y
> +CONFIG_NAND_OMAP_GPMC=y
> +CONFIG_CMD_NAND=y
> +CONFIG_NAND_OMAP_ELM=y
> +CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW=y
> +CONFIG_SYS_NAND_BLOCK_SIZE=0x4
> +CONFIG_SYS_NAND_ONFI_DETECTION=y
> +CONFIG_SYS_NAND_PAGE_SIZE=0x1000
> +CONFIG_SYS_NAND_PAGE_COUNT=0x40
> +CONFIG_SYS_NAND_OOBSIZE=0x100
> +CONFIG_SPL_NAND_SUPPORT=y
> +CONFIG_SPL_NAND_DRIVERS=y
> +CONFIG_SPL_NAND_BASE=y
> +CONFIG_SPL_NAND_IDENT=y
> +CONFIG_SPL_NAND_ECC=y
> +CONFIG_SYS_NAND_MAX_CHIPS=1
> +CONFIG_SYS_MAX_NAND_DEVICE=1
> +# CONFIG_SPL_NAND_AM33XX_BCH is not set
> +CONFIG_SPL_MTD_SUPPORT=y
> +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
> +CONFIG_SYS_NAND_U_BOOT_OFFS=0x60
> -- 
> 2.34.1
> 

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D


Re: [PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Nishanth Menon
On 14:26-20240109, Roger Quadros wrote:
> Enables configuration required for NAND in SPL and u-boot.
> 
> Enable MTD Driver model and MTD + UBI command line utilities.
> 
> Add mtdids/mtdparts for NAND as it is required for u-boot's
> MTD subsystem commands to recognize NAND partitions.
> 
> Add u-boot partition location.
> 
> Signed-off-by: Roger Quadros 
> ---
>  configs/am64x_evm_a53_defconfig | 32 
>  1 file changed, 32 insertions(+)
> 
> diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
> index 05e35a8db6..e22153a958 100644
> --- a/configs/am64x_evm_a53_defconfig
> +++ b/configs/am64x_evm_a53_defconfig
> @@ -66,10 +66,15 @@ CONFIG_CMD_DFU=y
>  CONFIG_CMD_GPT=y
>  CONFIG_CMD_I2C=y
>  CONFIG_CMD_MMC=y
> +CONFIG_CMD_MTD=y
>  CONFIG_CMD_USB=y
>  CONFIG_CMD_TIME=y
>  CONFIG_CMD_PMIC=y
>  CONFIG_CMD_REGULATOR=y
> +CONFIG_CMD_MTDPARTS=y
> +CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
> +CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
> +CONFIG_CMD_UBI=y
>  CONFIG_OF_CONTROL=y
>  CONFIG_SPL_OF_CONTROL=y
>  CONFIG_OF_LIST="k3-am642-evm k3-am642-sk"
> @@ -107,6 +112,9 @@ CONFIG_MMC_SDHCI=y
>  CONFIG_MMC_SDHCI_ADMA=y
>  CONFIG_SPL_MMC_SDHCI_ADMA=y
>  CONFIG_MMC_SDHCI_AM654=y
> +CONFIG_MTD=y
> +CONFIG_SPL_MTD=y
> +CONFIG_DM_MTD=y
>  CONFIG_DM_SPI_FLASH=y
>  CONFIG_SPI_FLASH_SPANSION=y
>  CONFIG_SPI_FLASH_STMICRO=y
> @@ -161,3 +169,27 @@ CONFIG_USB_GADGET_DOWNLOAD=y
>  CONFIG_USB_FUNCTION_MASS_STORAGE=y
>  CONFIG_SPL_DFU=y
>  CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
> +CONFIG_MEMORY=y
> +CONFIG_SPL_MEMORY=y
> +CONFIG_TI_GPMC=y
> +CONFIG_MTD_RAW_NAND=y
> +CONFIG_NAND_OMAP_GPMC=y
> +CONFIG_CMD_NAND=y
> +CONFIG_NAND_OMAP_ELM=y
> +CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW=y
> +CONFIG_SYS_NAND_BLOCK_SIZE=0x4
> +CONFIG_SYS_NAND_ONFI_DETECTION=y
> +CONFIG_SYS_NAND_PAGE_SIZE=0x1000
> +CONFIG_SYS_NAND_PAGE_COUNT=0x40
> +CONFIG_SYS_NAND_OOBSIZE=0x100
> +CONFIG_SPL_NAND_SUPPORT=y
> +CONFIG_SPL_NAND_DRIVERS=y
> +CONFIG_SPL_NAND_BASE=y
> +CONFIG_SPL_NAND_IDENT=y
> +CONFIG_SPL_NAND_ECC=y
> +CONFIG_SYS_NAND_MAX_CHIPS=1
> +CONFIG_SYS_MAX_NAND_DEVICE=1
> +# CONFIG_SPL_NAND_AM33XX_BCH is not set
> +CONFIG_SPL_MTD_SUPPORT=y
> +CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
> +CONFIG_SYS_NAND_U_BOOT_OFFS=0x60
> -- 
> 2.34.1
> 

Why not a config fragment?

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D


[PATCH 4/4] configs: am64x_evm_a53_defconfig: Enable NAND

2024-01-09 Thread Roger Quadros
Enables configuration required for NAND in SPL and u-boot.

Enable MTD Driver model and MTD + UBI command line utilities.

Add mtdids/mtdparts for NAND as it is required for u-boot's
MTD subsystem commands to recognize NAND partitions.

Add u-boot partition location.

Signed-off-by: Roger Quadros 
---
 configs/am64x_evm_a53_defconfig | 32 
 1 file changed, 32 insertions(+)

diff --git a/configs/am64x_evm_a53_defconfig b/configs/am64x_evm_a53_defconfig
index 05e35a8db6..e22153a958 100644
--- a/configs/am64x_evm_a53_defconfig
+++ b/configs/am64x_evm_a53_defconfig
@@ -66,10 +66,15 @@ CONFIG_CMD_DFU=y
 CONFIG_CMD_GPT=y
 CONFIG_CMD_I2C=y
 CONFIG_CMD_MMC=y
+CONFIG_CMD_MTD=y
 CONFIG_CMD_USB=y
 CONFIG_CMD_TIME=y
 CONFIG_CMD_PMIC=y
 CONFIG_CMD_REGULATOR=y
+CONFIG_CMD_MTDPARTS=y
+CONFIG_MTDIDS_DEFAULT="nand0=omap2-nand.0"
+CONFIG_MTDPARTS_DEFAULT="mtdparts=omap2-nand.0:2m(NAND.tiboot3),2m(NAND.tispl),2m(NAND.tiboot3.backup),4m(NAND.u-boot),256k(NAND.u-boot-env),256k(NAND.u-boot-env.backup),-(NAND.file-system)"
+CONFIG_CMD_UBI=y
 CONFIG_OF_CONTROL=y
 CONFIG_SPL_OF_CONTROL=y
 CONFIG_OF_LIST="k3-am642-evm k3-am642-sk"
@@ -107,6 +112,9 @@ CONFIG_MMC_SDHCI=y
 CONFIG_MMC_SDHCI_ADMA=y
 CONFIG_SPL_MMC_SDHCI_ADMA=y
 CONFIG_MMC_SDHCI_AM654=y
+CONFIG_MTD=y
+CONFIG_SPL_MTD=y
+CONFIG_DM_MTD=y
 CONFIG_DM_SPI_FLASH=y
 CONFIG_SPI_FLASH_SPANSION=y
 CONFIG_SPI_FLASH_STMICRO=y
@@ -161,3 +169,27 @@ CONFIG_USB_GADGET_DOWNLOAD=y
 CONFIG_USB_FUNCTION_MASS_STORAGE=y
 CONFIG_SPL_DFU=y
 CONFIG_FS_FAT_MAX_CLUSTSIZE=16384
+CONFIG_MEMORY=y
+CONFIG_SPL_MEMORY=y
+CONFIG_TI_GPMC=y
+CONFIG_MTD_RAW_NAND=y
+CONFIG_NAND_OMAP_GPMC=y
+CONFIG_CMD_NAND=y
+CONFIG_NAND_OMAP_ELM=y
+CONFIG_NAND_OMAP_ECCSCHEME_BCH8_CODE_HW=y
+CONFIG_SYS_NAND_BLOCK_SIZE=0x4
+CONFIG_SYS_NAND_ONFI_DETECTION=y
+CONFIG_SYS_NAND_PAGE_SIZE=0x1000
+CONFIG_SYS_NAND_PAGE_COUNT=0x40
+CONFIG_SYS_NAND_OOBSIZE=0x100
+CONFIG_SPL_NAND_SUPPORT=y
+CONFIG_SPL_NAND_DRIVERS=y
+CONFIG_SPL_NAND_BASE=y
+CONFIG_SPL_NAND_IDENT=y
+CONFIG_SPL_NAND_ECC=y
+CONFIG_SYS_NAND_MAX_CHIPS=1
+CONFIG_SYS_MAX_NAND_DEVICE=1
+# CONFIG_SPL_NAND_AM33XX_BCH is not set
+CONFIG_SPL_MTD_SUPPORT=y
+CONFIG_SYS_NAND_U_BOOT_LOCATIONS=y
+CONFIG_SYS_NAND_U_BOOT_OFFS=0x60
-- 
2.34.1