All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: Neal Frager <neal.frager@amd.com>
Cc: ibai.erkiaga-elorza@amd.com, brandon.maier@collins.com,
	thomas.petazzoni@bootlin.com, buildroot@buildroot.org,
	michal.simek@amd.com, yann.morin.1998@free.fr
Subject: Re: [Buildroot] [PATCH v3 1/4] boot/xilinx-source: new boot package
Date: Fri, 28 Jun 2024 11:32:33 +0200	[thread overview]
Message-ID: <20240628113233.2d8f765f@booty> (raw)
In-Reply-To: <20240618074922.3555070-1-neal.frager@amd.com>

Hello Neal,

On Tue, 18 Jun 2024 08:49:19 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch adds a new boot package for building boot firmware for Xilinx
> versal, zynqmp and kria targets.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
> - add make dependency to be sure bare-metal toolchain is built before trying
>   to use the toolchain for building the xilinx-source firmware
> V2->V3:
> - fix copy paste error that causes build failure
> ---
>  DEVELOPERS                            |  1 +
>  boot/Config.in                        |  1 +
>  boot/xilinx-source/Config.in          | 45 +++++++++++++++++
>  boot/xilinx-source/xilinx-source.hash |  2 +
>  boot/xilinx-source/xilinx-source.mk   | 70 +++++++++++++++++++++++++++
>  5 files changed, 119 insertions(+)
>  create mode 100644 boot/xilinx-source/Config.in
>  create mode 100644 boot/xilinx-source/xilinx-source.hash
>  create mode 100644 boot/xilinx-source/xilinx-source.mk
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index 8bfd36f1d8..adfd9520ea 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2340,6 +2340,7 @@ F:	board/xilinx/
>  F:	board/zynq/
>  F:	board/zynqmp/
>  F:	boot/xilinx-prebuilt/
> +F:	boot/xilinx-source/
>  F:	configs/versal_vck190_defconfig
>  F:	configs/zynq_zc702_defconfig
>  F:	configs/zynq_zc706_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index 25a50265d2..da22f15e8a 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -22,5 +22,6 @@ source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
>  source "boot/vexpress-firmware/Config.in"
>  source "boot/xilinx-prebuilt/Config.in"
> +source "boot/xilinx-source/Config.in"
>  
>  endmenu
> diff --git a/boot/xilinx-source/Config.in b/boot/xilinx-source/Config.in
> new file mode 100644
> index 0000000000..bf87ff4178
> --- /dev/null
> +++ b/boot/xilinx-source/Config.in
> @@ -0,0 +1,45 @@
> +config BR2_TARGET_XILINX_SOURCE
> +	bool "xilinx-source"
> +	depends on BR2_aarch64
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH = "microblazeel-xilinx-elf"
> +	help
> +	  Build boot firmware from source for Xilinx boards.
> +
> +	  https://github.com/Xilinx/embeddedsw

It would be useful to add here a few words about what gets built and why
versal requires BR2_TARGET_XILINX_PREBUILT while zynqmp and kria require
!BR2_TARGET_XILINX_PREBUILT.

> +comment "xilinx-source needs a bare metal toolchain for tuple microblazeel-xilinx-elf"
> +	depends on BR2_TOOLCHAIN_BARE_METAL_BUILDROOT_ARCH != "microblazeel-xilinx-elf"
> +
> +if BR2_TARGET_XILINX_SOURCE
> +
> +config BR2_TARGET_XILINX_SOURCE_VERSION
> +	string "source version"
> +	default "xilinx_v2024.1"
> +	help
> +	  Release version of Xilinx firmware.
> +	  Must be xilinx_v2023.1 or newer.
> +
> +choice
> +	bool "family variant"
> +	default BR2_TARGET_XILINX_SOURCE_ZYNQMP
> +
> +config BR2_TARGET_XILINX_SOURCE_ZYNQMP
> +	bool "zynqmp"
> +	depends on !BR2_TARGET_XILINX_PREBUILT
> +
> +config BR2_TARGET_XILINX_SOURCE_KRIA
> +	bool "kria"
> +	depends on !BR2_TARGET_XILINX_PREBUILT
> +
> +config BR2_TARGET_XILINX_SOURCE_VERSAL
> +	bool "versal"
> +	depends on BR2_TARGET_XILINX_PREBUILT
> +
> +endchoice
> +
> +config BR2_TARGET_XILINX_SOURCE_USER_CFLAGS
> +	string "optional user cflags"
> +	help
> +	  Add optional config flags when building xilinx boot firmware.
> +
> +endif # BR2_TARGET_XILINX_SOURCE
> diff --git a/boot/xilinx-source/xilinx-source.hash b/boot/xilinx-source/xilinx-source.hash
> new file mode 100644
> index 0000000000..ed6a165574
> --- /dev/null
> +++ b/boot/xilinx-source/xilinx-source.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256  733fdb09b2525c1fa322242b97f015122aaf9e32530a824dec71d6328be83850  xilinx-source-xilinx_v2024.1.tar.gz
> diff --git a/boot/xilinx-source/xilinx-source.mk b/boot/xilinx-source/xilinx-source.mk
> new file mode 100644
> index 0000000000..4352b07eed
> --- /dev/null
> +++ b/boot/xilinx-source/xilinx-source.mk
> @@ -0,0 +1,70 @@
> +################################################################################
> +#
> +# xilinx-source
> +#
> +################################################################################
> +
> +XILINX_SOURCE_VERSION = $(call qstrip,$(BR2_TARGET_XILINX_SOURCE_VERSION))
> +XILINX_SOURCE_SITE = $(call github,Xilinx,embeddedsw,$(XILINX_SOURCE_VERSION))
> +XILINX_SOURCE_LICENSE = MIT
> +XILINX_SOURCE_LICENSE_FILES = LICENSE
> +XILINX_SOURCE_INSTALL_TARGET = NO
> +XILINX_SOURCE_INSTALL_IMAGES = YES
> +XILINX_SOURCE_DEPENDENCIES = toolchain-bare-metal-buildroot
> +
> +XILINX_SOURCE_USER_CFLAGS = $(call qstrip,$(BR2_TARGET_XILINX_SOURCE_USER_CFLAGS))
> +ifeq ($(BR2_TARGET_XILINX_SOURCE_KRIA),y)
> +XILINX_SOURCE_CFLAGS = "-Os -flto -ffat-lto-objects -DK26_SOM $(XILINX_SOURCE_USER_CFLAGS)"
> +else
> +XILINX_SOURCE_CFLAGS = "-Os -flto -ffat-lto-objects $(XILINX_SOURCE_USER_CFLAGS)"
> +endif
> +
> +ifeq ($(BR2_TARGET_XILINX_SOURCE_VERSAL),y)
> +define XILINX_SOURCE_BUILD_VERSAL
> +	$(MAKE) -C $(@D)/lib/sw_apps/versal_plm/src/versal \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(XILINX_SOURCE_CFLAGS)
> +		
> +	$(MAKE) -C $(@D)/lib/sw_apps/versal_psmfw/src/versal \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(XILINX_SOURCE_CFLAGS)
> +endef
> +else # BR2_TARGET_XILINX_SOURCE_VERSAL
> +define XILINX_SOURCE_BUILD_OTHERS
> +	$(MAKE) -C $(@D)/lib/sw_apps/zynqmp_pmufw/src \
> +		COMPILER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		ARCHIVER=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc-ar \
> +		CC=$(HOST_DIR)/bin/microblazeel-xilinx-elf-gcc \
> +		CFLAGS=$(XILINX_SOURCE_CFLAGS)
> +endef
> +endif # BR2_TARGET_XILINX_SOURCE_VERSAL
> +
> +define XILINX_SOURCE_BUILD_CMDS
> +	$(XILINX_SOURCE_BUILD_VERSAL)
> +	$(XILINX_SOURCE_BUILD_OTHERS)

We are always building either for versal or for "others", so only one
of these two variables is ever defined. So you could use only one
variable name (XILINX_SOURCE_BUILD?), or even define directly
XILINX_SOURCE_BUILD_CMDS inside the ifeq/else/endif clause above.

> +endef
> +
> +ifeq ($(BR2_TARGET_XILINX_SOURCE_VERSAL),y)
> +define XILINX_SOURCE_INSTALL_VERSAL
> +	$(INSTALL) -D -m 0755 $(@D)/lib/sw_apps/versal_plm/src/versal/plm.elf \
> +		$(BINARIES_DIR)/plm.elf
> +	$(INSTALL) -D -m 0755 $(@D)/lib/sw_apps/versal_psmfw/src/versal/psmfw.elf \
> +		$(BINARIES_DIR)/psmfw.elf
> +endef
> +else # BR2_TARGET_XILINX_SOURCE_VERSAL
> +define XILINX_SOURCE_INSTALL_OTHERS
> +	$(INSTALL) -D -m 0755 $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf \
> +		$(BINARIES_DIR)/pmufw.elf
> +endef
> +endif # BR2_TARGET_XILINX_SOURCE_VERSAL
> +
> +define XILINX_SOURCE_INSTALL_IMAGES_CMDS
> +	$(XILINX_SOURCE_INSTALL_VERSAL)
> +	$(XILINX_SOURCE_INSTALL_OTHERS)

As above.

Luca

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-06-28  9:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-18  7:49 [Buildroot] [PATCH v3 1/4] boot/xilinx-source: new boot package Neal Frager via buildroot
2024-06-18  7:49 ` [Buildroot] [PATCH v3 2/4] boot/xilinx-prebuilt: wire up xilinx-source Neal Frager via buildroot
2024-06-28  9:32   ` Luca Ceresoli via buildroot
2024-06-28 12:50     ` Frager, Neal via buildroot
2024-06-18  7:49 ` [Buildroot] [PATCH v3 3/4] boot/uboot.mk: new zynqmp pmufw source option Neal Frager via buildroot
2024-06-28  9:32   ` Luca Ceresoli via buildroot
2024-06-18  7:49 ` [Buildroot] [PATCH v3 4/4] configs/zynqmp|versal: migrate to xilinx-source Neal Frager via buildroot
2024-06-28  9:32 ` Luca Ceresoli via buildroot [this message]
2024-06-28 12:40   ` [Buildroot] [PATCH v3 1/4] boot/xilinx-source: new boot package Frager, Neal via buildroot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240628113233.2d8f765f@booty \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=ibai.erkiaga-elorza@amd.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=michal.simek@amd.com \
    --cc=neal.frager@amd.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.