Re: [U-Boot] [PATCH v3 1/5] arm64: layerscape: Move CONFIG_HAS_FSL_XHCI_USB to Kconfig

2017-10-20 Thread Ran Wang
Hi Bin

> -Original Message-
> From: Bin Meng [mailto:bmeng...@gmail.com]
> Sent: Thursday, October 12, 2017 2:01 PM
> To: Ran Wang 
> Cc: Albert Aribaud ; Prabhakar Kushwaha
> ; Ashish Kumar ;
> York Sun ; open list 
> Subject: Re: [PATCH v3 1/5] arm64: layerscape: Move
> CONFIG_HAS_FSL_XHCI_USB to Kconfig
> 
> Hi Ran,
> 
> On Wed, Oct 11, 2017 at 1:30 PM, Ran Wang  wrote:
> > Use Kconfig to select QE-HDLC and USB pin-mux.
> >
> > Signed-off-by: Ran Wang 
> > ---
> > Change in v3:
> > New patch file.
> >
> >  arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 7 +++
> >  include/configs/ls1012afrdm.h | 4 
> >  include/configs/ls1012aqds.h  | 4 
> >  include/configs/ls1012ardb.h  | 4 
> >  include/configs/ls1021aiot.h  | 4 
> >  include/configs/ls1021aqds.h  | 4 
> >  include/configs/ls1021atwr.h  | 4 
> >  include/configs/ls1043aqds.h  | 3 ---
> >  include/configs/ls1043ardb.h  | 3 ---
> >  include/configs/ls1046aqds.h  | 3 ---
> >  include/configs/ls1046ardb.h  | 3 ---
> >  include/configs/ls2080aqds.h  | 1 -
> >  include/configs/ls2080ardb.h  | 1 -
> >  scripts/config_whitelist.txt  | 1 -
> >  14 files changed, 7 insertions(+), 39 deletions(-)
> >
> > diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> > b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> > index 3518d8601d..9fda8a1e83 100644
> > --- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> > +++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> > @@ -489,3 +489,10 @@ config SYS_MC_RSV_MEM_ALIGN
> >
> >  config SPL_LDSCRIPT
> > default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A ||
> > ARCH_LS1046A || ARCH_LS2080A
> > +
> > +config HAS_FSL_XHCI_USB
> > +   bool
> > +   default y if ARCH_LS1043A || ARCH_LS1046A
> 
> How about LS2080? I see there is modification on 2080 related files in this
> patch.
> 
Actually HAS_FSL_XHCI_USB is not necessary to LS2080A, previous code is 
redundant.

> > +   help
> > + For some SoC(such as LS1043A and LS1046A), USB and QE-HDLC
> > + multi-use
> 
> nits: SoCs (
> 
> What is multi-use? I think you wanted to say: multiplex

Yes, will change it 

> > + the pins, select it when pin assigned to USB.
> 
> nits: when pin is assigned
Got it. Will update it and other nits in rest patch files, many thanks.

> > diff --git a/include/configs/ls1012afrdm.h
> > b/include/configs/ls1012afrdm.h index 6b1ba578e9..2e5af9cc4e 100644
> > --- a/include/configs/ls1012afrdm.h
> > +++ b/include/configs/ls1012afrdm.h
> > @@ -34,12 +34,8 @@
> >  /*
> >  * USB
> >  */
> > -#define CONFIG_HAS_FSL_XHCI_USB
> > -
> > -#ifdef CONFIG_HAS_FSL_XHCI_USB
> >  #define CONFIG_USB_XHCI_FSL
> >  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> > -#endif
> >
> >  #define CONFIG_CMD_MEMINFO
> >  #define CONFIG_CMD_MEMTEST
> > diff --git a/include/configs/ls1012aqds.h
> > b/include/configs/ls1012aqds.h index b3121d2c21..e0949d0b53 100644
> > --- a/include/configs/ls1012aqds.h
> > +++ b/include/configs/ls1012aqds.h
> > @@ -119,12 +119,8 @@
> >  #endif
> >
> >  /*XHCI Support - enabled by default*/ -#define
> > CONFIG_HAS_FSL_XHCI_USB
> > -
> > -#ifdef CONFIG_HAS_FSL_XHCI_USB
> >  #define CONFIG_USB_XHCI_FSL
> >  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> > -#endif
> >
> >  /*  MMC  */
> >  #ifdef CONFIG_MMC
> > diff --git a/include/configs/ls1012ardb.h
> > b/include/configs/ls1012ardb.h index e9edcd2bc9..66ff004384 100644
> > --- a/include/configs/ls1012ardb.h
> > +++ b/include/configs/ls1012ardb.h
> > @@ -22,12 +22,8 @@
> >  /*
> >  * USB
> >  */
> > -#define CONFIG_HAS_FSL_XHCI_USB
> > -
> > -#ifdef CONFIG_HAS_FSL_XHCI_USB
> >  #define CONFIG_USB_XHCI_FSL
> >  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> > -#endif
> >
> >  /*
> >   * I2C IO expander
> > diff --git a/include/configs/ls1021aiot.h
> > b/include/configs/ls1021aiot.h index 3fe7b8f44c..2cbea87d95 100644
> > --- a/include/configs/ls1021aiot.h
> > +++ b/include/configs/ls1021aiot.h
> > @@ -20,12 +20,8 @@
> >  #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
> >
> >  /* XHCI Support - enabled by default */ -#define
> > CONFIG_HAS_FSL_XHCI_USB
> > -
> > -#ifdef CONFIG_HAS_FSL_XHCI_USB
> >  #define CONFIG_USB_XHCI_FSL
> >  #define CONFIG_USB_MAX_CONTROLLER_COUNT1
> > -#endif
> >
> >  #define CONFIG_SYS_CLK_FREQ1
> >  #define CONFIG_DDR_CLK_FREQ1
> > diff --git a/include/configs/ls1021aqds.h
> > b/include/configs/ls1021aqds.h index f3d3aa2271..0046ded536 100644
> > --- a/include/configs/ls1021aqds.h
> > +++ b/include/configs/ls1021aqds.h
> > @@ -405,12 +405,8 @@ unsigned long get_board_ddr_clk(void);  #endif
> >
> >  /*XHCI 

Re: [U-Boot] [PATCH v3 1/5] arm64: layerscape: Move CONFIG_HAS_FSL_XHCI_USB to Kconfig

2017-10-12 Thread Bin Meng
Hi Ran,

On Wed, Oct 11, 2017 at 1:30 PM, Ran Wang  wrote:
> Use Kconfig to select QE-HDLC and USB pin-mux.
>
> Signed-off-by: Ran Wang 
> ---
> Change in v3:
> New patch file.
>
>  arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 7 +++
>  include/configs/ls1012afrdm.h | 4 
>  include/configs/ls1012aqds.h  | 4 
>  include/configs/ls1012ardb.h  | 4 
>  include/configs/ls1021aiot.h  | 4 
>  include/configs/ls1021aqds.h  | 4 
>  include/configs/ls1021atwr.h  | 4 
>  include/configs/ls1043aqds.h  | 3 ---
>  include/configs/ls1043ardb.h  | 3 ---
>  include/configs/ls1046aqds.h  | 3 ---
>  include/configs/ls1046ardb.h  | 3 ---
>  include/configs/ls2080aqds.h  | 1 -
>  include/configs/ls2080ardb.h  | 1 -
>  scripts/config_whitelist.txt  | 1 -
>  14 files changed, 7 insertions(+), 39 deletions(-)
>
> diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
> b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> index 3518d8601d..9fda8a1e83 100644
> --- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> +++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
> @@ -489,3 +489,10 @@ config SYS_MC_RSV_MEM_ALIGN
>
>  config SPL_LDSCRIPT
> default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || 
> ARCH_LS1046A || ARCH_LS2080A
> +
> +config HAS_FSL_XHCI_USB
> +   bool
> +   default y if ARCH_LS1043A || ARCH_LS1046A

How about LS2080? I see there is modification on 2080 related files in
this patch.

> +   help
> + For some SoC(such as LS1043A and LS1046A), USB and QE-HDLC multi-use

nits: SoCs (

What is multi-use? I think you wanted to say: multiplex

> + the pins, select it when pin assigned to USB.

nits: when pin is assigned

> diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
> index 6b1ba578e9..2e5af9cc4e 100644
> --- a/include/configs/ls1012afrdm.h
> +++ b/include/configs/ls1012afrdm.h
> @@ -34,12 +34,8 @@
>  /*
>  * USB
>  */
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> -#endif
>
>  #define CONFIG_CMD_MEMINFO
>  #define CONFIG_CMD_MEMTEST
> diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
> index b3121d2c21..e0949d0b53 100644
> --- a/include/configs/ls1012aqds.h
> +++ b/include/configs/ls1012aqds.h
> @@ -119,12 +119,8 @@
>  #endif
>
>  /*XHCI Support - enabled by default*/
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> -#endif
>
>  /*  MMC  */
>  #ifdef CONFIG_MMC
> diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
> index e9edcd2bc9..66ff004384 100644
> --- a/include/configs/ls1012ardb.h
> +++ b/include/configs/ls1012ardb.h
> @@ -22,12 +22,8 @@
>  /*
>  * USB
>  */
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
> -#endif
>
>  /*
>   * I2C IO expander
> diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
> index 3fe7b8f44c..2cbea87d95 100644
> --- a/include/configs/ls1021aiot.h
> +++ b/include/configs/ls1021aiot.h
> @@ -20,12 +20,8 @@
>  #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
>
>  /* XHCI Support - enabled by default */
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT1
> -#endif
>
>  #define CONFIG_SYS_CLK_FREQ1
>  #define CONFIG_DDR_CLK_FREQ1
> diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
> index f3d3aa2271..0046ded536 100644
> --- a/include/configs/ls1021aqds.h
> +++ b/include/configs/ls1021aqds.h
> @@ -405,12 +405,8 @@ unsigned long get_board_ddr_clk(void);
>  #endif
>
>  /*XHCI Support - enabled by default*/
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT1
> -#endif
>
>  /*
>   * Video
> diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
> index 852ff57fb6..0172c9015d 100644
> --- a/include/configs/ls1021atwr.h
> +++ b/include/configs/ls1021atwr.h
> @@ -45,12 +45,8 @@
>  #endif
>
>  /* XHCI Support - enabled by default */
> -#define CONFIG_HAS_FSL_XHCI_USB
> -
> -#ifdef CONFIG_HAS_FSL_XHCI_USB
>  #define CONFIG_USB_XHCI_FSL
>  #define CONFIG_USB_MAX_CONTROLLER_COUNT1
> -#endif
>
>  #define CONFIG_SYS_CLK_FREQ1
>  #define CONFIG_DDR_CLK_FREQ1
> diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
> index 5aadd92efd..607c289d17 100644
> --- 

[U-Boot] [PATCH v3 1/5] arm64: layerscape: Move CONFIG_HAS_FSL_XHCI_USB to Kconfig

2017-10-10 Thread Ran Wang
Use Kconfig to select QE-HDLC and USB pin-mux.

Signed-off-by: Ran Wang 
---
Change in v3:
New patch file.

 arch/arm/cpu/armv8/fsl-layerscape/Kconfig | 7 +++
 include/configs/ls1012afrdm.h | 4 
 include/configs/ls1012aqds.h  | 4 
 include/configs/ls1012ardb.h  | 4 
 include/configs/ls1021aiot.h  | 4 
 include/configs/ls1021aqds.h  | 4 
 include/configs/ls1021atwr.h  | 4 
 include/configs/ls1043aqds.h  | 3 ---
 include/configs/ls1043ardb.h  | 3 ---
 include/configs/ls1046aqds.h  | 3 ---
 include/configs/ls1046ardb.h  | 3 ---
 include/configs/ls2080aqds.h  | 1 -
 include/configs/ls2080ardb.h  | 1 -
 scripts/config_whitelist.txt  | 1 -
 14 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig 
b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
index 3518d8601d..9fda8a1e83 100644
--- a/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
+++ b/arch/arm/cpu/armv8/fsl-layerscape/Kconfig
@@ -489,3 +489,10 @@ config SYS_MC_RSV_MEM_ALIGN
 
 config SPL_LDSCRIPT
default "arch/arm/cpu/armv8/u-boot-spl.lds" if ARCH_LS1043A || 
ARCH_LS1046A || ARCH_LS2080A
+
+config HAS_FSL_XHCI_USB
+   bool
+   default y if ARCH_LS1043A || ARCH_LS1046A
+   help
+ For some SoC(such as LS1043A and LS1046A), USB and QE-HDLC multi-use
+ the pins, select it when pin assigned to USB.
diff --git a/include/configs/ls1012afrdm.h b/include/configs/ls1012afrdm.h
index 6b1ba578e9..2e5af9cc4e 100644
--- a/include/configs/ls1012afrdm.h
+++ b/include/configs/ls1012afrdm.h
@@ -34,12 +34,8 @@
 /*
 * USB
 */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 #define CONFIG_CMD_MEMINFO
 #define CONFIG_CMD_MEMTEST
diff --git a/include/configs/ls1012aqds.h b/include/configs/ls1012aqds.h
index b3121d2c21..e0949d0b53 100644
--- a/include/configs/ls1012aqds.h
+++ b/include/configs/ls1012aqds.h
@@ -119,12 +119,8 @@
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /*  MMC  */
 #ifdef CONFIG_MMC
diff --git a/include/configs/ls1012ardb.h b/include/configs/ls1012ardb.h
index e9edcd2bc9..66ff004384 100644
--- a/include/configs/ls1012ardb.h
+++ b/include/configs/ls1012ardb.h
@@ -22,12 +22,8 @@
 /*
 * USB
 */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT 1
-#endif
 
 /*
  * I2C IO expander
diff --git a/include/configs/ls1021aiot.h b/include/configs/ls1021aiot.h
index 3fe7b8f44c..2cbea87d95 100644
--- a/include/configs/ls1021aiot.h
+++ b/include/configs/ls1021aiot.h
@@ -20,12 +20,8 @@
 #define CONFIG_SYS_INIT_RAM_SIZE   OCRAM_SIZE
 
 /* XHCI Support - enabled by default */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
diff --git a/include/configs/ls1021aqds.h b/include/configs/ls1021aqds.h
index f3d3aa2271..0046ded536 100644
--- a/include/configs/ls1021aqds.h
+++ b/include/configs/ls1021aqds.h
@@ -405,12 +405,8 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /*XHCI Support - enabled by default*/
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 /*
  * Video
diff --git a/include/configs/ls1021atwr.h b/include/configs/ls1021atwr.h
index 852ff57fb6..0172c9015d 100644
--- a/include/configs/ls1021atwr.h
+++ b/include/configs/ls1021atwr.h
@@ -45,12 +45,8 @@
 #endif
 
 /* XHCI Support - enabled by default */
-#define CONFIG_HAS_FSL_XHCI_USB
-
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT1
-#endif
 
 #define CONFIG_SYS_CLK_FREQ1
 #define CONFIG_DDR_CLK_FREQ1
diff --git a/include/configs/ls1043aqds.h b/include/configs/ls1043aqds.h
index 5aadd92efd..607c289d17 100644
--- a/include/configs/ls1043aqds.h
+++ b/include/configs/ls1043aqds.h
@@ -371,11 +371,8 @@ unsigned long get_board_ddr_clk(void);
 #endif
 
 /* USB */
-#define CONFIG_HAS_FSL_XHCI_USB
-#ifdef CONFIG_HAS_FSL_XHCI_USB
 #define CONFIG_USB_XHCI_FSL
 #define CONFIG_USB_MAX_CONTROLLER_COUNT3
-#endif
 
 /*
  * Miscellaneous configurable options
diff --git a/include/configs/ls1043ardb.h b/include/configs/ls1043ardb.h
index ca1d862479..866817d579 100644
--- a/include/configs/ls1043ardb.h
+++ b/include/configs/ls1043ardb.h
@@ -281,12