Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package
@ 2023-09-24 15:11 Neal Frager via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
                   ` (9 more replies)
  0 siblings, 10 replies; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:11 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new package for building binutils for a bare-metal toolchain.
The cpu architecture is defined by a toolchain-bare-metal virtual package.
While any cpu architecture could be used, the default configuration will be a
Xilinx microblaze little endian architecture, so that buildroot will be able
to build the microblaze firmware applications for zynqmp and versal.

When configured for the Xilinx microblaze architecture, all of the binutils
patches that are applied to the Xilinx distributed toolchain will be applied
in order to generate a toolchain that is equivalent to what Xilinx distributes.

Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - removed default enable to be replaced with toolchain select config
V2->V3:
 - no changes
V3->V4:
 - split tar instruction into multiple lines
 - replaced unnecessary =? with = for assignments
 - changed xlnx-rel-v2023.1.tar.gz hash to sha256
 - improved menuconfig help comment
---
 DEVELOPERS                                    |  4 ++
 package/binutils-bare-metal/Config.in.host    | 12 ++++
 .../binutils-bare-metal.hash                  |  7 +++
 .../binutils-bare-metal.mk                    | 56 +++++++++++++++++++
 4 files changed, 79 insertions(+)
 create mode 100644 package/binutils-bare-metal/Config.in.host
 create mode 100644 package/binutils-bare-metal/binutils-bare-metal.hash
 create mode 100644 package/binutils-bare-metal/binutils-bare-metal.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index e8b78a8d46..046f8f7874 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1350,6 +1350,9 @@ F:	package/mrp/
 N:	Ian Haylock <haylocki@yahoo.co.uk>
 F:	package/python-rpi-gpio/
 
+N:	Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
+F:	package/binutils-bare-metal/
+
 N:	Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
 F:	package/angularjs/
 
@@ -2178,6 +2181,7 @@ F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
 F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
+F:	package/binutils-bare-metal/
 F:	package/bootgen/
 F:	package/versal-firmware/
 
diff --git a/package/binutils-bare-metal/Config.in.host b/package/binutils-bare-metal/Config.in.host
new file mode 100644
index 0000000000..3a68c1e02d
--- /dev/null
+++ b/package/binutils-bare-metal/Config.in.host
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
+	bool "host binutils-bare-metal"
+	help
+	  Build GNU binutils for a bare-metal toolchain
+
+if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
+
+config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
+	string
+	default "2.39"
+
+endif #BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
diff --git a/package/binutils-bare-metal/binutils-bare-metal.hash b/package/binutils-bare-metal/binutils-bare-metal.hash
new file mode 100644
index 0000000000..c50443e837
--- /dev/null
+++ b/package/binutils-bare-metal/binutils-bare-metal.hash
@@ -0,0 +1,7 @@
+# From https://gcc.gnu.org/pub/binutils/releases/sha512.sum
+sha512  68e038f339a8c21faa19a57bbc447a51c817f47c2e06d740847c6e9cc3396c025d35d5369fa8c3f8b70414757c89f0e577939ddc0d70f283182504920f53b0a3  binutils-2.39.tar.xz
+
+# locally calculated
+sha256  5992ce6865468537b84372480f7593125db754f673dccae1ecf6d6a7c74ed88e  xlnx-rel-v2023.1.tar.gz
+sha256  8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903  COPYING3
+sha256  56bdea73b6145ef6ac5259b3da390b981d840c24cb03b8e1cbc678de7ecfa18d  COPYING.LIB
diff --git a/package/binutils-bare-metal/binutils-bare-metal.mk b/package/binutils-bare-metal/binutils-bare-metal.mk
new file mode 100644
index 0000000000..de8ddcc9e9
--- /dev/null
+++ b/package/binutils-bare-metal/binutils-bare-metal.mk
@@ -0,0 +1,56 @@
+################################################################################
+#
+# binutils-bare-metal
+#
+################################################################################
+
+HOST_BINUTILS_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION))
+ifeq ($(HOST_BINUTILS_BARE_METAL_VERSION),)
+HOST_BINUTILS_BARE_METAL_VERSION = 2.39
+endif # BINUTILS_VERSION  
+
+HOST_BINUTILS_BARE_METAL_SITE = $(BR2_GNU_MIRROR)/binutils
+HOST_BINUTILS_BARE_METAL_SOURCE = binutils-$(HOST_BINUTILS_BARE_METAL_VERSION).tar.xz
+
+HOST_BINUTILS_BARE_METAL_LICENSE = GPL-3.0+, libiberty LGPL-2.1+
+HOST_BINUTILS_BARE_METAL_LICENSE_FILES = COPYING3 COPYING.LIB
+HOST_BINUTILS_BARE_METAL_CPE_ID_VENDOR = gnu
+
+HOST_BINUTILS_BARE_METAL_DEPENDENCIES = host-zlib
+
+# if toolchain is for microblazeel-xilinx, apply Xilinx patch set
+ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS = https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2023.1.tar.gz
+
+define HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES
+  mkdir -p $(@D)/patches
+  tar -xf $(HOST_BINUTILS_BARE_METAL_DL_DIR)/xlnx-rel-v2023.1.tar.gz \
+      --strip-components=5 \
+      -C $(@D)/patches \
+      meta-xilinx-xlnx-rel-v2023.1/meta-microblaze/recipes-devtools/binutils/binutils
+endef
+HOST_BINUTILS_BARE_METAL_POST_EXTRACT_HOOKS += HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES
+
+define HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
+	$(APPLY_PATCHES) $(@D) $(@D)/patches *.patch;
+endef
+HOST_BINUTILS_BARE_METAL_POST_PATCH_HOOKS += HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
+endif #ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+
+# Don't build documentation. It takes up extra space / build time,
+# and sometimes needs specific makeinfo versions to work
+HOST_BINUTILS_BARE_METAL_CONF_ENV += MAKEINFO=true
+HOST_BINUTILS_BARE_METAL_MAKE_OPTS += MAKEINFO=true
+HOST_BINUTILS_BARE_METAL_INSTALL_OPTS += MAKEINFO=true install
+
+HOST_BINUTILS_BARE_METAL_CONF_OPTS = \
+	--target=$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf \
+	--disable-gprof \
+	--disable-shared \
+	--enable-lto \
+	--enable-static \
+	--disable-initfini-array \
+	--disable-multilib \
+	--disable-werror
+
+$(eval $(host-autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: new package
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
@ 2023-09-24 15:11 ` Neal Frager via buildroot
  2023-10-16 10:11   ` Luca Ceresoli via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
                   ` (8 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:11 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new package for building gcc for a bare-metal toolchain.
The cpu architecture is defined by a toolchain-bare-metal virtual package.
While any cpu architecture could be used, the default configuration will be a
Xilinx microblaze little endian architecture, so that buildroot will be able
to build the microblaze firmware applications for zynqmp and versal.

When configured for the Xilinx microblaze architecture, all of the gcc
patches that are applied to the Xilinx distributed toolchain will be applied
in order to generate a toolchain that is equivalent to what Xilinx distributes.

Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - removed default enable to be replaced with toolchain select config
V2->V3:
 - no changes
V3->V4:
 - split tar instruction into multiple lines
 - replaced unnecessary =? with = for assignments
 - changed xlnx-rel-v2023.1.tar.gz hash to sha256
 - improved menuconfig help comment
---
 DEVELOPERS                                 |  2 +
 package/gcc-bare-metal/Config.in.host      | 12 ++++
 package/gcc-bare-metal/gcc-bare-metal.hash |  5 ++
 package/gcc-bare-metal/gcc-bare-metal.mk   | 70 ++++++++++++++++++++++
 4 files changed, 89 insertions(+)
 create mode 100644 package/gcc-bare-metal/Config.in.host
 create mode 100644 package/gcc-bare-metal/gcc-bare-metal.hash
 create mode 100644 package/gcc-bare-metal/gcc-bare-metal.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 046f8f7874..284a231f7f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1352,6 +1352,7 @@ F:	package/python-rpi-gpio/
 
 N:	Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
 F:	package/binutils-bare-metal/
+F:	package/gcc-bare-metal/
 
 N:	Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
 F:	package/angularjs/
@@ -2183,6 +2184,7 @@ F:	configs/zynqmp_zcu102_defconfig
 F:	configs/zynqmp_zcu106_defconfig
 F:	package/binutils-bare-metal/
 F:	package/bootgen/
+F:	package/gcc-bare-metal/
 F:	package/versal-firmware/
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
diff --git a/package/gcc-bare-metal/Config.in.host b/package/gcc-bare-metal/Config.in.host
new file mode 100644
index 0000000000..7fdf443511
--- /dev/null
+++ b/package/gcc-bare-metal/Config.in.host
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_GCC_BARE_METAL
+	bool "host gcc-bare-metal"
+	help
+	  Build GCC for a bare-metal toolchain
+
+if BR2_PACKAGE_HOST_GCC_BARE_METAL
+
+config BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION
+	string
+	default "12.2.0"
+
+endif #BR2_PACKAGE_HOST_GCC_BARE_METAL
diff --git a/package/gcc-bare-metal/gcc-bare-metal.hash b/package/gcc-bare-metal/gcc-bare-metal.hash
new file mode 100644
index 0000000000..56ac845e28
--- /dev/null
+++ b/package/gcc-bare-metal/gcc-bare-metal.hash
@@ -0,0 +1,5 @@
+# From https://gcc.gnu.org/pub/gcc/releases/gcc-12.2.0/sha512.sum
+sha512  e9e857bd81bf7a370307d6848c81b2f5403db8c7b5207f54bce3f3faac3bde63445684092c2bc1a2427cddb6f7746496d9fbbef05fbbd77f2810b2998f1f9173  gcc-12.2.0.tar.xz
+
+# locally calculated
+sha256  5992ce6865468537b84372480f7593125db754f673dccae1ecf6d6a7c74ed88e  xlnx-rel-v2023.1.tar.gz
diff --git a/package/gcc-bare-metal/gcc-bare-metal.mk b/package/gcc-bare-metal/gcc-bare-metal.mk
new file mode 100644
index 0000000000..93c17d6520
--- /dev/null
+++ b/package/gcc-bare-metal/gcc-bare-metal.mk
@@ -0,0 +1,70 @@
+################################################################################
+#
+# gcc-bare-metal
+#
+################################################################################
+
+HOST_GCC_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION))
+ifeq ($(HOST_GCC_BARE_METAL_VERSION),)
+HOST_GCC_BARE_METAL_VERSION = 12.2.0
+endif
+
+HOST_GCC_BARE_METAL_SITE = https://ftp.gnu.org/gnu/gcc/gcc-$(HOST_GCC_BARE_METAL_VERSION)
+HOST_GCC_BARE_METAL_SOURCE = gcc-$(HOST_GCC_BARE_METAL_VERSION).tar.xz
+
+HOST_GCC_BARE_METAL_DEPENDENCIES = host-binutils-bare-metal host-gmp host-mpc host-mpfr host-isl
+
+# if toolchain is for microblazeel-xilinx, apply Xilinx patch set
+ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+HOST_GCC_BARE_METAL_EXTRA_DOWNLOADS = https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2023.1.tar.gz
+
+define HOST_GCC_BARE_METAL_EXTRACT_PATCHES
+  mkdir -p $(@D)/patches
+  tar -xf $(HOST_GCC_BARE_METAL_DL_DIR)/xlnx-rel-v2023.1.tar.gz \
+      --strip-components=5 \
+      -C $(@D)/patches \
+      meta-xilinx-xlnx-rel-v2023.1/meta-microblaze/recipes-devtools/gcc/gcc-12
+endef
+HOST_GCC_BARE_METAL_POST_EXTRACT_HOOKS += HOST_GCC_BARE_METAL_EXTRACT_PATCHES
+
+define HOST_GCC_BARE_METAL_APPLY_LOCAL_PATCHES
+        $(APPLY_PATCHES) $(@D) $(@D)/patches *.patch;
+endef
+HOST_GCC_BARE_METAL_POST_PATCH_HOOKS += HOST_GCC_BARE_METAL_APPLY_LOCAL_PATCHES
+endif #ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
+
+# gcc doesn't support in-tree build, so we create a 'build'
+# subdirectory in the gcc sources, and build from there.
+define GCC_BARE_METAL_CONFIGURE_SYMLINK
+	mkdir -p $(@D)/build
+	ln -sf ../configure $(@D)/build/configure
+endef
+
+HOST_GCC_BARE_METAL_PRE_CONFIGURE_HOOKS += GCC_BARE_METAL_CONFIGURE_SYMLINK
+HOST_GCC_BARE_METAL_SUBDIR = build
+
+HOST_GCC_BARE_METAL_MAKE_OPTS = $(HOST_GCC_COMMON_MAKE_OPTS) all-gcc all-target-libgcc
+HOST_GCC_BARE_METAL_INSTALL_OPTS = install-gcc install-target-libgcc
+
+HOST_GCC_BARE_METAL_CONF_OPTS = \
+	--target=$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf \
+	--disable-initfini_array \
+	--disable-__cxa_atexit \
+	--disable-libstdcxx-pch \
+	--with-newlib \
+	--disable-threads \
+	--enable-plugins \
+	--with-gnu-as \
+	--disable-libitm \
+	--without-long-double-128 \
+	--without-headers \
+	--enable-languages=c \
+	--disable-multilib \
+	--with-gmp=$(HOST_DIR) \
+	--with-mpc=$(HOST_DIR) \
+	--with-mpfr=$(HOST_DIR) \
+	--with-isl=$(HOST_DIR) \
+	AR_FOR_TARGET=$(O)/host/bin/$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf-ar \
+	RANLIB_FOR_TARGET=$(O)/host/bin/$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf-ranlib
+
+$(eval $(host-autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: new package
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
@ 2023-09-24 15:11 ` Neal Frager via buildroot
  2023-10-16 10:11   ` Luca Ceresoli via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain Neal Frager via buildroot
                   ` (7 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:11 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new package for building newlib for a bare-metal toolchain.
The cpu architecture is defined by a toolchain-bare-metal virtual package.
While any cpu architecture could be used, the default configuration will be a
Xilinx microblaze little endian architecture, so that buildroot will be able
to build the microblaze firmware applications for zynqmp and versal.

Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - removed default enable to be replaced with toolchain select config
V2->V3:
 - no changes
V3->V4:
 - replaced unnecessary =? with = for assignments
 - improved menuconfig help comment
---
 DEVELOPERS                                    |  2 ++
 package/newlib-bare-metal/Config.in.host      | 12 +++++++++
 .../newlib-bare-metal/newlib-bare-metal.hash  |  8 ++++++
 .../newlib-bare-metal/newlib-bare-metal.mk    | 27 +++++++++++++++++++
 4 files changed, 49 insertions(+)
 create mode 100644 package/newlib-bare-metal/Config.in.host
 create mode 100644 package/newlib-bare-metal/newlib-bare-metal.hash
 create mode 100644 package/newlib-bare-metal/newlib-bare-metal.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 284a231f7f..5c5f4f1e21 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1353,6 +1353,7 @@ F:	package/python-rpi-gpio/
 N:	Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
 F:	package/binutils-bare-metal/
 F:	package/gcc-bare-metal/
+F:	package/newlib-bare-metal/
 
 N:	Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
 F:	package/angularjs/
@@ -2185,6 +2186,7 @@ F:	configs/zynqmp_zcu106_defconfig
 F:	package/binutils-bare-metal/
 F:	package/bootgen/
 F:	package/gcc-bare-metal/
+F:	package/newlib-bare-metal/
 F:	package/versal-firmware/
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
diff --git a/package/newlib-bare-metal/Config.in.host b/package/newlib-bare-metal/Config.in.host
new file mode 100644
index 0000000000..be92a1d6a6
--- /dev/null
+++ b/package/newlib-bare-metal/Config.in.host
@@ -0,0 +1,12 @@
+config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
+	bool "host newlib-bare-metal"
+	help
+	  Build the newlib C library for a bare-metal toolchain
+
+if BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
+
+config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_VERSION
+	string
+	default "4.1.0"
+
+endif #BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
diff --git a/package/newlib-bare-metal/newlib-bare-metal.hash b/package/newlib-bare-metal/newlib-bare-metal.hash
new file mode 100644
index 0000000000..1a681ecf77
--- /dev/null
+++ b/package/newlib-bare-metal/newlib-bare-metal.hash
@@ -0,0 +1,8 @@
+# Locally calculated
+sha256  f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154  newlib-4.1.0.tar.gz
+
+# Hashes for license files locally calculated
+sha256  231f7edcc7352d7734a96eef0b8030f77982678c516876fcb81e25b32d68564c  COPYING
+sha256  a9bdde5616ecdd1e980b44f360600ee8783b1f99b8cc83a2beb163a0a390e861  COPYING.LIB
+sha256  f3b7f3e4426b1fa6f60198dae7adfedd94b77b28db2d108adc0253575011e0ff  COPYING.LIBGLOSS
+sha256  422aa40293093fb54fc66e692a0d68fd0b24ed5602e5d1d33ad05ba3909057e9  COPYING.NEWLIB
diff --git a/package/newlib-bare-metal/newlib-bare-metal.mk b/package/newlib-bare-metal/newlib-bare-metal.mk
new file mode 100644
index 0000000000..149f7b1768
--- /dev/null
+++ b/package/newlib-bare-metal/newlib-bare-metal.mk
@@ -0,0 +1,27 @@
+################################################################################
+#
+# newlib-bare-metal
+#
+################################################################################
+
+HOST_NEWLIB_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_VERSION))
+ifeq ($(HOST_NEWLIB_BARE_METAL_VERSION),)
+HOST_NEWLIB_BARE_METAL_VERSION = 4.1.0
+endif
+
+HOST_NEWLIB_BARE_METAL_SITE = ftp://sourceware.org/pub/newlib
+HOST_NEWLIB_BARE_METAL_SOURCE = newlib-$(HOST_NEWLIB_BARE_METAL_VERSION).tar.gz
+HOST_NEWLIB_BARE_METAL_DEPENDENCIES = host-gcc-bare-metal
+
+HOST_NEWLIB_BARE_METAL_CONF_OPTS = \
+	--target=$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf \
+	CC_FOR_TARGET=$(HOST_DIR)/bin/$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf-gcc \
+	AR_FOR_TARGET=$(HOST_DIR)/bin/$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf-ar \
+	RANLIB_FOR_TARGET=$(HOST_DIR)/bin/$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf-ranlib \
+	--enable-newlib-io-c99-formats \
+	--enable-newlib-io-long-long \
+	--enable-newlib-io-float \
+	--enable-newlib-io-long-double \
+	--disable-multilib
+
+$(eval $(host-autotools-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
@ 2023-09-24 15:11 ` Neal Frager via buildroot
  2023-10-16 10:11   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
                   ` (6 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:11 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new virtual package for adding a bare-metal toolchain to
buildroot.  By default, this package will configure a bare-metal toolchain
for the Xilinx microblaze little endian architecture.  When configured for
the Xilinx microblaze architecture, this toolchain can be used to build the
microblaze firmware applications for zynqmp and versal.

Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - adds select option to bring in all packages needed for toolchain-bare-metal
V2->V3:
 - no changes
V3->V4:
 - moved from package to toolchain directory
 - improved menuconfig help comment
---
 DEVELOPERS                                    |  2 ++
 toolchain/Config.in                           |  1 +
 toolchain/toolchain-bare-metal/Config.in      | 21 +++++++++++++++++++
 .../toolchain-bare-metal.mk                   |  7 +++++++
 4 files changed, 31 insertions(+)
 create mode 100644 toolchain/toolchain-bare-metal/Config.in
 create mode 100644 toolchain/toolchain-bare-metal/toolchain-bare-metal.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 5c5f4f1e21..f976552445 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1354,6 +1354,7 @@ N:	Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
 F:	package/binutils-bare-metal/
 F:	package/gcc-bare-metal/
 F:	package/newlib-bare-metal/
+F:	toolchain/toolchain-bare-metal/
 
 N:	Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
 F:	package/angularjs/
@@ -2188,6 +2189,7 @@ F:	package/bootgen/
 F:	package/gcc-bare-metal/
 F:	package/newlib-bare-metal/
 F:	package/versal-firmware/
+F:	toolchain/toolchain-bare-metal/
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
 F:	package/uacme/
diff --git a/toolchain/Config.in b/toolchain/Config.in
index da6bf5f4c8..1604fa0108 100644
--- a/toolchain/Config.in
+++ b/toolchain/Config.in
@@ -59,6 +59,7 @@ config BR2_TOOLCHAIN_EXTERNAL
 
 endchoice
 
+source "toolchain/toolchain-bare-metal/Config.in"
 source "toolchain/toolchain-buildroot/Config.in"
 source "toolchain/toolchain-external/Config.in"
 
diff --git a/toolchain/toolchain-bare-metal/Config.in b/toolchain/toolchain-bare-metal/Config.in
new file mode 100644
index 0000000000..ddd6d3c253
--- /dev/null
+++ b/toolchain/toolchain-bare-metal/Config.in
@@ -0,0 +1,21 @@
+config BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
+	bool "host toolchain-bare-metal"
+	select BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
+	select BR2_PACKAGE_HOST_GCC_BARE_METAL
+	select BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
+	help
+	  Build a bare-metal toolchain in addition to the main Linux toolchain
+
+if BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
+
+config BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH
+	string
+	default "microblazeel-xilinx"
+	help
+	  select architecture for bare-metal toolchain
+
+source "package/binutils-bare-metal/Config.in.host"
+source "package/gcc-bare-metal/Config.in.host"
+source "package/newlib-bare-metal/Config.in.host"
+
+endif #BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
diff --git a/toolchain/toolchain-bare-metal/toolchain-bare-metal.mk b/toolchain/toolchain-bare-metal/toolchain-bare-metal.mk
new file mode 100644
index 0000000000..407ad4ea33
--- /dev/null
+++ b/toolchain/toolchain-bare-metal/toolchain-bare-metal.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# toolchain-bare-metal
+#
+################################################################################
+
+(eval $(host-virtual-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (2 preceding siblings ...)
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:11   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
                   ` (5 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
It requires the toolchain-bare-metal package that includes a bare-metal
binutils, gcc and newlib which can be built for the microblaze architecture.

A patch is required to enable parallel building of the pmufw.  This patch has
been submitted upstream internally at AMD / Xilinx and will be included with
the 2023.2 release of the embeddedsw repository.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - builds a bare-metal gcc toolchain instead of requiring an external
   microblaze toolchain
V2->V3:
 - corrected custom cflags option
 - added support for xilinx_v2022.2 version
 - added zynqmp-firmware.hash
V3->V4:
 - no changes
---
 DEVELOPERS                                    |   1 +
 boot/Config.in                                |   1 +
 boot/zynqmp-firmware/Config.in                |  22 ++++
 ...akefile-specify-sequential-Makefiles.patch |   1 +
 ...akefile-specify-sequential-Makefiles.patch | 115 ++++++++++++++++++
 boot/zynqmp-firmware/zynqmp-firmware.hash     |   3 +
 boot/zynqmp-firmware/zynqmp-firmware.mk       |  29 +++++
 7 files changed, 172 insertions(+)
 create mode 100644 boot/zynqmp-firmware/Config.in
 create mode 120000 boot/zynqmp-firmware/xilinx_v2022.2/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
 create mode 100644 boot/zynqmp-firmware/xilinx_v2023.1/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
 create mode 100644 boot/zynqmp-firmware/zynqmp-firmware.hash
 create mode 100644 boot/zynqmp-firmware/zynqmp-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index f976552445..c9e87818d4 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2179,6 +2179,7 @@ N:	Neal Frager <neal.frager@amd.com>
 F:	board/versal/
 F:	board/zynq/
 F:	board/zynqmp/
+F:	boot/zynqmp-firmware/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
 F:	configs/zynqmp_kria_kv260_defconfig
diff --git a/boot/Config.in b/boot/Config.in
index e5fdf7ad43..c7478fef2e 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -24,5 +24,6 @@ source "boot/ti-k3-image-gen/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
 source "boot/vexpress-firmware/Config.in"
+source "boot/zynqmp-firmware/Config.in"
 
 endmenu
diff --git a/boot/zynqmp-firmware/Config.in b/boot/zynqmp-firmware/Config.in
new file mode 100644
index 0000000000..3419a099e3
--- /dev/null
+++ b/boot/zynqmp-firmware/Config.in
@@ -0,0 +1,22 @@
+config BR2_TARGET_ZYNQMP_FIRMWARE
+	bool "zynqmp-firmware"
+	select BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
+	help
+	  This package builds the PMU Firmware application required to run
+	  U-Boot and Linux in the Zynq MPSoC devices.
+
+if BR2_TARGET_ZYNQMP_FIRMWARE
+
+config BR2_TARGET_ZYNQMP_FIRMWARE_VERSION
+	string "firmware version"
+	default "xilinx_v2023.1"
+	help
+	  Release version of zynqmp firmware.
+	  Only versions xilinx_v2022.2 and newer are supported.
+
+config BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS
+	string "custom cflags"
+	help
+	  Adds additional CFLAGS for building zynqmp firmware.
+
+endif # BR2_TARGET_ZYNQMP_FIRMWARE
diff --git a/boot/zynqmp-firmware/xilinx_v2022.2/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch b/boot/zynqmp-firmware/xilinx_v2022.2/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
new file mode 120000
index 0000000000..51cb8a6ae0
--- /dev/null
+++ b/boot/zynqmp-firmware/xilinx_v2022.2/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
@@ -0,0 +1 @@
+../xilinx_v2023.1/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
\ No newline at end of file
diff --git a/boot/zynqmp-firmware/xilinx_v2023.1/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch b/boot/zynqmp-firmware/xilinx_v2023.1/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
new file mode 100644
index 0000000000..29c652d6ef
--- /dev/null
+++ b/boot/zynqmp-firmware/xilinx_v2023.1/0001-pmufw-misc-Makefile-specify-sequential-Makefiles.patch
@@ -0,0 +1,115 @@
+From 23002defd462845db376425a7b7d975f3deba83d Mon Sep 17 00:00:00 2001
+From: Neal Frager <neal.frager@amd.com>
+Date: Mon, 24 Apr 2023 12:53:25 +0100
+Subject: [PATCH v1 1/1] pmufw: misc/Makefile: specify sequential Makefiles
+
+The BSP_SEQUENTIAL_MAKEFILES variable is not properly assigned and exported
+from copy_bsp.sh.
+
+Because of this, no library is built sequentially even if it was desired to
+build them sequentially by assigning to BSP_SEQUENTIAL_MAKEFILES. All the
+libraries are built in parallel.
+
+This patch resolves this issue, so that libraries that must be built
+sequentially are indeed built sequentially.
+
+Signed-off-by: Neal Frager <neal.frager@amd.com>
+---
+ lib/sw_apps/zynqmp_pmufw/misc/Makefile    | 10 +++++++++-
+ lib/sw_apps/zynqmp_pmufw/misc/copy_bsp.sh |  7 -------
+ lib/sw_apps/zynqmp_pmufw/src/Makefile     |  2 ++
+ 3 files changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/lib/sw_apps/zynqmp_pmufw/misc/Makefile b/lib/sw_apps/zynqmp_pmufw/misc/Makefile
+index a773498512..fe2d23c965 100644
+--- a/lib/sw_apps/zynqmp_pmufw/misc/Makefile
++++ b/lib/sw_apps/zynqmp_pmufw/misc/Makefile
+@@ -7,6 +7,14 @@ PROCESSOR = psu_pmu_0
+ LIBRARIES = ${PROCESSOR}/lib/libxil.a
+ BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
+ SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
++DRIVERS_LIST=../drivers.txt
++SEQUENTIAL_MAKEFILES := $(shell cat ${DRIVERS_LIST})
++BSP_SEQUENTIAL_MAKEFILES = $(patsubst %, ${PROCESSOR}/libsrc/%/src/Makefile, $(SEQUENTIAL_MAKEFILES))
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilskey/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilfpga/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilsecure/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/dppsu/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/dpdma/src/Makefile
+ BSP_PARALLEL_MAKEFILES := $(filter-out $(BSP_SEQUENTIAL_MAKEFILES),$(BSP_MAKEFILES))
+ SEQ_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_SEQUENTIAL_MAKEFILES))
+ PAR_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_PARALLEL_MAKEFILES))
+@@ -16,7 +24,7 @@ ifneq (,$(findstring win,$(RDI_PLATFORM)))
+ endif
+ 
+ all:
+-	$(MAKE) --no-print-directory seq_libs
++	$(MAKE) -j1 --no-print-directory seq_libs
+ 	$(MAKE) -j --no-print-directory par_libs
+ 	$(MAKE) --no-print-directory archive
+ 	@echo 'Finished building libraries'
+diff --git a/lib/sw_apps/zynqmp_pmufw/misc/copy_bsp.sh b/lib/sw_apps/zynqmp_pmufw/misc/copy_bsp.sh
+index 197f7af844..ac8dd8249e 100755
+--- a/lib/sw_apps/zynqmp_pmufw/misc/copy_bsp.sh
++++ b/lib/sw_apps/zynqmp_pmufw/misc/copy_bsp.sh
+@@ -29,8 +29,6 @@ STANDALONE_DIR=$EMBEDDED_SW_DIR/lib/bsp/standalone/src
+ # libraries dir
+ SERVICES_DIR=$EMBEDDED_SW_DIR/lib/sw_services
+ 
+-BSP_SEQUENTIAL_MAKEFILES=
+-
+ # creation of BSP folders required
+ if [ -d $BSP_DIR ]; then
+ 	echo "BSP directory already exists"
+@@ -55,14 +53,12 @@ cp -r $SERVICES_DIR/xilfpga/src/interface/zynqmp/xilfpga_pcap.c $BSP_DIR/libsrc/
+ cp -r $SERVICES_DIR/xilfpga/src/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilfpga/src/interface/zynqmp/*.h $BSP_DIR/include/
+ rm -r $BSP_DIR/libsrc/xilfpga/src/interface/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilfpga/src/Makefile"
+ mkdir -p $BSP_DIR/libsrc/xilsecure/src/
+ cp -r $SERVICES_DIR/xilsecure/src/Makefile $BSP_DIR/libsrc/xilsecure/src/
+ cp -r $SERVICES_DIR/xilsecure/src/common/all/* $BSP_DIR/libsrc/xilsecure/src/
+ cp -r $SERVICES_DIR/xilsecure/src/zynqmp/* $BSP_DIR/libsrc/xilsecure/src/
+ cp -r $SERVICES_DIR/xilsecure/src/common/all/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilsecure/src/zynqmp/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilsecure/src/Makefile"
+ cp -r $SERVICES_DIR/xilskey/ $BSP_DIR/libsrc/
+ 
+ # remove the xilskey library files which are not required for PMU
+@@ -84,7 +80,6 @@ rm -r $BSP_DIR/libsrc/xilskey/src/include/xilskey_bbram.h
+ # copy the xilskey library header files to include directory
+ cp -r $BSP_DIR/libsrc/xilskey/src/*.h $BSP_DIR/include/
+ cp -r $BSP_DIR/libsrc/xilskey/src/include/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilskey/src/Makefile"
+ 
+ # copy bsp standalone code
+ cp -r $STANDALONE_DIR/common/*  $BSP_DIR/libsrc/standalone/src/
+@@ -113,7 +108,6 @@ do
+ 	if [ $line != "avbuf" ] && [ $line != "video_common" ]; then
+ 		cp $WORKING_DIR/x"$line"_g.c $BSP_DIR/libsrc/$line/src/
+ 	fi
+-	BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/$line/src/Makefile"
+ 
+ done < $DRIVERS_LIST
+ 
+@@ -136,4 +130,3 @@ cp $STANDALONE_DIR/profile/*.h  $BSP_DIR/include/
+ 
+ # no inbyte and outbyte present in standalone
+ cp $WORKING_DIR/inbyte.c $WORKING_DIR/outbyte.c  $BSP_DIR/libsrc/standalone/src/
+-export BSP_SEQUENTIAL_MAKEFILES
+diff --git a/lib/sw_apps/zynqmp_pmufw/src/Makefile b/lib/sw_apps/zynqmp_pmufw/src/Makefile
+index 1750c0a329..8747db5cdf 100644
+--- a/lib/sw_apps/zynqmp_pmufw/src/Makefile
++++ b/lib/sw_apps/zynqmp_pmufw/src/Makefile
+@@ -27,6 +27,8 @@ all: $(EXEC)
+ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
+ 	$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)
+ 
++$(OBJS): $(LIBS)
++
+ $(LIBS):
+ 	echo "Copying BSP files"
+ 	../misc/copy_bsp.sh
+-- 
+2.17.1
+
diff --git a/boot/zynqmp-firmware/zynqmp-firmware.hash b/boot/zynqmp-firmware/zynqmp-firmware.hash
new file mode 100644
index 0000000000..ee2d656110
--- /dev/null
+++ b/boot/zynqmp-firmware/zynqmp-firmware.hash
@@ -0,0 +1,3 @@
+# locally computed
+sha256  fc0e86027bdba53f5df373bcb38a171d61704db4ff1b4671f3886a87ceec7068  zynqmp-firmware-xilinx_v2022.2.tar.gz
+sha256  9850f893113936b9959cc76cc3e9152e30f815ff1acaa4b45f7a60fe3e1836f0  zynqmp-firmware-xilinx_v2023.1.tar.gz
diff --git a/boot/zynqmp-firmware/zynqmp-firmware.mk b/boot/zynqmp-firmware/zynqmp-firmware.mk
new file mode 100644
index 0000000000..695cec4b74
--- /dev/null
+++ b/boot/zynqmp-firmware/zynqmp-firmware.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# zynqmp-firmware
+#
+################################################################################
+
+ZYNQMP_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_VERSION))
+ZYNQMP_FIRMWARE_SITE = $(call github,Xilinx,embeddedsw,$(ZYNQMP_FIRMWARE_VERSION))
+ZYNQMP_FIRMWARE_LICENSE = MIT
+ZYNQMP_FIRMWARE_LICENSE_FILES = license.txt
+ZYNQMP_FIRMWARE_INSTALL_IMAGES = YES
+ZYNQMP_FIRMWARE_INSTALL_TARGET = NO
+ZYNQMP_FIRMWARE_DEPENDENCIES = host-newlib-bare-metal
+
+ZYNQMP_CFLAGS = "-Os -flto -ffat-lto-objects $(call qstrip,$(BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS))"
+
+define ZYNQMP_FIRMWARE_BUILD_CMDS
+	$(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=$(ZYNQMP_CFLAGS)
+endef
+
+define ZYNQMP_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/lib/sw_apps/zynqmp_pmufw/src/executable.elf $(BINARIES_DIR)/pmufw.elf
+endef
+
+$(eval $(generic-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (3 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:12   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
                   ` (4 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option will enable u-boot to
use the zynqmp-firmware package for building a pmufw.elf that gets included in
the generated boot.bin.

If the BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option is enabled, then the
BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw will
be ignored.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
V1->V2:
 - patch is now backwards compatible for users already using the
   BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw
V2->V3:
 - no changes
V3->V4:
 - BR2_TARGET_UBOOT_ZYNQMP_PMUFW removed when
   BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE selected
---
 boot/uboot/Config.in | 19 +++++++++++++++++--
 boot/uboot/uboot.mk  |  5 +++++
 2 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 21f19db890..ef9e811764 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -514,11 +514,26 @@ config BR2_TARGET_UBOOT_ZYNQMP
 
 if BR2_TARGET_UBOOT_ZYNQMP
 
+config BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
+	bool "Build zynqmp PMU firmware from source"
+	select BR2_TARGET_ZYNQMP_FIRMWARE
+	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+	help
+	  This option instructs u-boot to build the zynqmp pmufw using
+	  the zynqmp-firmware package.  u-boot will then include this
+	  pmufw.elf in the generated boot.bin.
+	  
+	  If this option is selected, the BR2_TARGET_UBOOT_ZYNQMP_PMUFW
+	  prebuilt option will be ignored.
+
+	  This feature requires U-Boot >= 2018.07.
+
 config BR2_TARGET_UBOOT_ZYNQMP_PMUFW
-	string "PMU firmware location"
+	string "Pre-built zynqmp PMU firmware location"
 	depends on BR2_TARGET_UBOOT_BUILD_SYSTEM_KCONFIG
+	depends on !BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
 	help
-	  Location of a PMU firmware binary.
+	  Location of a pre-built PMU firmware binary.
 
 	  If not empty, instructs the U-Boot build process to generate
 	  a boot.bin (to be loaded by the ZynqMP boot ROM) containing
diff --git a/boot/uboot/uboot.mk b/boot/uboot/uboot.mk
index dda606a880..c11e3d89f7 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -416,7 +416,12 @@ endef
 
 ifeq ($(BR2_TARGET_UBOOT_ZYNQMP),y)
 
+ifeq ($(BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE),y)
+UBOOT_DEPENDENCIES += zynqmp-firmware
+UBOOT_ZYNQMP_PMUFW = $(BINARIES_DIR)/pmufw.elf
+else
 UBOOT_ZYNQMP_PMUFW = $(call qstrip,$(BR2_TARGET_UBOOT_ZYNQMP_PMUFW))
+endif #BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
 
 ifneq ($(findstring ://,$(UBOOT_ZYNQMP_PMUFW)),)
 UBOOT_EXTRA_DOWNLOADS += $(UBOOT_ZYNQMP_PMUFW)
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (4 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:12   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
                   ` (3 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch migrates the zynqmp config files to use the new
zynqmp-firmware package for building the zynqmp pmufw from source.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 configs/zynqmp_kria_kv260_defconfig | 4 +++-
 configs/zynqmp_zcu102_defconfig     | 3 ++-
 configs/zynqmp_zcu106_defconfig     | 3 ++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/configs/zynqmp_kria_kv260_defconfig b/configs/zynqmp_kria_kv260_defconfig
index 78b62a9ff8..5e0c820ba7 100644
--- a/configs/zynqmp_kria_kv260_defconfig
+++ b/configs/zynqmp_kria_kv260_defconfig
@@ -32,7 +32,9 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/kv260-kria/pmufw.elf"
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2023.1"
+BR2_TARGET_ZYNQMP_FIRMWARE_CUSTOM_CFLAGS="-DBOARD_SHUTDOWN_PIN=2 -DBOARD_SHUTDOWN_PIN_STATE=0 -DENABLE_EM -DENABLE_MOD_OVERTEMP -DENABLE_DYNAMIC_MIO_CONFIG -DENABLE_IOCTL -DCONNECT_PMU_GPO_2_VAL=0"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/kria/kv260/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
diff --git a/configs/zynqmp_zcu102_defconfig b/configs/zynqmp_zcu102_defconfig
index 18230cf89b..6674fc6dfb 100644
--- a/configs/zynqmp_zcu102_defconfig
+++ b/configs/zynqmp_zcu102_defconfig
@@ -30,7 +30,8 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/zcu102-zynqmp/pmufw.elf"
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2023.1"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu102/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
diff --git a/configs/zynqmp_zcu106_defconfig b/configs/zynqmp_zcu106_defconfig
index 21f41a2d8f..201d3daeda 100644
--- a/configs/zynqmp_zcu106_defconfig
+++ b/configs/zynqmp_zcu106_defconfig
@@ -30,7 +30,8 @@ BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_SPL=y
 BR2_TARGET_UBOOT_SPL_NAME="spl/boot.bin"
 BR2_TARGET_UBOOT_ZYNQMP=y
-BR2_TARGET_UBOOT_ZYNQMP_PMUFW="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/zcu106-zynqmp/pmufw.elf"
+BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
+BR2_TARGET_ZYNQMP_FIRMWARE_VERSION="xilinx_v2023.1"
 BR2_TARGET_UBOOT_ZYNQMP_PM_CFG="board/zynqmp/zcu106/pm_cfg_obj.c"
 BR2_TARGET_UBOOT_FORMAT_ITB=y
 BR2_TARGET_UBOOT_NEEDS_ATF_BL31=y
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (5 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:12   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
                   ` (2 subsequent siblings)
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch adds a new boot firmware to buildroot for building the versal plm
and psmfw.  It requires the toolchain-bare-metal package that includes a
bare-metal binutils, gcc and newlib which can be built for the microblaze
architecture.

A patch is required to enable parallel building of the versal plm and psmfw
applications.  These two patches have been submitted upstream internally at
AMD / Xilinx and will be included with the 2023.2 release of the embeddedsw
repository.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 DEVELOPERS                                    |   1 +
 boot/Config.in                                |   1 +
 boot/versal-firmware/Config.in                |  34 ++++
 boot/versal-firmware/versal-firmware.hash     |   2 +
 boot/versal-firmware/versal-firmware.mk       |  47 ++++++
 ...al_plm-add-support-of-parallel-build.patch | 157 ++++++++++++++++++
 ..._psmfw-add-support-of-parallel-build.patch |  48 ++++++
 7 files changed, 290 insertions(+)
 create mode 100644 boot/versal-firmware/Config.in
 create mode 100644 boot/versal-firmware/versal-firmware.hash
 create mode 100644 boot/versal-firmware/versal-firmware.mk
 create mode 100644 boot/versal-firmware/xilinx_v2023.1/0001-sw_apps-versal_plm-add-support-of-parallel-build.patch
 create mode 100644 boot/versal-firmware/xilinx_v2023.1/0002-sw_apps-versal_psmfw-add-support-of-parallel-build.patch

diff --git a/DEVELOPERS b/DEVELOPERS
index c9e87818d4..1c66659b19 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2179,6 +2179,7 @@ N:	Neal Frager <neal.frager@amd.com>
 F:	board/versal/
 F:	board/zynq/
 F:	board/zynqmp/
+F:	boot/versal-firmware/
 F:	boot/zynqmp-firmware/
 F:	configs/versal_vck190_defconfig
 F:	configs/zynq_zc706_defconfig
diff --git a/boot/Config.in b/boot/Config.in
index c7478fef2e..da5ccb6b9c 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -23,6 +23,7 @@ source "boot/ti-k3-boot-firmware/Config.in"
 source "boot/ti-k3-image-gen/Config.in"
 source "boot/ti-k3-r5-loader/Config.in"
 source "boot/uboot/Config.in"
+source "boot/versal-firmware/Config.in"
 source "boot/vexpress-firmware/Config.in"
 source "boot/zynqmp-firmware/Config.in"
 
diff --git a/boot/versal-firmware/Config.in b/boot/versal-firmware/Config.in
new file mode 100644
index 0000000000..34279f84b8
--- /dev/null
+++ b/boot/versal-firmware/Config.in
@@ -0,0 +1,34 @@
+config BR2_TARGET_VERSAL_FIRMWARE
+	bool "versal-firmware"
+	select BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
+	help
+	  This package builds the boot firmware apps for Xilinx versal
+	  boards, so that they can boot u-boot and Linux.
+
+if BR2_TARGET_VERSAL_FIRMWARE
+
+config BR2_TARGET_VERSAL_FIRMWARE_VERSION
+	string "firmware version"
+	default "xilinx_v2023.1"
+	help
+	  Release version of versal firmware.
+	  Only versions xilinx_v2023.1 and newer are supported.
+	  
+config BR2_TARGET_VERSAL_FIRMWARE_CUSTOM_CFLAGS
+	string "custom cflags"
+	help
+	  Adds additional CFLAGS for building versal firmware.
+
+config BR2_TARGET_VERSAL_FIRMWARE_PDI
+	string "pdi file location"
+	default "https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/vck190-versal/vpl_gen_fixed.pdi"
+	help
+	  The PDI file defines everything which is board specific for versal.
+	  It gets parsed by the plm.elf during boot.  To boot a custom target
+	  based on versal, this should be configured to point to your Vivado
+	  generated PDI file.
+	  
+	  This config should never be undefined, so default configuration is
+	  for the vck190 evaluation board.
+
+endif # BR2_TARGET_VERSAL_FIRMWARE
diff --git a/boot/versal-firmware/versal-firmware.hash b/boot/versal-firmware/versal-firmware.hash
new file mode 100644
index 0000000000..3a03f9c3ff
--- /dev/null
+++ b/boot/versal-firmware/versal-firmware.hash
@@ -0,0 +1,2 @@
+# locally computed
+sha256  9850f893113936b9959cc76cc3e9152e30f815ff1acaa4b45f7a60fe3e1836f0  versal-firmware-xilinx_v2023.1.tar.gz
diff --git a/boot/versal-firmware/versal-firmware.mk b/boot/versal-firmware/versal-firmware.mk
new file mode 100644
index 0000000000..ad4aad49ec
--- /dev/null
+++ b/boot/versal-firmware/versal-firmware.mk
@@ -0,0 +1,47 @@
+################################################################################
+#
+# versal-firmware
+#
+################################################################################
+
+VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_SITE = $(call github,Xilinx,embeddedsw,$(VERSAL_FIRMWARE_VERSION))
+VERSAL_FIRMWARE_LICENSE = MIT
+VERSAL_FIRMWARE_LICENSE_FILES = license.txt
+VERSAL_FIRMWARE_INSTALL_IMAGES = YES
+VERSAL_FIRMWARE_INSTALL_TARGET = NO
+VERSAL_FIRMWARE_DEPENDENCIES = host-newlib-bare-metal
+
+VERSAL_CFLAGS = "-Os -flto -ffat-lto-objects $(call qstrip,$(BR2_TARGET_VERSAL_FIRMWARE_CUSTOM_CFLAGS))"
+
+VERSAL_FIRMWARE_PDI = $(call qstrip,$(BR2_TARGET_VERSAL_FIRMWARE_PDI))
+
+ifneq ($(findstring ://,$(VERSAL_FIRMWARE_PDI)),)
+VERSAL_FIRMWARE_EXTRA_DOWNLOADS = $(VERSAL_FIRMWARE_PDI)
+BR_NO_CHECK_HASH_FOR += $(notdir $(VERSAL_FIRMWARE_PDI))
+VERSAL_FIRMWARE_PDI_PATH = $(VERSAL_FIRMWARE_DL_DIR)/$(notdir $(VERSAL_FIRMWARE_PDI))
+else ifneq ($(VERSAL_FIRMWARE_PDI),)
+VERSAL_FIRMWARE_PDI_PATH = $(shell readlink -f $(VERSAL_FIRMWARE_PDI))
+endif #VERSAL_FIRMWARE_PDI
+
+define VERSAL_FIRMWARE_BUILD_CMDS
+	$(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=$(VERSAL_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=$(VERSAL_CFLAGS)
+endef
+
+define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
+	$(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
+	$(INSTALL) -D -m 0755 $(VERSAL_FIRMWARE_PDI_PATH) $(BINARIES_DIR)/vpl_gen_fixed.pdi
+endef
+
+$(eval $(generic-package))
diff --git a/boot/versal-firmware/xilinx_v2023.1/0001-sw_apps-versal_plm-add-support-of-parallel-build.patch b/boot/versal-firmware/xilinx_v2023.1/0001-sw_apps-versal_plm-add-support-of-parallel-build.patch
new file mode 100644
index 0000000000..84fffc1d82
--- /dev/null
+++ b/boot/versal-firmware/xilinx_v2023.1/0001-sw_apps-versal_plm-add-support-of-parallel-build.patch
@@ -0,0 +1,157 @@
+From 245509f87776c7727973480f08ead6f293a2f3b2 Mon Sep 17 00:00:00 2001
+From: Neal Frager <neal.frager@amd.com>
+Date: Mon, 4 Sep 2023 07:08:02 +0100
+Subject: [PATCH 1/2] sw_apps:versal_plm: add support of parallel build
+
+The build fails when make command is invoked with -j option.
+The root cause is, BSP_SEQUENTIAL_MAKEFILES variable is not assigned
+and exported properly in copy_bsp.sh file. Also, the 'all' target in
+src/Makefile tries to compile the source code before bsp copy was
+finished when -j option is enabled during build.
+
+Added BSP_SEQUENTIAL_MAKEFILES in the misc/Makefile to resolve the
+export issue and corrected dependency in the src/Makefile to let the bsp
+copy finished before compiling the source.
+
+Signed-off-by: Duvvi Divya <Duvvi.Divya@xilinx.com>
+Acked-by: Sreedhar Kundella <sreedhar.k@xilinx.com>
+---
+ lib/sw_apps/versal_plm/misc/versal/Makefile    | 12 +++++++++++-
+ lib/sw_apps/versal_plm/misc/versal/copy_bsp.sh | 11 -----------
+ lib/sw_apps/versal_plm/src/versal/Makefile     |  2 ++
+ 3 files changed, 13 insertions(+), 12 deletions(-)
+
+diff --git a/lib/sw_apps/versal_plm/misc/versal/Makefile b/lib/sw_apps/versal_plm/misc/versal/Makefile
+index 5c8e719e9c..d735f64530 100644
+--- a/lib/sw_apps/versal_plm/misc/versal/Makefile
++++ b/lib/sw_apps/versal_plm/misc/versal/Makefile
+@@ -7,6 +7,16 @@ PROCESSOR = psv_pmc_0
+ LIBRARIES = ${PROCESSOR}/lib/libxil.a
+ BSP_MAKEFILES := $(wildcard $(PROCESSOR)/libsrc/*/src/Makefile)
+ SUBDIRS := $(patsubst %/Makefile, %, $(BSP_MAKEFILES))
++DRIVERS_LIST=../drivers.txt
++SEQUENTIAL_MAKEFILES := $(shell cat ${DRIVERS_LIST})
++BSP_SEQUENTIAL_MAKEFILES = $(patsubst %, ${PROCESSOR}/libsrc/%/src/Makefile, $(SEQUENTIAL_MAKEFILES))
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilffs/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilpdi/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilplmi/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilpuf/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilloader/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilnvm/src/Makefile
++BSP_SEQUENTIAL_MAKEFILES += ${PROCESSOR}/libsrc/xilsecure/src/Makefile
+ BSP_PARALLEL_MAKEFILES := $(filter-out $(BSP_SEQUENTIAL_MAKEFILES),$(BSP_MAKEFILES))
+ SEQ_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_SEQUENTIAL_MAKEFILES))
+ PAR_SUBDIRS := $(patsubst %/Makefile, %, $(BSP_PARALLEL_MAKEFILES))
+@@ -16,7 +26,7 @@ ifneq (,$(findstring win,$(RDI_PLATFORM)))
+ endif
+ 
+ all:
+-	$(MAKE) --no-print-directory seq_libs
++	$(MAKE) -j1 --no-print-directory seq_libs
+ 	$(MAKE) -j --no-print-directory par_libs
+ 	$(MAKE) --no-print-directory archive
+ 	@echo 'Finished building libraries'
+diff --git a/lib/sw_apps/versal_plm/misc/versal/copy_bsp.sh b/lib/sw_apps/versal_plm/misc/versal/copy_bsp.sh
+index 404e588ae2..244d36e2ee 100755
+--- a/lib/sw_apps/versal_plm/misc/versal/copy_bsp.sh
++++ b/lib/sw_apps/versal_plm/misc/versal/copy_bsp.sh
+@@ -29,7 +29,6 @@ STANDALONE_DIR=$EMBEDDED_SW_DIR/lib/bsp/standalone/src
+ 
+ # libraries dir
+ SERVICES_DIR=$EMBEDDED_SW_DIR/lib/sw_services
+-BSP_SEQUENTIAL_MAKEFILES=
+ 
+ # creation of BSP folders required
+ if [ -d $BSP_DIR ]; then
+@@ -52,7 +51,6 @@ fi
+ mkdir -p $BSP_DIR/libsrc/xilffs
+ cp -r $SERVICES_DIR/xilffs/src $BSP_DIR/libsrc/xilffs/
+ cp -r $SERVICES_DIR/xilffs/src/include/* $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilffs/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilpdi/src
+ cp -r $SERVICES_DIR/xilpdi/src/Makefile $BSP_DIR/libsrc/xilpdi/src
+@@ -60,7 +58,6 @@ cp -r $SERVICES_DIR/xilpdi/src/versal/* $BSP_DIR/libsrc/xilpdi/src/
+ cp -r $SERVICES_DIR/xilpdi/src/versal/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilpdi/src/common/* $BSP_DIR/libsrc/xilpdi/src/
+ cp -r $SERVICES_DIR/xilpdi/src/common/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilpdi/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilplmi/src
+ cp -r $SERVICES_DIR/xilplmi/src/Makefile $BSP_DIR/libsrc/xilplmi/src
+@@ -68,14 +65,12 @@ cp -r $SERVICES_DIR/xilplmi/src/versal/* $BSP_DIR/libsrc/xilplmi/src/
+ cp -r $SERVICES_DIR/xilplmi/src/versal/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilplmi/src/common/* $BSP_DIR/libsrc/xilplmi/src/
+ cp -r $SERVICES_DIR/xilplmi/src/common/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilplmi/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilpuf/src
+ cp -r $SERVICES_DIR/xilpuf/src/Makefile $BSP_DIR/libsrc/xilpuf/src
+ cp -r $SERVICES_DIR/xilpuf/src/common/* $BSP_DIR/libsrc/xilpuf/src
+ cp -r $SERVICES_DIR/xilpuf/src/server/* $BSP_DIR/libsrc/xilpuf/src
+ cp -r $BSP_DIR/libsrc/xilpuf/src/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilpuf/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilloader/src
+ cp -r $SERVICES_DIR/xilloader/src/Makefile $BSP_DIR/libsrc/xilloader/src
+@@ -83,7 +78,6 @@ cp -r $SERVICES_DIR/xilloader/src/versal/* $BSP_DIR/libsrc/xilloader/src/
+ cp -r $SERVICES_DIR/xilloader/src/versal/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilloader/src/common/* $BSP_DIR/libsrc/xilloader/src/
+ cp -r $SERVICES_DIR/xilloader/src/common/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilloader/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilpm/src/
+ cp -r $SERVICES_DIR/xilpm/src/versal/common/* $BSP_DIR/libsrc/xilpm/src/
+@@ -94,7 +88,6 @@ cp -r $SERVICES_DIR/xilpm/src/versal_common/server/* $BSP_DIR/libsrc/xilpm/src/
+ cp -r $SERVICES_DIR/xilpm/src/versal_common/server/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilpm/src/versal_common/common/*.h $BSP_DIR/include/
+ cp -r $SERVICES_DIR/xilpm/src/versal_common/common/* $BSP_DIR/libsrc/xilpm/src/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilpm/src/versal/common/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilnvm/src
+ cp -r $SERVICES_DIR/xilnvm/src/Makefile $BSP_DIR/libsrc/xilnvm/src
+@@ -103,7 +96,6 @@ cp -r $SERVICES_DIR/xilnvm/src/versal/server/* $BSP_DIR/libsrc/xilnvm/src/
+ cp -r $SERVICES_DIR/xilnvm/src/common/server/* $BSP_DIR/libsrc/xilnvm/src/
+ cp -r $SERVICES_DIR/xilnvm/src/common/* $BSP_DIR/libsrc/xilnvm/src/
+ cp $BSP_DIR/libsrc/xilnvm/src/*.h $BSP_DIR/include/
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilnvm/src/Makefile"
+ 
+ mkdir -p $BSP_DIR/libsrc/xilsecure/src
+ cp -r $SERVICES_DIR/xilsecure/src/Makefile $BSP_DIR/libsrc/xilsecure/src
+@@ -115,7 +107,6 @@ cp -r $SERVICES_DIR/xilsecure/src/versal/common/* $BSP_DIR/libsrc/xilsecure/src/
+ cp $BSP_DIR/libsrc/xilsecure/src/*.h $BSP_DIR/include/
+ mv $BSP_DIR/libsrc/xilsecure/src/libxilsecure_pmc.a $BSP_DIR/libsrc/xilsecure/src/libxilsecure.a
+ rm -f $BSP_DIR/libsrc/xilsecure/src/libxilsecure_*.a
+-BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/xilsecure/src/Makefile"
+ 
+ # copy bsp standalone code
+ cp -r $STANDALONE_DIR/common/*  $BSP_DIR/libsrc/standalone/src/
+@@ -144,7 +135,6 @@ do
+     cp -r $DRIVERS_DIR/$line/src/*.h $BSP_DIR/include/
+ # copy all the HSM generated driver files DRIVER_g.c
+ 	cp $WORKING_DIR/x"$line"_g.c $BSP_DIR/libsrc/$line/src/
+-	BSP_SEQUENTIAL_MAKEFILES="$BSP_SEQUENTIAL_MAKEFILES $BSP_DIR/libsrc/$line/src/Makefile"
+ done < $DRIVERS_LIST
+ 
+ #copy the processor code.
+@@ -176,4 +166,3 @@ cp $STANDALONE_DIR/microblaze/*.h  $BSP_DIR/include/
+ 
+ # no inbyte and outbyte present in standalone
+ cp $WORKING_DIR/inbyte.c $WORKING_DIR/outbyte.c  $BSP_DIR/libsrc/standalone/src/
+-export BSP_SEQUENTIAL_MAKEFILES
+diff --git a/lib/sw_apps/versal_plm/src/versal/Makefile b/lib/sw_apps/versal_plm/src/versal/Makefile
+index 15956c8a14..a944225845 100644
+--- a/lib/sw_apps/versal_plm/src/versal/Makefile
++++ b/lib/sw_apps/versal_plm/src/versal/Makefile
+@@ -32,6 +32,8 @@ all: $(EXEC)
+ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
+ 	$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)
+ 
++$(OBJS): $(LIBS)
++
+ $(LIBS):
+ 	echo "Copying BSP files"
+ 	../../misc/versal/copy_bsp.sh
+-- 
+2.25.1
+
diff --git a/boot/versal-firmware/xilinx_v2023.1/0002-sw_apps-versal_psmfw-add-support-of-parallel-build.patch b/boot/versal-firmware/xilinx_v2023.1/0002-sw_apps-versal_psmfw-add-support-of-parallel-build.patch
new file mode 100644
index 0000000000..7918f20946
--- /dev/null
+++ b/boot/versal-firmware/xilinx_v2023.1/0002-sw_apps-versal_psmfw-add-support-of-parallel-build.patch
@@ -0,0 +1,48 @@
+From 2ed864ef5965b7466fb145f479ce0747123f2ce0 Mon Sep 17 00:00:00 2001
+From: Neal Frager <neal.frager@amd.com>
+Date: Mon, 4 Sep 2023 07:14:38 +0100
+Subject: [PATCH 2/2] sw_apps:versal_psmfw: add support of parallel build
+
+The PSMFW build fails when make command is invoked with -j option.
+The root cause is, the 'all' target in src/Makefile tries to compile
+the source code before bsp copy was finished when -j option is
+enabled during build.
+
+Corrected dependency in the src/Makefile to let the bsp copy
+finished before compiling the source.
+
+Signed-off-by: Naman Trivedi Manojbhai <naman.trivedimanojbhai@amd.com>
+---
+ lib/sw_apps/versal_psmfw/misc/Makefile       | 2 +-
+ lib/sw_apps/versal_psmfw/src/versal/Makefile | 2 ++
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/lib/sw_apps/versal_psmfw/misc/Makefile b/lib/sw_apps/versal_psmfw/misc/Makefile
+index 02d85e492e..92d95d0896 100644
+--- a/lib/sw_apps/versal_psmfw/misc/Makefile
++++ b/lib/sw_apps/versal_psmfw/misc/Makefile
+@@ -17,7 +17,7 @@ ifneq (,$(findstring win,$(RDI_PLATFORM)))
+ endif
+ 
+ all:
+-	$(MAKE) --no-print-directory seq_libs
++	$(MAKE) -j1 --no-print-directory seq_libs
+ 	$(MAKE) -j --no-print-directory par_libs
+ 	$(MAKE) --no-print-directory archive
+ 	@echo 'Finished building libraries'
+diff --git a/lib/sw_apps/versal_psmfw/src/versal/Makefile b/lib/sw_apps/versal_psmfw/src/versal/Makefile
+index 1572bbbca9..3f1589283b 100644
+--- a/lib/sw_apps/versal_psmfw/src/versal/Makefile
++++ b/lib/sw_apps/versal_psmfw/src/versal/Makefile
+@@ -33,6 +33,8 @@ all: $(EXEC)
+ $(EXEC): $(LIBS) $(OBJS) $(INCLUDES)
+ 	$(CC) -o $@ $(OBJS) $(CC_FLAGS) $(CFLAGS) $(LN_FLAGS) $(LIBPATH) $(LSCRIPT)
+ 
++$(OBJS): $(LIBS)
++
+ $(LIBS):
+ 	echo "Copying BSP files"
+ 	../../misc/copy_bsp.sh
+-- 
+2.25.1
+
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (6 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:12   ` Luca Ceresoli via buildroot
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package Neal Frager via buildroot
  2023-10-16 10:11 ` [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Luca Ceresoli via buildroot
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch migrates the versal_vck190_defconfig to use the new
versal-firmware package for building the versal plm and psmfw from source.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 configs/versal_vck190_defconfig | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/configs/versal_vck190_defconfig b/configs/versal_vck190_defconfig
index e30bb35b74..78eaa02a28 100644
--- a/configs/versal_vck190_defconfig
+++ b/configs/versal_vck190_defconfig
@@ -32,9 +32,9 @@ BR2_TARGET_UBOOT_NEEDS_OPENSSL=y
 BR2_TARGET_UBOOT_NEEDS_GNUTLS=y
 BR2_TARGET_UBOOT_FORMAT_REMAKE_ELF=y
 BR2_TARGET_UBOOT_FORMAT_DTB=y
-BR2_PACKAGE_VERSAL_FIRMWARE=y
-BR2_PACKAGE_VERSAL_FIRMWARE_VERSION="xilinx_v2023.1"
-BR2_PACKAGE_VERSAL_FIRMWARE_BOARD="vck190"
+BR2_TARGET_VERSAL_FIRMWARE=y
+BR2_TARGET_VERSAL_FIRMWARE_VERSION="xilinx_v2023.1"
+BR2_TARGET_VERSAL_FIRMWARE_PDI="https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/vck190-versal/vpl_gen_fixed.pdi"
 BR2_PACKAGE_HOST_DOSFSTOOLS=y
 BR2_PACKAGE_HOST_GENIMAGE=y
 BR2_PACKAGE_HOST_MTOOLS=y
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (7 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
@ 2023-09-24 15:12 ` Neal Frager via buildroot
  2023-10-16 10:12   ` Luca Ceresoli via buildroot
  2023-10-16 10:11 ` [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Luca Ceresoli via buildroot
  9 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-24 15:12 UTC (permalink / raw)
  To: buildroot
  Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
	michal.simek

This patch removes the package/versal-firmware as this package is replaced
by the boot/versal-firmware target boot firmware package for versal.

Signed-off-by: Neal Frager <neal.frager@amd.com>
---
 DEVELOPERS                                 |  1 -
 package/Config.in                          |  1 -
 package/versal-firmware/Config.in          | 24 ----------------------
 package/versal-firmware/versal-firmware.mk | 21 -------------------
 4 files changed, 47 deletions(-)
 delete mode 100644 package/versal-firmware/Config.in
 delete mode 100644 package/versal-firmware/versal-firmware.mk

diff --git a/DEVELOPERS b/DEVELOPERS
index 1c66659b19..1c05a3e17f 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2190,7 +2190,6 @@ F:	package/binutils-bare-metal/
 F:	package/bootgen/
 F:	package/gcc-bare-metal/
 F:	package/newlib-bare-metal/
-F:	package/versal-firmware/
 F:	toolchain/toolchain-bare-metal/
 
 N:	Nicola Di Lieto <nicola.dilieto@gmail.com>
diff --git a/package/Config.in b/package/Config.in
index e8dbadadf3..55316edc7c 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -448,7 +448,6 @@ menu "Firmware"
 	source "package/sunxi-boards/Config.in"
 	source "package/ts4900-fpga/Config.in"
 	source "package/ux500-firmware/Config.in"
-	source "package/versal-firmware/Config.in"
 	source "package/wilc-firmware/Config.in"
 	source "package/wilink-bt-firmware/Config.in"
 	source "package/zd1211-firmware/Config.in"
diff --git a/package/versal-firmware/Config.in b/package/versal-firmware/Config.in
deleted file mode 100644
index 01daefd204..0000000000
--- a/package/versal-firmware/Config.in
+++ /dev/null
@@ -1,24 +0,0 @@
-config BR2_PACKAGE_VERSAL_FIRMWARE
-	bool "versal-firmware"
-	depends on BR2_aarch64
-	help
-	  Pre-built firmware files for Xilinx Versal boards.
-
-	  https://github.com/Xilinx/soc-prebuilt-firmware
-
-if BR2_PACKAGE_VERSAL_FIRMWARE
-
-config BR2_PACKAGE_VERSAL_FIRMWARE_VERSION
-	string "firmware version"
-	default "xilinx_v2023.1"
-	help
-	  Release version of Versal firmware.
-
-config BR2_PACKAGE_VERSAL_FIRMWARE_BOARD
-	string "board name"
-	default "vck190"
-	help
-	  Name of Versal target board.
-	  Used for installing the appropriate firmware.
-
-endif # BR2_PACKAGE_VERSAL_FIRMWARE
diff --git a/package/versal-firmware/versal-firmware.mk b/package/versal-firmware/versal-firmware.mk
deleted file mode 100644
index 1ced259be1..0000000000
--- a/package/versal-firmware/versal-firmware.mk
+++ /dev/null
@@ -1,21 +0,0 @@
-################################################################################
-#
-# versal-firmware
-#
-################################################################################
-
-VERSAL_FIRMWARE_VERSION = $(call qstrip,$(BR2_PACKAGE_VERSAL_FIRMWARE_VERSION))
-VERSAL_FIRMWARE_SITE = $(call github,Xilinx,soc-prebuilt-firmware,$(VERSAL_FIRMWARE_VERSION))
-VERSAL_FIRMWARE_LICENSE = MIT
-VERSAL_FIRMWARE_LICENSE_FILES = LICENSE
-VERSAL_FIRMWARE_INSTALL_TARGET = NO
-VERSAL_FIRMWARE_INSTALL_IMAGES = YES
-
-define VERSAL_FIRMWARE_INSTALL_IMAGES_CMDS
-	$(foreach f,plm.elf psmfw.elf vpl_gen_fixed.pdi,\
-		$(INSTALL) -D -m 0755 $(@D)/$(BR2_PACKAGE_VERSAL_FIRMWARE_BOARD)-versal/$(f) \
-			$(BINARIES_DIR)/$(f)
-	)
-endef
-
-$(eval $(generic-package))
-- 
2.25.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package
  2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
                   ` (8 preceding siblings ...)
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package Neal Frager via buildroot
@ 2023-10-16 10:11 ` Luca Ceresoli via buildroot
  9 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:11 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

Hi Neal, Ibai,

On Sun, 24 Sep 2023 16:11:56 +0100
Neal Frager <neal.frager@amd.com> wrote:

> +# if toolchain is for microblazeel-xilinx, apply Xilinx patch set
> +ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
> +HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS = https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2023.1.tar.gz
> +
> +define HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES
> +  mkdir -p $(@D)/patches
> +  tar -xf $(HOST_BINUTILS_BARE_METAL_DL_DIR)/xlnx-rel-v2023.1.tar.gz \
> +      --strip-components=5 \
> +      -C $(@D)/patches \
> +      meta-xilinx-xlnx-rel-v2023.1/meta-microblaze/recipes-devtools/binutils/binutils
> +endef
> +HOST_BINUTILS_BARE_METAL_POST_EXTRACT_HOOKS += HOST_BINUTILS_BARE_METAL_EXTRACT_PATCHES

I think all the patches needed to build zynqmp firmwares are now in
mainline, right? (which is a great thing!!) If it is the case, then you
should probably remove all this tarball mangling and just add the
relevant patches as regular package/*/*.patch files, both for binutils
and for gcc.

> +
> +define HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
> +	$(APPLY_PATCHES) $(@D) $(@D)/patches *.patch;
> +endef
> +HOST_BINUTILS_BARE_METAL_POST_PATCH_HOOKS += HOST_BINUTILS_BARE_METAL_APPLY_LOCAL_PATCHES
> +endif #ifeq ($(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH),"microblazeel-xilinx")
> +
> +# Don't build documentation. It takes up extra space / build time,
> +# and sometimes needs specific makeinfo versions to work
> +HOST_BINUTILS_BARE_METAL_CONF_ENV += MAKEINFO=true
> +HOST_BINUTILS_BARE_METAL_MAKE_OPTS += MAKEINFO=true
> +HOST_BINUTILS_BARE_METAL_INSTALL_OPTS += MAKEINFO=true install
> +
> +HOST_BINUTILS_BARE_METAL_CONF_OPTS = \
> +	--target=$(BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH)-elf \

As pointed out in v3, this patch series is not bisectable due to the
chicken-egg loop on BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL_ARCH, which
is added in patch 4 and used in patches 1-3. I don't know how this
could be better handled, thus if the maintainers have no objections I
also won't have any.

Otherwise LGTM.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: new package
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
@ 2023-10-16 10:11   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:11 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

Hi Neal, Ibai,

On Sun, 24 Sep 2023 16:11:57 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch adds a new package for building gcc for a bare-metal toolchain.
> The cpu architecture is defined by a toolchain-bare-metal virtual package.
> While any cpu architecture could be used, the default configuration will be a
> Xilinx microblaze little endian architecture, so that buildroot will be able
> to build the microblaze firmware applications for zynqmp and versal.
> 
> When configured for the Xilinx microblaze architecture, all of the gcc
> patches that are applied to the Xilinx distributed toolchain will be applied
> in order to generate a toolchain that is equivalent to what Xilinx distributes.
> 
> Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
> Signed-off-by: Neal Frager <neal.frager@amd.com>

...

> --- /dev/null
> +++ b/package/gcc-bare-metal/gcc-bare-metal.mk
> @@ -0,0 +1,70 @@
> +################################################################################
> +#
> +# gcc-bare-metal
> +#
> +################################################################################
> +
> +HOST_GCC_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION))
> +ifeq ($(HOST_GCC_BARE_METAL_VERSION),)
> +HOST_GCC_BARE_METAL_VERSION = 12.2.0
> +endif
> +
> +HOST_GCC_BARE_METAL_SITE = https://ftp.gnu.org/gnu/gcc/gcc-$(HOST_GCC_BARE_METAL_VERSION)
> +HOST_GCC_BARE_METAL_SOURCE = gcc-$(HOST_GCC_BARE_METAL_VERSION).tar.xz
> +
> +HOST_GCC_BARE_METAL_DEPENDENCIES = host-binutils-bare-metal host-gmp host-mpc host-mpfr host-isl

Missing _LICENSE.

Otherwise LGTM.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: new package
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
@ 2023-10-16 10:11   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:11 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:11:58 +0100
Neal Frager <neal.frager@amd.com> wrote:

> --- /dev/null
> +++ b/package/newlib-bare-metal/newlib-bare-metal.mk
> @@ -0,0 +1,27 @@
> +################################################################################
> +#
> +# newlib-bare-metal
> +#
> +################################################################################
> +
> +HOST_NEWLIB_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_VERSION))
> +ifeq ($(HOST_NEWLIB_BARE_METAL_VERSION),)
> +HOST_NEWLIB_BARE_METAL_VERSION = 4.1.0
> +endif
> +
> +HOST_NEWLIB_BARE_METAL_SITE = ftp://sourceware.org/pub/newlib
> +HOST_NEWLIB_BARE_METAL_SOURCE = newlib-$(HOST_NEWLIB_BARE_METAL_VERSION).tar.gz
> +HOST_NEWLIB_BARE_METAL_DEPENDENCIES = host-gcc-bare-metal

Missing _LICENSE.

Otherwise LGTM.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain
  2023-09-24 15:11 ` [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain Neal Frager via buildroot
@ 2023-10-16 10:11   ` Luca Ceresoli via buildroot
  2023-10-18 12:46     ` Frager, Neal via buildroot
  0 siblings, 1 reply; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:11 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:11:59 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch adds a new virtual package for adding a bare-metal toolchain to
> buildroot.  By default, this package will configure a bare-metal toolchain
> for the Xilinx microblaze little endian architecture.  When configured for
> the Xilinx microblaze architecture, this toolchain can be used to build the
> microblaze firmware applications for zynqmp and versal.
> 
> Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
>  - adds select option to bring in all packages needed for toolchain-bare-metal
> V2->V3:
>  - no changes
> V3->V4:
>  - moved from package to toolchain directory
>  - improved menuconfig help comment
> ---
>  DEVELOPERS                                    |  2 ++
>  toolchain/Config.in                           |  1 +
>  toolchain/toolchain-bare-metal/Config.in      | 21 +++++++++++++++++++
>  .../toolchain-bare-metal.mk                   |  7 +++++++

I wonder whether this should be in
toolchain/toolchain-bare-metal-toolchain to make room for a future
toolchain/toolchain-bare-metal-external.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
@ 2023-10-16 10:11   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:11 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:00 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch adds a new boot firmware to buildroot for building the zynqmp pmufw.
> It requires the toolchain-bare-metal package that includes a bare-metal
> binutils, gcc and newlib which can be built for the microblaze architecture.
> 
> A patch is required to enable parallel building of the pmufw.  This patch has
> been submitted upstream internally at AMD / Xilinx and will be included with
> the 2023.2 release of the embeddedsw repository.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2023-10-16 10:12   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:12 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:01 +0100
Neal Frager <neal.frager@amd.com> wrote:

> The new BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option will enable u-boot to
> use the zynqmp-firmware package for building a pmufw.elf that gets included in
> the generated boot.bin.
> 
> If the BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE option is enabled, then the
> BR2_TARGET_UBOOT_ZYNQMP_PMUFW config for downloading a prebuilt pmufw will
> be ignored.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
@ 2023-10-16 10:12   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:12 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:02 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch migrates the zynqmp config files to use the new
> zynqmp-firmware package for building the zynqmp pmufw from source.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
@ 2023-10-16 10:12   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:12 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:03 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch adds a new boot firmware to buildroot for building the versal plm
> and psmfw.  It requires the toolchain-bare-metal package that includes a
> bare-metal binutils, gcc and newlib which can be built for the microblaze
> architecture.
> 
> A patch is required to enable parallel building of the versal plm and psmfw
> applications.  These two patches have been submitted upstream internally at
> AMD / Xilinx and will be included with the 2023.2 release of the embeddedsw
> repository.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
>  DEVELOPERS                                    |   1 +
>  boot/Config.in                                |   1 +
>  boot/versal-firmware/Config.in                |  34 ++++
>  boot/versal-firmware/versal-firmware.hash     |   2 +
>  boot/versal-firmware/versal-firmware.mk       |  47 ++++++
>  ...al_plm-add-support-of-parallel-build.patch | 157 ++++++++++++++++++
>  ..._psmfw-add-support-of-parallel-build.patch |  48 ++++++
>  7 files changed, 290 insertions(+)
>  create mode 100644 boot/versal-firmware/Config.in
>  create mode 100644 boot/versal-firmware/versal-firmware.hash
>  create mode 100644 boot/versal-firmware/versal-firmware.mk
>  create mode 100644 boot/versal-firmware/xilinx_v2023.1/0001-sw_apps-versal_plm-add-support-of-parallel-build.patch
>  create mode 100644 boot/versal-firmware/xilinx_v2023.1/0002-sw_apps-versal_psmfw-add-support-of-parallel-build.patch
> 
> diff --git a/DEVELOPERS b/DEVELOPERS
> index c9e87818d4..1c66659b19 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -2179,6 +2179,7 @@ N:	Neal Frager <neal.frager@amd.com>
>  F:	board/versal/
>  F:	board/zynq/
>  F:	board/zynqmp/
> +F:	boot/versal-firmware/
>  F:	boot/zynqmp-firmware/
>  F:	configs/versal_vck190_defconfig
>  F:	configs/zynq_zc706_defconfig
> diff --git a/boot/Config.in b/boot/Config.in
> index c7478fef2e..da5ccb6b9c 100644
> --- a/boot/Config.in
> +++ b/boot/Config.in
> @@ -23,6 +23,7 @@ source "boot/ti-k3-boot-firmware/Config.in"
>  source "boot/ti-k3-image-gen/Config.in"
>  source "boot/ti-k3-r5-loader/Config.in"
>  source "boot/uboot/Config.in"
> +source "boot/versal-firmware/Config.in"
>  source "boot/vexpress-firmware/Config.in"
>  source "boot/zynqmp-firmware/Config.in"
>  
> diff --git a/boot/versal-firmware/Config.in b/boot/versal-firmware/Config.in
> new file mode 100644
> index 0000000000..34279f84b8
> --- /dev/null
> +++ b/boot/versal-firmware/Config.in
> @@ -0,0 +1,34 @@
> +config BR2_TARGET_VERSAL_FIRMWARE
> +	bool "versal-firmware"
> +	select BR2_PACKAGE_HOST_TOOLCHAIN_BARE_METAL
> +	help
> +	  This package builds the boot firmware apps for Xilinx versal
> +	  boards, so that they can boot u-boot and Linux.
> +
> +if BR2_TARGET_VERSAL_FIRMWARE
> +
> +config BR2_TARGET_VERSAL_FIRMWARE_VERSION
> +	string "firmware version"
> +	default "xilinx_v2023.1"
> +	help
> +	  Release version of versal firmware.
> +	  Only versions xilinx_v2023.1 and newer are supported.
> +	  
> +config BR2_TARGET_VERSAL_FIRMWARE_CUSTOM_CFLAGS
> +	string "custom cflags"
> +	help
> +	  Adds additional CFLAGS for building versal firmware.
> +
> +config BR2_TARGET_VERSAL_FIRMWARE_PDI
> +	string "pdi file location"
> +	default "https://github.com/Xilinx/soc-prebuilt-firmware/raw/xilinx_v2023.1/vck190-versal/vpl_gen_fixed.pdi"
> +	help
> +	  The PDI file defines everything which is board specific for versal.
> +	  It gets parsed by the plm.elf during boot.  To boot a custom target
> +	  based on versal, this should be configured to point to your Vivado
> +	  generated PDI file.
> +	  
> +	  This config should never be undefined, so default configuration is
> +	  for the vck190 evaluation board.

The help text should mention that this can be a URL for download or a
local file.

Looks good otherwise.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
@ 2023-10-16 10:12   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:12 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:04 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch migrates the versal_vck190_defconfig to use the new
> versal-firmware package for building the versal plm and psmfw from source.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package
  2023-09-24 15:12 ` [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package Neal Frager via buildroot
@ 2023-10-16 10:12   ` Luca Ceresoli via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-16 10:12 UTC (permalink / raw)
  To: Neal Frager
  Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot

On Sun, 24 Sep 2023 16:12:05 +0100
Neal Frager <neal.frager@amd.com> wrote:

> This patch removes the package/versal-firmware as this package is replaced
> by the boot/versal-firmware target boot firmware package for versal.
> 
> Signed-off-by: Neal Frager <neal.frager@amd.com>

Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain
  2023-10-16 10:11   ` Luca Ceresoli via buildroot
@ 2023-10-18 12:46     ` Frager, Neal via buildroot
  2023-10-19  7:19       ` Luca Ceresoli via buildroot
  0 siblings, 1 reply; 23+ messages in thread
From: Frager, Neal via buildroot @ 2023-10-18 12:46 UTC (permalink / raw)
  To: Luca Ceresoli, thomas.petazzoni@bootlin.com
  Cc: Erkiaga Elorza, Ibai, Simek, Michal, buildroot@buildroot.org

Hi Luca,

> This patch adds a new virtual package for adding a bare-metal 
> toolchain to buildroot.  By default, this package will configure a 
> bare-metal toolchain for the Xilinx microblaze little endian 
> architecture.  When configured for the Xilinx microblaze architecture, 
> this toolchain can be used to build the microblaze firmware applications for zynqmp and versal.
> 
> Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
> Signed-off-by: Neal Frager <neal.frager@amd.com>
> ---
> V1->V2:
>  - adds select option to bring in all packages needed for 
> toolchain-bare-metal
> V2->V3:
>  - no changes
> V3->V4:
>  - moved from package to toolchain directory
>  - improved menuconfig help comment
> ---
>  DEVELOPERS                                    |  2 ++
>  toolchain/Config.in                           |  1 +
>  toolchain/toolchain-bare-metal/Config.in      | 21 +++++++++++++++++++
>  .../toolchain-bare-metal.mk                   |  7 +++++++

> I wonder whether this should be in
> toolchain/toolchain-bare-metal-toolchain to make room for a future toolchain/toolchain-bare-metal-external.

What is the value of adding another toolchain in the name?

For example:

Internal Toolchains:
toolchain-bare-metal
toolchain-buildroot

External Toolchains:
toolchain-bare-metal-external
toolchain-external

If anything, I could argue that we should then rename 'toolchain-external' to 'toolchain-buildroot-external'.

That would give us the following:

Internal Toolchains:
toolchain-bare-metal
toolchain-buildroot

External Toolchains:
toolchain-bare-metal-external
toolchain-buildroot-external

What do you think?

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain
  2023-10-18 12:46     ` Frager, Neal via buildroot
@ 2023-10-19  7:19       ` Luca Ceresoli via buildroot
       [not found]         ` <MN0PR12MB6004F504CD8806653C2D244BA0D4A@MN0PR12MB6004.namprd12.prod.outlook.com>
  0 siblings, 1 reply; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-10-19  7:19 UTC (permalink / raw)
  To: Frager, Neal
  Cc: Erkiaga Elorza, Ibai, Simek, Michal, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org

Hi Neal,

On Wed, 18 Oct 2023 12:46:40 +0000
"Frager, Neal" <neal.frager@amd.com> wrote:

> Hi Luca,
> 
> > This patch adds a new virtual package for adding a bare-metal 
> > toolchain to buildroot.  By default, this package will configure a 
> > bare-metal toolchain for the Xilinx microblaze little endian 
> > architecture.  When configured for the Xilinx microblaze architecture, 
> > this toolchain can be used to build the microblaze firmware applications for zynqmp and versal.
> > 
> > Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
> > Signed-off-by: Neal Frager <neal.frager@amd.com>
> > ---
> > V1->V2:
> >  - adds select option to bring in all packages needed for 
> > toolchain-bare-metal
> > V2->V3:
> >  - no changes
> > V3->V4:
> >  - moved from package to toolchain directory
> >  - improved menuconfig help comment
> > ---
> >  DEVELOPERS                                    |  2 ++
> >  toolchain/Config.in                           |  1 +
> >  toolchain/toolchain-bare-metal/Config.in      | 21 +++++++++++++++++++
> >  .../toolchain-bare-metal.mk                   |  7 +++++++  
> 
> > I wonder whether this should be in
> > toolchain/toolchain-bare-metal-toolchain to make room for a future toolchain/toolchain-bare-metal-external.  
> 
> What is the value of adding another toolchain in the name?
> 
> For example:
> 
> Internal Toolchains:
> toolchain-bare-metal
> toolchain-buildroot
> 
> External Toolchains:
> toolchain-bare-metal-external
> toolchain-external
> 
> If anything, I could argue that we should then rename 'toolchain-external' to 'toolchain-buildroot-external'.
> 
> That would give us the following:
> 
> Internal Toolchains:
> toolchain-bare-metal
> toolchain-buildroot
> 
> External Toolchains:
> toolchain-bare-metal-external
> toolchain-buildroot-external
> 
> What do you think?

My understanding of the current naming is that the "buildroot" suffix
means "built by Buildroot as part of the build" while "external" means
"already built, by whatever tool". Ans as such the toolchains are
currently named toolchain-{buildroot,external}.

Following this line of thought, the bare-metal toolchains would be
called toolchain-bare-metal-{buildroot,external}.

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

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain
       [not found]         ` <MN0PR12MB6004F504CD8806653C2D244BA0D4A@MN0PR12MB6004.namprd12.prod.outlook.com>
@ 2023-10-19  8:13           ` Frager, Neal via buildroot
  0 siblings, 0 replies; 23+ messages in thread
From: Frager, Neal via buildroot @ 2023-10-19  8:13 UTC (permalink / raw)
  To: Erkiaga Elorza, Ibai, Luca Ceresoli
  Cc: Simek, Michal, thomas.petazzoni@bootlin.com,
	buildroot@buildroot.org

[AMD Official Use Only - General]

Hi Ibai, Luca,

> >
> > > This patch adds a new virtual package for adding a bare-metal
> > > toolchain to buildroot.  By default, this package will configure a
> > > bare-metal toolchain for the Xilinx microblaze little endian
> > > architecture.  When configured for the Xilinx microblaze
> > > architecture, this toolchain can be used to build the microblaze
> > > firmware
> applications for zynqmp and versal.
> > >
> > > Signed-off-by: Ibai Erkiaga-Elorza <ibai.erkiaga-elorza@amd.com>
> > > Signed-off-by: Neal Frager <neal.frager@amd.com>
> > > ---
> > > V1->V2:
> > >  - adds select option to bring in all packages needed for
> > > toolchain-bare-metal
> > > V2->V3:
> > >  - no changes
> > > V3->V4:
> > >  - moved from package to toolchain directory
> > >  - improved menuconfig help comment
> > > ---
> > >  DEVELOPERS                                    |  2 ++
> > >  toolchain/Config.in                           |  1 +
> > >  toolchain/toolchain-bare-metal/Config.in      | 21 +++++++++++++++++++
> > >  .../toolchain-bare-metal.mk                   |  7 +++++++
> >
> > > I wonder whether this should be in
> > > toolchain/toolchain-bare-metal-toolchain to make room for a future
> toolchain/toolchain-bare-metal-external.
> >
> > What is the value of adding another toolchain in the name?
> >
> > For example:
> >
> > Internal Toolchains:
> > toolchain-bare-metal
> > toolchain-buildroot
> >
> > External Toolchains:
> > toolchain-bare-metal-external
> > toolchain-external
> >
> > If anything, I could argue that we should then rename
> > 'toolchain-external' to
> 'toolchain-buildroot-external'.
> >
> > That would give us the following:
> >
> > Internal Toolchains:
> > toolchain-bare-metal
> > toolchain-buildroot
> >
> > External Toolchains:
> > toolchain-bare-metal-external
> > toolchain-buildroot-external
> >
> > What do you think?
>
> My understanding of the current naming is that the "buildroot" suffix
> means "built by Buildroot as part of the build" while "external" means
> "already built, by whatever tool". Ans as such the toolchains are
> currently named toolchain- {buildroot,external}.
>
> Following this line of thought, the bare-metal toolchains would be
> called toolchain-bare-metal-{buildroot,external}.
>

> I agree with Luca's view on this.

Yes, this is indeed a clearer explanation.  I will move the toolchain to toolchain-bare-metal-buildroot to leave room for a future toolchain-bare-metal-external solution.

I will implement this in v6.  In the meantime, could you review v5 thoroughly to verify that nothing else requires a change?

Thank you for your review!

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2023-10-19  8:13 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-24 15:11 [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 02/10] package/gcc-bare-metal: " Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 03/10] package/newlib-bare-metal: " Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:11 ` [Buildroot] [PATCH v4 04/10] toolchain/toolchain-bare-metal: new toolchain Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-10-18 12:46     ` Frager, Neal via buildroot
2023-10-19  7:19       ` Luca Ceresoli via buildroot
     [not found]         ` <MN0PR12MB6004F504CD8806653C2D244BA0D4A@MN0PR12MB6004.namprd12.prod.outlook.com>
2023-10-19  8:13           ` Frager, Neal via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 05/10] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
2023-10-16 10:11   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 06/10] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 07/10] configs/zynqmp*: build pmufw source Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 08/10] boot/versal-firmware: new boot firmware Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 09/10] configs/versal_vck190_defconfig: build plm and psmfw source Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-09-24 15:12 ` [Buildroot] [PATCH v4 10/10] package/versal-firmware: remove package Neal Frager via buildroot
2023-10-16 10:12   ` Luca Ceresoli via buildroot
2023-10-16 10:11 ` [Buildroot] [PATCH v4 01/10] package/binutils-bare-metal: new package Luca Ceresoli via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox