From: Marco Felsch <m.felsch@pengutronix.de>
To: distrokit@pengutronix.de
Subject: [DistroKit] [PATCH 03/14] v8a: replace imx-atf with tf-a
Date: Fri, 10 Feb 2023 20:36:01 +0100 [thread overview]
Message-ID: <20230210193612.2143905-4-m.felsch@pengutronix.de> (raw)
In-Reply-To: <20230210193612.2143905-1-m.felsch@pengutronix.de>
Replace the downstream imx-atf version with the most recent upstream
version already used by the v7a platform.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
---
configs/platform-v8a/platformconfig | 1 -
.../platform-v8a/platforms/barebox-imx8m.in | 2 +-
configs/platform-v8a/rules/barebox-imx8m.make | 2 +-
configs/platform-v8a/rules/imx-atf.in | 7 --
configs/platform-v8a/rules/imx-atf.make | 87 -------------------
...-add-helper-to-detect-linker-options.patch | 38 --------
...void-gcc-warning-that-triggers-with-.patch | 48 ----------
...dd-support-for-new-binutils-versions.patch | 38 --------
...004-makefile-link-with-z-noexecstack.patch | 38 --------
patches/imx-atf-imx_5.4.24_2.1.0/series | 4 -
10 files changed, 2 insertions(+), 263 deletions(-)
delete mode 100644 configs/platform-v8a/rules/imx-atf.in
delete mode 100644 configs/platform-v8a/rules/imx-atf.make
delete mode 100644 patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch
delete mode 100644 patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch
delete mode 100644 patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch
delete mode 100644 patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch
delete mode 100644 patches/imx-atf-imx_5.4.24_2.1.0/series
diff --git a/configs/platform-v8a/platformconfig b/configs/platform-v8a/platformconfig
index c5cd8fb..634698d 100644
--- a/configs/platform-v8a/platformconfig
+++ b/configs/platform-v8a/platformconfig
@@ -182,7 +182,6 @@ PTXCONF_BAREBOX_ARCH_STRING="arm"
PTXCONF_BOOTLOADER=y
# PTXCONF_GRUB is not set
# PTXCONF_HOST_MXS_UTILS is not set
-PTXCONF_IMX_ATF=y
PTXCONF_TF_A=y
PTXCONF_TF_A_URL="https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/snapshot"
PTXCONF_TF_A_VERSION="v2.8"
diff --git a/configs/platform-v8a/platforms/barebox-imx8m.in b/configs/platform-v8a/platforms/barebox-imx8m.in
index ca11fe2..edba6ac 100644
--- a/configs/platform-v8a/platforms/barebox-imx8m.in
+++ b/configs/platform-v8a/platforms/barebox-imx8m.in
@@ -2,7 +2,7 @@
config BAREBOX_IMX8M
select FIRMWARE_IMX
- select IMX_ATF
+ select TF_A
tristate
prompt "Barebox (imx8m)"
help
diff --git a/configs/platform-v8a/rules/barebox-imx8m.make b/configs/platform-v8a/rules/barebox-imx8m.make
index da1adfa..c96c10d 100644
--- a/configs/platform-v8a/rules/barebox-imx8m.make
+++ b/configs/platform-v8a/rules/barebox-imx8m.make
@@ -71,7 +71,7 @@ $(STATEDIR)/barebox-imx8m.prepare: $(BAREBOX_IMX8M_CONFIG)
done
@for i in m p q; do \
- cp $(PTXCONF_SYSROOT_TARGET)/usr/lib/atf/imx8m$$i-bl31.bin \
+ cp $(PTXCONF_SYSROOT_TARGET)/usr/lib/firmware/imx8m$$i-bl31.bin \
$(BAREBOX_IMX8M_DIR)/firmware/; \
done
diff --git a/configs/platform-v8a/rules/imx-atf.in b/configs/platform-v8a/rules/imx-atf.in
deleted file mode 100644
index 10c29b2..0000000
--- a/configs/platform-v8a/rules/imx-atf.in
+++ /dev/null
@@ -1,7 +0,0 @@
-## SECTION=bootloader
-
-config IMX_ATF
- tristate
- prompt "imx-atf"
- help
- ARM trusted firmware for i.MX SoCs.
diff --git a/configs/platform-v8a/rules/imx-atf.make b/configs/platform-v8a/rules/imx-atf.make
deleted file mode 100644
index 7e0a30f..0000000
--- a/configs/platform-v8a/rules/imx-atf.make
+++ /dev/null
@@ -1,87 +0,0 @@
-# -*-makefile-*-
-#
-# Copyright (C) 2019 by Lucas Stach <l.stach@pengutronix.de>
-#
-# For further information about the PTXdist project and license conditions
-# see the README file.
-#
-
-#
-# We provide this package
-#
-PACKAGES-$(PTXCONF_IMX_ATF) += imx-atf
-
-#
-# Paths and names
-#
-IMX_ATF_VERSION := imx_5.4.24_2.1.0
-IMX_ATF_MD5 := f60e3f42e90d552227d6fc1278761637
-IMX_ATF := imx-atf-$(IMX_ATF_VERSION)
-IMX_ATF_SUFFIX := tar.xz
-IMX_ATF_URL := https://source.codeaurora.org/external/imx/imx-atf.git;tag=rel_$(IMX_ATF_VERSION)
-IMX_ATF_SOURCE := $(SRCDIR)/$(IMX_ATF).$(IMX_ATF_SUFFIX)
-IMX_ATF_DIR := $(BUILDDIR)/$(IMX_ATF)
-IMX_ATF_LICENSE := BSD-3-clause
-
-# ----------------------------------------------------------------------------
-# Prepare
-# ----------------------------------------------------------------------------
-IMX_ATF_WRAPPER_BLACKLIST := \
- TARGET_HARDEN_RELRO \
- TARGET_HARDEN_BINDNOW \
- TARGET_HARDEN_PIE \
- TARGET_DEBUG \
- TARGET_BUILD_ID
-
-IMX_ATF_CONF_TOOL := NO
-
-IMX_ATF_CONF_OPT := \
- CROSS_COMPILE=$(BOOTLOADER_CROSS_COMPILE)
-
-IMX_ATF_PLATFORMS := imx8mq imx8mm imx8mp
-
-# ----------------------------------------------------------------------------
-# Compile
-# ----------------------------------------------------------------------------
-IMX_ATF_MAKE_OPT := $(IMX_ATF_CONF_OPT)
-
-$(STATEDIR)/imx-atf.compile:
- @$(call targetinfo)
-
- @$(foreach plat, $(IMX_ATF_PLATFORMS), \
- $(call compile, IMX_ATF, \
- $(IMX_ATF_MAKE_OPT) PLAT=$(plat) bl31)$(ptx/nl))
-
- @$(call touch)
-
-# ----------------------------------------------------------------------------
-# Install
-# ----------------------------------------------------------------------------
-
-$(STATEDIR)/imx-atf.install:
- @$(call targetinfo)
-
- @$(foreach plat, $(IMX_ATF_PLATFORMS), \
- install -v -D -m644 $(IMX_ATF_DIR)/build/$(plat)/release/bl31.bin \
- $(PTXCONF_SYSROOT_TARGET)/usr/lib/atf/$(plat)-bl31.bin;)
-
- @$(call touch)
-
-# ----------------------------------------------------------------------------
-# Target-Install
-# ----------------------------------------------------------------------------
-
-$(STATEDIR)/imx-atf.targetinstall:
- @$(call targetinfo)
-
- @$(call install_init, imx-atf)
- @$(call install_fixup, imx-atf,PRIORITY,optional)
- @$(call install_fixup, imx-atf,SECTION,base)
- @$(call install_fixup, imx-atf,AUTHOR,"Lucas Stach <l.stach@pengutronix.de>")
- @$(call install_fixup, imx-atf,DESCRIPTION,missing)
-
- @$(call install_finish, imx-atf)
-
- @$(call touch)
-
-# vim: syntax=make
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch
deleted file mode 100644
index 164f199..0000000
--- a/patches/imx-atf-imx_5.4.24_2.1.0/0001-build-makefile-add-helper-to-detect-linker-options.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From 456257d346b295982761d33f4e24e07a9feee74d Mon Sep 17 00:00:00 2001
-From: Marco Felsch <mfe@pengutronix.de>
-Date: Sat, 26 Nov 2022 08:00:39 +0100
-Subject: [PATCH 1/2] build(makefile): add helper to detect linker options
-
-This is a small helper to check for possible linker options. If the
-linker supports the requested option it is returned and if not nothing
-will be returned, e.g.:
-
- TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments)
-
-can be called unconditional.
-
-Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
----
- make_helpers/build_macros.mk | 6 ++++++
- 1 file changed, 6 insertions(+)
-
-diff --git a/make_helpers/build_macros.mk b/make_helpers/build_macros.mk
-index b89d87ea6087..9f4f70dbe42f 100644
---- a/make_helpers/build_macros.mk
-+++ b/make_helpers/build_macros.mk
-@@ -67,6 +67,12 @@ $(foreach d,$(0-9),$(eval __numeric := $(subst $(d),,$(__numeric))))
- $(if $(__numeric),$(error $(1) must be numeric))
- endef
-
-+# Convenience function to check for a given linker option. An call to
-+# $(call ld_option, --no-XYZ) will return --no-XYZ if supported by the linker
-+define ld_option
-+ $(shell if $(LD) $(1) -v >/dev/null 2>&1; then echo $(1); fi )
-+endef
-+
- # IMG_LINKERFILE defines the linker script corresponding to a BL stage
- # $(1) = BL stage (2, 30, 31, 32, 33)
- define IMG_LINKERFILE
---
-2.30.2
-
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch
deleted file mode 100644
index a433800..0000000
--- a/patches/imx-atf-imx_5.4.24_2.1.0/0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch
+++ /dev/null
@@ -1,48 +0,0 @@
-From 710c027045df0d51e3d83bd26ec954b08108d836 Mon Sep 17 00:00:00 2001
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Sat, 26 Nov 2022 08:06:40 +0100
-Subject: [PATCH 2/2] build(makefile): avoid gcc warning that triggers with
- -Werror=array-bounds
-
-With gcc 12, we get these warnings:
-
-make: Entering directory 'imx-atf-imx_5.4.24_2.1.0'
- CC plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c
-In file included from plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:20:
-In function 'mmio_read_8',
- inlined from 'imx8mq_soc_info_init' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:82:16,
- inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:224:2:
-include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
- 19 | return *(volatile uint8_t*)addr;
- | ^~~~~~~~~~~~~~~~~~~~~~~~
-In function 'mmio_read_8',
- inlined from 'imx8mq_soc_info_init' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:86:16,
- inlined from 'bl31_platform_setup' at plat/imx/imx8m/imx8mq/imx8mq_bl31_setup.c:224:2:
-include/lib/mmio.h:19:16: error: array subscript 0 is outside array bounds of 'volatile uint8_t[0]' {aka 'volatile unsigned char[]'} [-Werror=array-bounds]
- 19 | return *(volatile uint8_t*)addr;
- | ^~~~~~~~~~~~~~~~~~~~~~~~
-cc1: all warnings being treated as errors
-
-According to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523#c9, this
-is the right fix for TF-A, as it is a firmware that has memory at 0.
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- Makefile | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/Makefile b/Makefile
-index 2ae12fda741a..555b46e7b361 100644
---- a/Makefile
-+++ b/Makefile
-@@ -284,6 +284,7 @@ CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
- ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
- -ffreestanding -Wa,--fatal-warnings
- TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
-+ --param=min-pagesize=0 \
- -ffreestanding -fno-builtin -Wall -std=gnu99 \
- -Os -ffunction-sections -fdata-sections
-
---
-2.30.2
-
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch
deleted file mode 100644
index 35b2be9..0000000
--- a/patches/imx-atf-imx_5.4.24_2.1.0/0003-feat-build-add-support-for-new-binutils-versions.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From b102865225c8db6a4ef60f346aded5959acc4d1c Mon Sep 17 00:00:00 2001
-From: Marco Felsch <m.felsch@pengutronix.de>
-Date: Wed, 9 Nov 2022 12:59:09 +0100
-Subject: [PATCH 3/4] feat(build): add support for new binutils versions
-
-The new ld.bfd linker version has added new warnings which are enabled by
-default to secure elf binaries:
- - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
- - https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=0d38576a34ec64a1b4500c9277a8e9d0f07e6774
-
-Since the tf-a handles every warning as error we need to tell the linker
-to not warn about this. This is required to make the bl31 target
-buildable with newer toolchain versions.
-
-Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
-Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
----
- Makefile | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/Makefile b/Makefile
-index 3941f869800a..af7fd1535694 100644
---- a/Makefile
-+++ b/Makefile
-@@ -444,6 +444,10 @@ TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH))
- endif
- endif
-
-+# With ld.bfd version 2.29 and newer new warnings are added. Skip those since we
-+# are not loaded by a elf loader.
-+TF_LDFLAGS += $(call ld_option, --no-warn-rwx-segments)
-+
- DTC_FLAGS += -I dts -O dtb
- DTC_CPPFLAGS += -P -nostdinc -Iinclude -Ifdts -undef \
- -x assembler-with-cpp $(DEFINES)
---
-2.30.2
-
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch b/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch
deleted file mode 100644
index 727f8af..0000000
--- a/patches/imx-atf-imx_5.4.24_2.1.0/0004-makefile-link-with-z-noexecstack.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-From f77451f77ff01dda1a5239a65901ed0b666116b3 Mon Sep 17 00:00:00 2001
-From: Robert Schwebel <r.schwebel@pengutronix.de>
-Date: Sat, 26 Nov 2022 08:24:50 +0100
-Subject: [PATCH 4/4] makefile: link with -z noexecstack
-
-Starting with binutils 2.39+, there is a new warning:
-
- ld: warning: vmlinux: missing .note.GNU-stack section implies executable stack
- ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
- ld: warning: vmlinux has a LOAD segment with RWX permissions
-
-Fix it in a similar way to what the Linux kernel does, see:
-https://lore.kernel.org/all/20220810222442.2296651-1-ndesaulniers@google.com/
-
-Following the reasoning there, we set "-z noexecstack" for all linkers
-(although LLVM's LLD defaults to it).
-
-Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
----
- Makefile | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/Makefile b/Makefile
-index 54072a4543ce..86be2e68da3e 100644
---- a/Makefile
-+++ b/Makefile
-@@ -298,6 +298,8 @@ endif
-
- GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
-
-+TF_LDFLAGS += -z noexecstack
-+
- ifneq ($(findstring armlink,$(notdir $(LD))),)
- TF_LDFLAGS += --diag_error=warning --lto_level=O1
- TF_LDFLAGS += --remove --info=unused,unusedsymbols
---
-2.30.2
-
diff --git a/patches/imx-atf-imx_5.4.24_2.1.0/series b/patches/imx-atf-imx_5.4.24_2.1.0/series
deleted file mode 100644
index c731f9c..0000000
--- a/patches/imx-atf-imx_5.4.24_2.1.0/series
+++ /dev/null
@@ -1,4 +0,0 @@
-0001-build-makefile-add-helper-to-detect-linker-options.patch
-0002-build-makefile-avoid-gcc-warning-that-triggers-with-.patch
-0003-feat-build-add-support-for-new-binutils-versions.patch
-0004-makefile-link-with-z-noexecstack.patch
--
2.30.2
next prev parent reply other threads:[~2023-02-10 19:36 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-10 19:35 [DistroKit] [PATCH 00/14] Mainline TF-A support and blspec-entry cleanups Marco Felsch
2023-02-10 19:35 ` [DistroKit] [PATCH 01/14] v7a: tf-a: version bump v2.7 -> 2.8/customers/pengutronix/distrokit/20230210-1 Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 02/14] v8a: tf-a: enable package Marco Felsch
2023-02-10 19:36 ` Marco Felsch [this message]
2023-02-10 19:36 ` [DistroKit] [PATCH 04/14] v8a: firmware-imx: fix dest path Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 05/14] v8a: firmware-imx: fix destition path Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 06/14] v8a: barebox-imx8m: fix firmware-imx dependencies Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 07/14] v8a: barebox-imx8m: make use of the INJECT_FILES mechanism Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 08/14] v8a: barebox: version sync to 2023.01.0 Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 09/14] blspec-entry: import from upstream ptxdist-2022.12.0 Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 10/14] blspec-entry: add linux-appendroot support Marco Felsch
2023-02-13 9:00 ` Michael Olbrich
2023-02-13 10:20 ` Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 11/14] v8a: blspec: switch to default blspec entry Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 12/14] v7a: blspec: drop incomplete Gute Fee support Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 13/14] v7a: vexpress: remove console from blspec config Marco Felsch
2023-02-10 19:36 ` [DistroKit] [PATCH 14/14] v7a: blspec: convert to ptxdist default entries Marco Felsch
2023-02-11 20:59 ` [DistroKit] [PATCH 00/14] Mainline TF-A support and blspec-entry cleanups Robert Schwebel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230210193612.2143905-4-m.felsch@pengutronix.de \
--to=m.felsch@pengutronix.de \
--cc=distrokit@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox