[U-Boot] [PATCH 2/7] arm: socfpga: Convert FPGA configuration to Kconfig method.

Marek Vasut marex at denx.de
Fri May 5 11:11:52 UTC 2017


On 05/05/2017 12:26 PM, tien.fong.chee at intel.com wrote:
> From: Tien Fong Chee <tien.fong.chee at intel.com>
> 
> Convert Macro #define configuration to Kconfig method. All FPGA devices
> enable configuration based on CONFIG_FPGA_ALTERA.
> 
> Signed-off-by: Tien Fong Chee <tien.fong.chee at intel.com>
> ---
>  drivers/fpga/Kconfig             |    5 ++++-
>  drivers/fpga/Makefile            |    3 +--
>  include/altera.h                 |    2 +-
>  include/configs/socfpga_common.h |    3 ---
>  4 files changed, 6 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/fpga/Kconfig b/drivers/fpga/Kconfig
> index a760944..fc4ea0d 100644
> --- a/drivers/fpga/Kconfig
> +++ b/drivers/fpga/Kconfig
> @@ -2,12 +2,15 @@ menu "FPGA support"
>  
>  config FPGA
>  	bool
> +	help
> +	  Enable FPGA driver build.

Separate patch please , also this is not driver, but framework . There's
not just drivers here IMO.

>  config FPGA_ALTERA
>  	bool "Enable Altera FPGA drivers"
> +	default y if TARGET_SOCFPGA_GEN5 && CMD_FPGA

Should be selected by arch code, drop this.

>  	select FPGA
>  	help
> -	  Say Y here to enable the Altera FPGA driver
> +	  Default Y here to enable the Altera FPGA driver

Keep as is, it's up to user to decide.

>  	  This provides basic infrastructure to support Altera FPGA devices.
>  	  Enable Altera FPGA specific functions which includes bitstream
> diff --git a/drivers/fpga/Makefile b/drivers/fpga/Makefile
> index 777706f..84e7605 100644
> --- a/drivers/fpga/Makefile
> +++ b/drivers/fpga/Makefile
> @@ -14,10 +14,9 @@ obj-$(CONFIG_FPGA_ZYNQMPPL) += zynqmppl.o
>  obj-$(CONFIG_FPGA_XILINX) += xilinx.o
>  obj-$(CONFIG_FPGA_LATTICE) += ivm_core.o lattice.o
>  ifdef CONFIG_FPGA_ALTERA
> -obj-y += altera.o
> +obj-y += altera.o socfpga.o

Now all the ancient systems which had the ancient Altera FPGAs will
build-in the socfpga stuff too . That cannot work.

>  obj-$(CONFIG_FPGA_ACEX1K) += ACEX1K.o
>  obj-$(CONFIG_FPGA_CYCLON2) += cyclon2.o
>  obj-$(CONFIG_FPGA_STRATIX_II) += stratixII.o
>  obj-$(CONFIG_FPGA_STRATIX_V) += stratixv.o
> -obj-$(CONFIG_FPGA_SOCFPGA) += socfpga.o
>  endif
> diff --git a/include/altera.h b/include/altera.h
> index 48d3eb7..a627b37 100644
> --- a/include/altera.h
> +++ b/include/altera.h
> @@ -109,7 +109,7 @@ typedef struct {
>  	Altera_post_fn post;
>  } altera_board_specific_func;
>  
> -#ifdef CONFIG_FPGA_SOCFPGA
> +#ifdef CONFIG_FPGA_ALTERA
>  int socfpga_load(Altera_desc *desc, const void *rbf_data, size_t rbf_size);
>  #endif
>  
> diff --git a/include/configs/socfpga_common.h b/include/configs/socfpga_common.h
> index da7e4ad..1b79c03 100644
> --- a/include/configs/socfpga_common.h
> +++ b/include/configs/socfpga_common.h
> @@ -107,9 +107,6 @@
>   */
>  #ifdef CONFIG_TARGET_SOCFPGA_GEN5
>  #ifdef CONFIG_CMD_FPGA
> -#define CONFIG_FPGA
> -#define CONFIG_FPGA_ALTERA
> -#define CONFIG_FPGA_SOCFPGA
>  #define CONFIG_FPGA_COUNT		1
>  #endif
>  #endif
> 


-- 
Best regards,
Marek Vasut


More information about the U-Boot mailing list