* [Buildroot] [PATCH v3 2/6] package/gcc-bare-metal: new package
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
@ 2023-09-04 10:04 ` Neal Frager via buildroot
2023-09-22 12:53 ` Luca Ceresoli via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 3/6] package/newlib-bare-metal: " Neal Frager via buildroot
` (4 subsequent siblings)
5 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-04 10:04 UTC (permalink / raw)
To: buildroot
Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
michal.simek
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 6095 bytes --]
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
---
DEVELOPERS | 2 +
package/gcc-bare-metal/Config.in.host | 18 ++++++
package/gcc-bare-metal/gcc-bare-metal.hash | 5 ++
package/gcc-bare-metal/gcc-bare-metal.mk | 67 ++++++++++++++++++++++
4 files changed, 92 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 1ebdf0a2c9..9fc597da07 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1329,6 +1329,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/
@@ -2196,6 +2197,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..9e28e862ec
--- /dev/null
+++ b/package/gcc-bare-metal/Config.in.host
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_GCC_BARE_METAL
+ bool "host gcc-bare-metal"
+ help
+ gcc-bare-metal is a host utility 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"
+
+config BR2_PACKAGE_HOST_GCC_BARE_METAL_EXTRA_CONFIG_OPTIONS
+ string "Additional gcc options"
+ default ""
+ help
+ Any additional gcc options you may want to include.
+
+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..d505540bf9
--- /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 computed
+sha512 bf3561c3495dd112b269a2c21dd758c1e5e7a73f959052f63511313e44222ce85b8db81e8de3b60b2c0bb8668ee834ac85036517fb6970e06fe352765dd127d0 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..fd84450007
--- /dev/null
+++ b/package/gcc-bare-metal/gcc-bare-metal.mk
@@ -0,0 +1,67 @@
+################################################################################
+#
+# gcc-bare-metal
+#
+################################################################################
+
+HOST_GCC_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_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
+
+# 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
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
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 v3 2/6] package/gcc-bare-metal: new package
2023-09-04 10:04 ` [Buildroot] [PATCH v3 2/6] package/gcc-bare-metal: " Neal Frager via buildroot
@ 2023-09-22 12:53 ` Luca Ceresoli via buildroot
0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:53 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
On Mon, 4 Sep 2023 11:04:39 +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>
> ---
> V1->V2:
> - removed default enable to be replaced with toolchain select config
> V2->V3:
> - no changes
> ---
> DEVELOPERS | 2 +
> package/gcc-bare-metal/Config.in.host | 18 ++++++
> package/gcc-bare-metal/gcc-bare-metal.hash | 5 ++
> package/gcc-bare-metal/gcc-bare-metal.mk | 67 ++++++++++++++++++++++
> 4 files changed, 92 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 1ebdf0a2c9..9fc597da07 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1329,6 +1329,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/
> @@ -2196,6 +2197,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..9e28e862ec
> --- /dev/null
> +++ b/package/gcc-bare-metal/Config.in.host
> @@ -0,0 +1,18 @@
> +config BR2_PACKAGE_HOST_GCC_BARE_METAL
> + bool "host gcc-bare-metal"
> + help
> + gcc-bare-metal is a host utility for a bare-metal toolchain
"Build GCC for a bare-metal toolchain" seems fore accurate.
> +
> +if BR2_PACKAGE_HOST_GCC_BARE_METAL
> +
> +config BR2_PACKAGE_HOST_GCC_BARE_METAL_VERSION
> + string
> + default "12.2.0"
> +
> +config BR2_PACKAGE_HOST_GCC_BARE_METAL_EXTRA_CONFIG_OPTIONS
> + string "Additional gcc options"
> + default ""
> + help
> + Any additional gcc options you may want to include.
> +
> +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..d505540bf9
> --- /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 computed
> +sha512 bf3561c3495dd112b269a2c21dd758c1e5e7a73f959052f63511313e44222ce85b8db81e8de3b60b2c0bb8668ee834ac85036517fb6970e06fe352765dd127d0 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..fd84450007
> --- /dev/null
> +++ b/package/gcc-bare-metal/gcc-bare-metal.mk
> @@ -0,0 +1,67 @@
> +################################################################################
> +#
> +# gcc-bare-metal
> +#
> +################################################################################
> +
> +HOST_GCC_BARE_METAL_VERSION = $(call qstrip,$(BR2_PACKAGE_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
Using '?=' in these two lines seems useless, you should use '='.
> +
> +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
Same concerns as those I expressed for patch 1. Some of the gcc patches
look really not well maintained too, such as patch 1 introducing an
obvious mistake and patch 3 fixing it, what about squashing them?
> +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
> +
> +# gcc doesn't support in-tree build, so we create a 'build'
> +# subdirectory in the gcc sources, and build from there.
This comment is actually more useful than the on in gcc.mk from which I
guess you took inspiration. Thanks! You may want to replace the
original comment in gcc.mk with your version.
Otherwise looks good.
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
* [Buildroot] [PATCH v3 3/6] package/newlib-bare-metal: new package
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 2/6] package/gcc-bare-metal: " Neal Frager via buildroot
@ 2023-09-04 10:04 ` Neal Frager via buildroot
2023-09-22 12:54 ` Luca Ceresoli via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 4/6] package/toolchain-bare-metal: " Neal Frager via buildroot
` (3 subsequent siblings)
5 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-04 10:04 UTC (permalink / raw)
To: buildroot
Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
michal.simek
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 4783 bytes --]
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
---
DEVELOPERS | 2 ++
package/newlib-bare-metal/Config.in.host | 18 ++++++++++++
.../newlib-bare-metal/newlib-bare-metal.hash | 8 +++++
.../newlib-bare-metal/newlib-bare-metal.mk | 29 +++++++++++++++++++
4 files changed, 57 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 9fc597da07..b8daa9183a 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1330,6 +1330,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/
@@ -2198,6 +2199,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..3bbf62e3fc
--- /dev/null
+++ b/package/newlib-bare-metal/Config.in.host
@@ -0,0 +1,18 @@
+config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
+ bool "host newlib-bare-metal"
+ help
+ newlib-bare-metal is a host utility 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"
+
+config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS
+ string "Additional newlib options"
+ default ""
+ help
+ Any additional newlib options you may want to include.
+
+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..b1966c3055
--- /dev/null
+++ b/package/newlib-bare-metal/newlib-bare-metal.hash
@@ -0,0 +1,8 @@
+# Locally calculated (fetched from Github)
+sha256 f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154 newlib-4.1.0.tar.gz
+
+# Hashes for license files
+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..a0a22bd6d9
--- /dev/null
+++ b/package/newlib-bare-metal/newlib-bare-metal.mk
@@ -0,0 +1,29 @@
+################################################################################
+#
+# 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_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS))
+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 \
+ $(NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS)
+
+$(eval $(host-autotools-package))
--
2.25.1
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
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 v3 3/6] package/newlib-bare-metal: new package
2023-09-04 10:04 ` [Buildroot] [PATCH v3 3/6] package/newlib-bare-metal: " Neal Frager via buildroot
@ 2023-09-22 12:54 ` Luca Ceresoli via buildroot
0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:54 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
On Mon, 4 Sep 2023 11:04:40 +0100
Neal Frager <neal.frager@amd.com> wrote:
> 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
> ---
> DEVELOPERS | 2 ++
> package/newlib-bare-metal/Config.in.host | 18 ++++++++++++
> .../newlib-bare-metal/newlib-bare-metal.hash | 8 +++++
> .../newlib-bare-metal/newlib-bare-metal.mk | 29 +++++++++++++++++++
> 4 files changed, 57 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 9fc597da07..b8daa9183a 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1330,6 +1330,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/
> @@ -2198,6 +2199,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..3bbf62e3fc
> --- /dev/null
> +++ b/package/newlib-bare-metal/Config.in.host
> @@ -0,0 +1,18 @@
> +config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
> + bool "host newlib-bare-metal"
> + help
> + newlib-bare-metal is a host utility for a bare-metal toolchain
"Build the newlib C library for a bare-metal toolchain" seems fore accurate.
> +
> +if BR2_PACKAGE_HOST_NEWLIB_BARE_METAL
> +
> +config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_VERSION
> + string
> + default "4.1.0"
> +
> +config BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS
> + string "Additional newlib options"
> + default ""
> + help
> + Any additional newlib options you may want to include.
> +
> +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..b1966c3055
> --- /dev/null
> +++ b/package/newlib-bare-metal/newlib-bare-metal.hash
> @@ -0,0 +1,8 @@
> +# Locally calculated (fetched from Github)
Github? The download site is sourceware.org.
> +sha256 f296e372f51324224d387cc116dc37a6bd397198756746f93a2b02e9a5d40154 newlib-4.1.0.tar.gz
> +
> +# Hashes for license files
> +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..a0a22bd6d9
> --- /dev/null
> +++ b/package/newlib-bare-metal/newlib-bare-metal.mk
> @@ -0,0 +1,29 @@
> +################################################################################
> +#
> +# 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
Using '?=' in these two lines seems useless, you should use '='.
> +HOST_NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS = $(call qstrip,$(BR2_PACKAGE_HOST_NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS))
> +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 \
> + $(NEWLIB_BARE_METAL_EXTRA_CONFIG_OPTIONS)
> +
> +$(eval $(host-autotools-package))
--
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
* [Buildroot] [PATCH v3 4/6] package/toolchain-bare-metal: new package
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 2/6] package/gcc-bare-metal: " Neal Frager via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 3/6] package/newlib-bare-metal: " Neal Frager via buildroot
@ 2023-09-04 10:04 ` Neal Frager via buildroot
2023-09-22 12:55 ` Luca Ceresoli via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 5/6] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
` (2 subsequent siblings)
5 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-04 10:04 UTC (permalink / raw)
To: buildroot
Cc: ibai.erkiaga-elorza, luca.ceresoli, thomas.petazzoni, Neal Frager,
michal.simek
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="y", Size: 3580 bytes --]
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/
---
DEVELOPERS | 2 ++
package/Config.in.host | 1 +
package/toolchain-bare-metal/Config.in.host | 21 +++++++++++++++++++
.../toolchain-bare-metal.mk | 7 +++++++
4 files changed, 31 insertions(+)
create mode 100644 package/toolchain-bare-metal/Config.in.host
create mode 100644 package/toolchain-bare-metal/toolchain-bare-metal.mk
diff --git a/DEVELOPERS b/DEVELOPERS
index b8daa9183a..5978d79a06 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -1331,6 +1331,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: package/toolchain-bare-metal/
N: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
F: package/angularjs/
@@ -2200,6 +2201,7 @@ F: package/binutils-bare-metal/
F: package/bootgen/
F: package/gcc-bare-metal/
F: package/newlib-bare-metal/
+F: package/toolchain-bare-metal/
F: package/versal-firmware/
N: Nicola Di Lieto <nicola.dilieto@gmail.com>
diff --git a/package/Config.in.host b/package/Config.in.host
index aa1f15e3ac..103d461a7f 100644
--- a/package/Config.in.host
+++ b/package/Config.in.host
@@ -106,6 +106,7 @@ menu "Host utilities"
source "package/systemd/Config.in.host"
source "package/tegrarcm/Config.in.host"
source "package/ti-cgt-pru/Config.in.host"
+ source "package/toolchain-bare-metal/Config.in.host"
source "package/uboot-tools/Config.in.host"
source "package/util-linux/Config.in.host"
source "package/utp_com/Config.in.host"
diff --git a/package/toolchain-bare-metal/Config.in.host b/package/toolchain-bare-metal/Config.in.host
new file mode 100644
index 0000000000..629b58d9c5
--- /dev/null
+++ b/package/toolchain-bare-metal/Config.in.host
@@ -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
+ toolchain-bare-metal is a host utility for a bare-metal 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/package/toolchain-bare-metal/toolchain-bare-metal.mk b/package/toolchain-bare-metal/toolchain-bare-metal.mk
new file mode 100644
index 0000000000..407ad4ea33
--- /dev/null
+++ b/package/toolchain-bare-metal/toolchain-bare-metal.mk
@@ -0,0 +1,7 @@
+################################################################################
+#
+# toolchain-bare-metal
+#
+################################################################################
+
+(eval $(host-virtual-package))
--
2.25.1
[-- Attachment #2: Type: text/plain, Size: 150 bytes --]
_______________________________________________
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 v3 4/6] package/toolchain-bare-metal: new package
2023-09-04 10:04 ` [Buildroot] [PATCH v3 4/6] package/toolchain-bare-metal: " Neal Frager via buildroot
@ 2023-09-22 12:55 ` Luca Ceresoli via buildroot
0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:55 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
Hello,
On Mon, 4 Sep 2023 11:04:41 +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/
> ---
> DEVELOPERS | 2 ++
> package/Config.in.host | 1 +
> package/toolchain-bare-metal/Config.in.host | 21 +++++++++++++++++++
> .../toolchain-bare-metal.mk | 7 +++++++
I wonder whether this should be in toolchain/ instead of package/.
> 4 files changed, 31 insertions(+)
> create mode 100644 package/toolchain-bare-metal/Config.in.host
> create mode 100644 package/toolchain-bare-metal/toolchain-bare-metal.mk
>
> diff --git a/DEVELOPERS b/DEVELOPERS
> index b8daa9183a..5978d79a06 100644
> --- a/DEVELOPERS
> +++ b/DEVELOPERS
> @@ -1331,6 +1331,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: package/toolchain-bare-metal/
>
> N: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
> F: package/angularjs/
> @@ -2200,6 +2201,7 @@ F: package/binutils-bare-metal/
> F: package/bootgen/
> F: package/gcc-bare-metal/
> F: package/newlib-bare-metal/
> +F: package/toolchain-bare-metal/
> F: package/versal-firmware/
>
> N: Nicola Di Lieto <nicola.dilieto@gmail.com>
> diff --git a/package/Config.in.host b/package/Config.in.host
> index aa1f15e3ac..103d461a7f 100644
> --- a/package/Config.in.host
> +++ b/package/Config.in.host
> @@ -106,6 +106,7 @@ menu "Host utilities"
> source "package/systemd/Config.in.host"
> source "package/tegrarcm/Config.in.host"
> source "package/ti-cgt-pru/Config.in.host"
> + source "package/toolchain-bare-metal/Config.in.host"
> source "package/uboot-tools/Config.in.host"
> source "package/util-linux/Config.in.host"
> source "package/utp_com/Config.in.host"
> diff --git a/package/toolchain-bare-metal/Config.in.host b/package/toolchain-bare-metal/Config.in.host
> new file mode 100644
> index 0000000000..629b58d9c5
> --- /dev/null
> +++ b/package/toolchain-bare-metal/Config.in.host
> @@ -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
> + toolchain-bare-metal is a host utility for a bare-metal toolchain
"Build a bare-metal toolchain in addition to the main Linux toolchain"
or something similar?
> +
> +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/package/toolchain-bare-metal/toolchain-bare-metal.mk b/package/toolchain-bare-metal/toolchain-bare-metal.mk
> new file mode 100644
> index 0000000000..407ad4ea33
> --- /dev/null
> +++ b/package/toolchain-bare-metal/toolchain-bare-metal.mk
> @@ -0,0 +1,7 @@
> +################################################################################
> +#
> +# toolchain-bare-metal
> +#
> +################################################################################
> +
> +(eval $(host-virtual-package))
--
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
* [Buildroot] [PATCH v3 5/6] boot/zynqmp-firmware: new boot firmware
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
` (2 preceding siblings ...)
2023-09-04 10:04 ` [Buildroot] [PATCH v3 4/6] package/toolchain-bare-metal: " Neal Frager via buildroot
@ 2023-09-04 10:04 ` Neal Frager via buildroot
2023-09-22 12:57 ` Luca Ceresoli via buildroot
2023-09-04 10:04 ` [Buildroot] [PATCH v3 6/6] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
2023-09-22 12:52 ` [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Luca Ceresoli via buildroot
5 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-04 10:04 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
---
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 5978d79a06..361c6767da 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -2192,6 +2192,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 9d7f5c4cb9..b105a43d27 100644
--- a/boot/Config.in
+++ b/boot/Config.in
@@ -22,5 +22,6 @@ source "boot/syslinux/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* Re: [Buildroot] [PATCH v3 5/6] boot/zynqmp-firmware: new boot firmware
2023-09-04 10:04 ` [Buildroot] [PATCH v3 5/6] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
@ 2023-09-22 12:57 ` Luca Ceresoli via buildroot
0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:57 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
Hi,
On Mon, 4 Sep 2023 11:04:42 +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>
[On Kria KV260]
Tested-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
In order to test I did, after applying the whole series:
- make zynqmp_kria_kv260_defconfig
- set BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE=y
- set (for Kria):
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"
And flashed the resulting boot.bin and u-boot.itb. The board boots
normally. Thanks to Neal for providing me these details.
I suggest adding a new patch in the v4 patchset to update the KV260
defconfig, so the entire patch set can be tested.
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
* [Buildroot] [PATCH v3 6/6] boot/uboot.mk: new zynqmp pmufw build option
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
` (3 preceding siblings ...)
2023-09-04 10:04 ` [Buildroot] [PATCH v3 5/6] boot/zynqmp-firmware: new boot firmware Neal Frager via buildroot
@ 2023-09-04 10:04 ` Neal Frager via buildroot
2023-09-22 12:58 ` Luca Ceresoli via buildroot
2023-09-22 12:52 ` [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Luca Ceresoli via buildroot
5 siblings, 1 reply; 23+ messages in thread
From: Neal Frager via buildroot @ 2023-09-04 10:04 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
---
boot/uboot/Config.in | 18 ++++++++++++++++--
boot/uboot/uboot.mk | 5 +++++
2 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
index 8b726eaa57..6d830e81c6 100644
--- a/boot/uboot/Config.in
+++ b/boot/uboot/Config.in
@@ -495,11 +495,25 @@ 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
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 9f81c0b842..0e338efaf1 100644
--- a/boot/uboot/uboot.mk
+++ b/boot/uboot/uboot.mk
@@ -410,7 +410,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* Re: [Buildroot] [PATCH v3 6/6] boot/uboot.mk: new zynqmp pmufw build option
2023-09-04 10:04 ` [Buildroot] [PATCH v3 6/6] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2023-09-22 12:58 ` Luca Ceresoli via buildroot
0 siblings, 0 replies; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:58 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
On Mon, 4 Sep 2023 11:04:43 +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>
> ---
> 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
> ---
> boot/uboot/Config.in | 18 ++++++++++++++++--
> boot/uboot/uboot.mk | 5 +++++
> 2 files changed, 21 insertions(+), 2 deletions(-)
>
> diff --git a/boot/uboot/Config.in b/boot/uboot/Config.in
> index 8b726eaa57..6d830e81c6 100644
> --- a/boot/uboot/Config.in
> +++ b/boot/uboot/Config.in
> @@ -495,11 +495,25 @@ 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
Maybe here we should add
depends on !BR2_TARGET_UBOOT_ZYNQMP_PMUFW_SOURCE
to hide the prebuilt option when building from source has been chosen.
It would be confusing otherwise.
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 v3 1/6] package/binutils-bare-metal: new package
2023-09-04 10:04 [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Neal Frager via buildroot
` (4 preceding siblings ...)
2023-09-04 10:04 ` [Buildroot] [PATCH v3 6/6] boot/uboot.mk: new zynqmp pmufw build option Neal Frager via buildroot
@ 2023-09-22 12:52 ` Luca Ceresoli via buildroot
2023-09-22 13:34 ` Frager, Neal via buildroot
5 siblings, 1 reply; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 12:52 UTC (permalink / raw)
To: Neal Frager
Cc: ibai.erkiaga-elorza, michal.simek, thomas.petazzoni, buildroot
Hello Neal, Ibai,
thank you for your persistence in working on this!
The overall patch set appears pretty clean, except for a few remarks as
you can read in this and the other replies.
I had a small hiccup while trying to apply your patches using 'git
am' from my inbox:
error: cannot convert from y to UTF-8
This is probably due to this weird header value:
Content-Type: text/plain; charset="y"
Probably some dirt in your git config. However the mbox file as
downloaded from patchwork did apply without issues. I don't think you
need to resend the series just for this.
On Mon, 4 Sep 2023 11:04:38 +0100
Neal Frager <neal.frager@amd.com> wrote:
> 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>
...
> diff --git a/package/binutils-bare-metal/Config.in.host b/package/binutils-bare-metal/Config.in.host
> new file mode 100644
> index 0000000000..036698d418
> --- /dev/null
> +++ b/package/binutils-bare-metal/Config.in.host
> @@ -0,0 +1,19 @@
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> + bool "host binutils-bare-metal"
> + help
> + binutils-bare-metal is a host utility for a
> + bare-metal toolchain
"a host utility seems a bit of an understatement, I'd rather say "Build
to GNU binutils for a bare-metal toolchain" to clarify this is building
no less than the GNU binutils.
> +
> +if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> +
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
> + string
> + default "2.39"
> +
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_EXTRA_CONFIG_OPTIONS
> + string "Additional binutils options"
> + default ""
> + help
> + Any additional binutils options you may want to include
Do we really want this without a valid use case?
The same question could apply to the _VERSION setting, however I feel
it's reasonable to keep it...
This applies to patches 2 and 3 as well.
> 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..fd983abc93
> --- /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")
The toolchain-bare-metal is added in patch 4, thus this series as-is is
not bisectable. I don't see any obvious solutions as
toolchain-bare-metal selects binutils-bare-metal so I guess some maintainer
can provide some hints on how to handle this.
The same issue applies to patches 2 and 3.
> +HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS = https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2023.1.tar.gz
This is not a huge download (500 kB compressed, 5.6 MB uncompressed),
but we use the binutils patches only, which account for 10% of the whole
archive. I wonder whether there is a way to download only a
subdirectory from github.
And looking at the patches themselves, I wonder how many are actually
needed. At a cursory look, some don't really look like production code.
Are those changes being mainlined?
> +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
Please split this very long line. e.g.:
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
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 v3 1/6] package/binutils-bare-metal: new package
2023-09-22 12:52 ` [Buildroot] [PATCH v3 1/6] package/binutils-bare-metal: new package Luca Ceresoli via buildroot
@ 2023-09-22 13:34 ` Frager, Neal via buildroot
2023-09-22 13:57 ` Luca Ceresoli via buildroot
0 siblings, 1 reply; 23+ messages in thread
From: Frager, Neal via buildroot @ 2023-09-22 13:34 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Erkiaga Elorza, Ibai, Simek, Michal, thomas.petazzoni@bootlin.com,
buildroot@buildroot.org
Hi Luca,
> Hello Neal, Ibai,
> thank you for your persistence in working on this!
> The overall patch set appears pretty clean, except for a few remarks as you can read in this and the other replies.
Thank you for the kind words.
> I had a small hiccup while trying to apply your patches using 'git am' from my inbox:
> error: cannot convert from y to UTF-8
> This is probably due to this weird header value:
> Content-Type: text/plain; charset="y"
> Probably some dirt in your git config. However the mbox file as downloaded from patchwork did apply without issues. I don't think you need to resend the series just for this.
I will create a clean patch set with v4, so this should hopefully disappear.
> 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>
...
> diff --git a/package/binutils-bare-metal/Config.in.host
> b/package/binutils-bare-metal/Config.in.host
> new file mode 100644
> index 0000000000..036698d418
> --- /dev/null
> +++ b/package/binutils-bare-metal/Config.in.host
> @@ -0,0 +1,19 @@
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> + bool "host binutils-bare-metal"
> + help
> + binutils-bare-metal is a host utility for a
> + bare-metal toolchain
> "a host utility seems a bit of an understatement, I'd rather say "Build to GNU binutils for a bare-metal toolchain" to clarify this is building no less than the GNU binutils.
I agree. I will change this in v4.
> +
> +if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> +
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
> + string
> + default "2.39"
> +
> +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_EXTRA_CONFIG_OPTIONS
> + string "Additional binutils options"
> + default ""
> + help
> + Any additional binutils options you may want to include
> Do we really want this without a valid use case?
> The same question could apply to the _VERSION setting, however I feel it's reasonable to keep it...
> This applies to patches 2 and 3 as well.
My thought was that someone might want to add additional bare-metal options aside from the Xilinx microblaze target.
If not building binutils, gcc or newlib for microblaze, users might want to change the version and the config options used.
> 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..fd983abc93
> --- /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")
> The toolchain-bare-metal is added in patch 4, thus this series as-is is not bisectable. I don't see any obvious solutions as toolchain-bare-metal selects binutils-bare-metal so I guess some maintainer can provide some hints on how to handle this.
> The same issue applies to patches 2 and 3.
Ok, I am not sure what to do with this feedback.
> +HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS =
> +https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v202
> +3.1.tar.gz
> This is not a huge download (500 kB compressed, 5.6 MB uncompressed), but we use the binutils patches only, which account for 10% of the whole archive. I wonder whether there is a way to download only a subdirectory from github.
> And looking at the patches themselves, I wonder how many are actually needed. At a cursory look, some don't really look like production code.
> Are those changes being mainlined?
Our initial plan was to make binutils and gcc versions that match the Xilinx software release as closely as possible. This is why we just took the patch set blindly.
From my view, it is easier for me to maintain this if we either take all of the patches as is or none at all.
> +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/binutil
> +s/binutils
> Please split this very long line. e.g.:
> 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
Yes, no problem for v4.
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 v3 1/6] package/binutils-bare-metal: new package
2023-09-22 13:34 ` Frager, Neal via buildroot
@ 2023-09-22 13:57 ` Luca Ceresoli via buildroot
2023-09-22 14:57 ` Frager, Neal via buildroot
0 siblings, 1 reply; 23+ messages in thread
From: Luca Ceresoli via buildroot @ 2023-09-22 13:57 UTC (permalink / raw)
To: Frager, Neal
Cc: Erkiaga Elorza, Ibai, Simek, Michal, thomas.petazzoni@bootlin.com,
buildroot@buildroot.org
Hi Neal,
On Fri, 22 Sep 2023 13:34:58 +0000
"Frager, Neal" <neal.frager@amd.com> wrote:
> Hi Luca,
>
> > Hello Neal, Ibai,
>
> > thank you for your persistence in working on this!
>
> > The overall patch set appears pretty clean, except for a few remarks as you can read in this and the other replies.
>
> Thank you for the kind words.
>
> > I had a small hiccup while trying to apply your patches using 'git am' from my inbox:
>
> > error: cannot convert from y to UTF-8
>
> > This is probably due to this weird header value:
>
> > Content-Type: text/plain; charset="y"
>
> > Probably some dirt in your git config. However the mbox file as downloaded from patchwork did apply without issues. I don't think you need to resend the series just for this.
>
> I will create a clean patch set with v4, so this should hopefully disappear.
>
>
> > 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>
>
> ...
>
> > diff --git a/package/binutils-bare-metal/Config.in.host
> > b/package/binutils-bare-metal/Config.in.host
> > new file mode 100644
> > index 0000000000..036698d418
> > --- /dev/null
> > +++ b/package/binutils-bare-metal/Config.in.host
> > @@ -0,0 +1,19 @@
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> > + bool "host binutils-bare-metal"
> > + help
> > + binutils-bare-metal is a host utility for a
> > + bare-metal toolchain
>
> > "a host utility seems a bit of an understatement, I'd rather say "Build to GNU binutils for a bare-metal toolchain" to clarify this is building no less than the GNU binutils.
>
> I agree. I will change this in v4.
>
> > +
> > +if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> > +
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
> > + string
> > + default "2.39"
> > +
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_EXTRA_CONFIG_OPTIONS
> > + string "Additional binutils options"
> > + default ""
> > + help
> > + Any additional binutils options you may want to include
>
> > Do we really want this without a valid use case?
>
> > The same question could apply to the _VERSION setting, however I feel it's reasonable to keep it...
>
> > This applies to patches 2 and 3 as well.
>
> My thought was that someone might want to add additional bare-metal options aside from the Xilinx microblaze target.
>
> If not building binutils, gcc or newlib for microblaze, users might want to change the version and the config options used.
>
> > 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..fd983abc93
> > --- /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")
>
> > The toolchain-bare-metal is added in patch 4, thus this series as-is is not bisectable. I don't see any obvious solutions as toolchain-bare-metal selects binutils-bare-metal so I guess some maintainer can provide some hints on how to handle this.
>
> > The same issue applies to patches 2 and 3.
>
> Ok, I am not sure what to do with this feedback.
I'd say waiting for Buildroot maintainers feedback.
> > +HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS =
> > +https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v202
> > +3.1.tar.gz
>
> > This is not a huge download (500 kB compressed, 5.6 MB uncompressed), but we use the binutils patches only, which account for 10% of the whole archive. I wonder whether there is a way to download only a subdirectory from github.
>
> > And looking at the patches themselves, I wonder how many are actually needed. At a cursory look, some don't really look like production code.
> > Are those changes being mainlined?
>
> Our initial plan was to make binutils and gcc versions that match the Xilinx software release as closely as possible. This is why we just took the patch set blindly.
>
> From my view, it is easier for me to maintain this if we either take all of the patches as is or none at all.
Agreed it is simpler to maintain, so this boils down to the question:
are those patches being actively mainlined? I have a sad feeling about
it as the number and overall quality of those patches seems the same I
saw more than an year ago.
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 v3 1/6] package/binutils-bare-metal: new package
2023-09-22 13:57 ` Luca Ceresoli via buildroot
@ 2023-09-22 14:57 ` Frager, Neal via buildroot
[not found] ` <MN0PR12MB60045761B225083426E7B1A1A0FFA@MN0PR12MB6004.namprd12.prod.outlook.com>
0 siblings, 1 reply; 23+ messages in thread
From: Frager, Neal via buildroot @ 2023-09-22 14:57 UTC (permalink / raw)
To: Luca Ceresoli
Cc: Erkiaga Elorza, Ibai, Simek, Michal, thomas.petazzoni@bootlin.com,
buildroot@buildroot.org
Hi Luca,
> Hi Luca,
>
> > Hello Neal, Ibai,
>
> > thank you for your persistence in working on this!
>
> > The overall patch set appears pretty clean, except for a few remarks as you can read in this and the other replies.
>
> Thank you for the kind words.
>
> > I had a small hiccup while trying to apply your patches using 'git am' from my inbox:
>
> > error: cannot convert from y to UTF-8
>
> > This is probably due to this weird header value:
>
> > Content-Type: text/plain; charset="y"
>
> > Probably some dirt in your git config. However the mbox file as downloaded from patchwork did apply without issues. I don't think you need to resend the series just for this.
>
> I will create a clean patch set with v4, so this should hopefully disappear.
>
>
> > 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>
>
> ...
>
> > diff --git a/package/binutils-bare-metal/Config.in.host
> > b/package/binutils-bare-metal/Config.in.host
> > new file mode 100644
> > index 0000000000..036698d418
> > --- /dev/null
> > +++ b/package/binutils-bare-metal/Config.in.host
> > @@ -0,0 +1,19 @@
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> > + bool "host binutils-bare-metal"
> > + help
> > + binutils-bare-metal is a host utility for a
> > + bare-metal toolchain
>
> > "a host utility seems a bit of an understatement, I'd rather say "Build to GNU binutils for a bare-metal toolchain" to clarify this is building no less than the GNU binutils.
>
> I agree. I will change this in v4.
>
> > +
> > +if BR2_PACKAGE_HOST_BINUTILS_BARE_METAL
> > +
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_VERSION
> > + string
> > + default "2.39"
> > +
> > +config BR2_PACKAGE_HOST_BINUTILS_BARE_METAL_EXTRA_CONFIG_OPTIONS
> > + string "Additional binutils options"
> > + default ""
> > + help
> > + Any additional binutils options you may want to include
>
> > Do we really want this without a valid use case?
>
> > The same question could apply to the _VERSION setting, however I feel it's reasonable to keep it...
>
> > This applies to patches 2 and 3 as well.
>
> My thought was that someone might want to add additional bare-metal options aside from the Xilinx microblaze target.
>
> If not building binutils, gcc or newlib for microblaze, users might want to change the version and the config options used.
>
> > 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..fd983abc93
> > --- /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
> > +")
>
> > The toolchain-bare-metal is added in patch 4, thus this series as-is is not bisectable. I don't see any obvious solutions as toolchain-bare-metal selects binutils-bare-metal so I guess some maintainer can provide some hints on how to handle this.
>
> > The same issue applies to patches 2 and 3.
>
> Ok, I am not sure what to do with this feedback.
> I'd say waiting for Buildroot maintainers feedback.
> > +HOST_BINUTILS_BARE_METAL_EXTRA_DOWNLOADS =
> > +https://github.com/Xilinx/meta-xilinx/archive/refs/tags/xlnx-rel-v2
> > +02
> > +3.1.tar.gz
>
> > This is not a huge download (500 kB compressed, 5.6 MB uncompressed), but we use the binutils patches only, which account for 10% of the whole archive. I wonder whether there is a way to download only a subdirectory from github.
>
> > And looking at the patches themselves, I wonder how many are actually needed. At a cursory look, some don't really look like production code.
> > Are those changes being mainlined?
>
> Our initial plan was to make binutils and gcc versions that match the Xilinx software release as closely as possible. This is why we just took the patch set blindly.
>
> From my view, it is easier for me to maintain this if we either take all of the patches as is or none at all.
> Agreed it is simpler to maintain, so this boils down to the question:
> are those patches being actively mainlined? I have a sad feeling about it as the number and overall quality of those patches seems the same I saw more than an year ago.
As a quick test, I tried removing the Xilinx patch set to see if the build would still work.
I ended up getting the following build error with the zynqmp pmufw:
microblaze_sleep.c:81:9: note: '#pragma message: For the sleep routines, assembly instructions are used'
81 | #pragma message ("For the sleep routines, assembly instructions are used")
| ^~~~~~~
microblaze_selftest.S: Assembler messages:
microblaze_selftest.S:554: Error: unknown opcode "bsifi"
microblaze_selftest.S:555: Error: unknown opcode "bsefi"
This is the same error we see when using the zynqmp-pmufw-builder.
I will go through the gcc patch set. Perhaps instead of applying all patches, I just look for the one that fixes the above issue and apply that.
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