[PATCH] fpga: kconfig: Rename SPL_FPGA_SUPPORT to SPL_FPGA

Michal Simek monstr at monstr.eu
Wed Sep 23 14:27:13 CEST 2020


čt 10. 9. 2020 v 12:53 odesílatel Michal Simek <michal.simek at xilinx.com> napsal:
>
> The patch does sed 's/SPL_FPGA_SUPPORT/SPL_FPGA/g' but also fixing Makefile
> and zynqmp.c to simplify if/endif logic in zynqmp.c.
>
> This change is mostly done to be able to use CONFIG_IS_ENABLED macro and
> obj-$(CONFIG_$(SPL_)FPGA) in Makefile. For them symbols need to be in sync.
>
> And removing one line from Topic Miami boards which is not needed because
> symbol is not enabled via Kconfig.
>
> Signed-off-by: Michal Simek <michal.simek at xilinx.com>
> ---
>
>  arch/arm/mach-zynq/cpu.c           |  6 ++----
>  arch/arm/mach-zynq/spl.c           |  2 +-
>  board/xilinx/zynqmp/zynqmp.c       | 10 +++-------
>  common/spl/Kconfig                 |  2 +-
>  common/spl/spl_fit.c               |  4 ++--
>  configs/socfpga_arria10_defconfig  |  2 +-
>  configs/xilinx_zynq_virt_defconfig |  2 +-
>  drivers/Makefile                   |  3 +--
>  include/configs/topic_miami.h      |  1 -
>  9 files changed, 12 insertions(+), 20 deletions(-)
>
> diff --git a/arch/arm/mach-zynq/cpu.c b/arch/arm/mach-zynq/cpu.c
> index 77b7cb130712..3befc120289c 100644
> --- a/arch/arm/mach-zynq/cpu.c
> +++ b/arch/arm/mach-zynq/cpu.c
> @@ -17,8 +17,7 @@
>  #define ZYNQ_SILICON_VER_MASK  0xF0000000
>  #define ZYNQ_SILICON_VER_SHIFT 28
>
> -#if (defined(CONFIG_FPGA) && !defined(CONFIG_SPL_BUILD)) || \
> -    (defined(CONFIG_SPL_FPGA_SUPPORT) && defined(CONFIG_SPL_BUILD))
> +#if CONFIG_IS_ENABLED(FPGA)
>  xilinx_desc fpga = {
>         .family = xilinx_zynq,
>         .iface = devcfg,
> @@ -111,8 +110,7 @@ static int __maybe_unused cpu_desc_id(void)
>  #if defined(CONFIG_ARCH_EARLY_INIT_R)
>  int arch_early_init_r(void)
>  {
> -#if (defined(CONFIG_FPGA) && !defined(CONFIG_SPL_BUILD)) || \
> -    (defined(CONFIG_SPL_FPGA_SUPPORT) && defined(CONFIG_SPL_BUILD))
> +#if CONFIG_IS_ENABLED(FPGA)
>         int cpu_id = cpu_desc_id();
>
>         if (cpu_id < 0)
> diff --git a/arch/arm/mach-zynq/spl.c b/arch/arm/mach-zynq/spl.c
> index 239ce3436a62..cb8cfd2f3537 100644
> --- a/arch/arm/mach-zynq/spl.c
> +++ b/arch/arm/mach-zynq/spl.c
> @@ -34,7 +34,7 @@ void board_init_f(ulong dummy)
>  void spl_board_init(void)
>  {
>         preloader_console_init();
> -#if defined(CONFIG_ARCH_EARLY_INIT_R) && defined(CONFIG_SPL_FPGA_SUPPORT)
> +#if defined(CONFIG_ARCH_EARLY_INIT_R) && defined(CONFIG_SPL_FPGA)
>         arch_early_init_r();
>  #endif
>         board_init();
> diff --git a/board/xilinx/zynqmp/zynqmp.c b/board/xilinx/zynqmp/zynqmp.c
> index b4e7301d5094..c940dd49ede0 100644
> --- a/board/xilinx/zynqmp/zynqmp.c
> +++ b/board/xilinx/zynqmp/zynqmp.c
> @@ -40,8 +40,7 @@
>
>  DECLARE_GLOBAL_DATA_PTR;
>
> -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
> -    !defined(CONFIG_SPL_BUILD)
> +#if CONFIG_IS_ENABLED(FPGA) && defined(CONFIG_FPGA_ZYNQMPPL)
>  static xilinx_desc zynqmppl = XILINX_ZYNQMP_DESC;
>
>  static const struct {
> @@ -206,8 +205,7 @@ static const struct {
>                                         ~BIT(ZYNQMP_IPDIS_VCU_BIT)
>  #define MAX_VARIANTS_EV                        3
>
> -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
> -       !defined(CONFIG_SPL_BUILD)
> +#if CONFIG_IS_ENABLED(FPGA) && defined(CONFIG_FPGA_ZYNQMPPL)
>  static char *zynqmp_get_silicon_idcode_name(void)
>  {
>         u32 i, id, ver, j;
> @@ -342,9 +340,7 @@ int board_init(void)
>         /* Bug in ROM sets wrong value in this register */
>         writel(PS_SYSMON_ANALOG_BUS_VAL, PS_SYSMON_ANALOG_BUS_REG);
>
> -#if defined(CONFIG_FPGA) && defined(CONFIG_FPGA_ZYNQMPPL) && \
> -    !defined(CONFIG_SPL_BUILD) || (defined(CONFIG_SPL_FPGA_SUPPORT) && \
> -    defined(CONFIG_SPL_BUILD))
> +#if CONFIG_IS_ENABLED(FPGA) && defined(CONFIG_FPGA_ZYNQMPPL)
>         zynqmppl.name = zynqmp_get_silicon_idcode_name();
>         printf("Chip ID:\t%s\n", zynqmppl.name);
>         fpga_init();
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index a7fabda969d4..807b1dc05937 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -602,7 +602,7 @@ config SPL_FAT_WRITE
>           Support for the underlying block device (e.g. MMC or USB) must be
>           enabled separately.
>
> -config SPL_FPGA_SUPPORT
> +config SPL_FPGA
>         bool "Support FPGAs"
>         help
>           Enable support for FPGAs in SPL. Field-programmable Gate Arrays
> diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
> index b69b3948841f..363602a439cd 100644
> --- a/common/spl/spl_fit.c
> +++ b/common/spl/spl_fit.c
> @@ -253,7 +253,7 @@ static int spl_load_fit_image(struct spl_load_info *info, ulong sector,
>         const void *data;
>         bool external_data = false;
>
> -       if (IS_ENABLED(CONFIG_SPL_FPGA_SUPPORT) ||
> +       if (IS_ENABLED(CONFIG_SPL_FPGA) ||
>             (IS_ENABLED(CONFIG_SPL_OS_BOOT) && IS_ENABLED(CONFIG_SPL_GZIP))) {
>                 if (fit_image_get_type(fit, node, &type))
>                         puts("Cannot get image type.\n");
> @@ -547,7 +547,7 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
>                 return -1;
>         }
>
> -#ifdef CONFIG_SPL_FPGA_SUPPORT
> +#ifdef CONFIG_SPL_FPGA
>         node = spl_fit_get_image_node(fit, images, "fpga", 0);
>         if (node >= 0) {
>                 /* Load the image and set up the spl_image structure */
> diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig
> index 8fdd21c0d37d..5d6fe4f35abf 100644
> --- a/configs/socfpga_arria10_defconfig
> +++ b/configs/socfpga_arria10_defconfig
> @@ -23,7 +23,7 @@ CONFIG_DEFAULT_FDT_FILE="socfpga_arria10_socdk_sdmmc.dtb"
>  CONFIG_VERSION_VARIABLE=y
>  CONFIG_DISPLAY_BOARDINFO_LATE=y
>  CONFIG_SPL_ENV_SUPPORT=y
> -CONFIG_SPL_FPGA_SUPPORT=y
> +CONFIG_SPL_FPGA=y
>  CONFIG_CMD_ASKENV=y
>  CONFIG_CMD_GREPENV=y
>  # CONFIG_CMD_FLASH is not set
> diff --git a/configs/xilinx_zynq_virt_defconfig b/configs/xilinx_zynq_virt_defconfig
> index 8acdab25b70c..b12794529700 100644
> --- a/configs/xilinx_zynq_virt_defconfig
> +++ b/configs/xilinx_zynq_virt_defconfig
> @@ -20,7 +20,7 @@ CONFIG_SPL_LOAD_FIT_ADDRESS=0x10000000
>  CONFIG_LEGACY_IMAGE_FORMAT=y
>  CONFIG_USE_PREBOOT=y
>  CONFIG_SPL_STACK_R=y
> -CONFIG_SPL_FPGA_SUPPORT=y
> +CONFIG_SPL_FPGA=y
>  CONFIG_SPL_OS_BOOT=y
>  CONFIG_SPL_SPI_LOAD=y
>  # CONFIG_BOOTM_NETBSD is not set
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 33126b2da7bb..9eb51453e57a 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -30,6 +30,7 @@ obj-$(CONFIG_$(SPL_TPL_)TPM) += tpm/
>  obj-$(CONFIG_$(SPL_TPL_)ACPI_PMC) += power/acpi_pmc/
>  obj-$(CONFIG_$(SPL_)BOARD) += board/
>  obj-$(CONFIG_XEN) += xen/
> +obj-$(CONFIG_$(SPL_)FPGA) += fpga/
>
>  ifndef CONFIG_TPL_BUILD
>  ifdef CONFIG_SPL_BUILD
> @@ -60,7 +61,6 @@ obj-$(CONFIG_SPL_USB_HOST_SUPPORT) += usb/host/
>  obj-$(CONFIG_OMAP_USB_PHY) += usb/phy/
>  obj-$(CONFIG_SPL_SATA_SUPPORT) += ata/ scsi/
>  obj-$(CONFIG_HAVE_BLOCK_DEVICE) += block/
> -obj-$(CONFIG_SPL_FPGA_SUPPORT) += fpga/
>  obj-$(CONFIG_SPL_THERMAL) += thermal/
>
>  endif
> @@ -85,7 +85,6 @@ obj-y += cache/
>  obj-$(CONFIG_CPU) += cpu/
>  obj-y += crypto/
>  obj-$(CONFIG_FASTBOOT) += fastboot/
> -obj-$(CONFIG_FPGA) += fpga/
>  obj-y += misc/
>  obj-$(CONFIG_MMC) += mmc/
>  obj-$(CONFIG_NVME) += nvme/
> diff --git a/include/configs/topic_miami.h b/include/configs/topic_miami.h
> index 6e3953835d15..010d28ac86f7 100644
> --- a/include/configs/topic_miami.h
> +++ b/include/configs/topic_miami.h
> @@ -24,7 +24,6 @@
>
>  /* No falcon support */
>  #undef CONFIG_SPL_OS_BOOT
> -#undef CONFIG_SPL_FPGA_SUPPORT
>
>  /* FPGA commands that we don't use */
>
> --
> 2.28.0
>

Applied.
M


-- 
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP/Versal SoCs


More information about the U-Boot mailing list