diff mbox

[U-Boot,1/2,v4] armv8: ls2080a: Reorganise NAND_BOOT code in config flag

Message ID 1491217279-3915-1-git-send-email-santan.kumar@nxp.com
State Superseded
Delegated to: York Sun
Headers show

Commit Message

Santan Kumar April 3, 2017, 11:01 a.m. UTC
Add CONFIG_NAND_BOOT config flag to organise
NAND_BOOT specific code in config flag like
-nand-boot specfic errata errata_rcw_src()
-CONFIG_SYS_NAND_U_BOOT_DST,etc

Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
---
Changes for v4:
 Rebased to latest codebase
 Incorporated York's comments to remove CONFIG_SPL
 and move CONFIG_SPL_NAND_SUPPORT to kconfig

 arch/arm/cpu/armv8/fsl-layerscape/soc.c | 2 +-
 configs/ls2080aqds_nand_defconfig       | 1 +
 configs/ls2080ardb_nand_defconfig       | 1 +
 include/configs/ls2080a_common.h        | 2 ++
 include/configs/ls2080aqds.h            | 4 +++-
 5 files changed, 8 insertions(+), 2 deletions(-)

Comments

York Sun April 10, 2017, 4:45 p.m. UTC | #1
On 04/03/2017 03:58 AM, Santan Kumar wrote:
> Add CONFIG_NAND_BOOT config flag to organise
> NAND_BOOT specific code in config flag like
> -nand-boot specfic errata errata_rcw_src()
> -CONFIG_SYS_NAND_U_BOOT_DST,etc
>
> Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
> Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
> ---
> Changes for v4:
>  Rebased to latest codebase
>  Incorporated York's comments to remove CONFIG_SPL
>  and move CONFIG_SPL_NAND_SUPPORT to kconfig
>
>  arch/arm/cpu/armv8/fsl-layerscape/soc.c | 2 +-
>  configs/ls2080aqds_nand_defconfig       | 1 +
>  configs/ls2080ardb_nand_defconfig       | 1 +
>  include/configs/ls2080a_common.h        | 2 ++
>  include/configs/ls2080aqds.h            | 4 +++-
>  5 files changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> index 9e3cdd7..76e3af0 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
> @@ -134,7 +134,7 @@ void erratum_a009635(void)
>
>  static void erratum_rcw_src(void)
>  {
> -#if defined(CONFIG_SPL)
> +#if defined(CONFIG_SPL) && defined(CONFIG_NAND_BOOT)
>  	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
>  	u32 __iomem *dcfg_dcsr = (u32 __iomem *)DCFG_DCSR_BASE;
>  	u32 val;
> diff --git a/configs/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig
> index 2a649c5..7fe4262 100644
> --- a/configs/ls2080aqds_nand_defconfig
> +++ b/configs/ls2080aqds_nand_defconfig
> @@ -10,6 +10,7 @@ CONFIG_FIT=y
>  CONFIG_FIT_VERBOSE=y
>  CONFIG_OF_BOARD_SETUP=y
>  CONFIG_OF_STDOUT_VIA_ALIAS=y
> +CONFIG_NAND_BOOT=y
>  CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"

Can we get rid of the extra options for NAND? I think it can be replaced 
by CONFIG_NAND_BOOT, can't it?

I have sent a patch to get rid of the LS2080A do you don't have to worry 
about that. http://patchwork.ozlabs.org/patch/746782/

>  CONFIG_BOOTDELAY=10
>  CONFIG_SPL=y
> diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig
> index 81987fe..7c45541 100644
> --- a/configs/ls2080ardb_nand_defconfig
> +++ b/configs/ls2080ardb_nand_defconfig
> @@ -10,6 +10,7 @@ CONFIG_FIT=y
>  CONFIG_FIT_VERBOSE=y
>  CONFIG_OF_BOARD_SETUP=y
>  CONFIG_OF_STDOUT_VIA_ALIAS=y
> +CONFIG_NAND_BOOT=y
>  CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"
>  CONFIG_BOOTDELAY=10
>  CONFIG_SPL=y
> diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
> index 427f623..12078c3 100644
> --- a/include/configs/ls2080a_common.h
> +++ b/include/configs/ls2080a_common.h
> @@ -222,8 +222,10 @@ unsigned long long get_qixis_addr(void);
>  #define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
>  #define CONFIG_SPL_TEXT_BASE		0x1800a000
>
> +#ifdef CONFIG_NAND_BOOT
>  #define CONFIG_SYS_NAND_U_BOOT_DST	0x80400000
>  #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
> +#endif
>  #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00100000
>  #define CONFIG_SYS_SPL_MALLOC_START	0x80200000
>  #define CONFIG_SYS_MONITOR_LEN		(640 * 1024)
> diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
> index beacb99..4c48562 100644
> --- a/include/configs/ls2080aqds.h
> +++ b/include/configs/ls2080aqds.h
> @@ -197,7 +197,8 @@ unsigned long get_board_ddr_clk(void);
>  					FTIM2_GPCM_TWP(0x3E))
>  #define CONFIG_SYS_CS3_FTIM3		0x0
>
> -#if defined(CONFIG_SPL) && defined(CONFIG_NAND)
> +#if defined(CONFIG_SPL)
> +#if defined(CONFIG_NAND_BOOT)

This is exactly what I was thinking. So we don't need the CONFIG_NAND 
macro. After this patch, can you sent another clean up patch to remove 
other CONFIG_NAND macros? You don't have to respin this patch.

York
Santan Kumar April 12, 2017, 6:14 a.m. UTC | #2
> -----Original Message-----

> From: York Sun [mailto:york.sun@nxp.com]

> Sent: Monday, April 10, 2017 10:15 PM

> To: Santan Kumar <santan.kumar@nxp.com>; u-boot@lists.denx.de

> Cc: Priyanka Jain <priyanka.jain@nxp.com>; Abhimanyu Saini

> <abhimanyu.saini@nxp.com>

> Subject: Re: [PATCH 1/2][v4] armv8: ls2080a: Reorganise NAND_BOOT code

> in config flag

> 

> On 04/03/2017 03:58 AM, Santan Kumar wrote:

> > Add CONFIG_NAND_BOOT config flag to organise NAND_BOOT specific

> code

> > in config flag like -nand-boot specfic errata errata_rcw_src()

> > -CONFIG_SYS_NAND_U_BOOT_DST,etc

> >

> > Signed-off-by: Santan Kumar <santan.kumar@nxp.com>

> > Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>

> > Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>

> > ---

> > Changes for v4:

> >  Rebased to latest codebase

> >  Incorporated York's comments to remove CONFIG_SPL  and move

> > CONFIG_SPL_NAND_SUPPORT to kconfig

> >

> >  arch/arm/cpu/armv8/fsl-layerscape/soc.c | 2 +-

> >  configs/ls2080aqds_nand_defconfig       | 1 +

> >  configs/ls2080ardb_nand_defconfig       | 1 +

> >  include/configs/ls2080a_common.h        | 2 ++

> >  include/configs/ls2080aqds.h            | 4 +++-

> >  5 files changed, 8 insertions(+), 2 deletions(-)

> >

> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c

> > b/arch/arm/cpu/armv8/fsl-layerscape/soc.c

> > index 9e3cdd7..76e3af0 100644

> > --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c

> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c

> > @@ -134,7 +134,7 @@ void erratum_a009635(void)

> >

> >  static void erratum_rcw_src(void)

> >  {

> > -#if defined(CONFIG_SPL)

> > +#if defined(CONFIG_SPL) && defined(CONFIG_NAND_BOOT)

> >  	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;

> >  	u32 __iomem *dcfg_dcsr = (u32 __iomem *)DCFG_DCSR_BASE;

> >  	u32 val;

> > diff --git a/configs/ls2080aqds_nand_defconfig

> > b/configs/ls2080aqds_nand_defconfig

> > index 2a649c5..7fe4262 100644

> > --- a/configs/ls2080aqds_nand_defconfig

> > +++ b/configs/ls2080aqds_nand_defconfig

> > @@ -10,6 +10,7 @@ CONFIG_FIT=y

> >  CONFIG_FIT_VERBOSE=y

> >  CONFIG_OF_BOARD_SETUP=y

> >  CONFIG_OF_STDOUT_VIA_ALIAS=y

> > +CONFIG_NAND_BOOT=y

> >  CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"

> 

> Can we get rid of the extra options for NAND? I think it can be replaced by

> CONFIG_NAND_BOOT, can't it?

[Santan Kumar] CONFIG_NAND_BOOT has been added for the requirements of NAND boot specification
While NAND is being used for NAND support specification both are using for difference purpose.
> 

> I have sent a patch to get rid of the LS2080A do you don't have to worry

> about that. http://patchwork.ozlabs.org/patch/746782/

[Santan Kumar] yes, After this patch I don't need LS2080A in extra option.
Do I need to send next version to remove this or you will take care in your patch?
>

> >  CONFIG_BOOTDELAY=10

> >  CONFIG_SPL=y

> > diff --git a/configs/ls2080ardb_nand_defconfig

> > b/configs/ls2080ardb_nand_defconfig

> > index 81987fe..7c45541 100644

> > --- a/configs/ls2080ardb_nand_defconfig

> > +++ b/configs/ls2080ardb_nand_defconfig

> > @@ -10,6 +10,7 @@ CONFIG_FIT=y

> >  CONFIG_FIT_VERBOSE=y

> >  CONFIG_OF_BOARD_SETUP=y

> >  CONFIG_OF_STDOUT_VIA_ALIAS=y

> > +CONFIG_NAND_BOOT=y

> >  CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"

> >  CONFIG_BOOTDELAY=10

> >  CONFIG_SPL=y

> > diff --git a/include/configs/ls2080a_common.h

> > b/include/configs/ls2080a_common.h

> > index 427f623..12078c3 100644

> > --- a/include/configs/ls2080a_common.h

> > +++ b/include/configs/ls2080a_common.h

> > @@ -222,8 +222,10 @@ unsigned long long get_qixis_addr(void);

> >  #define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"

> >  #define CONFIG_SPL_TEXT_BASE		0x1800a000

> >

> > +#ifdef CONFIG_NAND_BOOT

> >  #define CONFIG_SYS_NAND_U_BOOT_DST	0x80400000

> >  #define CONFIG_SYS_NAND_U_BOOT_START

> 	CONFIG_SYS_NAND_U_BOOT_DST

> > +#endif

> >  #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00100000

> >  #define CONFIG_SYS_SPL_MALLOC_START	0x80200000

> >  #define CONFIG_SYS_MONITOR_LEN		(640 * 1024)

> > diff --git a/include/configs/ls2080aqds.h

> > b/include/configs/ls2080aqds.h index beacb99..4c48562 100644

> > --- a/include/configs/ls2080aqds.h

> > +++ b/include/configs/ls2080aqds.h

> > @@ -197,7 +197,8 @@ unsigned long get_board_ddr_clk(void);

> >  					FTIM2_GPCM_TWP(0x3E))

> >  #define CONFIG_SYS_CS3_FTIM3		0x0

> >

> > -#if defined(CONFIG_SPL) && defined(CONFIG_NAND)

> > +#if defined(CONFIG_SPL)

> > +#if defined(CONFIG_NAND_BOOT)

> 

> This is exactly what I was thinking. So we don't need the CONFIG_NAND

> macro. After this patch, can you sent another clean up patch to remove other

> CONFIG_NAND macros? You don't have to respin this patch.

> 

> York
York Sun April 12, 2017, 3:09 p.m. UTC | #3
On 04/11/2017 11:14 PM, Santan Kumar wrote:
>
>
>> -----Original Message-----
>> From: York Sun [mailto:york.sun@nxp.com]
>> Sent: Monday, April 10, 2017 10:15 PM
>> To: Santan Kumar <santan.kumar@nxp.com>; u-boot@lists.denx.de
>> Cc: Priyanka Jain <priyanka.jain@nxp.com>; Abhimanyu Saini
>> <abhimanyu.saini@nxp.com>
>> Subject: Re: [PATCH 1/2][v4] armv8: ls2080a: Reorganise NAND_BOOT code
>> in config flag
>>
>> On 04/03/2017 03:58 AM, Santan Kumar wrote:
>>> Add CONFIG_NAND_BOOT config flag to organise NAND_BOOT specific
>> code
>>> in config flag like -nand-boot specfic errata errata_rcw_src()
>>> -CONFIG_SYS_NAND_U_BOOT_DST,etc
>>>
>>> Signed-off-by: Santan Kumar <santan.kumar@nxp.com>
>>> Signed-off-by: Priyanka Jain <priyanka.jain@nxp.com>
>>> Signed-off-by: Abhimanyu Saini <abhimanyu.saini@nxp.com>
>>> ---
>>> Changes for v4:
>>>  Rebased to latest codebase
>>>  Incorporated York's comments to remove CONFIG_SPL  and move
>>> CONFIG_SPL_NAND_SUPPORT to kconfig
>>>
>>>  arch/arm/cpu/armv8/fsl-layerscape/soc.c | 2 +-
>>>  configs/ls2080aqds_nand_defconfig       | 1 +
>>>  configs/ls2080ardb_nand_defconfig       | 1 +
>>>  include/configs/ls2080a_common.h        | 2 ++
>>>  include/configs/ls2080aqds.h            | 4 +++-
>>>  5 files changed, 8 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
>>> b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
>>> index 9e3cdd7..76e3af0 100644
>>> --- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
>>> +++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
>>> @@ -134,7 +134,7 @@ void erratum_a009635(void)
>>>
>>>  static void erratum_rcw_src(void)
>>>  {
>>> -#if defined(CONFIG_SPL)
>>> +#if defined(CONFIG_SPL) && defined(CONFIG_NAND_BOOT)
>>>  	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
>>>  	u32 __iomem *dcfg_dcsr = (u32 __iomem *)DCFG_DCSR_BASE;
>>>  	u32 val;
>>> diff --git a/configs/ls2080aqds_nand_defconfig
>>> b/configs/ls2080aqds_nand_defconfig
>>> index 2a649c5..7fe4262 100644
>>> --- a/configs/ls2080aqds_nand_defconfig
>>> +++ b/configs/ls2080aqds_nand_defconfig
>>> @@ -10,6 +10,7 @@ CONFIG_FIT=y
>>>  CONFIG_FIT_VERBOSE=y
>>>  CONFIG_OF_BOARD_SETUP=y
>>>  CONFIG_OF_STDOUT_VIA_ALIAS=y
>>> +CONFIG_NAND_BOOT=y
>>>  CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"
>>
>> Can we get rid of the extra options for NAND? I think it can be replaced by
>> CONFIG_NAND_BOOT, can't it?
> [Santan Kumar] CONFIG_NAND_BOOT has been added for the requirements of NAND boot specification
> While NAND is being used for NAND support specification both are using for difference purpose.

OK. I will let it go for now. In long term we will convert this option 
to Kconfig.

>>
>> I have sent a patch to get rid of the LS2080A do you don't have to worry
>> about that. http://patchwork.ozlabs.org/patch/746782/
> [Santan Kumar] yes, After this patch I don't need LS2080A in extra option.
> Do I need to send next version to remove this or you will take care in your patch?

I will take care of it.

York
diff mbox

Patch

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/soc.c b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
index 9e3cdd7..76e3af0 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/soc.c
+++ b/arch/arm/cpu/armv8/fsl-layerscape/soc.c
@@ -134,7 +134,7 @@  void erratum_a009635(void)
 
 static void erratum_rcw_src(void)
 {
-#if defined(CONFIG_SPL)
+#if defined(CONFIG_SPL) && defined(CONFIG_NAND_BOOT)
 	u32 __iomem *dcfg_ccsr = (u32 __iomem *)DCFG_BASE;
 	u32 __iomem *dcfg_dcsr = (u32 __iomem *)DCFG_DCSR_BASE;
 	u32 val;
diff --git a/configs/ls2080aqds_nand_defconfig b/configs/ls2080aqds_nand_defconfig
index 2a649c5..7fe4262 100644
--- a/configs/ls2080aqds_nand_defconfig
+++ b/configs/ls2080aqds_nand_defconfig
@@ -10,6 +10,7 @@  CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_NAND_BOOT=y
 CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
diff --git a/configs/ls2080ardb_nand_defconfig b/configs/ls2080ardb_nand_defconfig
index 81987fe..7c45541 100644
--- a/configs/ls2080ardb_nand_defconfig
+++ b/configs/ls2080ardb_nand_defconfig
@@ -10,6 +10,7 @@  CONFIG_FIT=y
 CONFIG_FIT_VERBOSE=y
 CONFIG_OF_BOARD_SETUP=y
 CONFIG_OF_STDOUT_VIA_ALIAS=y
+CONFIG_NAND_BOOT=y
 CONFIG_SYS_EXTRA_OPTIONS="NAND, LS2080A"
 CONFIG_BOOTDELAY=10
 CONFIG_SPL=y
diff --git a/include/configs/ls2080a_common.h b/include/configs/ls2080a_common.h
index 427f623..12078c3 100644
--- a/include/configs/ls2080a_common.h
+++ b/include/configs/ls2080a_common.h
@@ -222,8 +222,10 @@  unsigned long long get_qixis_addr(void);
 #define CONFIG_SPL_TARGET		"u-boot-with-spl.bin"
 #define CONFIG_SPL_TEXT_BASE		0x1800a000
 
+#ifdef CONFIG_NAND_BOOT
 #define CONFIG_SYS_NAND_U_BOOT_DST	0x80400000
 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_NAND_U_BOOT_DST
+#endif
 #define CONFIG_SYS_SPL_MALLOC_SIZE	0x00100000
 #define CONFIG_SYS_SPL_MALLOC_START	0x80200000
 #define CONFIG_SYS_MONITOR_LEN		(640 * 1024)
diff --git a/include/configs/ls2080aqds.h b/include/configs/ls2080aqds.h
index beacb99..4c48562 100644
--- a/include/configs/ls2080aqds.h
+++ b/include/configs/ls2080aqds.h
@@ -197,7 +197,8 @@  unsigned long get_board_ddr_clk(void);
 					FTIM2_GPCM_TWP(0x3E))
 #define CONFIG_SYS_CS3_FTIM3		0x0
 
-#if defined(CONFIG_SPL) && defined(CONFIG_NAND)
+#if defined(CONFIG_SPL)
+#if defined(CONFIG_NAND_BOOT)
 #define CONFIG_SYS_CSPR1_EXT		CONFIG_SYS_NOR0_CSPR_EXT
 #define CONFIG_SYS_CSPR1		CONFIG_SYS_NOR0_CSPR_EARLY
 #define CONFIG_SYS_CSPR1_FINAL		CONFIG_SYS_NOR0_CSPR
@@ -233,6 +234,7 @@  unsigned long get_board_ddr_clk(void);
 #define CONFIG_SPL_PAD_TO		0x20000
 #define CONFIG_SYS_NAND_U_BOOT_OFFS	(256 * 1024)
 #define CONFIG_SYS_NAND_U_BOOT_SIZE	(640 * 1024)
+#endif
 #else
 #define CONFIG_SYS_CSPR0_EXT		CONFIG_SYS_NOR0_CSPR_EXT
 #define CONFIG_SYS_CSPR0		CONFIG_SYS_NOR0_CSPR_EARLY