diff mbox series

[v5,05/21] arm: mvebu: x530: Disable smart hwcaps selection

Message ID 20200604124438.16783-6-p.yadav@ti.com
State Superseded
Delegated to: Jagannadha Sutradharudu Teki
Headers show
Series mtd: spi-nor-core: add xSPI Octal DTR support | expand

Commit Message

Pratyush Yadav June 4, 2020, 12:44 p.m. UTC
The option SPI_FLASH_SMART_HWCAPS will be introduced in a future commit.
It is enabled by default. It updates the hwcaps selection of SPI NOR to
use the SPI MEM's supports_op() hook. But this leads to a code size
increase and so the SPL binary exceeds the size limit.

So, use the old hwcaps selection logic here to make sure the SPL size
does not exceed the limit.

Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
---
 configs/x530_defconfig | 1 +
 1 file changed, 1 insertion(+)

Comments

Chris Packham June 4, 2020, 8:47 p.m. UTC | #1
On 5/06/20 12:44 am, Pratyush Yadav wrote:
> The option SPI_FLASH_SMART_HWCAPS will be introduced in a future commit.
> It is enabled by default. It updates the hwcaps selection of SPI NOR to
> use the SPI MEM's supports_op() hook. But this leads to a code size
> increase and so the SPL binary exceeds the size limit.
>
> So, use the old hwcaps selection logic here to make sure the SPL size
> does not exceed the limit.
>
> Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> ---
>   configs/x530_defconfig | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/configs/x530_defconfig b/configs/x530_defconfig
> index 67c8fbf663..35e2d53285 100644
> --- a/configs/x530_defconfig
> +++ b/configs/x530_defconfig
> @@ -58,6 +58,7 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
>   CONFIG_NAND_PXA3XX=y
>   CONFIG_SF_DEFAULT_BUS=1
>   CONFIG_SF_DEFAULT_SPEED=50000000
> +CONFIG_SPI_FLASH_SMART_HWCAPS=n

Last time I checked =n wasn't valid Kconfig for this to have the desired 
effect wouldn't it need to be

# CONFIG_SPI_FLASH_SMART_HWCAPS is not set

>   CONFIG_SPI_FLASH_BAR=y
>   CONFIG_SPI_FLASH_MACRONIX=y
>   CONFIG_SPI_FLASH_STMICRO=y
Pratyush Yadav June 5, 2020, 9:48 a.m. UTC | #2
Hi Chris,

On 04/06/20 08:47PM, Chris Packham wrote:
> 
> On 5/06/20 12:44 am, Pratyush Yadav wrote:
> > The option SPI_FLASH_SMART_HWCAPS will be introduced in a future commit.
> > It is enabled by default. It updates the hwcaps selection of SPI NOR to
> > use the SPI MEM's supports_op() hook. But this leads to a code size
> > increase and so the SPL binary exceeds the size limit.
> >
> > So, use the old hwcaps selection logic here to make sure the SPL size
> > does not exceed the limit.
> >
> > Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> > ---
> >   configs/x530_defconfig | 1 +
> >   1 file changed, 1 insertion(+)
> >
> > diff --git a/configs/x530_defconfig b/configs/x530_defconfig
> > index 67c8fbf663..35e2d53285 100644
> > --- a/configs/x530_defconfig
> > +++ b/configs/x530_defconfig
> > @@ -58,6 +58,7 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
> >   CONFIG_NAND_PXA3XX=y
> >   CONFIG_SF_DEFAULT_BUS=1
> >   CONFIG_SF_DEFAULT_SPEED=50000000
> > +CONFIG_SPI_FLASH_SMART_HWCAPS=n
> 
> Last time I checked =n wasn't valid Kconfig for this to have the desired 
> effect wouldn't it need to be

So I've been doing it wrong all along, huh! Setting a config to 'n' does 
lead to it getting converted to the "not set" form in .config, so that 
probably helped in fooling me. Will fix. Thanks.

> # CONFIG_SPI_FLASH_SMART_HWCAPS is not set
> 
> >   CONFIG_SPI_FLASH_BAR=y
> >   CONFIG_SPI_FLASH_MACRONIX=y
> >   CONFIG_SPI_FLASH_STMICRO=y
Ley Foon Tan June 5, 2020, 9:50 a.m. UTC | #3
> -----Original Message-----
> From: Pratyush Yadav <p.yadav@ti.com>
> Sent: Friday, June 5, 2020 5:48 PM
> To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
> Cc: Jagan Teki <jagan@amarulasolutions.com>; Vignesh R
> <vigneshr@ti.com>; Ryder Lee <ryder.lee@mediatek.com>; Weijie Gao
> <weijie.gao@mediatek.com>; GSS_MTK_Uboot_upstream
> <GSS_MTK_Uboot_upstream@mediatek.com>; u-boot@lists.denx.de;
> Sekhar Nori <nsekhar@ti.com>; Tan, Ley Foon <ley.foon.tan@intel.com>
> Subject: Re: [PATCH v5 05/21] arm: mvebu: x530: Disable smart hwcaps
> selection
> 
> Hi Chris,
> 
> On 04/06/20 08:47PM, Chris Packham wrote:
> >
> > On 5/06/20 12:44 am, Pratyush Yadav wrote:
> > > The option SPI_FLASH_SMART_HWCAPS will be introduced in a future
> commit.
> > > It is enabled by default. It updates the hwcaps selection of SPI NOR
> > > to use the SPI MEM's supports_op() hook. But this leads to a code
> > > size increase and so the SPL binary exceeds the size limit.
> > >
> > > So, use the old hwcaps selection logic here to make sure the SPL
> > > size does not exceed the limit.
> > >
> > > Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> > > ---
> > >   configs/x530_defconfig | 1 +
> > >   1 file changed, 1 insertion(+)
> > >
> > > diff --git a/configs/x530_defconfig b/configs/x530_defconfig index
> > > 67c8fbf663..35e2d53285 100644
> > > --- a/configs/x530_defconfig
> > > +++ b/configs/x530_defconfig
> > > @@ -58,6 +58,7 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
> > >   CONFIG_NAND_PXA3XX=y
> > >   CONFIG_SF_DEFAULT_BUS=1
> > >   CONFIG_SF_DEFAULT_SPEED=50000000
> > > +CONFIG_SPI_FLASH_SMART_HWCAPS=n
> >
> > Last time I checked =n wasn't valid Kconfig for this to have the
> > desired effect wouldn't it need to be
> 
> So I've been doing it wrong all along, huh! Setting a config to 'n' does lead to
> it getting converted to the "not set" form in .config, so that probably helped
> in fooling me. Will fix. Thanks.
> 
Did you run "make savedefconfig" command to generate defconfig?
Shouldn't edit defconfig manually.

Regards
Ley Foon
Pratyush Yadav June 5, 2020, 12:27 p.m. UTC | #4
On 05/06/20 09:50AM, Tan, Ley Foon wrote:
> 
> 
> > -----Original Message-----
> > From: Pratyush Yadav <p.yadav@ti.com>
> > Sent: Friday, June 5, 2020 5:48 PM
> > To: Chris Packham <Chris.Packham@alliedtelesis.co.nz>
> > Cc: Jagan Teki <jagan@amarulasolutions.com>; Vignesh R
> > <vigneshr@ti.com>; Ryder Lee <ryder.lee@mediatek.com>; Weijie Gao
> > <weijie.gao@mediatek.com>; GSS_MTK_Uboot_upstream
> > <GSS_MTK_Uboot_upstream@mediatek.com>; u-boot@lists.denx.de;
> > Sekhar Nori <nsekhar@ti.com>; Tan, Ley Foon <ley.foon.tan@intel.com>
> > Subject: Re: [PATCH v5 05/21] arm: mvebu: x530: Disable smart hwcaps
> > selection
> > 
> > Hi Chris,
> > 
> > On 04/06/20 08:47PM, Chris Packham wrote:
> > >
> > > On 5/06/20 12:44 am, Pratyush Yadav wrote:
> > > > The option SPI_FLASH_SMART_HWCAPS will be introduced in a future
> > commit.
> > > > It is enabled by default. It updates the hwcaps selection of SPI NOR
> > > > to use the SPI MEM's supports_op() hook. But this leads to a code
> > > > size increase and so the SPL binary exceeds the size limit.
> > > >
> > > > So, use the old hwcaps selection logic here to make sure the SPL
> > > > size does not exceed the limit.
> > > >
> > > > Signed-off-by: Pratyush Yadav <p.yadav@ti.com>
> > > > ---
> > > >   configs/x530_defconfig | 1 +
> > > >   1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/configs/x530_defconfig b/configs/x530_defconfig index
> > > > 67c8fbf663..35e2d53285 100644
> > > > --- a/configs/x530_defconfig
> > > > +++ b/configs/x530_defconfig
> > > > @@ -58,6 +58,7 @@ CONFIG_SYS_NAND_USE_FLASH_BBT=y
> > > >   CONFIG_NAND_PXA3XX=y
> > > >   CONFIG_SF_DEFAULT_BUS=1
> > > >   CONFIG_SF_DEFAULT_SPEED=50000000
> > > > +CONFIG_SPI_FLASH_SMART_HWCAPS=n
> > >
> > > Last time I checked =n wasn't valid Kconfig for this to have the
> > > desired effect wouldn't it need to be
> > 
> > So I've been doing it wrong all along, huh! Setting a config to 'n' does lead to
> > it getting converted to the "not set" form in .config, so that probably helped
> > in fooling me. Will fix. Thanks.
> > 
> Did you run "make savedefconfig" command to generate defconfig?
> Shouldn't edit defconfig manually.

No I didn't. Thanks for the tip.
diff mbox series

Patch

diff --git a/configs/x530_defconfig b/configs/x530_defconfig
index 67c8fbf663..35e2d53285 100644
--- a/configs/x530_defconfig
+++ b/configs/x530_defconfig
@@ -58,6 +58,7 @@  CONFIG_SYS_NAND_USE_FLASH_BBT=y
 CONFIG_NAND_PXA3XX=y
 CONFIG_SF_DEFAULT_BUS=1
 CONFIG_SF_DEFAULT_SPEED=50000000
+CONFIG_SPI_FLASH_SMART_HWCAPS=n
 CONFIG_SPI_FLASH_BAR=y
 CONFIG_SPI_FLASH_MACRONIX=y
 CONFIG_SPI_FLASH_STMICRO=y