Initial Commit
- initial default booting image
This commit is contained in:
36
boot/Config.in
Normal file
36
boot/Config.in
Normal file
@@ -0,0 +1,36 @@
|
||||
config BR2_TARGET_XILINX_FIRMWARE_ARCH_SUPPORTS
|
||||
bool
|
||||
default y
|
||||
# All Xilinx SoCs using this package are aarch64 only
|
||||
depends on BR2_aarch64
|
||||
# only CPUs with corresponding firmwares:
|
||||
depends on BR2_cortex_a53 || BR2_cortex_a72 || BR2_cortex_a78
|
||||
|
||||
menu "Bootloaders"
|
||||
|
||||
source "boot/afboot-stm32/Config.in"
|
||||
source "boot/at91bootstrap3/Config.in"
|
||||
source "boot/arm-trusted-firmware/Config.in"
|
||||
source "boot/barebox/Config.in"
|
||||
source "boot/binaries-marvell/Config.in"
|
||||
source "boot/boot-wrapper-aarch64/Config.in"
|
||||
source "boot/edk2/Config.in"
|
||||
source "boot/grub2/Config.in"
|
||||
source "boot/mv-ddr-marvell/Config.in"
|
||||
source "boot/mxs-bootlets/Config.in"
|
||||
source "boot/optee-os/Config.in"
|
||||
source "boot/opensbi/Config.in"
|
||||
source "boot/palo/Config.in"
|
||||
source "boot/shim/Config.in"
|
||||
source "boot/syslinux/Config.in"
|
||||
source "boot/ti-k3-boot-firmware/Config.in"
|
||||
source "boot/ti-k3-r5-loader/Config.in"
|
||||
source "boot/uboot/Config.in"
|
||||
source "boot/vexpress-firmware/Config.in"
|
||||
|
||||
if BR2_TARGET_XILINX_FIRMWARE_ARCH_SUPPORTS
|
||||
source "boot/xilinx-embeddedsw/Config.in"
|
||||
source "boot/xilinx-prebuilt/Config.in"
|
||||
endif
|
||||
|
||||
endmenu
|
||||
@@ -0,0 +1,46 @@
|
||||
From 9901603e18524c4c52fd1dd47bda4ab4016628fc Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Thu, 10 Sep 2020 11:37:33 +0200
|
||||
Subject: [PATCH] Pass -fno-builtin to fix build with gcc 10
|
||||
|
||||
gcc 10, if it recognizes some hand-written code that looks like
|
||||
memcpy, will generate a call to memcpy().
|
||||
|
||||
For example:
|
||||
|
||||
while (dst < &_end_data) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
gets recognized as such. However, in the context of bare-metal code,
|
||||
having a call to memcpy() in the C library doesn't work. So we fix
|
||||
that by disabling builtins.
|
||||
|
||||
Fixes:
|
||||
|
||||
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.o: in function `reset':
|
||||
stm32f429i-disco.c:(.text.reset+0x1a): undefined reference to `memcpy'
|
||||
/home/thomas/projets/buildroot/output/host/opt/ext-toolchain/bin/../arm-buildroot-uclinux-uclibcgnueabi/bin/ld.real: stm32f429i-disco.c:(.text.reset+0x34): undefined reference to `memset'
|
||||
make[1]: *** [Makefile:26: stm32f429i-disco] Error 1
|
||||
|
||||
Upstream: https://github.com/mcoquelin-stm32/afboot-stm32/pull/11
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index f699176..1e8557d 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -13,6 +13,7 @@ DTB_ADDR?=0x08004000
|
||||
CFLAGS := -mthumb -mcpu=cortex-m4
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Os -std=gnu99 -Wall
|
||||
+CFLAGS += -fno-builtin
|
||||
LINKERFLAGS := -nostartfiles --gc-sections
|
||||
|
||||
obj-y += gpio.o mpu.o qspi.o start_kernel.o
|
||||
--
|
||||
2.35.1
|
||||
|
||||
40
boot/afboot-stm32/0002-Makefile-drop-nostartfiles.patch
Normal file
40
boot/afboot-stm32/0002-Makefile-drop-nostartfiles.patch
Normal file
@@ -0,0 +1,40 @@
|
||||
From be760c062c5d05bd2223f3916afafd37120d3318 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
Date: Thu, 28 Apr 2022 22:47:09 +0200
|
||||
Subject: [PATCH] Makefile: drop -nostartfiles
|
||||
|
||||
In commit 0f3e61c9dd48fd8b4248ce4672c044c2562e4de1 ("Use ld instead of
|
||||
gcc for linking "), we started using ld instead of gcc for the link
|
||||
step. This worked fine for a while, but recent versions of ld no
|
||||
longer accept the -nostartfiles option, causing the build to break:
|
||||
|
||||
Error: unable to disambiguate: -nostartfiles (did you mean --nostartfiles ?)
|
||||
|
||||
In fact, -nostartfiles was passed to gcc prior to
|
||||
0f3e61c9dd48fd8b4248ce4672c044c2562e4de1, but it is not a ld
|
||||
option. It is only by luck that it was accepted and ignored by older
|
||||
ld versions. Since this option is useless when calling ld directly, we
|
||||
can simply drop it.
|
||||
|
||||
Upstream: https://github.com/mcoquelin-stm32/afboot-stm32/pull/11
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1e8557d..8f42be1 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -14,7 +14,7 @@ CFLAGS := -mthumb -mcpu=cortex-m4
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Os -std=gnu99 -Wall
|
||||
CFLAGS += -fno-builtin
|
||||
-LINKERFLAGS := -nostartfiles --gc-sections
|
||||
+LINKERFLAGS := --gc-sections
|
||||
|
||||
obj-y += gpio.o mpu.o qspi.o start_kernel.o
|
||||
obj-f4 += $(obj-y) usart-f4.o
|
||||
--
|
||||
2.35.1
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From d65b07d6fe438e760fdbc33a8e42650a27d5b417 Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Sat, 31 Dec 2022 11:09:38 +0100
|
||||
Subject: [PATCH] Makefile: disable stack-protector
|
||||
|
||||
Disable stack-protector to avoid the following build failure:
|
||||
|
||||
/home/autobuild/autobuild/instance-14/output-1/host/bin/arm-buildroot-linux-gnueabi-ld -T stm32f429.lds --gc-sections -o stm32f469i-disco.elf stm32f469i-disco.o gpio.o mpu.o qspi.o start_kernel.o usart-f4.o
|
||||
/home/autobuild/autobuild/instance-14/output-1/host/bin/arm-buildroot-linux-gnueabi-ld: stm32f469i-disco.o: in function `main':
|
||||
stm32f469i-disco.c:(.text.startup.main+0x3b0): undefined reference to `__stack_chk_guard'
|
||||
/home/autobuild/autobuild/instance-14/output-1/host/bin/arm-buildroot-linux-gnueabi-ld: stm32f469i-disco.c:(.text.startup.main+0x4c0): undefined reference to `__stack_chk_fail'
|
||||
/home/autobuild/autobuild/instance-14/output-1/host/bin/arm-buildroot-linux-gnueabi-ld: stm32f469i-disco.c:(.text.startup.main+0x4ec): undefined reference to `__stack_chk_guard'
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/fa6ffab24c3998f21034ab24e8d2852cacde08c1
|
||||
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 8f42be1..8da7a25 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -14,6 +14,7 @@ CFLAGS := -mthumb -mcpu=cortex-m4
|
||||
CFLAGS += -ffunction-sections -fdata-sections
|
||||
CFLAGS += -Os -std=gnu99 -Wall
|
||||
CFLAGS += -fno-builtin
|
||||
+CFLAGS += -fno-stack-protector
|
||||
LINKERFLAGS := --gc-sections
|
||||
|
||||
obj-y += gpio.o mpu.o qspi.o start_kernel.o
|
||||
--
|
||||
2.35.1
|
||||
|
||||
27
boot/afboot-stm32/Config.in
Normal file
27
boot/afboot-stm32/Config.in
Normal file
@@ -0,0 +1,27 @@
|
||||
menuconfig BR2_TARGET_AFBOOT_STM32
|
||||
bool "afboot-stm32"
|
||||
depends on BR2_arm
|
||||
help
|
||||
afboot-stm32 is a very small bootloader for STM32 platforms
|
||||
|
||||
https://github.com/mcoquelin-stm32/afboot-stm32
|
||||
|
||||
if BR2_TARGET_AFBOOT_STM32
|
||||
|
||||
config BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR
|
||||
hex "Kernel load address"
|
||||
default "0x08008000"
|
||||
help
|
||||
This is the physical address in your flash memory the kernel
|
||||
will be linked for and stored to. This address is dependent on
|
||||
your own flash usage.
|
||||
|
||||
config BR2_TARGET_AFBOOT_STM32_DTB_ADDR
|
||||
hex "Device-tree load address"
|
||||
default "0x08004000"
|
||||
help
|
||||
This is the physical address in your flash memory the
|
||||
device-tree will be stored to. This address is dependent on
|
||||
your own flash usage.
|
||||
|
||||
endif
|
||||
2
boot/afboot-stm32/afboot-stm32.hash
Normal file
2
boot/afboot-stm32/afboot-stm32.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# Locally calculated
|
||||
sha256 2caacd302ab3ed5b70b3b93a6aef04162abf779c758a5be547be3ab01b68ca10 afboot-stm32-3566acd582e5536fb60864281788a30f5527df2d.tar.gz
|
||||
22
boot/afboot-stm32/afboot-stm32.mk
Normal file
22
boot/afboot-stm32/afboot-stm32.mk
Normal file
@@ -0,0 +1,22 @@
|
||||
################################################################################
|
||||
#
|
||||
# afboot-stm32
|
||||
#
|
||||
################################################################################
|
||||
|
||||
AFBOOT_STM32_VERSION = 3566acd582e5536fb60864281788a30f5527df2d
|
||||
AFBOOT_STM32_SITE = $(call github,mcoquelin-stm32,afboot-stm32,$(AFBOOT_STM32_VERSION))
|
||||
AFBOOT_STM32_INSTALL_IMAGES = YES
|
||||
AFBOOT_STM32_INSTALL_TARGET = NO
|
||||
|
||||
define AFBOOT_STM32_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) CROSS_COMPILE=$(TARGET_CROSS) all \
|
||||
KERNEL_ADDR=$(BR2_TARGET_AFBOOT_STM32_KERNEL_ADDR) \
|
||||
DTB_ADDR=$(BR2_TARGET_AFBOOT_STM32_DTB_ADDR)
|
||||
endef
|
||||
|
||||
define AFBOOT_STM32_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -m 0755 -t $(BINARIES_DIR) -D $(@D)/stm32*.bin
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
303
boot/arm-trusted-firmware/Config.in
Normal file
303
boot/arm-trusted-firmware/Config.in
Normal file
@@ -0,0 +1,303 @@
|
||||
menuconfig BR2_TARGET_ARM_TRUSTED_FIRMWARE
|
||||
bool "ARM Trusted Firmware (ATF)"
|
||||
depends on (BR2_ARM_CPU_ARMV8A || BR2_ARM_CPU_ARMV7A)
|
||||
help
|
||||
Enable this option if you want to build the ATF for your ARM
|
||||
based embedded device.
|
||||
|
||||
https://github.com/ARM-software/arm-trusted-firmware
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE
|
||||
choice
|
||||
prompt "ATF Version"
|
||||
help
|
||||
Select the specific ATF version you want to use
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION
|
||||
bool "v2.12"
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_12_VERSION
|
||||
bool "latest lts-v2.12.x"
|
||||
help
|
||||
Select the latest LTS v2.12.x version available
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_10_VERSION
|
||||
bool "latest lts-v2.10.x"
|
||||
help
|
||||
Select the latest LTS v2.10.x version available
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_8_VERSION
|
||||
bool "latest lts-v2.8.x"
|
||||
help
|
||||
Select the latest LTS v2.8.x version available
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
endchoice
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom ATF tarball"
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE
|
||||
string "ATF version"
|
||||
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_VERSION
|
||||
string
|
||||
default "v2.12" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_VERSION
|
||||
default "lts-v2.12.1" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_12_VERSION
|
||||
default "lts-v2.10.5" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_10_VERSION
|
||||
default "lts-v2.8.20" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_LATEST_LTS_2_8_VERSION
|
||||
default "custom" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION_VALUE \
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL
|
||||
string "URL of custom repository"
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_VERSION
|
||||
string "Custom repository version"
|
||||
help
|
||||
Revision to use in the typical format used by Git
|
||||
E.G. a sha id, a tag, ..
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LICENSE_FILES
|
||||
string "ATF license files" if BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT || \
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL
|
||||
default "docs/license.rst"
|
||||
help
|
||||
A space-separated list of license files related to the ATF
|
||||
package.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM
|
||||
string "ATF platform"
|
||||
help
|
||||
Target platform to build for.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD
|
||||
string "ATF target board"
|
||||
help
|
||||
Target board to build for. In many cases, this can be left
|
||||
empty.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH
|
||||
string "Device Tree Source file paths"
|
||||
help
|
||||
Space-separated list of paths to device tree source files
|
||||
that will be copied to fdts/ before starting the build.
|
||||
|
||||
To use this device tree source file, the ATF configuration
|
||||
file must refer to it.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
|
||||
bool "Build FIP image"
|
||||
help
|
||||
This option enables building the FIP image (Firmware Image
|
||||
Package). This is typically the image format used by
|
||||
platforms were ATF encapsulates the second stage bootloader
|
||||
(such as U-Boot).
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
|
||||
bool "Build BL31 image"
|
||||
help
|
||||
This option enables building the BL31 image. This is
|
||||
typically used on platforms where another bootloader (e.g
|
||||
U-Boot) encapsulates ATF BL31.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT
|
||||
bool "Build BL31 U-Boot image"
|
||||
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31
|
||||
help
|
||||
Generates a U-Boot image named atf-uboot.ub containing
|
||||
bl31.bin. This is used for example by the Xilinx version of
|
||||
U-Boot SPL to load ATF on the ZynqMP SoC.
|
||||
|
||||
choice
|
||||
prompt "BL32"
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_DEFAULT
|
||||
help
|
||||
Select BL32 stage for the trusted firmware
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_DEFAULT
|
||||
bool "Default"
|
||||
help
|
||||
With this option selected, ATF will not use any BL32 stage,
|
||||
unless if one is explicitly chosen using the SPD (for
|
||||
AArch64) or AARCH32_SP (for AArch32) variables, which can be
|
||||
passed through
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
|
||||
bool "OP-TEE OS"
|
||||
depends on BR2_TARGET_OPTEE_OS
|
||||
help
|
||||
This option allows to embed OP-TEE OS as the BL32 part of
|
||||
the ARM Trusted Firmware boot sequence.
|
||||
|
||||
endchoice
|
||||
|
||||
choice
|
||||
prompt "BL33"
|
||||
default BR2_TARGET_ARM_TRUSTED_FIRMWARE_NONE_AS_BL33
|
||||
help
|
||||
Select the image to include as BL33.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NONE_AS_BL33
|
||||
bool "None"
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_AS_BL33
|
||||
bool "Barebox"
|
||||
depends on BR2_TARGET_BAREBOX
|
||||
help
|
||||
This option allows to embed the Barebox generic BL33 image in
|
||||
the ARM Trusted Firmware. It ensures that the Barebox package
|
||||
gets built before ATF, and that the appropriate BL33
|
||||
variable pointing to the generic bl33 image is passed
|
||||
when building ATF.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
|
||||
bool "U-Boot"
|
||||
depends on BR2_TARGET_UBOOT
|
||||
help
|
||||
This option allows to embed u-boot.bin as the BL33 part of
|
||||
the ARM Trusted Firmware. It ensures that the u-boot package
|
||||
gets built before ATF, and that the appropriate BL33
|
||||
variable pointing to u-boot.bin is passed when building ATF.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
|
||||
bool "EDK2"
|
||||
depends on BR2_TARGET_EDK2
|
||||
help
|
||||
This option allows to embed EDK2 as the BL33 part of
|
||||
the ARM Trusted Firmware. It ensures that the EDK2 package
|
||||
gets built before ATF, and that the appropriate BL33
|
||||
variable pointing to the EDK2 is passed when building ATF.
|
||||
|
||||
Do not choose this option if you intend to build ATF and EDK2
|
||||
for the 'qemu_sbsa' platform. In this case, due to the EDK2
|
||||
build system, the dependency between ATF and EDK is reversed.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33
|
||||
bool "Linux kernel"
|
||||
depends on BR2_LINUX_KERNEL
|
||||
depends on (BR2_arm || BR2_armeb)
|
||||
depends on (BR2_LINUX_KERNEL_ZIMAGE || BR2_LINUX_KERNEL_APPENDED_ZIMAGE)
|
||||
help
|
||||
This option allows to embed the Linux kernel as the BL33
|
||||
part of the ARM Trusted Firmware.
|
||||
|
||||
Do not choose this option if you intend to use U-Boot or
|
||||
another second-stage bootloader. With this option, TF-A
|
||||
starts Linux directly.
|
||||
|
||||
endchoice
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_AS_BL33
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_BL33_IMAGE
|
||||
string "Barebox BL33 image name"
|
||||
default "*-generic-bl33.img"
|
||||
help
|
||||
Name of the Barebox BL33 image to include in ATF, it must
|
||||
have been installed to BINARIES_DIR by the Barebox package.
|
||||
|
||||
endif
|
||||
|
||||
if BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE
|
||||
string "U-Boot BL33 image name"
|
||||
default "u-boot.bin"
|
||||
help
|
||||
Name of the U-Boot BL33 image to include in ATF, it must
|
||||
have been installed to BINARIES_DIR by the U-Boot package.
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_RCW
|
||||
bool "Include NXP RCW in BL2"
|
||||
depends on BR2_PACKAGE_HOST_QORIQ_RCW
|
||||
help
|
||||
Include the NXP RCW (Reset Control Word) in BL2. See
|
||||
package/qoriq-rcw/ for more details. This is mostly useful
|
||||
on NXP LayerScape platforms.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS
|
||||
string "Additional ATF make targets"
|
||||
help
|
||||
Additional targets for the ATF build
|
||||
E.G. When using the QorIQ custom ATF repository from NXP,
|
||||
the target 'pbl' can be used to build the pbl binary.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES
|
||||
string "Additional ATF build variables"
|
||||
help
|
||||
Additional parameters for the ATF build
|
||||
E.G. 'DEBUG=1 LOG_LEVEL=20'
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG
|
||||
bool "Build in debug mode"
|
||||
help
|
||||
Enable this option to build ATF with DEBUG=1.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES
|
||||
string "Binary boot images"
|
||||
default "*.bin"
|
||||
help
|
||||
Names of generated image files that are installed in the
|
||||
output images/ directory.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC
|
||||
bool "Needs dtc"
|
||||
select BR2_PACKAGE_HOST_DTC
|
||||
help
|
||||
Select this option if your ATF board configuration
|
||||
requires the Device Tree compiler to be available.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN
|
||||
bool "Needs arm-none-eabi toolchain"
|
||||
depends on BR2_aarch64
|
||||
depends on BR2_PACKAGE_HOST_ARM_GNU_TOOLCHAIN_SUPPORTS
|
||||
help
|
||||
Select this option if your ATF board configuration requires
|
||||
an ARM32 bare metal toolchain to be available.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP
|
||||
bool "Build with SSP"
|
||||
depends on BR2_TOOLCHAIN_HAS_SSP
|
||||
depends on !BR2_SSP_NONE
|
||||
help
|
||||
Say 'y' here if you want to build ATF with SSP.
|
||||
|
||||
Your board must have SSP support in ATF: it must have an
|
||||
implementation for plat_get_stack_protector_canary().
|
||||
|
||||
If you say 'y', the SSP level will be the level selected
|
||||
by the global SSP setting.
|
||||
|
||||
config BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL
|
||||
string
|
||||
default "default" if BR2_SSP_REGULAR
|
||||
default "strong" if BR2_SSP_STRONG
|
||||
default "all" if BR2_SSP_ALL
|
||||
|
||||
endif
|
||||
244
boot/arm-trusted-firmware/arm-trusted-firmware.mk
Normal file
244
boot/arm-trusted-firmware/arm-trusted-firmware.mk
Normal file
@@ -0,0 +1,244 @@
|
||||
################################################################################
|
||||
#
|
||||
# arm-trusted-firmware
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_VERSION = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_VERSION))
|
||||
ARM_TRUSTED_FIRMWARE_CPE_ID_PREFIX = cpe:2.3:o
|
||||
ARM_TRUSTED_FIRMWARE_CPE_ID_VENDOR = trustedfirmware
|
||||
ARM_TRUSTED_FIRMWARE_CPE_ID_PRODUCT = trusted_firmware-a
|
||||
ARM_TRUSTED_FIRMWARE_CPE_ID_VERSION = $(patsubst v%,%,$(patsubst lts-%,%,$(ARM_TRUSTED_FIRMWARE_VERSION)))
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL),y)
|
||||
# Handle custom ATF tarballs as specified by the configuration
|
||||
ARM_TRUSTED_FIRMWARE_TARBALL = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION))
|
||||
ARM_TRUSTED_FIRMWARE_SITE = $(patsubst %/,%,$(dir $(ARM_TRUSTED_FIRMWARE_TARBALL)))
|
||||
ARM_TRUSTED_FIRMWARE_SOURCE = $(notdir $(ARM_TRUSTED_FIRMWARE_TARBALL))
|
||||
else ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y)
|
||||
ARM_TRUSTED_FIRMWARE_SITE = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL))
|
||||
ARM_TRUSTED_FIRMWARE_SITE_METHOD = git
|
||||
else
|
||||
# Handle stable official ATF versions
|
||||
ARM_TRUSTED_FIRMWARE_SITE = https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
|
||||
ARM_TRUSTED_FIRMWARE_SITE_METHOD = git
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_LICENSE = BSD-3-Clause
|
||||
ARM_TRUSTED_FIRMWARE_LICENSE_FILES = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LICENSE_FILES))
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE):$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_VERSION)$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL)$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y:y)
|
||||
BR_NO_CHECK_HASH_FOR += $(ARM_TRUSTED_FIRMWARE_SOURCE)
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES = YES
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_DTC),y)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-dtc
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_NEEDS_ARM32_TOOLCHAIN),y)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-arm-gnu-toolchain
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_PLATFORM = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_PLATFORM))
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_TARGET_BOARD = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_TARGET_BOARD))
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_DEBUG),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += DEBUG=1
|
||||
ifneq ($(ARM_TRUSTED_FIRMWARE_TARGET_BOARD),)
|
||||
ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)/debug
|
||||
else
|
||||
ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/debug
|
||||
endif
|
||||
else
|
||||
ifneq ($(ARM_TRUSTED_FIRMWARE_TARGET_BOARD),)
|
||||
ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD)/release
|
||||
else
|
||||
ARM_TRUSTED_FIRMWARE_IMG_DIR = $(@D)/build/$(ARM_TRUSTED_FIRMWARE_PLATFORM)/release
|
||||
endif
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
|
||||
$(if $(VERBOSE),V=1) \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
BUILD_STRING=$(ARM_TRUSTED_FIRMWARE_VERSION) \
|
||||
$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES)) \
|
||||
PLAT=$(ARM_TRUSTED_FIRMWARE_PLATFORM) \
|
||||
TARGET_BOARD=$(ARM_TRUSTED_FIRMWARE_TARGET_BOARD) \
|
||||
HOSTCC="$(HOSTCC) $(HOST_CFLAGS) $(HOST_LDFLAGS)"
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
|
||||
ENABLE_STACK_PROTECTOR=$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_SSP_LEVEL))
|
||||
else
|
||||
ARM_TRUSTED_FIRMWARE_CFLAGS += -fno-stack-protector
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_PIC_PIE),y)
|
||||
ARM_TRUSTED_FIRMWARE_CFLAGS += -fno-PIE
|
||||
ARM_TRUSTED_FIRMWARE_LDFLAGS += -no-pie
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_ENV += \
|
||||
$(TARGET_MAKE_ENV) \
|
||||
CFLAGS="$(ARM_TRUSTED_FIRMWARE_CFLAGS)" \
|
||||
LDFLAGS="$(ARM_TRUSTED_FIRMWARE_LDFLAGS)"
|
||||
|
||||
ifeq ($(BR2_ARM_CPU_ARMV7A),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=7
|
||||
else ifeq ($(BR2_ARM_CPU_ARMV8A),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARM_ARCH_MAJOR=8
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_arm),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARCH=aarch32
|
||||
else ifeq ($(BR2_aarch64),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += ARCH=aarch64
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE),y)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += optee-os
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
|
||||
BL32=$(BINARIES_DIR)/tee-header_v2.bin \
|
||||
BL32_EXTRA1=$(BINARIES_DIR)/tee-pager_v2.bin \
|
||||
BL32_EXTRA2=$(BINARIES_DIR)/tee-pageable_v2.bin
|
||||
ifeq ($(BR2_aarch64),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SPD=opteed
|
||||
endif
|
||||
ifeq ($(BR2_arm),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += AARCH32_SP=optee
|
||||
endif
|
||||
endif # BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL32_OPTEE
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_AS_BL33),y)
|
||||
ARM_TRUSTED_FIRMWARE_BAREBOX_BIN = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BAREBOX_BL33_IMAGE))
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_BAREBOX_BIN)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += barebox
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33),y)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += edk2
|
||||
# Since the flash device name vary between platforms, we use the variable
|
||||
# provided by the EDK2 package for this. Using this variable here is OK
|
||||
# as it will expand after all dependencies are resolved, inside _BUILD_CMDS.
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += \
|
||||
BL33=$(BINARIES_DIR)/$(call qstrip,$(BR2_TARGET_EDK2_FD_NAME).fd)
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_AS_BL33),y)
|
||||
ARM_TRUSTED_FIRMWARE_UBOOT_BIN = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_UBOOT_BL33_IMAGE))
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/$(ARM_TRUSTED_FIRMWARE_UBOOT_BIN)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += uboot
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_LINUX_AS_BL33),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33=$(BINARIES_DIR)/zImage
|
||||
ifeq ($(ARM_TRUSTED_FIRMWARE_PLATFORM),stm32mp1)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL33_CFG=$(BINARIES_DIR)/$(LINUX_DTBS)
|
||||
endif
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += linux
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_VEXPRESS_FIRMWARE),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += vexpress-firmware
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_BINARIES_MARVELL),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += SCP_BL2=$(BINARIES_DIR)/scp-fw.bin
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += binaries-marvell
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MV_DDR_MARVELL),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += MV_DDR_PATH=$(MV_DDR_MARVELL_DIR)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += mv-ddr-marvell
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS = all
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += fip
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-openssl
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_RCW),y)
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-qoriq-rcw
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += pbl
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RCW=$(BINARIES_DIR)/PBL.bin
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31),y)
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += bl31
|
||||
# Avoid BL31 environment variable from polluting the build
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += BL31=
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_BL31_UBOOT),y)
|
||||
define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD
|
||||
# Get the entry point address from the elf.
|
||||
BASE_ADDR=$$($(TARGET_READELF) -h $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf | \
|
||||
sed -r '/^ Entry point address:\s*(.*)/!d; s//\1/') && \
|
||||
$(MKIMAGE) \
|
||||
-A $(MKIMAGE_ARCH) -O arm-trusted-firmware -C none \
|
||||
-a $${BASE_ADDR} -e $${BASE_ADDR} \
|
||||
-d $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31.bin \
|
||||
$(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub
|
||||
endef
|
||||
define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL
|
||||
$(INSTALL) -m 0644 $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/atf-uboot.ub \
|
||||
$(BINARIES_DIR)/atf-uboot.ub
|
||||
endef
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_OPTS += RESET_TO_BL31=1
|
||||
ARM_TRUSTED_FIRMWARE_DEPENDENCIES += host-uboot-tools
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_UBOOT_NEEDS_ATF_BL31_ELF),y)
|
||||
define ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF
|
||||
$(INSTALL) -D -m 0644 $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/bl31/bl31.elf \
|
||||
$(BINARIES_DIR)/bl31.elf
|
||||
endef
|
||||
endif
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_MAKE_TARGETS += \
|
||||
$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_TARGETS))
|
||||
|
||||
ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH))
|
||||
|
||||
define ARM_TRUSTED_FIRMWARE_BUILD_CMDS
|
||||
$(if $(ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH),
|
||||
cp -f $(ARM_TRUSTED_FIRMWARE_CUSTOM_DTS_PATH) $(@D)/fdts/
|
||||
)
|
||||
$(ARM_TRUSTED_FIRMWARE_MAKE_ENV) $(MAKE) -C $(@D) \
|
||||
$(ARM_TRUSTED_FIRMWARE_MAKE_OPTS) \
|
||||
$(ARM_TRUSTED_FIRMWARE_MAKE_TARGETS)
|
||||
$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_BUILD)
|
||||
endef
|
||||
|
||||
define ARM_TRUSTED_FIRMWARE_INSTALL_IMAGES_CMDS
|
||||
$(foreach f,$(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_IMAGES)), \
|
||||
cp -dpf $(ARM_TRUSTED_FIRMWARE_IMG_DIR)/$(f) $(BINARIES_DIR)/
|
||||
)
|
||||
$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL)
|
||||
$(ARM_TRUSTED_FIRMWARE_BL31_UBOOT_INSTALL_ELF)
|
||||
endef
|
||||
|
||||
# Configuration check
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE)$(BR_BUILDING),yy)
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION)),)
|
||||
$(error No tarball location specified. Please check BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_TARBALL_LOCATION)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_GIT),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL)),)
|
||||
$(error No repository specified. Please check BR2_TARGET_ARM_TRUSTED_FIRMWARE_CUSTOM_REPO_URL)
|
||||
endif
|
||||
endif
|
||||
|
||||
endif
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,34 @@
|
||||
From 70be9272d8d8b8e205fc60b41704d470a6798e36 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 752ab419d2..78de01686c 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 62af6f1f2e9406d761ace03025f6bf22a0670578b1d0b76092dc1db455746dad arm-trusted-firmware-lts-v2.10.5-git4.tar.gz
|
||||
sha256 130d0c6e5159fa454b1e969fd281fa1d388819aefb203f65dd282544b5ab7ba9 docs/license.rst
|
||||
@@ -0,0 +1,34 @@
|
||||
From 83487cb4f74aa25cc3a03cbfa784d7b410cc3d07 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 5ab6123904..654f291732 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
$(q)+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 3ab7e90d6fc3364815ad7770d7aa7af9cfd68edde43da7123f5f38f80e034c44 arm-trusted-firmware-lts-v2.12.1-git4.tar.gz
|
||||
sha256 b2c79635797bafcde84c6edadadde290b9d5e05deb3ea16a847210fd2ca83669 docs/license.rst
|
||||
@@ -0,0 +1,77 @@
|
||||
From aa57ce632c629fe72ff417e261e0f5bfd8db6bab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 4 Jul 2023 16:14:02 +0200
|
||||
Subject: [PATCH] build(tools): avoid unnecessary link
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In their respective makefiles, cert_create, encrypt_fw and fiptool
|
||||
depend on the --openssl phony target as a prerequisite. This forces
|
||||
those tools to be re-linked each time.
|
||||
|
||||
Move the dependencies on the --openssl target from the tools to their
|
||||
makefiles all targets, to avoid unnecessary linking while preserving the
|
||||
OpenSSL version printing done in the --openssl targets when in debug.
|
||||
|
||||
Fixes: cf2dd17ddda2 ("refactor(security): add OpenSSL 1.x compatibility")
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
Change-Id: I98a3ab30f36dffc253cecaaf3a57d2712522135d
|
||||
Upstream: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=aa57ce632c629fe72ff417e261e0f5bfd8db6bab
|
||||
---
|
||||
tools/cert_create/Makefile | 4 ++--
|
||||
tools/encrypt_fw/Makefile | 4 ++--
|
||||
tools/fiptool/Makefile | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile
|
||||
index 042e844626..b911d19d2b 100644
|
||||
--- a/tools/cert_create/Makefile
|
||||
+++ b/tools/cert_create/Makefile
|
||||
@@ -85,9 +85,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
|
||||
const char platform_msg[] = "${PLAT_MSG}";' | \
|
||||
diff --git a/tools/encrypt_fw/Makefile b/tools/encrypt_fw/Makefile
|
||||
index 2939b142be..924e5febab 100644
|
||||
--- a/tools/encrypt_fw/Makefile
|
||||
+++ b/tools/encrypt_fw/Makefile
|
||||
@@ -65,9 +65,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__;' | \
|
||||
${HOSTCC} -c ${HOSTCCFLAGS} -xc - -o src/build_msg.o
|
||||
diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
|
||||
index 2ebee33931..4bdebd9235 100644
|
||||
--- a/tools/fiptool/Makefile
|
||||
+++ b/tools/fiptool/Makefile
|
||||
@@ -68,9 +68,9 @@ DEPS := $(patsubst %.o,%.d,$(OBJECTS))
|
||||
|
||||
.PHONY: all clean distclean --openssl
|
||||
|
||||
-all: ${PROJECT}
|
||||
+all: --openssl ${PROJECT}
|
||||
|
||||
-${PROJECT}: --openssl ${OBJECTS} Makefile
|
||||
+${PROJECT}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
|
||||
@${ECHO_BLANK_LINE}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 26073dca5982e86b45d6ff82176418f8624315f5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 160e98f12a..569f5f1552 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 a90617cc2c1791c98d36b9e3d9a7f3f77029897e00c4279ff4ef559b769e9d7b arm-trusted-firmware-lts-v2.8.20-git4.tar.gz
|
||||
sha256 130d0c6e5159fa454b1e969fd281fa1d388819aefb203f65dd282544b5ab7ba9 docs/license.rst
|
||||
@@ -0,0 +1,34 @@
|
||||
From ea879d9dcb7f22b9a0921613bf2f530e2787d0db Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 752ab419d2..78de01686c 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From f0f29a693064915f5df7ab9369f93353c6c692cc Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 752ab419d2..78de01686c 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From afa038938b5bc54703a10f9103e6b85e07fd562f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 5ab6123904..654f291732 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
$(q)+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 06b35a3596b8417bf66f7bfdd7acd181bcb53fc36dc13216227b5cae154e0219 arm-trusted-firmware-v2.12-git4.tar.gz
|
||||
sha256 b2c79635797bafcde84c6edadadde290b9d5e05deb3ea16a847210fd2ca83669 docs/license.rst
|
||||
@@ -0,0 +1,59 @@
|
||||
From 5e1beb793c06352e87c46eca1144ff1fe8555103 Mon Sep 17 00:00:00 2001
|
||||
From: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Date: Mon, 10 Jul 2023 10:43:03 +0200
|
||||
Subject: [PATCH] [PATCH] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 721246d51..5893cf422 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -297,11 +297,16 @@ 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
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
endif
|
||||
TF_LDFLAGS += $(TF_LDFLAGS_$(ARCH))
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From e94c6513bad0a2cdb2a2266129c06e5a55826d74 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 160e98f12a..569f5f1552 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From bbb06a551951a96b738f1aac70f8c2fc44b39e50 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 160e98f12a..569f5f1552 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
From 0f75b03c008eacb9818af3a56dc088e72a623d17 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] feat(build): add support for new binutils versions
|
||||
|
||||
Users of GNU ld (BPF) from binutils 2.39+ will observe multiple instaces
|
||||
of a new warning when linking the bl*.elf in the form:
|
||||
|
||||
ld.bfd: warning: stm32mp1_helper.o: missing .note.GNU-stack section implies executable stack
|
||||
ld.bfd: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
|
||||
ld.bfd: warning: bl2.elf has a LOAD segment with RWX permissions
|
||||
ld.bfd: warning: bl32.elf has a LOAD segment with RWX permissions
|
||||
|
||||
These new warnings are enbaled 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
|
||||
|
||||
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) and optional add
|
||||
--no-warn-rwx-segments since this a ld.bfd related.
|
||||
|
||||
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
|
||||
Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
|
||||
Change-Id: I9430f5fa5036ca88da46cd3b945754d62616b617
|
||||
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
|
||||
Upstream: https://github.com/ARM-software/arm-trusted-firmware/commit/1f49db5f25cdd4e43825c9bcc0575070b80f628c
|
||||
---
|
||||
Makefile | 7 ++++++-
|
||||
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 1ddb7b844..470956b19 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,6 +416,8 @@ endif
|
||||
|
||||
GCC_V_OUTPUT := $(shell $(CC) -v 2>&1)
|
||||
|
||||
+TF_LDFLAGS += -z noexecstack
|
||||
+
|
||||
# LD = armlink
|
||||
ifneq ($(findstring armlink,$(notdir $(LD))),)
|
||||
TF_LDFLAGS += --diag_error=warning --lto_level=O1
|
||||
@@ -442,7 +444,10 @@ TF_LDFLAGS += $(subst --,-Xlinker --,$(TF_LDFLAGS_$(ARCH)))
|
||||
|
||||
# LD = gcc-ld (ld) or llvm-ld (ld.lld) or other
|
||||
else
|
||||
-TF_LDFLAGS += --fatal-warnings -O1
|
||||
+# With ld.bfd version 2.39 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)
|
||||
+TF_LDFLAGS += -O1
|
||||
TF_LDFLAGS += --gc-sections
|
||||
# ld.lld doesn't recognize the errata flags,
|
||||
# therefore don't add those in that case
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
From aa57ce632c629fe72ff417e261e0f5bfd8db6bab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 4 Jul 2023 16:14:02 +0200
|
||||
Subject: [PATCH] build(tools): avoid unnecessary link
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In their respective makefiles, cert_create, encrypt_fw and fiptool
|
||||
depend on the --openssl phony target as a prerequisite. This forces
|
||||
those tools to be re-linked each time.
|
||||
|
||||
Move the dependencies on the --openssl target from the tools to their
|
||||
makefiles all targets, to avoid unnecessary linking while preserving the
|
||||
OpenSSL version printing done in the --openssl targets when in debug.
|
||||
|
||||
Fixes: cf2dd17ddda2 ("refactor(security): add OpenSSL 1.x compatibility")
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
Change-Id: I98a3ab30f36dffc253cecaaf3a57d2712522135d
|
||||
Upstream: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=aa57ce632c629fe72ff417e261e0f5bfd8db6bab
|
||||
---
|
||||
tools/cert_create/Makefile | 4 ++--
|
||||
tools/encrypt_fw/Makefile | 4 ++--
|
||||
tools/fiptool/Makefile | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile
|
||||
index 042e844626..b911d19d2b 100644
|
||||
--- a/tools/cert_create/Makefile
|
||||
+++ b/tools/cert_create/Makefile
|
||||
@@ -85,9 +85,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
|
||||
const char platform_msg[] = "${PLAT_MSG}";' | \
|
||||
diff --git a/tools/encrypt_fw/Makefile b/tools/encrypt_fw/Makefile
|
||||
index 2939b142be..924e5febab 100644
|
||||
--- a/tools/encrypt_fw/Makefile
|
||||
+++ b/tools/encrypt_fw/Makefile
|
||||
@@ -65,9 +65,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__;' | \
|
||||
${HOSTCC} -c ${HOSTCCFLAGS} -xc - -o src/build_msg.o
|
||||
diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
|
||||
index 2ebee33931..4bdebd9235 100644
|
||||
--- a/tools/fiptool/Makefile
|
||||
+++ b/tools/fiptool/Makefile
|
||||
@@ -68,9 +68,9 @@ DEPS := $(patsubst %.o,%.d,$(OBJECTS))
|
||||
|
||||
.PHONY: all clean distclean --openssl
|
||||
|
||||
-all: ${PROJECT}
|
||||
+all: --openssl ${PROJECT}
|
||||
|
||||
-${PROJECT}: --openssl ${OBJECTS} Makefile
|
||||
+${PROJECT}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
|
||||
@${ECHO_BLANK_LINE}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From e349eb61b8b5f058ad9d54fc063b66ca26cf5a5b Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 160e98f12a..569f5f1552 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
From aa57ce632c629fe72ff417e261e0f5bfd8db6bab Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 4 Jul 2023 16:14:02 +0200
|
||||
Subject: [PATCH] build(tools): avoid unnecessary link
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
In their respective makefiles, cert_create, encrypt_fw and fiptool
|
||||
depend on the --openssl phony target as a prerequisite. This forces
|
||||
those tools to be re-linked each time.
|
||||
|
||||
Move the dependencies on the --openssl target from the tools to their
|
||||
makefiles all targets, to avoid unnecessary linking while preserving the
|
||||
OpenSSL version printing done in the --openssl targets when in debug.
|
||||
|
||||
Fixes: cf2dd17ddda2 ("refactor(security): add OpenSSL 1.x compatibility")
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
Change-Id: I98a3ab30f36dffc253cecaaf3a57d2712522135d
|
||||
Upstream: https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/commit/?id=aa57ce632c629fe72ff417e261e0f5bfd8db6bab
|
||||
---
|
||||
tools/cert_create/Makefile | 4 ++--
|
||||
tools/encrypt_fw/Makefile | 4 ++--
|
||||
tools/fiptool/Makefile | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/tools/cert_create/Makefile b/tools/cert_create/Makefile
|
||||
index 042e844626..b911d19d2b 100644
|
||||
--- a/tools/cert_create/Makefile
|
||||
+++ b/tools/cert_create/Makefile
|
||||
@@ -85,9 +85,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__; \
|
||||
const char platform_msg[] = "${PLAT_MSG}";' | \
|
||||
diff --git a/tools/encrypt_fw/Makefile b/tools/encrypt_fw/Makefile
|
||||
index 2939b142be..924e5febab 100644
|
||||
--- a/tools/encrypt_fw/Makefile
|
||||
+++ b/tools/encrypt_fw/Makefile
|
||||
@@ -65,9 +65,9 @@ HOSTCC ?= gcc
|
||||
|
||||
.PHONY: all clean realclean --openssl
|
||||
|
||||
-all: ${BINARY}
|
||||
+all: --openssl ${BINARY}
|
||||
|
||||
-${BINARY}: --openssl ${OBJECTS} Makefile
|
||||
+${BINARY}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
@echo 'const char build_msg[] = "Built : "__TIME__", "__DATE__;' | \
|
||||
${HOSTCC} -c ${HOSTCCFLAGS} -xc - -o src/build_msg.o
|
||||
diff --git a/tools/fiptool/Makefile b/tools/fiptool/Makefile
|
||||
index 2ebee33931..4bdebd9235 100644
|
||||
--- a/tools/fiptool/Makefile
|
||||
+++ b/tools/fiptool/Makefile
|
||||
@@ -68,9 +68,9 @@ DEPS := $(patsubst %.o,%.d,$(OBJECTS))
|
||||
|
||||
.PHONY: all clean distclean --openssl
|
||||
|
||||
-all: ${PROJECT}
|
||||
+all: --openssl ${PROJECT}
|
||||
|
||||
-${PROJECT}: --openssl ${OBJECTS} Makefile
|
||||
+${PROJECT}: ${OBJECTS} Makefile
|
||||
@echo " HOSTLD $@"
|
||||
${Q}${HOSTCC} ${OBJECTS} -o $@ ${LDLIBS}
|
||||
@${ECHO_BLANK_LINE}
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
From 51d35780d42b53c5215019c9d6ffe28ce768e886 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= <vincent.stehle@arm.com>
|
||||
Date: Tue, 8 Apr 2025 13:27:53 +0200
|
||||
Subject: [PATCH] build(plat/marvell): allow building with non-git
|
||||
mv-ddr-marvell
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
When the mv-ddr-marvell folder is not a git tree the build fails
|
||||
complaining that it "does not contain valid mv-ddr-marvell git
|
||||
repository".
|
||||
|
||||
Remove this check to allow building in Buildroot.
|
||||
|
||||
Upstream: Not applicable. Buildroot specific.
|
||||
Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com>
|
||||
---
|
||||
plat/marvell/armada/a8k/common/ble/ble.mk | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/plat/marvell/armada/a8k/common/ble/ble.mk b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
index 752ab419d2..78de01686c 100644
|
||||
--- a/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
+++ b/plat/marvell/armada/a8k/common/ble/ble.mk
|
||||
@@ -31,5 +31,4 @@ $(MV_DDR_LIB): FORCE
|
||||
# Do not remove! Following checks are required to ensure correct TF-A builds, removing these checks leads to broken TF-A builds
|
||||
$(if $(value MV_DDR_PATH),,$(error "Platform '$(PLAT)' for BLE requires MV_DDR_PATH. Please set MV_DDR_PATH to point to the right directory"))
|
||||
$(if $(wildcard $(value MV_DDR_PATH)/*),,$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' directory does not exist"))
|
||||
- $(if $(shell git -C $(value MV_DDR_PATH) rev-parse --show-cdup 2>&1),$(error "'MV_DDR_PATH=$(value MV_DDR_PATH)' was specified, but '$(value MV_DDR_PATH)' does not contain valid mv-ddr-marvell git repository"))
|
||||
@+make -C $(MV_DDR_PATH) --no-print-directory PLAT_INCLUDES="$(MV_DDR_INCLUDES)" PLATFORM=$(PLAT) ARCH=AARCH64 OBJ_DIR=$(BUILD_PLAT)/ble
|
||||
--
|
||||
2.48.1
|
||||
|
||||
127
boot/at91bootstrap3/Config.in
Normal file
127
boot/at91bootstrap3/Config.in
Normal file
@@ -0,0 +1,127 @@
|
||||
menuconfig BR2_TARGET_AT91BOOTSTRAP3
|
||||
bool "AT91 Bootstrap 3+"
|
||||
depends on BR2_arm926t || BR2_cortex_a5 || BR2_cortex_a7
|
||||
help
|
||||
AT91Bootstrap is a first level bootloader for the Atmel AT91
|
||||
devices. It integrates algorithms for:
|
||||
- Device initialization such as clock configuration, PIO
|
||||
settings...
|
||||
- Peripheral drivers such as PIO, PMC or SDRAMC...
|
||||
- Physical media algorithm such as DataFlash, NandFlash, NOR
|
||||
Flash...
|
||||
|
||||
https://www.at91.com/linux4sam/bin/view/Linux4SAM/AT91Bootstrap
|
||||
|
||||
if BR2_TARGET_AT91BOOTSTRAP3
|
||||
|
||||
choice
|
||||
|
||||
prompt "AT91 Bootstrap 3+ version"
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION
|
||||
bool "4.0.0"
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION_3X
|
||||
bool "3.10.3"
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
help
|
||||
This option allows Buildroot to get the AT91 Bootstrap 3
|
||||
source code from a Git repository.
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_SVN
|
||||
bool "Custom SVN repository"
|
||||
help
|
||||
This option allows Buildroot to get the AT91 Bootstrap 3
|
||||
source code from a Subversion repository
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom AT91Bootstrap tarball"
|
||||
depends on BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
|
||||
|
||||
if BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT || BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_SVN
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL
|
||||
string "URL of custom repository"
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION
|
||||
string "Custom repository version"
|
||||
help
|
||||
Revision to use in the typical format used by Git or SVN
|
||||
E.G. a sha id, a tag, branch, ..
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_VERSION
|
||||
string
|
||||
default "v4.0.0" if BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION
|
||||
default "v3.10.3" if BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION_3X
|
||||
default BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT || BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_SVN
|
||||
default "custom" if BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_LICENSE_FILES
|
||||
string "AT91Bootstrap3 license files" if BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT || \
|
||||
BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_SVN || \
|
||||
BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
|
||||
default "" if BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION_3X
|
||||
default "LICENSES/MIT.txt"
|
||||
help
|
||||
A space-separated list of license files related to the
|
||||
AT91Bootstrap3 package.
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR
|
||||
string "custom patch dir"
|
||||
help
|
||||
If your board requires custom patches, add the path to the
|
||||
directory containing the patches here. The patches must be
|
||||
named at91bootstrap3-<something>.patch.
|
||||
|
||||
Most users may leave this empty
|
||||
|
||||
#
|
||||
# Configuration selection
|
||||
#
|
||||
|
||||
choice
|
||||
prompt "AT91 Bootstrap 3 configuration"
|
||||
default BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG
|
||||
bool "Using a defconfig"
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG
|
||||
string "Defconfig name"
|
||||
depends on BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG
|
||||
help
|
||||
Name of the at91bootstrap3 defconfig file to use, without the
|
||||
trailing _defconfig. The defconfig is located at
|
||||
board/<processor>/<board>_defconfig in the at91bootstrap3
|
||||
tree.
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the at91bootstrap3 configuration file
|
||||
|
||||
config BR2_TARGET_AT91BOOTSTRAP3_NEEDS_PYTHON3
|
||||
bool "needs host-python3"
|
||||
help
|
||||
Enable this option if the at91bootstrap build process needs
|
||||
Python 3.x to be available on the host. This is needed in
|
||||
some at91bootstrap configurations to use NAND/PMECC Python
|
||||
scripts.
|
||||
|
||||
endif # BR2_TARGET_AT91BOOTSTRAP3
|
||||
4
boot/at91bootstrap3/at91bootstrap3.hash
Normal file
4
boot/at91bootstrap3/at91bootstrap3.hash
Normal file
@@ -0,0 +1,4 @@
|
||||
# Locally calculated
|
||||
sha256 b6ae5bcaacc5a949f400182e036ae053049638444a3ba8b1dd154ec5f7898d8e at91bootstrap3-v3.10.3.tar.gz
|
||||
sha256 08c5b95df28be7f2e0439fb2b77fe27524f97c499850641e4540c07ea0b2c25d at91bootstrap3-v4.0.0.tar.gz
|
||||
sha256 5a3809b1c2ba13b7242572322951311c584419f1f8516f665d6c06f0668d78de LICENSES/MIT.txt
|
||||
110
boot/at91bootstrap3/at91bootstrap3.mk
Normal file
110
boot/at91bootstrap3/at91bootstrap3.mk
Normal file
@@ -0,0 +1,110 @@
|
||||
################################################################################
|
||||
#
|
||||
# at91bootstrap3
|
||||
#
|
||||
################################################################################
|
||||
|
||||
AT91BOOTSTRAP3_VERSION = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_VERSION))
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
|
||||
AT91BOOTSTRAP3_TARBALL = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION))
|
||||
AT91BOOTSTRAP3_SITE = $(patsubst %/,%,$(dir $(AT91BOOTSTRAP3_TARBALL)))
|
||||
AT91BOOTSTRAP3_SOURCE = $(notdir $(AT91BOOTSTRAP3_TARBALL))
|
||||
BR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
|
||||
else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
|
||||
AT91BOOTSTRAP3_SITE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL))
|
||||
AT91BOOTSTRAP3_SITE_METHOD = git
|
||||
BR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
|
||||
else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_SVN),y)
|
||||
AT91BOOTSTRAP3_SITE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL))
|
||||
AT91BOOTSTRAP3_SITE_METHOD = svn
|
||||
BR_NO_CHECK_HASH_FOR += $(AT91BOOTSTRAP3_SOURCE)
|
||||
else
|
||||
AT91BOOTSTRAP3_SITE = $(call github,linux4sam,at91bootstrap,$(AT91BOOTSTRAP3_VERSION))
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION),y)
|
||||
AT91BOOTSTRAP3_LICENSE = MIT
|
||||
else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_LATEST_VERSION_3X),y)
|
||||
AT91BOOTSTRAP3_LICENSE = Atmel License
|
||||
endif
|
||||
|
||||
AT91BOOTSTRAP3_LICENSE_FILES = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_LICENSE_FILES))
|
||||
|
||||
AT91BOOTSTRAP3_CPE_ID_VENDOR = linux4sam
|
||||
AT91BOOTSTRAP3_CPE_ID_PRODUCT = at91bootstrap
|
||||
|
||||
AT91BOOTSTRAP3_INSTALL_IMAGES = YES
|
||||
AT91BOOTSTRAP3_INSTALL_TARGET = NO
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_NEEDS_PYTHON3),y)
|
||||
AT91BOOTSTRAP3_DEPENDENCIES += host-python3
|
||||
endif
|
||||
|
||||
AT91BOOTSTRAP3_CUSTOM_PATCH_DIR = \
|
||||
$(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_PATCH_DIR))
|
||||
|
||||
AT91BOOTSTRAP3_MAKE_OPTS = CROSS_COMPILE=$(TARGET_CROSS) DESTDIR=$(BINARIES_DIR)
|
||||
|
||||
ifneq ($(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR),)
|
||||
define AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
|
||||
$(APPLY_PATCHES) $(@D) $(AT91BOOTSTRAP3_CUSTOM_PATCH_DIR) \*.patch
|
||||
endef
|
||||
|
||||
AT91BOOTSTRAP3_POST_PATCH_HOOKS += AT91BOOTSTRAP3_APPLY_CUSTOM_PATCHES
|
||||
endif
|
||||
|
||||
define AT91BOOTSTRAP3_BUILD_CMDS
|
||||
$(MAKE) $(AT91BOOTSTRAP3_MAKE_OPTS) -C $(@D)
|
||||
endef
|
||||
|
||||
define AT91BOOTSTRAP3_INSTALL_IMAGES_CMDS
|
||||
cp $(wildcard $(@D)/build/binaries/*.bin $(@D)/binaries/*.bin) $(BINARIES_DIR)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
|
||||
AT91BOOTSTRAP3_KCONFIG_DEFCONFIG = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG))_defconfig
|
||||
else ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
|
||||
AT91BOOTSTRAP3_KCONFIG_FILE = $(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE))
|
||||
endif
|
||||
|
||||
AT91BOOTSTRAP3_KCONFIG_EDITORS = menuconfig xconfig gconfig
|
||||
AT91BOOTSTRAP3_KCONFIG_OPTS = $(AT91BOOTSTRAP3_MAKE_OPTS)
|
||||
|
||||
# Checks to give errors that the user can understand
|
||||
# Must be before we call to kconfig-package
|
||||
ifeq ($(BR_BUILDING),y)
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_DEFCONFIG),y)
|
||||
# We must use the user-supplied kconfig value, because
|
||||
# AT91BOOTSTRAP3_KCONFIG_DEFCONFIG will at least contain
|
||||
# the trailing _defconfig
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG)),)
|
||||
$(error No at91bootstrap3 defconfig name specified, check your BR2_TARGET_AT91BOOTSTRAP3_DEFCONFIG setting)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_USE_CUSTOM_CONFIG),y)
|
||||
ifeq ($(AT91BOOTSTRAP3_KCONFIG_FILE),)
|
||||
$(error No at91bootstrap3 configuration file specified, check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_CONFIG_FILE setting)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_GIT),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL)),)
|
||||
$(error No custom at91bootstrap3 repository URL specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_URL setting)
|
||||
endif
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION)),)
|
||||
$(error No custom at91bootstrap3 repository version specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_REPO_VERSION setting)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION)),)
|
||||
$(error No custom AT91Bootstrap3 tarball specified. Check your BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION setting)
|
||||
endif # qstrip BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL_LOCATION
|
||||
endif # BR2_TARGET_AT91BOOTSTRAP3_CUSTOM_TARBALL
|
||||
|
||||
endif # BR_BUILDING
|
||||
|
||||
$(eval $(kconfig-package))
|
||||
@@ -0,0 +1,47 @@
|
||||
From 908c65678867565a934ea5a967bfe7e204d1ccaf Mon Sep 17 00:00:00 2001
|
||||
From: Edgar Bonet <bonet@grenoble.cnrs.fr>
|
||||
Date: Wed, 25 Jun 2025 11:13:43 +0200
|
||||
Subject: [PATCH] include/types.h: conditionally define bool, false and true
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
|
||||
However, since C23, these are predefine keywords. As C23 is the default
|
||||
C dialect for GCC 15, building with this compiler fails with:
|
||||
|
||||
include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
|
||||
23 | typedef unsigned char bool;
|
||||
| ^~~~
|
||||
include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
|
||||
|
||||
Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
|
||||
dialects older than C23.
|
||||
|
||||
Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
|
||||
[Edgar: backport to v3.10.3]
|
||||
|
||||
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
|
||||
---
|
||||
include/types.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/include/types.h b/include/types.h
|
||||
index 1246a4df..2c1a41cf 100644
|
||||
--- a/include/types.h
|
||||
+++ b/include/types.h
|
||||
@@ -42,8 +42,11 @@ typedef signed long long s64;
|
||||
typedef unsigned long size_t;
|
||||
typedef signed long ssize_t;
|
||||
|
||||
+/* bool, false and true are predefined since C23. */
|
||||
+#if __STDC_VERSION__ < 202311L
|
||||
typedef unsigned char bool;
|
||||
#define false 0U
|
||||
#define true 1U
|
||||
+#endif
|
||||
|
||||
#endif /* TYPES_H_ */
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
From 4aab60e634d588dffbd3154fd0cfce78272b750a Mon Sep 17 00:00:00 2001
|
||||
From: Edgar Bonet <bonet@grenoble.cnrs.fr>
|
||||
Date: Wed, 25 Jun 2025 11:13:43 +0200
|
||||
Subject: [PATCH] include/types.h: conditionally define bool, false and true
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
include/types.h typedefs ‘bool’ and macro-defines ‘false’ and ‘true’.
|
||||
However, since C23, these are predefine keywords. As C23 is the default
|
||||
C dialect for GCC 15, building with this compiler fails with:
|
||||
|
||||
include/types.h:23:23: error: ‘bool’ cannot be defined via ‘typedef’
|
||||
23 | typedef unsigned char bool;
|
||||
| ^~~~
|
||||
include/types.h:23:23: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
|
||||
|
||||
Fix this build failure by only defining ‘bool’, ‘false’ and ‘true’ on C
|
||||
dialects older than C23.
|
||||
|
||||
Upstream: https://github.com/linux4sam/at91bootstrap/pull/188
|
||||
|
||||
Signed-off-by: Edgar Bonet <bonet@grenoble.cnrs.fr>
|
||||
---
|
||||
include/types.h | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
diff --git a/include/types.h b/include/types.h
|
||||
index 950b1a46..0ad9ae61 100644
|
||||
--- a/include/types.h
|
||||
+++ b/include/types.h
|
||||
@@ -20,8 +20,11 @@ typedef signed long long s64;
|
||||
typedef unsigned long size_t;
|
||||
typedef signed long ssize_t;
|
||||
|
||||
+/* bool, false and true are predefined since C23. */
|
||||
+#if __STDC_VERSION__ < 202311L
|
||||
typedef unsigned char bool;
|
||||
#define false 0U
|
||||
#define true 1U
|
||||
+#endif
|
||||
|
||||
#endif /* TYPES_H_ */
|
||||
--
|
||||
2.43.0
|
||||
|
||||
105
boot/barebox/Config.in
Normal file
105
boot/barebox/Config.in
Normal file
@@ -0,0 +1,105 @@
|
||||
menuconfig BR2_TARGET_BAREBOX
|
||||
bool "Barebox"
|
||||
help
|
||||
The Barebox bootloader, formerly known as U-Boot v2.
|
||||
|
||||
http://www.barebox.org
|
||||
|
||||
if BR2_TARGET_BAREBOX
|
||||
choice
|
||||
prompt "version"
|
||||
help
|
||||
Select the specific Barebox version you want to use
|
||||
|
||||
config BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
bool "2022.12.0"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE
|
||||
string "Barebox version"
|
||||
depends on BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
|
||||
if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom Barebox tarball"
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_BAREBOX_VERSION
|
||||
string
|
||||
default "2022.12.0" if BR2_TARGET_BAREBOX_LATEST_VERSION
|
||||
default BR2_TARGET_BAREBOX_CUSTOM_VERSION_VALUE if BR2_TARGET_BAREBOX_CUSTOM_VERSION
|
||||
default "custom" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL
|
||||
default BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION if BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_BAREBOX_LICENSE_FILES
|
||||
string "Barebox license files" if BR2_TARGET_BAREBOX_CUSTOM_TARBALL || \
|
||||
BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
default "COPYING"
|
||||
help
|
||||
A space-separated list of license files related to the Barebox
|
||||
package.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR
|
||||
string "custom patch dir"
|
||||
help
|
||||
If your board requires custom patches, add the path to the
|
||||
directory containing the patches here. The patches must be
|
||||
named barebox-<version>-<something>.patch.
|
||||
|
||||
Most users may leave this empty
|
||||
|
||||
config BR2_TARGET_BAREBOX_NEEDS_OPENSSL
|
||||
bool "Barebox needs OpenSSL"
|
||||
help
|
||||
Select this option if your Barebox board configuration
|
||||
requires OpenSSL to be available on the host.
|
||||
|
||||
config BR2_TARGET_BAREBOX_NEEDS_LIBUSB
|
||||
bool "Barebox needs LibUSB"
|
||||
help
|
||||
Select this option if your Barebox board configuration
|
||||
requires libUSB to be available on the host.
|
||||
|
||||
if BR2_TARGET_BAREBOX_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL
|
||||
string "URL of custom Git repository"
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_GIT_VERSION
|
||||
string "Custom Git version"
|
||||
|
||||
endif
|
||||
|
||||
source "boot/barebox/barebox/Config.in"
|
||||
|
||||
menuconfig BR2_TARGET_BAREBOX_AUX
|
||||
bool "Build barebox with an auxiliary config"
|
||||
help
|
||||
Build barebox with an auxiliary configuration.
|
||||
|
||||
Useful for building an SPL (Secondary Program Loader) in
|
||||
addition to the traditional TPL (Tertiary Program Loader),
|
||||
such as the X-Loader or MLO for Texas Instruments
|
||||
processors.
|
||||
|
||||
if BR2_TARGET_BAREBOX_AUX
|
||||
|
||||
source "boot/barebox/barebox-aux/Config.in"
|
||||
|
||||
endif
|
||||
|
||||
endif
|
||||
80
boot/barebox/barebox-aux/Config.in
Normal file
80
boot/barebox/barebox-aux/Config.in
Normal file
@@ -0,0 +1,80 @@
|
||||
choice
|
||||
prompt "Barebox configuration"
|
||||
default BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
bool "Using a defconfig"
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_BOARD_DEFCONFIG
|
||||
string "board defconfig"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_USE_DEFCONFIG
|
||||
help
|
||||
Name of the board for which Barebox should be built, without
|
||||
the _defconfig suffix.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the barebox configuration file
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CONFIG_FRAGMENT_FILES
|
||||
string "Additional configuration fragment files"
|
||||
help
|
||||
A space-separated list of configuration fragment files,
|
||||
that will be merged to the main Barebox configuration file.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_IMAGE_FILE
|
||||
string "Image file names"
|
||||
help
|
||||
Space-separated list of barebox images which will be copied to
|
||||
the images directory.
|
||||
|
||||
If left empty, defaults to:
|
||||
- all images as listed in barebox-flash-images (>= v2015.12.0)
|
||||
- the image pointed at by barebox-flash-image (>= v2012.10.0)
|
||||
- barebox.bin for even older barebox versions
|
||||
|
||||
In any case, this only influences the artifacts collected by
|
||||
Buildroot. They will still need to be referenced from image
|
||||
packages or flashed separately onto the hardware.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV
|
||||
bool "Generate an environment image"
|
||||
help
|
||||
Generate a custom environment image. This environment will
|
||||
contain the variables and scripts to be used at boot by
|
||||
barebox.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV_PATH
|
||||
string "Environment path"
|
||||
depends on BR2_TARGET_BAREBOX_AUX_CUSTOM_ENV
|
||||
help
|
||||
Path to the directory containing the custom barebox
|
||||
environment. Depending on your setup, it will probably be
|
||||
based on either the content of the defaultenv or
|
||||
defaultenv-2 directories in the barebox source code, plus
|
||||
the additions needed. The output will be an image in the
|
||||
barebox devfs format, stored in the images directory, with
|
||||
the same name as the directory name given here.
|
||||
|
||||
config BR2_TARGET_BAREBOX_AUX_CUSTOM_EMBEDDED_ENV_PATH
|
||||
string "Embedded environment path"
|
||||
help
|
||||
If this option is not empty, it is the path to a custom
|
||||
embedded barebox environment. This image will be used when
|
||||
the environment found in the environment sector is
|
||||
invalid. This option sets the barebox Kconfig option
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH to the specified path. This
|
||||
way it is possible to use Buildroot variables like
|
||||
TOPDIR etc. to refer to the custom environment.
|
||||
|
||||
Depending on your setup, the custom embedded environment
|
||||
will probably be based on either the content of the
|
||||
defaultenv or defaultenv-2 directories in the barebox source
|
||||
code.
|
||||
1
boot/barebox/barebox-aux/barebox-aux.hash
Symbolic link
1
boot/barebox/barebox-aux/barebox-aux.hash
Symbolic link
@@ -0,0 +1 @@
|
||||
../barebox.hash
|
||||
8
boot/barebox/barebox-aux/barebox-aux.mk
Normal file
8
boot/barebox/barebox-aux/barebox-aux.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox-aux
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Instantiate the auxiliary barebox package
|
||||
$(eval $(barebox-package))
|
||||
8
boot/barebox/barebox.hash
Normal file
8
boot/barebox/barebox.hash
Normal file
@@ -0,0 +1,8 @@
|
||||
# From https://www.barebox.org/download/barebox-2022.12.0.tar.bz2.md5
|
||||
md5 e4bf25cbf1e0b0c9a67ee56214617b9c barebox-2022.12.0.tar.bz2
|
||||
|
||||
# Locally calculated
|
||||
sha256 9f570d4ae089560bd6c17b2b7d21cdb6557ecb00612c77ecee72ac47575a6b74 barebox-2022.12.0.tar.bz2
|
||||
|
||||
# License files, locally computed
|
||||
sha256 ab1122aa9f9073ad1ec824edcd970b16a6a7881a34a18fd56c080debb2dca5d4 COPYING
|
||||
199
boot/barebox/barebox.mk
Normal file
199
boot/barebox/barebox.mk
Normal file
@@ -0,0 +1,199 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox
|
||||
#
|
||||
################################################################################
|
||||
|
||||
################################################################################
|
||||
# inner-barebox-package -- generates the KConfig logic and make targets needed
|
||||
# to support a barebox package. All barebox packages are built from the same
|
||||
# source (origin, version and patches). The remainder of the package
|
||||
# configuration is unique to each barebox package.
|
||||
#
|
||||
# argument 1 is the uppercase package name (used for variable name-space)
|
||||
################################################################################
|
||||
|
||||
define inner-barebox-package
|
||||
|
||||
$(1)_VERSION = $$(call qstrip,$$(BR2_TARGET_BAREBOX_VERSION))
|
||||
|
||||
ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL),y)
|
||||
# Handle custom Barebox tarballs as specified by the configuration
|
||||
$(1)_TARBALL = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_TARBALL_LOCATION))
|
||||
$(1)_SITE = $$(patsubst %/,%,$$(dir $$($(1)_TARBALL)))
|
||||
$(1)_SOURCE = $$(notdir $$($(1)_TARBALL))
|
||||
else ifeq ($$(BR2_TARGET_BAREBOX_CUSTOM_GIT),y)
|
||||
$(1)_SITE = $$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_GIT_REPO_URL))
|
||||
$(1)_SITE_METHOD = git
|
||||
# Override the default value of _SOURCE to 'barebox-*' so that it is not
|
||||
# downloaded a second time for barebox-aux; also allows avoiding the hash
|
||||
# check:
|
||||
$(1)_SOURCE = barebox-$$($(1)_VERSION)$$(BR_FMT_VERSION_git).tar.gz
|
||||
else
|
||||
# Handle stable official Barebox versions
|
||||
$(1)_SOURCE = barebox-$$($(1)_VERSION).tar.bz2
|
||||
$(1)_SITE = https://www.barebox.org/download
|
||||
endif
|
||||
|
||||
$(1)_DL_SUBDIR = barebox
|
||||
|
||||
$(1)_DEPENDENCIES = host-lzop
|
||||
$(1)_LICENSE = GPL-2.0 with exceptions
|
||||
$(1)_LICENSE_FILES = $$(call qstrip,$$(BR2_TARGET_BAREBOX_LICENSE_FILES))
|
||||
|
||||
ifeq ($(BR2_TARGET_BAREBOX_NEEDS_OPENSSL),y)
|
||||
BAREBOX_DEPENDENCIES += host-openssl host-pkgconf
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_BAREBOX_NEEDS_LIBUSB),y)
|
||||
BAREBOX_DEPENDENCIES += host-libusb host-pkgconf
|
||||
endif
|
||||
|
||||
$(1)_CUSTOM_EMBEDDED_ENV_PATH = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_EMBEDDED_ENV_PATH))
|
||||
|
||||
ifneq ($$(call qstrip,$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR)),)
|
||||
define $(1)_APPLY_CUSTOM_PATCHES
|
||||
$$(APPLY_PATCHES) $$(@D) \
|
||||
$$(BR2_TARGET_BAREBOX_CUSTOM_PATCH_DIR) \*.patch
|
||||
endef
|
||||
|
||||
$(1)_POST_PATCH_HOOKS += $(1)_APPLY_CUSTOM_PATCHES
|
||||
endif
|
||||
|
||||
$(1)_INSTALL_IMAGES = YES
|
||||
ifneq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
||||
$(1)_INSTALL_TARGET = NO
|
||||
endif
|
||||
|
||||
ifeq ($$(NORMALIZED_ARCH),i386)
|
||||
$(1)_ARCH = x86
|
||||
else ifeq ($$(NORMALIZED_ARCH),x86_64)
|
||||
$(1)_ARCH = x86
|
||||
else ifeq ($$(NORMALIZED_ARCH),powerpc)
|
||||
$(1)_ARCH = ppc
|
||||
else ifeq ($$(NORMALIZED_ARCH),arm64)
|
||||
$(1)_ARCH = arm
|
||||
else
|
||||
$(1)_ARCH = $$(NORMALIZED_ARCH)
|
||||
endif
|
||||
|
||||
$(1)_MAKE_FLAGS = ARCH=$$($(1)_ARCH) CROSS_COMPILE="$$(TARGET_CROSS)"
|
||||
$(1)_MAKE_ENV = $$(TARGET_MAKE_ENV)
|
||||
$(1)_MAKE_ENV += \
|
||||
PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)" \
|
||||
PKG_CONFIG_SYSROOT_DIR="/" \
|
||||
PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 \
|
||||
PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 \
|
||||
PKG_CONFIG_LIBDIR="$(HOST_DIR)/lib/pkgconfig:$(HOST_DIR)/share/pkgconfig"
|
||||
|
||||
ifeq ($$(BR2_REPRODUCIBLE),y)
|
||||
$(1)_MAKE_ENV += \
|
||||
KBUILD_BUILD_USER=buildroot \
|
||||
KBUILD_BUILD_HOST=buildroot \
|
||||
KBUILD_BUILD_TIMESTAMP="$$(shell LC_ALL=C TZ='UTC' date -d @$(SOURCE_DATE_EPOCH))"
|
||||
endif
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_USE_DEFCONFIG),y)
|
||||
$(1)_KCONFIG_DEFCONFIG = $$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))_defconfig
|
||||
else ifeq ($$(BR2_TARGET_$(1)_USE_CUSTOM_CONFIG),y)
|
||||
$(1)_KCONFIG_FILE = $$(call qstrip,$$(BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE))
|
||||
endif
|
||||
|
||||
$(1)_KCONFIG_FRAGMENT_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_CONFIG_FRAGMENT_FILES))
|
||||
$(1)_KCONFIG_EDITORS = menuconfig xconfig gconfig nconfig
|
||||
$(1)_KCONFIG_OPTS = $$($(1)_MAKE_FLAGS)
|
||||
|
||||
$(1)_KCONFIG_DEPENDENCIES = \
|
||||
$(BR2_BISON_HOST_DEPENDENCY) \
|
||||
$(BR2_FLEX_HOST_DEPENDENCY)
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_CUSTOM_ENV),y)
|
||||
$(1)_ENV_NAME = $$(notdir $$(call qstrip,\
|
||||
$$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)))
|
||||
define $(1)_BUILD_CUSTOM_ENV
|
||||
$$(@D)/scripts/bareboxenv -s \
|
||||
$$(call qstrip, $$(BR2_TARGET_$(1)_CUSTOM_ENV_PATH)) \
|
||||
$$(@D)/$$($(1)_ENV_NAME)
|
||||
endef
|
||||
define $(1)_INSTALL_CUSTOM_ENV
|
||||
cp $$(@D)/$$($(1)_ENV_NAME) $$(BINARIES_DIR)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifneq ($$($(1)_CUSTOM_EMBEDDED_ENV_PATH),)
|
||||
define $(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH
|
||||
$$(call KCONFIG_ENABLE_OPT,CONFIG_DEFAULT_ENVIRONMENT)
|
||||
$$(call KCONFIG_SET_OPT,CONFIG_DEFAULT_ENVIRONMENT_PATH,"$$($(1)_CUSTOM_EMBEDDED_ENV_PATH)")
|
||||
endef
|
||||
endif
|
||||
|
||||
define $(1)_KCONFIG_FIXUP_BAREBOXENV
|
||||
$$(if $$(BR2_TARGET_$(1)_BAREBOXENV),\
|
||||
$$(call KCONFIG_ENABLE_OPT,CONFIG_BAREBOXENV_TARGET),\
|
||||
$$(call KCONFIG_DISABLE_OPT,CONFIG_BAREBOXENV_TARGET))
|
||||
endef
|
||||
|
||||
define $(1)_KCONFIG_FIXUP_CMDS
|
||||
$$($(1)_KCONFIG_FIXUP_CUSTOM_EMBEDDED_ENV_PATH)
|
||||
$$($(1)_KCONFIG_FIXUP_BAREBOXENV)
|
||||
endef
|
||||
|
||||
define $(1)_BUILD_CMDS
|
||||
$$($(1)_BUILD_BAREBOXENV_CMDS)
|
||||
$$($(1)_MAKE_ENV) $$(MAKE) $$($(1)_MAKE_FLAGS) -C $$(@D)
|
||||
$$($(1)_BUILD_CUSTOM_ENV)
|
||||
endef
|
||||
|
||||
$(1)_IMAGE_FILES = $$(call qstrip,$$(BR2_TARGET_$(1)_IMAGE_FILE))
|
||||
|
||||
define $(1)_INSTALL_IMAGES_CMDS
|
||||
if test -n "$$($(1)_IMAGE_FILES)"; then \
|
||||
cp -L $$(foreach image,$$($(1)_IMAGE_FILES),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
|
||||
elif test -e $$(@D)/barebox-flash-images ; then \
|
||||
cp -L $$(foreach image,$$(shell cat $$(@D)/barebox-flash-images),$$(@D)/$$(image)) $$(BINARIES_DIR) ; \
|
||||
elif test -h $$(@D)/barebox-flash-image ; then \
|
||||
cp -L $$(@D)/barebox-flash-image $$(BINARIES_DIR)/barebox.bin ; \
|
||||
else \
|
||||
cp $$(@D)/barebox.bin $$(BINARIES_DIR);\
|
||||
fi
|
||||
$$($(1)_INSTALL_CUSTOM_ENV)
|
||||
endef
|
||||
|
||||
# Starting with barebox v2020.09.0, the kconfig used calls the
|
||||
# cross-compiler to check its capabilities. So we need the
|
||||
# toolchain before we can call the configurators.
|
||||
$(1)_KCONFIG_DEPENDENCIES += toolchain
|
||||
|
||||
ifeq ($$(BR2_TARGET_$(1)_BAREBOXENV),y)
|
||||
define $(1)_INSTALL_TARGET_CMDS
|
||||
cp $$(@D)/scripts/bareboxenv-target $$(TARGET_DIR)/usr/bin/bareboxenv
|
||||
endef
|
||||
endif
|
||||
|
||||
# Checks to give errors that the user can understand
|
||||
# Must be before we call to kconfig-package
|
||||
ifeq ($$(BR2_TARGET_$(1))$$(BR_BUILDING),yy)
|
||||
# We must use the user-supplied kconfig value, because
|
||||
# $(1)_KCONFIG_DEFCONFIG will at least contain the
|
||||
# trailing _defconfig
|
||||
ifeq ($$(or $$($(1)_KCONFIG_FILE),$$(call qstrip,$$(BR2_TARGET_$(1)_BOARD_DEFCONFIG))),)
|
||||
$$(error No Barebox config. Check your BR2_TARGET_$(1)_BOARD_DEFCONFIG or BR2_TARGET_$(1)_CUSTOM_CONFIG_FILE settings)
|
||||
endif
|
||||
endif
|
||||
|
||||
$$(eval $$(kconfig-package))
|
||||
|
||||
endef
|
||||
|
||||
################################################################################
|
||||
# barebox-package -- the target generator macro for barebox packages
|
||||
################################################################################
|
||||
|
||||
barebox-package=$(call inner-barebox-package,$(call UPPERCASE,$(pkgname)))
|
||||
|
||||
include boot/barebox/barebox/barebox.mk
|
||||
include boot/barebox/barebox-aux/barebox-aux.mk
|
||||
|
||||
ifeq ($(BR2_TARGET_BAREBOX)$(BR2_TARGET_BAREBOX_LATEST_VERSION),y)
|
||||
BR_NO_CHECK_HASH_FOR += $(BAREBOX_SOURCE)
|
||||
endif
|
||||
85
boot/barebox/barebox/Config.in
Normal file
85
boot/barebox/barebox/Config.in
Normal file
@@ -0,0 +1,85 @@
|
||||
choice
|
||||
prompt "Barebox configuration"
|
||||
default BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
|
||||
config BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
bool "Using a defconfig"
|
||||
|
||||
config BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
|
||||
bool "Using a custom config file"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_BAREBOX_BOARD_DEFCONFIG
|
||||
string "board defconfig"
|
||||
depends on BR2_TARGET_BAREBOX_USE_DEFCONFIG
|
||||
help
|
||||
Name of the board for which Barebox should be built, without
|
||||
the _defconfig suffix.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_CONFIG_FILE
|
||||
string "Configuration file path"
|
||||
depends on BR2_TARGET_BAREBOX_USE_CUSTOM_CONFIG
|
||||
help
|
||||
Path to the barebox configuration file
|
||||
|
||||
config BR2_TARGET_BAREBOX_CONFIG_FRAGMENT_FILES
|
||||
string "Additional configuration fragment files"
|
||||
help
|
||||
A space-separated list of configuration fragment files,
|
||||
that will be merged to the main Barebox configuration file.
|
||||
|
||||
config BR2_TARGET_BAREBOX_IMAGE_FILE
|
||||
string "Image file names"
|
||||
help
|
||||
Space-separated list of barebox images which will be copied to
|
||||
the images directory.
|
||||
|
||||
If left empty, defaults to:
|
||||
- all images as listed in barebox-flash-images (>= v2015.12.0)
|
||||
- the image pointed at by barebox-flash-image (>= v2012.10.0)
|
||||
- barebox.bin for even older barebox versions
|
||||
|
||||
In any case, this only influences the artifacts collected by
|
||||
Buildroot. They will still need to be referenced from image
|
||||
packages or flashed separately onto the hardware.
|
||||
|
||||
config BR2_TARGET_BAREBOX_BAREBOXENV
|
||||
bool "bareboxenv tool in target"
|
||||
help
|
||||
Install bareboxenv tool in target.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_ENV
|
||||
bool "Generate an environment image"
|
||||
help
|
||||
Generate a custom environment image. This environment will
|
||||
contain the variables and scripts to be used at boot by
|
||||
barebox.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_ENV_PATH
|
||||
string "Environment path"
|
||||
depends on BR2_TARGET_BAREBOX_CUSTOM_ENV
|
||||
help
|
||||
Path to the directory containing the custom barebox
|
||||
environment. Depending on your setup, it will probably be
|
||||
based on either the content of the defaultenv or
|
||||
defaultenv-2 directories in the barebox source code, plus
|
||||
the additions needed. The output will be an image in the
|
||||
barebox devfs format, stored in the images directory, with
|
||||
the same name as the directory name given here.
|
||||
|
||||
config BR2_TARGET_BAREBOX_CUSTOM_EMBEDDED_ENV_PATH
|
||||
string "Embedded environment path"
|
||||
help
|
||||
If this option is not empty, it is the path to a custom
|
||||
embedded barebox environment. This image will be used when
|
||||
the environment found in the environment sector is
|
||||
invalid. This option sets the barebox Kconfig option
|
||||
CONFIG_DEFAULT_ENVIRONMENT_PATH to the specified path. This
|
||||
way it is possible to use Buildroot variables like
|
||||
TOPDIR etc. to refer to the custom environment.
|
||||
|
||||
Depending on your setup, the custom embedded environment
|
||||
will probably be based on either the content of the
|
||||
defaultenv or defaultenv-2 directories in the barebox source
|
||||
code.
|
||||
1
boot/barebox/barebox/barebox.hash
Symbolic link
1
boot/barebox/barebox/barebox.hash
Symbolic link
@@ -0,0 +1 @@
|
||||
../barebox.hash
|
||||
8
boot/barebox/barebox/barebox.mk
Normal file
8
boot/barebox/barebox/barebox.mk
Normal file
@@ -0,0 +1,8 @@
|
||||
################################################################################
|
||||
#
|
||||
# barebox
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# Instantiate the barebox package
|
||||
$(eval $(barebox-package))
|
||||
12
boot/binaries-marvell/Config.in
Normal file
12
boot/binaries-marvell/Config.in
Normal file
@@ -0,0 +1,12 @@
|
||||
config BR2_TARGET_BINARIES_MARVELL
|
||||
bool "binaries-marvell"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Some systems, including Marvell Armada SoC, have a separate
|
||||
System Control Processor (SCP) for power management, clocks,
|
||||
reset and system control. ATF Boot Loader stage 2 (BL2) loads
|
||||
optional SCP_BL2 image into a platform-specific region
|
||||
of secure memory. This package downloads and installs such
|
||||
firmware, which is needed to build ATF.
|
||||
|
||||
https://github.com/MarvellEmbeddedProcessors/binaries-marvell/
|
||||
3
boot/binaries-marvell/binaries-marvell.hash
Normal file
3
boot/binaries-marvell/binaries-marvell.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 d818c95bcd4d5c026238d6e554151184ed7fea15bce1f861f9068b97b4cd320a binaries-marvell-c5d3ef2b63ba66d8717ecbe679fd2e639cde88ee.tar.gz
|
||||
sha256 e6d08ef60068ee72c68835001a24eb832dcba27cac0dde0f179dfb428be050ca README.md
|
||||
20
boot/binaries-marvell/binaries-marvell.mk
Normal file
20
boot/binaries-marvell/binaries-marvell.mk
Normal file
@@ -0,0 +1,20 @@
|
||||
################################################################################
|
||||
#
|
||||
# binaries-marvell
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# This is version binaries-marvell-armada-18.12
|
||||
BINARIES_MARVELL_VERSION = c5d3ef2b63ba66d8717ecbe679fd2e639cde88ee
|
||||
BINARIES_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,binaries-marvell,$(BINARIES_MARVELL_VERSION))
|
||||
|
||||
BINARIES_MARVELL_LICENSE = GPL-2.0 with freertos-exception-2.0
|
||||
BINARIES_MARVELL_LICENSE_FILES = README.md
|
||||
|
||||
BINARIES_MARVELL_INSTALL_IMAGES = YES
|
||||
|
||||
define BINARIES_MARVELL_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -D -m 0644 $(@D)/mrvl_scp_bl2.img $(BINARIES_DIR)/scp-fw.bin
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
46
boot/boot-wrapper-aarch64/Config.in
Normal file
46
boot/boot-wrapper-aarch64/Config.in
Normal file
@@ -0,0 +1,46 @@
|
||||
comment "boot-wrapper-aarch64 needs a Linux kernel to be built"
|
||||
depends on BR2_aarch64
|
||||
depends on !BR2_LINUX_KERNEL
|
||||
|
||||
menuconfig BR2_TARGET_BOOT_WRAPPER_AARCH64
|
||||
bool "boot-wrapper-aarch64"
|
||||
depends on BR2_aarch64
|
||||
depends on BR2_LINUX_KERNEL
|
||||
help
|
||||
The boot-wrapper-aarch64 is a small bootloader that makes it
|
||||
possible to start an Aarch64 kernel inside the available
|
||||
software simulators for the Aarch64 architecture.
|
||||
|
||||
https://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
|
||||
|
||||
if BR2_TARGET_BOOT_WRAPPER_AARCH64
|
||||
|
||||
config BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS
|
||||
string "Device Tree Source name"
|
||||
default ""
|
||||
help
|
||||
Name of the Device Tree Source file to use to generate the
|
||||
Device Tree Blob that will be embedded in the image
|
||||
generated by the boot wrapper. Valid names are the .dts
|
||||
files from arch/arm64/boot/dts/ in the kernel source
|
||||
tree. The name must be specified without the .dts suffix.
|
||||
|
||||
config BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS
|
||||
string "Kernel bootargs"
|
||||
default ""
|
||||
help
|
||||
Kernel bootargs to embed inside the image generated by the
|
||||
boot wrapper.
|
||||
|
||||
config BR2_TARGET_BOOT_WRAPPER_AARCH64_PSCI
|
||||
bool "Boot secondary SMP cores using PSCI"
|
||||
help
|
||||
Boot secondary SMP cores using PSCI firmware calls. If
|
||||
disabled, the spin-table method is used instead.
|
||||
|
||||
config BR2_TARGET_BOOT_WRAPPER_AARCH64_GICV3
|
||||
bool "Enable GICv3 instead of GICv2"
|
||||
help
|
||||
Boot using GICv3 instead of GICv2.
|
||||
|
||||
endif
|
||||
5
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.hash
Normal file
5
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# Locally computed:
|
||||
sha256 c9fcac5e28e1501bcffb3b36d56487cbefcf7cb708e00f48fe6360ef82fb3847 boot-wrapper-aarch64-b621b157b42f1fe398520cf499db88aa654c78e2-git4.tar.gz
|
||||
|
||||
# Hash for license files:
|
||||
sha256 bdaa479b497358151fc1166dc75a613e68321320b945e92ea07a4b6dc9a63271 LICENSE.txt
|
||||
50
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk
Normal file
50
boot/boot-wrapper-aarch64/boot-wrapper-aarch64.mk
Normal file
@@ -0,0 +1,50 @@
|
||||
################################################################################
|
||||
#
|
||||
# boot-wrapper-aarch64
|
||||
#
|
||||
################################################################################
|
||||
|
||||
BOOT_WRAPPER_AARCH64_VERSION = b621b157b42f1fe398520cf499db88aa654c78e2
|
||||
BOOT_WRAPPER_AARCH64_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/mark/boot-wrapper-aarch64.git
|
||||
BOOT_WRAPPER_AARCH64_SITE_METHOD = git
|
||||
BOOT_WRAPPER_AARCH64_LICENSE = BSD-3-Clause
|
||||
BOOT_WRAPPER_AARCH64_LICENSE_FILES = LICENSE.txt
|
||||
BOOT_WRAPPER_AARCH64_DEPENDENCIES = linux
|
||||
BOOT_WRAPPER_AARCH64_INSTALL_IMAGES = YES
|
||||
|
||||
# The Git repository does not have the generated configure script and
|
||||
# Makefile.
|
||||
BOOT_WRAPPER_AARCH64_AUTORECONF = YES
|
||||
|
||||
BOOT_WRAPPER_AARCH64_DTB = $(LINUX_DIR)/arch/arm64/boot/dts/$(basename $(call qstrip,$(BR2_TARGET_BOOT_WRAPPER_AARCH64_DTS))).dtb
|
||||
|
||||
BOOT_WRAPPER_AARCH64_CONF_OPTS = \
|
||||
--with-kernel-dir=$(LINUX_DIR) \
|
||||
--with-dtb=$(BOOT_WRAPPER_AARCH64_DTB) \
|
||||
--with-cmdline=$(BR2_TARGET_BOOT_WRAPPER_AARCH64_BOOTARGS)
|
||||
|
||||
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_PSCI),y)
|
||||
BOOT_WRAPPER_AARCH64_CONF_OPTS += --enable-psci
|
||||
else
|
||||
BOOT_WRAPPER_AARCH64_CONF_OPTS += --disable-psci
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_BOOT_WRAPPER_AARCH64_GICV3),y)
|
||||
BOOT_WRAPPER_AARCH64_CONF_OPTS += --enable-gicv3
|
||||
endif
|
||||
|
||||
# We need to convince the configure script that the Linux kernel tree
|
||||
# exists, as well as the DTB and the kernel Image. Even though those
|
||||
# are available on the build machine, the configure script uses
|
||||
# AC_CHECK_FILE tests, which are always disabled in cross-compilation
|
||||
# situations.
|
||||
BOOT_WRAPPER_AARCH64_CONF_ENV = \
|
||||
$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR))=yes \
|
||||
$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR)$(BOOT_WRAPPER_AARCH64_DTB))=yes \
|
||||
$(call AUTOCONF_AC_CHECK_FILE_VAL,$(LINUX_DIR)/arch/arm64/boot/Image)=yes
|
||||
|
||||
define BOOT_WRAPPER_AARCH64_INSTALL_IMAGES_CMDS
|
||||
cp $(@D)/linux-system.axf $(BINARIES_DIR)
|
||||
endef
|
||||
|
||||
$(eval $(autotools-package))
|
||||
1
boot/common.mk
Normal file
1
boot/common.mk
Normal file
@@ -0,0 +1 @@
|
||||
include $(sort $(wildcard boot/*/*.mk))
|
||||
@@ -0,0 +1,48 @@
|
||||
From 3d3af4812d29c5527e5a701d2cb7aff671fdc182 Mon Sep 17 00:00:00 2001
|
||||
From: Michael D Kinney <michael.d.kinney@intel.com>
|
||||
Date: Tue, 24 Feb 2026 21:50:20 -0800
|
||||
Subject: [PATCH] BaseTools/Source/C/VfrCompile: Fix parallel make failures
|
||||
|
||||
Update makefile rules to run antlr and dlg to completion
|
||||
before compiling any of the generated cpp files.
|
||||
|
||||
Without this change, parallel make may start compiling some
|
||||
of the cpp files before both antlr and dlg have finished
|
||||
which produces syntax errors from compilation with partially
|
||||
generated files.
|
||||
|
||||
Also use &: so the targets are treated as a group and the
|
||||
rule is only executed once for the entire group. Without
|
||||
this change, parallel make may run the rule actions more
|
||||
than once and modify the output while it is being used by
|
||||
another rule.
|
||||
|
||||
Upstream: https://github.com/tianocore/edk2/commit/9fc0aca51e83afda703963ea177feeb78a125cbc
|
||||
Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
|
||||
Signed-off-by: Julien Olivain <ju.o@free.fr>
|
||||
---
|
||||
BaseTools/Source/C/VfrCompile/GNUmakefile | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/BaseTools/Source/C/VfrCompile/GNUmakefile b/BaseTools/Source/C/VfrCompile/GNUmakefile
|
||||
index b469bd3f30..4f10b1d933 100644
|
||||
--- a/BaseTools/Source/C/VfrCompile/GNUmakefile
|
||||
+++ b/BaseTools/Source/C/VfrCompile/GNUmakefile
|
||||
@@ -54,10 +54,11 @@ VfrCompiler.o: ../Include/Common/BuildVersion.h
|
||||
|
||||
include $(MAKEROOT)/Makefiles/footer.makefile
|
||||
|
||||
-VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h: Pccts/antlr/antlr VfrSyntax.g
|
||||
- Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
|
||||
+ANTLR_GEN = VfrSyntax.cpp EfiVfrParser.cpp EfiVfrParser.h VfrParser.dlg VfrTokens.h
|
||||
+DLG_GEN = VfrLexer.cpp VfrLexer.h
|
||||
|
||||
-VfrLexer.cpp VfrLexer.h: Pccts/dlg/dlg VfrParser.dlg
|
||||
+$(ANTLR_GEN) $(DLG_GEN) &: Pccts/antlr/antlr Pccts/dlg/dlg VfrSyntax.g
|
||||
+ Pccts/antlr/antlr -CC -e3 -ck 3 -k 2 -fl VfrParser.dlg -ft VfrTokens.h -o . VfrSyntax.g
|
||||
Pccts/dlg/dlg -C2 -i -CC -cl VfrLexer -o . VfrParser.dlg
|
||||
|
||||
Pccts/antlr/antlr:
|
||||
--
|
||||
2.53.0
|
||||
|
||||
152
boot/edk2/Config.in
Normal file
152
boot/edk2/Config.in
Normal file
@@ -0,0 +1,152 @@
|
||||
config BR2_TARGET_EDK2_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_aarch64
|
||||
default y if BR2_i386
|
||||
default y if BR2_loongarch64
|
||||
default y if BR2_RISCV_64
|
||||
default y if BR2_x86_64
|
||||
|
||||
config BR2_TARGET_EDK2
|
||||
bool "EDK2"
|
||||
depends on BR2_TARGET_EDK2_ARCH_SUPPORTS
|
||||
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5
|
||||
select BR2_PACKAGE_EDK2_PLATFORMS
|
||||
help
|
||||
EDK II is a modern, feature-rich, cross-platform firmware
|
||||
development environment for the UEFI and PI specifications.
|
||||
|
||||
https://github.com/tianocore/tianocore.github.io/wiki/EDK-II
|
||||
|
||||
if BR2_TARGET_EDK2
|
||||
|
||||
choice
|
||||
prompt "Platform"
|
||||
default BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64 if \
|
||||
BR2_loongarch64
|
||||
default BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV if BR2_RISCV_64
|
||||
default BR2_TARGET_EDK2_PLATFORM_OVMF_X64 if BR2_x86_64
|
||||
default BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU if BR2_aarch64
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64
|
||||
bool "LoongArch64"
|
||||
depends on BR2_loongarch64
|
||||
help
|
||||
Platform configuration for LoongArch QEMU targeting the
|
||||
Virt machine. This platform will only boot from flash
|
||||
address 0x1c000000. It should therefore be used as the first
|
||||
bootloader.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV
|
||||
bool "RISC-V"
|
||||
depends on BR2_RISCV_64
|
||||
help
|
||||
Platform configuration for RISC-V QEMU targeting the Virt
|
||||
machine. This platform will only boot from flash address
|
||||
0x0. It should therefore be used as the first bootloader.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_OVMF_X64
|
||||
bool "x86-64"
|
||||
depends on BR2_x86_64
|
||||
help
|
||||
Platform configuration for a generic x86-64 target.
|
||||
This platform will boot from flash address 0x0.
|
||||
It should therefore be used as the first bootloader.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU
|
||||
bool "ARM Virt Qemu (flash)"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Platform configuration for QEMU targeting the Virt machine.
|
||||
This platform will only boot from flash address 0x0.
|
||||
It should therefore be used as the first bootloader.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL
|
||||
bool "ARM Virt Qemu (kernel)"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Platform configuration for QEMU targeting the Virt machine.
|
||||
This platform can boot from either flash address 0x0 or via
|
||||
the Linux boot protocol. It can therefore be loaded by a
|
||||
previous bootloader like ARM Trusted Firmware or OP-TEE.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_ARM_SGI575
|
||||
bool "ARM SGI-575"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Platform configuration for ARM SGI-575 on ARM's
|
||||
Fixed Virtual Platform (FVP).
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64
|
||||
bool "ARM VExpress FVP Aarch64"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Platform configuration for ARM Versatile Express targeting
|
||||
the Aarch64 Fixed Virtual Platform (FVP).
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN
|
||||
bool "SolidRun MacchiatoBin"
|
||||
depends on BR2_aarch64
|
||||
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
|
||||
select BR2_PACKAGE_EDK2_NON_OSI
|
||||
select BR2_PACKAGE_HOST_DTC
|
||||
select BR2_TARGET_ARM_TRUSTED_FIRMWARE_FIP
|
||||
help
|
||||
Platform configuration for the SolidRun MacchiatoBin.
|
||||
|
||||
config BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA
|
||||
bool "QEMU SBSA"
|
||||
depends on BR2_aarch64
|
||||
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE
|
||||
depends on !BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
|
||||
help
|
||||
Platform configuration for QEMU targeting the SBSA reference
|
||||
machine.
|
||||
|
||||
comment "QEMU SBSA depends on ATF not using EDK2 as BL33"
|
||||
depends on BR2_TARGET_ARM_TRUSTED_FIRMWARE_EDK2_AS_BL33
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL
|
||||
bool "OVMF Debug on Serial"
|
||||
depends on BR2_ENABLE_DEBUG
|
||||
depends on BR2_TARGET_EDK2_PLATFORM_OVMF_X64
|
||||
help
|
||||
When EDK2 OVMF is built with debug, messages are printed to
|
||||
IO port 0x402. Those messages are not shown in the normal
|
||||
Qemu emulated serial port. Enabling this option will print
|
||||
debug messages on the emulated serial port, potentially
|
||||
mixing messages with UEFI serial console output.
|
||||
|
||||
See OVMF README:
|
||||
https://github.com/tianocore/edk2/blob/master/OvmfPkg/README
|
||||
|
||||
config BR2_TARGET_EDK2_EXTRA_BUILD_OPTS
|
||||
string "Extra build options"
|
||||
help
|
||||
EDK2 build may include extra options. Those are usually in
|
||||
the form of "-D SOMEFLAG_ENABLE" and might be specific for a
|
||||
processor architecture or a platform. For example: "-D
|
||||
NETWORK_HTTP_BOOT_ENABLE", "-D NETWORK_TLS_ENABLE", ...
|
||||
|
||||
Those options are generally documented in their respective
|
||||
packages. See for example:
|
||||
https://github.com/tianocore/edk2/blob/master/OvmfPkg/README
|
||||
|
||||
This configuration is an arbitrary string that will be
|
||||
passed to the build command.
|
||||
|
||||
config BR2_TARGET_EDK2_FD_NAME
|
||||
string
|
||||
default "OVMF" if BR2_TARGET_EDK2_PLATFORM_OVMF_X64
|
||||
default "QEMU_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU
|
||||
default "QEMU_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL
|
||||
default "QEMU_EFI" if BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64
|
||||
default "BL33_AP_UEFI" if BR2_TARGET_EDK2_PLATFORM_ARM_SGI575
|
||||
default "FVP_AARCH64_EFI" if BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64
|
||||
default "ARMADA_EFI" if BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN
|
||||
|
||||
endif
|
||||
|
||||
comment "EDK2 needs a toolchain w/ gcc >= 5"
|
||||
depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_5
|
||||
3
boot/edk2/edk2.hash
Normal file
3
boot/edk2/edk2.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 a44b47f2d233213cdb848206bda8d475b264ed1a2cf097ae9cd82581e4aa2090 edk2-edk2-stable202602-git4.tar.gz
|
||||
sha256 50ce20c9cfdb0e19ee34fe0a51fc0afe961f743697b068359ab2f862b494df80 License.txt
|
||||
168
boot/edk2/edk2.mk
Normal file
168
boot/edk2/edk2.mk
Normal file
@@ -0,0 +1,168 @@
|
||||
################################################################################
|
||||
#
|
||||
# edk2
|
||||
#
|
||||
################################################################################
|
||||
|
||||
EDK2_VERSION = edk2-stable202602
|
||||
EDK2_SITE = https://github.com/tianocore/edk2
|
||||
EDK2_SITE_METHOD = git
|
||||
EDK2_LICENSE = BSD-2-Clause-Patent
|
||||
EDK2_LICENSE_FILES = License.txt
|
||||
EDK2_CPE_ID_VENDOR = tianocore
|
||||
EDK2_DEPENDENCIES = edk2-platforms host-python3 host-acpica host-util-linux
|
||||
EDK2_INSTALL_TARGET = NO
|
||||
EDK2_INSTALL_IMAGES = YES
|
||||
|
||||
ifeq ($(BR2_ENABLE_DEBUG),y)
|
||||
EDK2_BUILD_TYPE = DEBUG
|
||||
ifeq ($(BR2_TARGET_EDK2_OVMF_DEBUG_ON_SERIAL),y)
|
||||
# DEBUG_ON_SERIAL_PORT is only tested to be set, so don't disable it, as
|
||||
# it would still be set.
|
||||
EDK2_BUILD_OPTS += -DDEBUG_ON_SERIAL_PORT
|
||||
endif
|
||||
else
|
||||
EDK2_BUILD_TYPE = RELEASE
|
||||
# DEBUG_ON_SERIAL_PORT is only valid in debug builds, so useless to set
|
||||
# it (enabled or disabled) on a release build.
|
||||
endif
|
||||
|
||||
# Build system notes.
|
||||
#
|
||||
# The EDK2 build system is rather unique, so here are a few useful notes.
|
||||
#
|
||||
# First, builds rely heavily on Git submodules to fetch various dependencies
|
||||
# into specific directory structures. It might be possible to work around this
|
||||
# and rely on Buildroot's infrastructure, but using Git submodules greatly
|
||||
# simplifies this already complicated build system.
|
||||
#
|
||||
# Second, the build system is spread across various commands and stages.
|
||||
# Therefore, all build variables needs to be exported to be available
|
||||
# accordingly. The first stage will build $(@D)/BaseTools which contains
|
||||
# various tools and scripts for the host.
|
||||
#
|
||||
# Third, where applicable, the dependency direction between EDK2 and
|
||||
# ARM Trusted Firmware (ATF) will go in different direction for different
|
||||
# platforms. Most commonly, ATF will depend on EDK2 via the BL33 payload.
|
||||
# But for some platforms (e.g. QEMU SBSA) EDK2 will package the ATF
|
||||
# images within its own build system. In such cases, intermediary
|
||||
# "EDK2 packages" will be built in $(EDK2_BUILD_PACKAGES) in order for
|
||||
# EDK2 to be able to use them in subsequent build stages.
|
||||
#
|
||||
# For more information about the build setup:
|
||||
# https://edk2-docs.gitbook.io/edk-ii-build-specification/4_edk_ii_build_process_overview
|
||||
|
||||
EDK2_GIT_SUBMODULES = YES
|
||||
EDK2_BUILD_PACKAGES = $(@D)/Build/Buildroot
|
||||
EDK2_PACKAGES_PATHS = $(@D) $(EDK2_BUILD_PACKAGES) $(STAGING_DIR)/usr/share/edk2-platforms
|
||||
|
||||
ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_X64),y)
|
||||
EDK2_ARCH = X64
|
||||
EDK2_DEPENDENCIES += host-nasm
|
||||
EDK2_PACKAGE_NAME = OvmfPkg
|
||||
EDK2_PLATFORM_NAME = OvmfPkgX64
|
||||
EDK2_BUILD_DIR = OvmfX64
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_PACKAGE_NAME = ArmVirtPkg
|
||||
EDK2_PLATFORM_NAME = ArmVirtQemu
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-AArch64
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VIRT_QEMU_KERNEL),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_PACKAGE_NAME = ArmVirtPkg
|
||||
EDK2_PLATFORM_NAME = ArmVirtQemuKernel
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-AArch64
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_SGI575),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_PACKAGE_NAME = Platform/ARM/SgiPkg/Sgi575
|
||||
EDK2_PLATFORM_NAME = Sgi575
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_ARM_VEXPRESS_FVP_AARCH64),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_PACKAGE_NAME = Platform/ARM/VExpressPkg
|
||||
EDK2_PLATFORM_NAME = ArmVExpress-FVP-AArch64
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_SOLIDRUN_ARMADA80X0MCBIN),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_DEPENDENCIES += host-dtc edk2-non-osi
|
||||
EDK2_PACKAGE_NAME = Platform/SolidRun/Armada80x0McBin
|
||||
EDK2_PLATFORM_NAME = Armada80x0McBin
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)-$(EDK2_ARCH)
|
||||
EDK2_BUILD_ENV += DTC_PREFIX=$(HOST_DIR)/bin/
|
||||
EDK2_BUILD_OPTS += -D INCLUDE_TFTP_COMMAND
|
||||
EDK2_PACKAGES_PATHS += $(STAGING_DIR)/usr/share/edk2-non-osi
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_QEMU_SBSA),y)
|
||||
EDK2_ARCH = AARCH64
|
||||
EDK2_DEPENDENCIES += arm-trusted-firmware
|
||||
EDK2_PACKAGE_NAME = Platform/Qemu/SbsaQemu
|
||||
EDK2_PLATFORM_NAME = SbsaQemu
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
||||
EDK2_PRE_BUILD_HOOKS += EDK2_PRE_BUILD_QEMU_SBSA
|
||||
|
||||
define EDK2_PRE_BUILD_QEMU_SBSA
|
||||
mkdir -p $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa
|
||||
ln -srf $(BINARIES_DIR)/{bl1.bin,fip.bin} $(EDK2_BUILD_PACKAGES)/Platform/Qemu/Sbsa/
|
||||
endef
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_RISCV),y)
|
||||
EDK2_ARCH = RISCV64
|
||||
EDK2_PACKAGE_NAME = OvmfPkg/RiscVVirt
|
||||
EDK2_PLATFORM_NAME = RiscVVirtQemu
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
||||
|
||||
else ifeq ($(BR2_TARGET_EDK2_PLATFORM_OVMF_LOONGARCH64),y)
|
||||
EDK2_ARCH = LOONGARCH64
|
||||
EDK2_PACKAGE_NAME = OvmfPkg/LoongArchVirt
|
||||
EDK2_PLATFORM_NAME = LoongArchVirtQemu
|
||||
EDK2_BUILD_DIR = $(EDK2_PLATFORM_NAME)
|
||||
|
||||
endif
|
||||
|
||||
EDK2_BASETOOLS_OPTS = \
|
||||
EXTRA_LDFLAGS="$(HOST_LDFLAGS)" \
|
||||
EXTRA_OPTFLAGS="$(HOST_CPPFLAGS)"
|
||||
|
||||
EDK2_PACKAGES_PATH = $(subst $(space),:,$(strip $(EDK2_PACKAGES_PATHS)))
|
||||
|
||||
# EDK2 "build" script internally uses and calls "make", which controls
|
||||
# its own flags. It is mainly tested while not being a sub-make. In
|
||||
# order to stay in that configuration, we avoid leaking top-level
|
||||
# Buildroot make flags into EDK2 build by clearing the MAKEFLAGS
|
||||
# environment variable.
|
||||
EDK2_BUILD_ENV += \
|
||||
MAKEFLAGS= \
|
||||
WORKSPACE=$(@D) \
|
||||
PACKAGES_PATH=$(EDK2_PACKAGES_PATH) \
|
||||
PYTHON_COMMAND=$(HOST_DIR)/bin/python3 \
|
||||
IASL_PREFIX=$(HOST_DIR)/bin/ \
|
||||
NASM_PREFIX=$(HOST_DIR)/bin/ \
|
||||
GCC5_$(EDK2_ARCH)_PREFIX=$(TARGET_CROSS)
|
||||
|
||||
EDK2_BUILD_OPTS += \
|
||||
-t GCC5 \
|
||||
-n $(BR2_JLEVEL) \
|
||||
-a $(EDK2_ARCH) \
|
||||
-b $(EDK2_BUILD_TYPE) \
|
||||
-p $(EDK2_PACKAGE_NAME)/$(EDK2_PLATFORM_NAME).dsc \
|
||||
$(call qstrip,$(BR2_TARGET_EDK2_EXTRA_BUILD_OPTS))
|
||||
|
||||
define EDK2_BUILD_CMDS
|
||||
mkdir -p $(EDK2_BUILD_PACKAGES)
|
||||
export $(EDK2_BUILD_ENV) && \
|
||||
unset ARCH && \
|
||||
source $(@D)/edksetup.sh && \
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/BaseTools $(EDK2_BASETOOLS_OPTS) && \
|
||||
build $(EDK2_BUILD_OPTS) all
|
||||
endef
|
||||
|
||||
define EDK2_INSTALL_IMAGES_CMDS
|
||||
cp -f $(@D)/Build/$(EDK2_BUILD_DIR)/$(EDK2_BUILD_TYPE)_GCC5/FV/*.fd $(BINARIES_DIR)
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,75 @@
|
||||
From 3a9d2dd2f5fb07b75a74c307d61b9b9fc5d20a62 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Zhao <yi.zhao@windriver.com>
|
||||
Date: Fri, 27 Feb 2026 11:46:54 +0800
|
||||
Subject: [PATCH] Revert "configure: Check linker for --image-base support"
|
||||
|
||||
This reverts commit 1a5417f39a0ccefcdd5440f2a67f84d2d2e26960.
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
Upstream: temporary revert, until upstream fixes the issue, see
|
||||
discussion at
|
||||
https://lists.gnu.org/archive/html/grub-devel/2026-02/msg00039.html
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
acinclude.m4 | 5 -----
|
||||
configure.ac | 14 ++------------
|
||||
2 files changed, 2 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/acinclude.m4 b/acinclude.m4
|
||||
index 70c1912f8..fa7840f09 100644
|
||||
--- a/acinclude.m4
|
||||
+++ b/acinclude.m4
|
||||
@@ -79,11 +79,6 @@ AC_DEFUN([grub_PROG_OBJCOPY_ABSOLUTE],
|
||||
[AC_MSG_CHECKING([whether ${TARGET_OBJCOPY} works for absolute addresses])
|
||||
AC_CACHE_VAL(grub_cv_prog_objcopy_absolute,
|
||||
[cat > conftest.c <<\EOF
|
||||
-asm (
|
||||
- ".globl start, _start, __start\n"
|
||||
- ".ifdef cmain; .set start = _start = __start = cmain\n.endif\n"
|
||||
- ".ifdef _cmain; .set start = _start = __start = _cmain\n.endif\n"
|
||||
-);
|
||||
void cmain (void);
|
||||
void
|
||||
cmain (void)
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d8ca1b7c1..041cfbab4 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1461,6 +1461,7 @@ elif test x$grub_cv_target_cc_link_format = x-mi386pe || test x$grub_cv_target_c
|
||||
TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/i386-cygwin-img-ld.sc"
|
||||
TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}"
|
||||
TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/i386-cygwin-img-ld.sc"
|
||||
+ TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
|
||||
TARGET_IMG_CFLAGS=
|
||||
else
|
||||
TARGET_APPLE_LINKER=0
|
||||
@@ -1468,6 +1469,7 @@ else
|
||||
TARGET_IMG_LDSCRIPT=
|
||||
TARGET_IMG_LDFLAGS='-Wl,-N'
|
||||
TARGET_IMG_LDFLAGS_AC='-Wl,-N'
|
||||
+ TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"
|
||||
TARGET_IMG_CFLAGS=
|
||||
fi
|
||||
|
||||
@@ -1798,18 +1800,6 @@ grub_PROG_TARGET_CC
|
||||
m4_ifndef([AX_CHECK_LINK_FLAG], [m4_fatal([autoconf-archive is missing. You must install it to generate the configure script.])])
|
||||
|
||||
if test "x$TARGET_APPLE_LINKER" != x1 ; then
|
||||
-AX_CHECK_LINK_FLAG([-Wl,--image-base,0x400000],
|
||||
- [TARGET_IMG_BASE_LDOPT="-Wl,--image-base"],
|
||||
- [TARGET_IMG_BASE_LDOPT="-Wl,-Ttext"],
|
||||
- [],
|
||||
- [AC_LANG_SOURCE([
|
||||
-asm (".globl start; start:");
|
||||
-asm (".globl _start; _start:");
|
||||
-asm (".globl __start; __start:");
|
||||
-void __main (void);
|
||||
-void __main (void) {}
|
||||
-int main (void);
|
||||
- ])])
|
||||
grub_PROG_OBJCOPY_ABSOLUTE
|
||||
fi
|
||||
grub_PROG_LD_BUILD_ID_NONE
|
||||
--
|
||||
2.43.0
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
From d0f516385dc73e8dd92b78ce08c1df100434fe67 Mon Sep 17 00:00:00 2001
|
||||
From: Yi Zhao <yi.zhao@windriver.com>
|
||||
Date: Fri, 27 Feb 2026 13:58:44 +0800
|
||||
Subject: [PATCH] Revert "configure: Print a more helpful error if
|
||||
autoconf-archive is not installed"
|
||||
|
||||
This reverts commit ac042f3f58d33ce9cd5ff61750f06da1a1d7b0eb.
|
||||
|
||||
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
||||
Upstream: temporary revert, until upstream fixes the issue, see
|
||||
discussion at
|
||||
https://lists.gnu.org/archive/html/grub-devel/2026-02/msg00039.html
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
|
||||
---
|
||||
configure.ac | 5 -----
|
||||
1 file changed, 5 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 041cfbab4..209c0fb11 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -1794,11 +1794,6 @@ LIBS=""
|
||||
# Defined in acinclude.m4.
|
||||
grub_ASM_USCORE
|
||||
grub_PROG_TARGET_CC
|
||||
-
|
||||
-# The error message produced by autoconf if autoconf-archive is not installed is
|
||||
-# quite misleading and not very helpful. So, try point people in the right direction.
|
||||
-m4_ifndef([AX_CHECK_LINK_FLAG], [m4_fatal([autoconf-archive is missing. You must install it to generate the configure script.])])
|
||||
-
|
||||
if test "x$TARGET_APPLE_LINKER" != x1 ; then
|
||||
grub_PROG_OBJCOPY_ABSOLUTE
|
||||
fi
|
||||
--
|
||||
2.43.0
|
||||
|
||||
188
boot/grub2/Config.in
Normal file
188
boot/grub2/Config.in
Normal file
@@ -0,0 +1,188 @@
|
||||
config BR2_TARGET_GRUB2_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_i386
|
||||
default y if BR2_x86_64
|
||||
default y if BR2_arm
|
||||
default y if BR2_aarch64
|
||||
default y if BR2_RISCV_64
|
||||
default y if BR2_loongarch64
|
||||
depends on BR2_USE_MMU
|
||||
|
||||
menuconfig BR2_TARGET_GRUB2
|
||||
bool "grub2"
|
||||
depends on BR2_TARGET_GRUB2_ARCH_SUPPORTS
|
||||
depends on BR2_USE_WCHAR
|
||||
select BR2_TARGET_GRUB2_I386_PC if \
|
||||
!BR2_TARGET_GRUB2_HAS_PTF && \
|
||||
(BR2_i386 || BR2_x86_64)
|
||||
select BR2_TARGET_GRUB2_ARM_UBOOT if \
|
||||
!BR2_TARGET_GRUB2_HAS_PTF && \
|
||||
BR2_arm
|
||||
select BR2_TARGET_GRUB2_ARM64_EFI if BR2_aarch64
|
||||
help
|
||||
GNU GRUB is a Multiboot boot loader. It was derived from
|
||||
GRUB, the GRand Unified Bootloader, which was originally
|
||||
designed and implemented by Erich Stefan Boleyn. GRUB 2 has
|
||||
replaced what was formerly known as GRUB (i.e. version
|
||||
0.9x), which has, in turn, become GRUB Legacy.
|
||||
|
||||
Amongst others, GRUB2 offers EFI support, which GRUB Legacy
|
||||
doesn't provide.
|
||||
|
||||
The file boot/grub2/grub.cfg is used by default as the Grub
|
||||
configuration file. It can be overridden using a rootfs
|
||||
overlay or post-build script.
|
||||
|
||||
For additional notes on using Grub 2 with Buildroot, see
|
||||
boot/grub2/readme.txt
|
||||
|
||||
http://www.gnu.org/software/grub/
|
||||
|
||||
if BR2_TARGET_GRUB2
|
||||
|
||||
config BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
|
||||
bool
|
||||
|
||||
config BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
bool
|
||||
|
||||
config BR2_TARGET_GRUB2_HAS_PTF
|
||||
bool
|
||||
|
||||
config BR2_TARGET_GRUB2_I386_PC
|
||||
bool "i386-pc"
|
||||
depends on BR2_i386 || BR2_x86_64
|
||||
select BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is a
|
||||
x86 or x86-64 legacy BIOS based platform.
|
||||
|
||||
config BR2_TARGET_GRUB2_I386_EFI
|
||||
bool "i386-efi"
|
||||
depends on BR2_i386 || BR2_x86_64
|
||||
select BR2_TARGET_GRUB2_HAS_PTF
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting has a
|
||||
32 bits EFI BIOS. Note that some x86-64 platforms use a 32
|
||||
bits EFI BIOS, and this option should be used in this case.
|
||||
|
||||
config BR2_TARGET_GRUB2_X86_64_EFI
|
||||
bool "x86-64-efi"
|
||||
depends on BR2_x86_64
|
||||
select BR2_TARGET_GRUB2_HAS_PTF
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting has a
|
||||
64 bits EFI BIOS.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
bool "arm-uboot"
|
||||
depends on BR2_arm
|
||||
select BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is an
|
||||
ARM u-boot platform, and you want to boot Grub 2 as an u-boot
|
||||
compatible image.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM_EFI
|
||||
bool "arm-efi"
|
||||
depends on BR2_arm
|
||||
select BR2_TARGET_GRUB2_HAS_PTF
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is an
|
||||
ARM platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
config BR2_TARGET_GRUB2_ARM64_EFI
|
||||
bool "arm64-efi"
|
||||
depends on BR2_aarch64
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is an
|
||||
Aarch64 platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
config BR2_TARGET_GRUB2_RISCV64_EFI
|
||||
bool "riscv64-efi"
|
||||
depends on BR2_RISCV_64
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is a
|
||||
64bit RISC-V platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
config BR2_TARGET_GRUB2_LOONGARCH64_EFI
|
||||
bool "loongarch64-efi"
|
||||
depends on BR2_loongarch64
|
||||
select BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
help
|
||||
Select this option if the platform you're targeting is a
|
||||
64bit LoongArch platform and you want to boot Grub 2 as an EFI
|
||||
application.
|
||||
|
||||
if BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
|
||||
|
||||
comment "Options for the x86 legacy BIOS or ARM U-Boot support"
|
||||
|
||||
config BR2_TARGET_GRUB2_BOOT_PARTITION
|
||||
string "boot partition"
|
||||
default "hd0,msdos1"
|
||||
help
|
||||
Specify the partition where the /boot/grub/grub.cfg file is
|
||||
located. Use 'hd0,msdos1' for the first partition of the
|
||||
first disk if using a legacy partition table, or 'hd0,gpt1'
|
||||
if using GPT partition table.
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_MODULES_PC
|
||||
string "builtin modules"
|
||||
default BR2_TARGET_GRUB2_BUILTIN_MODULES if BR2_TARGET_GRUB2_BUILTIN_MODULES != "" # legacy
|
||||
default "boot linux ext2 fat squash4 part_msdos part_gpt normal biosdisk" if BR2_TARGET_GRUB2_I386_PC
|
||||
default "linux ext2 fat part_msdos normal" if BR2_TARGET_GRUB2_ARM_UBOOT
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC
|
||||
string "builtin config"
|
||||
default BR2_TARGET_GRUB2_BUILTIN_CONFIG if BR2_TARGET_GRUB2_BUILTIN_CONFIG != "" # legacy
|
||||
help
|
||||
Path to a Grub 2 configuration file that will be embedded
|
||||
into the Grub image itself. This allows to set the root
|
||||
device and other configuration parameters, but however menu
|
||||
entries cannot be described in this embedded configuration.
|
||||
|
||||
endif # BR2_TARGET_GRUB2_HAS_LEGACY_BOOT
|
||||
|
||||
if BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
|
||||
comment "Options for the EFI BIOS or ARM EFI support"
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI
|
||||
string "builtin modules"
|
||||
default BR2_TARGET_GRUB2_BUILTIN_MODULES if BR2_TARGET_GRUB2_BUILTIN_MODULES != "" # legacy
|
||||
default "boot linux ext2 fat squash4 part_msdos part_gpt normal efi_gop"
|
||||
|
||||
config BR2_TARGET_GRUB2_BUILTIN_CONFIG_EFI
|
||||
string "builtin config"
|
||||
default BR2_TARGET_GRUB2_BUILTIN_CONFIG if BR2_TARGET_GRUB2_BUILTIN_CONFIG != "" # legacy
|
||||
help
|
||||
Path to a Grub 2 configuration file that will be embedded
|
||||
into the Grub image itself. This allows to set the root
|
||||
device and other configuration parameters, but however menu
|
||||
entries cannot be described in this embedded configuration.
|
||||
|
||||
endif # BR2_TARGET_GRUB2_HAS_EFI_BOOT
|
||||
|
||||
config BR2_TARGET_GRUB2_INSTALL_TOOLS
|
||||
bool "install tools"
|
||||
help
|
||||
Install support tools to interact with GNU GRUB Multiboot
|
||||
boot loader.
|
||||
|
||||
This will also install the Grub 2 loadable modules to the
|
||||
target.
|
||||
|
||||
endif # BR2_TARGET_GRUB2
|
||||
|
||||
comment "grub2 needs a toolchain w/ wchar"
|
||||
depends on BR2_TARGET_GRUB2_ARCH_SUPPORTS
|
||||
depends on !BR2_USE_WCHAR
|
||||
6
boot/grub2/grub.cfg
Normal file
6
boot/grub2/grub.cfg
Normal file
@@ -0,0 +1,6 @@
|
||||
set default="0"
|
||||
set timeout="5"
|
||||
|
||||
menuentry "Buildroot" {
|
||||
linux /boot/bzImage root=/dev/sda1 rootwait console=tty1
|
||||
}
|
||||
5
boot/grub2/grub2.hash
Normal file
5
boot/grub2/grub2.hash
Normal file
@@ -0,0 +1,5 @@
|
||||
# Locally calculated after checking signature
|
||||
# https://ftp.gnu.org/gnu/grub/grub-2.14.tar.xz.sig
|
||||
sha256 bc8d3c73535b8838d8c8e2654d73edc4e6ae8c8acdb45d5df5dc9a1547446d43 grub-2.14.tar.xz
|
||||
# Locally computed:
|
||||
sha256 8ceb4b9ee5adedde47b31e975c1d90c73ad27b6b165a1dcd80c7c545eb65b903 COPYING
|
||||
203
boot/grub2/grub2.mk
Normal file
203
boot/grub2/grub2.mk
Normal file
@@ -0,0 +1,203 @@
|
||||
################################################################################
|
||||
#
|
||||
# grub2
|
||||
#
|
||||
################################################################################
|
||||
|
||||
GRUB2_VERSION = 2.14
|
||||
GRUB2_SITE = $(BR2_GNU_MIRROR)/grub
|
||||
GRUB2_SOURCE = grub-$(GRUB2_VERSION).tar.xz
|
||||
GRUB2_LICENSE = GPL-3.0+
|
||||
GRUB2_LICENSE_FILES = COPYING
|
||||
GRUB2_DEPENDENCIES = host-bison host-flex host-gawk host-grub2 \
|
||||
$(BR2_PYTHON3_HOST_DEPENDENCY)
|
||||
HOST_GRUB2_DEPENDENCIES = host-bison host-flex host-gawk \
|
||||
$(BR2_PYTHON3_HOST_DEPENDENCY)
|
||||
GRUB2_INSTALL_IMAGES = YES
|
||||
|
||||
# 0001-Revert-configure-Check-linker-for-image-base-support.patch
|
||||
# 0002-Revert-configure-Print-a-more-helpful-error-if-autoc.patch
|
||||
# Target grub2 package doesn't use autotools-package
|
||||
GRUB2_DEPENDENCIES += host-automake host-autoconf host-libtool host-pkgconf
|
||||
HOST_GRUB2_AUTORECONF = YES
|
||||
HOST_GRUB2_DEPENDENCIES += host-pkgconf
|
||||
|
||||
ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
|
||||
GRUB2_INSTALL_TARGET = YES
|
||||
else
|
||||
GRUB2_INSTALL_TARGET = NO
|
||||
endif
|
||||
GRUB2_CPE_ID_VENDOR = gnu
|
||||
|
||||
GRUB2_BUILTIN_MODULES_PC = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES_PC))
|
||||
GRUB2_BUILTIN_MODULES_EFI = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_MODULES_EFI))
|
||||
GRUB2_BUILTIN_CONFIG_PC = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC))
|
||||
GRUB2_BUILTIN_CONFIG_EFI = $(call qstrip,$(BR2_TARGET_GRUB2_BUILTIN_CONFIG_EFI))
|
||||
GRUB2_BOOT_PARTITION = $(call qstrip,$(BR2_TARGET_GRUB2_BOOT_PARTITION))
|
||||
|
||||
GRUB2_IMAGE_i386-pc = $(BINARIES_DIR)/grub.img
|
||||
GRUB2_CFG_i386-pc = $(TARGET_DIR)/boot/grub/grub.cfg
|
||||
GRUB2_PREFIX_i386-pc = ($(GRUB2_BOOT_PARTITION))/boot/grub
|
||||
GRUB2_TARGET_i386-pc = i386
|
||||
GRUB2_PLATFORM_i386-pc = pc
|
||||
GRUB2_BUILTIN_CONFIG_i386-pc = $(GRUB2_BUILTIN_CONFIG_PC)
|
||||
GRUB2_BUILTIN_MODULES_i386-pc = $(GRUB2_BUILTIN_MODULES_PC)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_I386_PC) += i386-pc
|
||||
|
||||
GRUB2_IMAGE_i386-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootia32.efi
|
||||
GRUB2_CFG_i386-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_i386-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_i386-efi = i386
|
||||
GRUB2_PLATFORM_i386-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_i386-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_i386-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_I386_EFI) += i386-efi
|
||||
|
||||
GRUB2_IMAGE_x86_64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootx64.efi
|
||||
GRUB2_CFG_x86_64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_x86_64-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_x86_64-efi = x86_64
|
||||
GRUB2_PLATFORM_x86_64-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_x86_64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_x86_64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_X86_64_EFI) += x86_64-efi
|
||||
|
||||
GRUB2_IMAGE_arm-uboot = $(BINARIES_DIR)/boot-part/grub/grub.img
|
||||
GRUB2_CFG_arm-uboot = $(BINARIES_DIR)/boot-part/grub/grub.cfg
|
||||
GRUB2_PREFIX_arm-uboot = ($(GRUB2_BOOT_PARTITION))/boot/grub
|
||||
GRUB2_TARGET_arm-uboot = arm
|
||||
GRUB2_PLATFORM_arm-uboot = uboot
|
||||
GRUB2_BUILTIN_CONFIG_arm-uboot = $(GRUB2_BUILTIN_CONFIG_PC)
|
||||
GRUB2_BUILTIN_MODULES_arm-uboot = $(GRUB2_BUILTIN_MODULES_PC)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM_UBOOT) += arm-uboot
|
||||
|
||||
GRUB2_IMAGE_arm-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootarm.efi
|
||||
GRUB2_CFG_arm-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_arm-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_arm-efi = arm
|
||||
GRUB2_PLATFORM_arm-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_arm-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_arm-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM_EFI) += arm-efi
|
||||
|
||||
GRUB2_IMAGE_arm64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootaa64.efi
|
||||
GRUB2_CFG_arm64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_arm64-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_arm64-efi = aarch64
|
||||
GRUB2_PLATFORM_arm64-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_arm64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_arm64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_ARM64_EFI) += arm64-efi
|
||||
|
||||
GRUB2_IMAGE_riscv64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootriscv64.efi
|
||||
GRUB2_CFG_riscv64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_riscv64-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_riscv64-efi = riscv64
|
||||
GRUB2_PLATFORM_riscv64-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_riscv64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_riscv64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_RISCV64_EFI) += riscv64-efi
|
||||
|
||||
GRUB2_IMAGE_loongarch64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/bootloongarch64.efi
|
||||
GRUB2_CFG_loongarch64-efi = $(BINARIES_DIR)/efi-part/EFI/BOOT/grub.cfg
|
||||
GRUB2_PREFIX_loongarch64-efi = /EFI/BOOT
|
||||
GRUB2_TARGET_loongarch64-efi = loongarch64
|
||||
GRUB2_PLATFORM_loongarch64-efi = efi
|
||||
GRUB2_BUILTIN_CONFIG_loongarch64-efi = $(GRUB2_BUILTIN_CONFIG_EFI)
|
||||
GRUB2_BUILTIN_MODULES_loongarch64-efi = $(GRUB2_BUILTIN_MODULES_EFI)
|
||||
GRUB2_TUPLES-$(BR2_TARGET_GRUB2_LOONGARCH64_EFI) += loongarch64-efi
|
||||
|
||||
# Grub2 is kind of special: it considers CC, LD and so on to be the
|
||||
# tools to build the host programs and uses TARGET_CC, TARGET_CFLAGS,
|
||||
# TARGET_CPPFLAGS, TARGET_LDFLAGS to build the bootloader itself.
|
||||
#
|
||||
# NOTE: TARGET_STRIP is overridden by !BR2_STRIP_strip, so always
|
||||
# use the cross compile variant to ensure grub2 builds
|
||||
|
||||
HOST_GRUB2_CONF_ENV = \
|
||||
CPP="$(HOSTCC) -E"
|
||||
|
||||
GRUB2_CONF_ENV = \
|
||||
CPP="$(TARGET_CC) -E" \
|
||||
TARGET_CC="$(TARGET_CC)" \
|
||||
CFLAGS="$(TARGET_CFLAGS) -Os" \
|
||||
TARGET_CFLAGS="$(TARGET_CFLAGS) -Os" \
|
||||
CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \
|
||||
TARGET_CPPFLAGS="$(TARGET_CPPFLAGS) -Os -fno-stack-protector" \
|
||||
TARGET_LDFLAGS="$(TARGET_LDFLAGS) -Os" \
|
||||
TARGET_NM="$(TARGET_NM)" \
|
||||
TARGET_OBJCOPY="$(TARGET_OBJCOPY)" \
|
||||
TARGET_STRIP="$(TARGET_CROSS)strip"
|
||||
|
||||
HOST_GRUB2_CONF_OPTS = \
|
||||
--with-platform=none \
|
||||
--disable-grub-mkfont \
|
||||
--enable-efiemu=no \
|
||||
ac_cv_lib_lzma_lzma_code=no \
|
||||
--enable-device-mapper=no \
|
||||
--enable-libzfs=no \
|
||||
--disable-werror
|
||||
|
||||
define GRUB2_CONFIGURE_CMDS
|
||||
cd $(@D); $(AUTORECONF)
|
||||
$(foreach tuple, $(GRUB2_TUPLES-y), \
|
||||
@$(call MESSAGE,Configuring $(tuple))
|
||||
mkdir -p $(@D)/build-$(tuple)
|
||||
cd $(@D)/build-$(tuple) && \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
$(TARGET_CONFIGURE_ARGS) \
|
||||
$(GRUB2_CONF_ENV) \
|
||||
../configure \
|
||||
--target=$(GRUB2_TARGET_$(tuple)) \
|
||||
--with-platform=$(GRUB2_PLATFORM_$(tuple)) \
|
||||
--host=$(GNU_TARGET_NAME) \
|
||||
--build=$(GNU_HOST_NAME) \
|
||||
--prefix=/ \
|
||||
--exec-prefix=/ \
|
||||
--disable-grub-mkfont \
|
||||
--enable-efiemu=no \
|
||||
ac_cv_lib_lzma_lzma_code=no \
|
||||
--enable-device-mapper=no \
|
||||
--enable-libzfs=no \
|
||||
--disable-werror
|
||||
)
|
||||
endef
|
||||
|
||||
define GRUB2_BUILD_CMDS
|
||||
$(foreach tuple, $(GRUB2_TUPLES-y), \
|
||||
@$(call MESSAGE,Building $(tuple))
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple)
|
||||
)
|
||||
endef
|
||||
|
||||
define GRUB2_INSTALL_IMAGES_CMDS
|
||||
$(foreach tuple, $(GRUB2_TUPLES-y), \
|
||||
@$(call MESSAGE,Installing $(tuple) to images directory)
|
||||
mkdir -p $(dir $(GRUB2_IMAGE_$(tuple)))
|
||||
$(HOST_DIR)/bin/grub-mkimage \
|
||||
-d $(@D)/build-$(tuple)/grub-core/ \
|
||||
-O $(tuple) \
|
||||
-o $(GRUB2_IMAGE_$(tuple)) \
|
||||
-p "$(GRUB2_PREFIX_$(tuple))" \
|
||||
$(if $(GRUB2_BUILTIN_CONFIG_$(tuple)), \
|
||||
-c $(GRUB2_BUILTIN_CONFIG_$(tuple))) \
|
||||
$(GRUB2_BUILTIN_MODULES_$(tuple))
|
||||
$(INSTALL) -D -m 0644 boot/grub2/grub.cfg $(GRUB2_CFG_$(tuple))
|
||||
$(if $(findstring $(GRUB2_PLATFORM_$(tuple)), pc), \
|
||||
cat $(@D)/build-$(tuple)/grub-core/cdboot.img $(GRUB2_IMAGE_$(tuple)) > \
|
||||
$(BINARIES_DIR)/grub-eltorito.img
|
||||
) \
|
||||
)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_GRUB2_INSTALL_TOOLS),y)
|
||||
define GRUB2_INSTALL_TARGET_CMDS
|
||||
$(foreach tuple, $(GRUB2_TUPLES-y), \
|
||||
@$(call MESSAGE,Installing $(tuple) to target directory)
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D)/build-$(tuple) DESTDIR=$(TARGET_DIR) install
|
||||
)
|
||||
endef
|
||||
endif
|
||||
|
||||
$(eval $(generic-package))
|
||||
$(eval $(host-autotools-package))
|
||||
192
boot/grub2/readme.txt
Normal file
192
boot/grub2/readme.txt
Normal file
@@ -0,0 +1,192 @@
|
||||
Notes on using Grub2 for BIOS-based platforms
|
||||
=============================================
|
||||
|
||||
1. Create a disk image
|
||||
dd if=/dev/zero of=disk.img bs=1M count=32
|
||||
2. Partition it (either legacy or GPT style partitions work)
|
||||
cfdisk disk.img
|
||||
- Create one partition, type Linux, for the root
|
||||
filesystem. The only constraint is to make sure there
|
||||
is enough free space *before* the first partition to
|
||||
store Grub2. Leaving 1 MB of free space is safe.
|
||||
3. Setup loop device and loop partitions
|
||||
loop_dev=$(sudo losetup -f --show disk.img)
|
||||
sudo partx -a "$loop_dev"
|
||||
4. Prepare the root partition
|
||||
sudo mkfs.ext3 -L root "${loop_dev}p1"
|
||||
sudo mount "${loop_dev}p1" /mnt
|
||||
sudo tar -C /mnt -xf output/images/rootfs.tar
|
||||
sudo umount /mnt
|
||||
5. Install Grub2
|
||||
sudo ./output/host/sbin/grub-bios-setup \
|
||||
-b ./output/host/lib/grub/i386-pc/boot.img \
|
||||
-c ./output/images/grub.img -d . "$loop_dev"
|
||||
6. Cleanup loop device
|
||||
sudo partx -d "$loop_dev"
|
||||
sudo losetup -d "$loop_dev"
|
||||
7. Your disk.img is ready!
|
||||
|
||||
Using genimage
|
||||
--------------
|
||||
|
||||
If you use genimage to generate your complete image,
|
||||
installing Grub can be tricky. Here is how to achieve Grub's
|
||||
installation with genimage:
|
||||
|
||||
partition boot {
|
||||
in-partition-table = "no"
|
||||
image = "path_to_boot.img"
|
||||
offset = 0
|
||||
size = 512
|
||||
}
|
||||
partition grub {
|
||||
in-partition-table = "no"
|
||||
image = "path_to_grub.img"
|
||||
offset = 512
|
||||
}
|
||||
|
||||
The result is not byte to byte identical to what
|
||||
grub-bios-setup does but it works anyway.
|
||||
|
||||
To test your BIOS image in Qemu
|
||||
-------------------------------
|
||||
|
||||
qemu-system-{i386,x86_64} -hda disk.img
|
||||
|
||||
Notes on using Grub2 for x86/x86_64 EFI-based platforms
|
||||
=======================================================
|
||||
|
||||
1. Create a disk image
|
||||
dd if=/dev/zero of=disk.img bs=1M count=32
|
||||
2. Partition it with GPT partitions
|
||||
cgdisk disk.img
|
||||
- Create a first partition, type EF00, for the
|
||||
bootloader and kernel image
|
||||
- Create a second partition, type 8300, for the root
|
||||
filesystem.
|
||||
3. Setup loop device and loop partitions
|
||||
loop_dev=$(sudo losetup -f --show disk.img)
|
||||
sudo partx -a "$loop_dev"
|
||||
4. Prepare the boot partition
|
||||
sudo mkfs.vfat -n boot "${loop_dev}p1"
|
||||
sudo mount "${loop_dev}p1" /mnt
|
||||
sudo cp -a output/images/efi-part/* /mnt/
|
||||
sudo cp output/images/bzImage /mnt/
|
||||
sudo umount /mnt
|
||||
5. Prepare the root partition
|
||||
sudo mkfs.ext3 -L root "${loop_dev}p2"
|
||||
sudo mount "${loop_dev}p2" /mnt
|
||||
sudo tar -C /mnt -xf output/images/rootfs.tar
|
||||
sudo umount /mnt
|
||||
6 Cleanup loop device
|
||||
sudo partx -d "$loop_dev"
|
||||
sudo losetup -d "$loop_dev"
|
||||
7. Your disk.img is ready!
|
||||
|
||||
To test your i386/x86-64 EFI image in Qemu
|
||||
------------------------------------------
|
||||
|
||||
1. Download/install the EFI BIOS for Qemu
|
||||
You can get it using the edk2 package in Buildroot (installed
|
||||
in BINARIES_DIR), grab prebuilt images from the unofficial nightly
|
||||
builds [0], or use one provided by your distribution as OVMF.
|
||||
|
||||
[0] https://github.com/retrage/edk2-nightly
|
||||
|
||||
2. qemu-system-{i386,x86_64} -bios <path-to-OVMF.fd> -hda disk.img
|
||||
|
||||
Notes on using Grub2 for ARM u-boot-based platforms
|
||||
===================================================
|
||||
|
||||
The following steps show how to use the Grub2 arm-uboot platform
|
||||
support in the simplest way possible and with a single
|
||||
buildroot-generated filesystem.
|
||||
|
||||
1. Load qemu_arm_vexpress_defconfig
|
||||
|
||||
2. Enable u-boot with the vexpress_ca9x4 board name and with
|
||||
u-boot.elf image format.
|
||||
|
||||
3. Enable grub2 for the arm-uboot platform.
|
||||
|
||||
4. Enable "Install kernel image to /boot in target" in the kernel
|
||||
menu to populate a /boot directory with zImage in it.
|
||||
|
||||
5. The upstream u-boot vexpress_ca9x4 doesn't have CONFIG_API enabled
|
||||
by default, which is required.
|
||||
|
||||
Before building, patch u-boot (for example, make u-boot-extract to
|
||||
edit the source before building) file
|
||||
include/configs/vexpress_common.h to define:
|
||||
|
||||
#define CONFIG_API
|
||||
#define CONFIG_SYS_MMC_MAX_DEVICE 1
|
||||
|
||||
6. Create a custom grub2 config file with the following contents and
|
||||
set its path in BR2_TARGET_GRUB2_CFG:
|
||||
|
||||
set default="0"
|
||||
set timeout="5"
|
||||
|
||||
menuentry "Buildroot" {
|
||||
set root='(hd0)'
|
||||
linux /boot/zImage root=/dev/mmcblk0 console=ttyAMA0
|
||||
devicetree /boot/vexpress-v2p-ca9.dtb
|
||||
}
|
||||
|
||||
7. Create a custom builtin config file with the following contents
|
||||
and set its path in BR2_TARGET_GRUB2_BUILTIN_CONFIG:
|
||||
|
||||
set root=(hd0)
|
||||
set prefix=/boot/grub
|
||||
|
||||
8. Create a custom post-build script which copies files from
|
||||
${BINARIES_DIR}/boot-part to $(TARGET_DIR)/boot (set its path in
|
||||
BR2_ROOTFS_POST_BUILD_SCRIPT):
|
||||
|
||||
#!/bin/sh
|
||||
cp -r ${BINARIES_DIR}/boot-part/* ${TARGET_DIR}/boot/
|
||||
|
||||
9. make
|
||||
|
||||
10. Run qemu with:
|
||||
|
||||
qemu-system-arm -M vexpress-a9 -kernel output/images/u-boot -m 1024 \
|
||||
-nographic -sd output/images/rootfs.ext2
|
||||
|
||||
11. In u-boot, stop at the prompt and run grub2 with:
|
||||
|
||||
=> ext2load mmc 0:0 ${loadaddr} /boot/grub/grub.img
|
||||
=> bootm
|
||||
|
||||
12. This should bring the grub2 menu, upon which selecting the "Buildroot"
|
||||
entry should boot Linux.
|
||||
|
||||
|
||||
Notes on using Grub2 for Aarch64 EFI-based platforms
|
||||
====================================================
|
||||
|
||||
The following steps show how to use the Grub2 arm64-efi platform,
|
||||
using qemu and EFI firmware built for qemu.
|
||||
|
||||
1. Load aarch64_efi_defconfig
|
||||
|
||||
2. make
|
||||
|
||||
3. Download the EFI firmware for qemu aarch64
|
||||
|
||||
You can get it using the edk2 package in Buildroot (installed
|
||||
in BINARIES_DIR), grab prebuilt images from the unofficial nightly
|
||||
builds [1], or use one provided by your distribution as OVMF-aarch64
|
||||
or AAVMF.
|
||||
|
||||
[1] https://github.com/retrage/edk2-nightly
|
||||
|
||||
4. Run qemu with:
|
||||
|
||||
qemu-system-aarch64 -M virt -cpu cortex-a57 -m 512 -nographic \
|
||||
-bios <path/to/EDK2>/QEMU_EFI.fd -hda output/images/disk.img \
|
||||
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
|
||||
|
||||
5. This should bring the grub2 menu, upon which selecting the
|
||||
"Buildroot" entry should boot Linux.
|
||||
@@ -0,0 +1,49 @@
|
||||
From 4796a1eacc6a5ccb623e7d2e46a5196f8335e496 Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Fri, 11 Aug 2023 11:19:49 +0300
|
||||
Subject: [PATCH] Allow access to low addresses with gcc 12
|
||||
|
||||
gcc 12 added a warning that triggers on access to low addresses. Add a
|
||||
compile option that allows access to lower addresses.
|
||||
|
||||
Add the 'cc_option' macro to avoid the compile option when the compiler
|
||||
does not support it.
|
||||
|
||||
This fixes build with TF-A. TF-A added a similar fix in commit
|
||||
dea23e245fb89.
|
||||
|
||||
See some more details in
|
||||
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523
|
||||
|
||||
Upstream: https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/pull/42
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Makefile | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 3f0dd89a7381..045284c30cbc 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -108,6 +108,10 @@ MV_DDR_VER_CSRC = mv_ddr_build_message.c
|
||||
# create mv_ddr build message and version string source file
|
||||
$(shell $(MV_DDR_ROOT)/scripts/localversion.sh $(MV_DDR_ROOT) $(MV_DDR_VER_CSRC) 2> /dev/null)
|
||||
|
||||
+define cc_option
|
||||
+ $(shell if $(CC) $(1) -c -x c /dev/null -o /dev/null >/dev/null 2>&1; then echo $(1); fi )
|
||||
+endef
|
||||
+
|
||||
# ******************
|
||||
# U-BOOT SPL SUPPORT
|
||||
# ******************
|
||||
@@ -331,6 +335,7 @@ OBJ_DIR ?= $(MV_DDR_ROOT)
|
||||
CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
|
||||
CFLAGS += -Wall -Werror -Os -ffreestanding -mlittle-endian -g -gdwarf-2 -nostdinc
|
||||
CFLAGS += -march=armv8-a -fpie
|
||||
+CFLAGS += $(call cc_option, --param=min-pagesize=0)
|
||||
|
||||
# PLATFORM is set in ble/ble.mk
|
||||
ifneq ($(findstring a80x0,$(PLATFORM)),)
|
||||
--
|
||||
2.40.1
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
From 53e34e3bff26fcbb7cc14178fa9fc80e7a73d556 Mon Sep 17 00:00:00 2001
|
||||
From: Baruch Siach <baruch@tkos.co.il>
|
||||
Date: Tue, 11 Oct 2022 16:34:44 +0300
|
||||
Subject: [PATCH] Makefile: disable stack protection
|
||||
|
||||
The Buildroot toolchain might enable stack protection by default. That
|
||||
breaks linking because ATF does not provide the required __stack_chk
|
||||
routines.
|
||||
|
||||
The mv-ddr-marvell Makefile provides no way to add custom CFLAGS. Patch
|
||||
Makefile to disable stack protection.
|
||||
|
||||
Upstream: not applicable; Buildroot specific
|
||||
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
|
||||
---
|
||||
Makefile | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index 045284c30cbc..9641354bcf86 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -336,6 +336,7 @@ CFLAGS = -DMV_DDR_ATF -DCONFIG_DDR4
|
||||
CFLAGS += -Wall -Werror -Os -ffreestanding -mlittle-endian -g -gdwarf-2 -nostdinc
|
||||
CFLAGS += -march=armv8-a -fpie
|
||||
CFLAGS += $(call cc_option, --param=min-pagesize=0)
|
||||
+CFLAGS += -fno-stack-protector
|
||||
|
||||
# PLATFORM is set in ble/ble.mk
|
||||
ifneq ($(findstring a80x0,$(PLATFORM)),)
|
||||
--
|
||||
2.40.1
|
||||
|
||||
10
boot/mv-ddr-marvell/Config.in
Normal file
10
boot/mv-ddr-marvell/Config.in
Normal file
@@ -0,0 +1,10 @@
|
||||
config BR2_TARGET_MV_DDR_MARVELL
|
||||
bool "mv-ddr-marvell"
|
||||
depends on BR2_aarch64
|
||||
help
|
||||
Marvell keeps algorithms for DDR training in a separate
|
||||
repository. This code is not built separately, it is needed
|
||||
as a dependency to build ATF firmware for Marvell Armada 7040
|
||||
and 8040 SoCs.
|
||||
|
||||
https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell/
|
||||
3
boot/mv-ddr-marvell/mv-ddr-marvell.hash
Normal file
3
boot/mv-ddr-marvell/mv-ddr-marvell.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 16f02232e21a15979b3d9971e28f7e59562484a5c1f99c2b28c248a3b76a63fa mv-ddr-marvell-d5acc10c287e40cc2feeb28710b92e45c93c702c.tar.gz
|
||||
sha256 907a03943ca940790e97620aca8d46b5b04c653dcf2ab6c66a25238b60cf5635 ddr3_init.c
|
||||
13
boot/mv-ddr-marvell/mv-ddr-marvell.mk
Normal file
13
boot/mv-ddr-marvell/mv-ddr-marvell.mk
Normal file
@@ -0,0 +1,13 @@
|
||||
################################################################################
|
||||
#
|
||||
# mv-ddr-marvell
|
||||
#
|
||||
################################################################################
|
||||
|
||||
# This is the latest commit on mv-ddr-devel as of 20220529
|
||||
MV_DDR_MARVELL_VERSION = d5acc10c287e40cc2feeb28710b92e45c93c702c
|
||||
MV_DDR_MARVELL_SITE = $(call github,MarvellEmbeddedProcessors,mv-ddr-marvell,$(MV_DDR_MARVELL_VERSION))
|
||||
MV_DDR_MARVELL_LICENSE = GPL-2.0+ or LGPL-2.1 with freertos-exception-2.0, BSD-3-Clause, Marvell Commercial
|
||||
MV_DDR_MARVELL_LICENSE_FILES = ddr3_init.c
|
||||
|
||||
$(eval $(generic-package))
|
||||
92
boot/mxs-bootlets/Config.in
Normal file
92
boot/mxs-bootlets/Config.in
Normal file
@@ -0,0 +1,92 @@
|
||||
menuconfig BR2_TARGET_MXS_BOOTLETS
|
||||
bool "mxs-bootlets"
|
||||
depends on BR2_arm
|
||||
depends on BR2_TARGET_BAREBOX || BR2_LINUX_KERNEL || \
|
||||
BR2_TARGET_UBOOT
|
||||
help
|
||||
Stage1 bootloaders for Freescale iMX23/iMX28 SoCs
|
||||
|
||||
if BR2_TARGET_MXS_BOOTLETS
|
||||
|
||||
choice
|
||||
prompt "Source"
|
||||
default BR2_TARGET_MXS_BOOTLETS_FREESCALE
|
||||
help
|
||||
Select the location of the bootlets you want to use
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_FREESCALE
|
||||
bool "Freescale 10.12.01 version"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL
|
||||
string "URL of custom bootlets tarball"
|
||||
depends on BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL
|
||||
|
||||
if BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL
|
||||
string "URL of custom Git repository"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION
|
||||
string "Custom Git version"
|
||||
|
||||
endif
|
||||
|
||||
choice
|
||||
prompt "Bootstream"
|
||||
help
|
||||
Select which bootstream to generate
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_BAREBOX
|
||||
bool "Barebox Bootloader"
|
||||
depends on BR2_TARGET_BAREBOX
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_LINUX
|
||||
bool "Linux Kernel"
|
||||
depends on BR2_LINUX_KERNEL
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_UBOOT
|
||||
bool "U-boot bootloader"
|
||||
depends on BR2_TARGET_UBOOT
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_HAS_IVT
|
||||
bool "HAB Support"
|
||||
help
|
||||
Enable this option if you are building bootlets
|
||||
for the iMX28 platform that needs to include instructions
|
||||
for the secure boot mechanism present on these SoCs
|
||||
|
||||
choice
|
||||
prompt "Board"
|
||||
help
|
||||
Select the board to build the bootlets for
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_STMP37xx
|
||||
bool "Sigmatel ST-MP3-7xx Board"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_STMP378x
|
||||
bool "Sigmatel ST-MP3-78x Board"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_IMX28EVK
|
||||
bool "Freescale iMX28 EVK Board"
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD
|
||||
bool "Custom board"
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME
|
||||
string "Custom board name"
|
||||
depends on BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD
|
||||
help
|
||||
Name of the board to build the bootlets for
|
||||
|
||||
endif
|
||||
34
boot/mxs-bootlets/barebox_ivt.bd
Normal file
34
boot/mxs-bootlets/barebox_ivt.bd
Normal file
@@ -0,0 +1,34 @@
|
||||
// STMP378x ROM command script to load and run U-Boot
|
||||
|
||||
sources {
|
||||
power_prep="./power_prep/power_prep";
|
||||
sdram_prep="./boot_prep/boot_prep";
|
||||
barebox="./barebox";
|
||||
}
|
||||
|
||||
section (0) {
|
||||
|
||||
//----------------------------------------------------------
|
||||
// Power Supply initialization
|
||||
//----------------------------------------------------------
|
||||
|
||||
load power_prep;
|
||||
load ivt (entry = power_prep:_start) > 0x8000;
|
||||
hab call 0x8000;
|
||||
|
||||
//----------------------------------------------------------
|
||||
// SDRAM initialization
|
||||
//----------------------------------------------------------
|
||||
|
||||
load sdram_prep;
|
||||
load ivt (entry = sdram_prep:_start) > 0x8000;
|
||||
hab call 0x8000;
|
||||
//----------------------------------------------------------
|
||||
// Load and call u_boot - ELF ARM image
|
||||
//----------------------------------------------------------
|
||||
|
||||
load barebox;
|
||||
load ivt (entry = barebox:start) > 0x8000;
|
||||
hab call 0x8000;
|
||||
|
||||
}
|
||||
2
boot/mxs-bootlets/mxs-bootlets.hash
Normal file
2
boot/mxs-bootlets/mxs-bootlets.hash
Normal file
@@ -0,0 +1,2 @@
|
||||
# locally computed
|
||||
sha256 63f6068ae36884adef4259bbb1fe2591755718f22c46d0a59d854883dfab1ffc imx-bootlets-src-10.12.01.tar.gz
|
||||
106
boot/mxs-bootlets/mxs-bootlets.mk
Normal file
106
boot/mxs-bootlets/mxs-bootlets.mk
Normal file
@@ -0,0 +1,106 @@
|
||||
################################################################################
|
||||
#
|
||||
# mxs-bootlets
|
||||
#
|
||||
################################################################################
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL),y)
|
||||
MXS_BOOTLETS_TARBALL = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_TARBALL_URL))
|
||||
MXS_BOOTLETS_SITE = $(patsubst %/,%,$(dir $(MXS_BOOTLETS_TARBALL)))
|
||||
MXS_BOOTLETS_SOURCE = $(notdir $(MXS_BOOTLETS_TARBALL))
|
||||
BR_NO_CHECK_HASH_FOR += $(MXS_BOOTLETS_SOURCE)
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT),y)
|
||||
MXS_BOOTLETS_SITE = $(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_URL)
|
||||
MXS_BOOTLETS_SITE_METHOD = git
|
||||
MXS_BOOTLETS_VERSION = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_GIT_VERSION))
|
||||
BR_NO_CHECK_HASH_FOR += $(MXS_BOOTLETS_SOURCE)
|
||||
else
|
||||
MXS_BOOTLETS_VERSION = 10.12.01
|
||||
MXS_BOOTLETS_SITE = http://download.ossystems.com.br/bsp/freescale/source
|
||||
MXS_BOOTLETS_SOURCE = imx-bootlets-src-$(MXS_BOOTLETS_VERSION).tar.gz
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP37xx),y)
|
||||
MXS_BOOTLETS_BOARD = stmp37xx_dev
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_STMP378x),y)
|
||||
MXS_BOOTLETS_BOARD = stmp378x_dev
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_IMX28EVK),y)
|
||||
MXS_BOOTLETS_BOARD = iMX28_EVK
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD),y)
|
||||
MXS_BOOTLETS_BOARD = $(call qstrip,$(BR2_TARGET_MXS_BOOTLETS_CUSTOM_BOARD_NAME))
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_HAS_IVT),y)
|
||||
MXS_BOOTLETS_IVT_SUFFIX = _ivt
|
||||
MXS_BOOTLETS_ELFTOSB_OPTIONS += -f imx28
|
||||
endif
|
||||
|
||||
MXS_BOOTLETS_DEPENDENCIES = host-elftosb
|
||||
MXS_BOOTLETS_LICENSE = GPL-2.0+
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
|
||||
MXS_BOOTLETS_DEPENDENCIES += barebox
|
||||
MXS_BOOTLETS_BOOTDESC = barebox$(MXS_BOOTLETS_IVT_SUFFIX).bd
|
||||
MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_barebox$(MXS_BOOTLETS_IVT_SUFFIX).sb
|
||||
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
|
||||
MXS_BOOTLETS_DEPENDENCIES += linux
|
||||
MXS_BOOTLETS_BOOTDESC = linux$(MXS_BOOTLETS_IVT_SUFFIX).bd
|
||||
MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_linux$(MXS_BOOTLETS_IVT_SUFFIX).sb
|
||||
|
||||
else ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
|
||||
MXS_BOOTLETS_DEPENDENCIES += uboot
|
||||
MXS_BOOTLETS_BOOTDESC = uboot$(MXS_BOOTLETS_IVT_SUFFIX).bd
|
||||
MXS_BOOTLETS_BOOTSTREAM = $(MXS_BOOTLETS_BOARD)_uboot$(MXS_BOOTLETS_IVT_SUFFIX).sb
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_BAREBOX),y)
|
||||
define MXS_BOOTLETS_SED_BAREBOX
|
||||
sed -i 's,[^ *]barebox.*;,\tbarebox="$(BAREBOX_DIR)/barebox";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_LINUX),y)
|
||||
define MXS_BOOTLETS_BUILD_LINUX_PREP
|
||||
BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
$(MAKE1) -C $(@D) linux_prep
|
||||
endef
|
||||
define MXS_BOOTLETS_SED_LINUX
|
||||
sed -i 's,[^ *]linux_prep.*;,\tlinux_prep="$(@D)/linux_prep/output-target/linux_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
sed -i 's,[^ *]zImage.*;,\tzImage="$(LINUX_DIR)/arch/arm/boot/zImage";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_MXS_BOOTLETS_UBOOT),y)
|
||||
define MXS_BOOTLETS_SED_UBOOT
|
||||
sed -i 's,[^ *]u_boot.*;,\tu_boot="$(UBOOT_DIR)/u-boot";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
endef
|
||||
endif
|
||||
|
||||
define MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
|
||||
cp boot/mxs-bootlets/barebox_ivt.bd $(@D)/
|
||||
endef
|
||||
|
||||
MXS_BOOTLETS_POST_EXTRACT_HOOKS += MXS_BOOTLETS_INSTALL_BAREBOX_BOOTDESC
|
||||
|
||||
define MXS_BOOTLETS_BUILD_CMDS
|
||||
BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
$(MAKE1) -C $(@D) power_prep
|
||||
BOARD=$(MXS_BOOTLETS_BOARD) CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
$(MAKE1) -C $(@D) boot_prep
|
||||
$(MXS_BOOTLETS_BUILD_LINUX_PREP)
|
||||
sed -i 's,[^ *]power_prep.*;,\tpower_prep="$(@D)/power_prep/power_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
sed -i 's,[^ *]sdram_prep.*;,\tsdram_prep="$(@D)/boot_prep/boot_prep";,' $(@D)/$(MXS_BOOTLETS_BOOTDESC)
|
||||
$(MXS_BOOTLETS_SED_BAREBOX)
|
||||
$(MXS_BOOTLETS_SED_LINUX)
|
||||
$(MXS_BOOTLETS_SED_UBOOT)
|
||||
$(HOST_DIR)/bin/elftosb $(MXS_BOOTLETS_ELFTOSB_OPTIONS) \
|
||||
-z -c $(@D)/$(MXS_BOOTLETS_BOOTDESC) \
|
||||
-o $(@D)/$(MXS_BOOTLETS_BOOTSTREAM)
|
||||
endef
|
||||
|
||||
define MXS_BOOTLETS_INSTALL_TARGET_CMDS
|
||||
cp $(@D)/$(MXS_BOOTLETS_BOOTSTREAM) $(BINARIES_DIR)/
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
136
boot/opensbi/Config.in
Normal file
136
boot/opensbi/Config.in
Normal file
@@ -0,0 +1,136 @@
|
||||
menuconfig BR2_TARGET_OPENSBI
|
||||
bool "opensbi"
|
||||
depends on BR2_riscv
|
||||
help
|
||||
OpenSBI aims to provide an open-source and extensible
|
||||
implementation of the RISC-V SBI specification for a platform
|
||||
specific firmware (M-mode) and a general purpose OS,
|
||||
hypervisor or bootloader (S-mode or HS-mode). OpenSBI
|
||||
implementation can be easily extended by RISC-V platform or
|
||||
System-on-Chip vendors to fit a particular hadware
|
||||
configuration.
|
||||
|
||||
https://github.com/riscv-software-src/opensbi
|
||||
|
||||
if BR2_TARGET_OPENSBI
|
||||
choice
|
||||
prompt "OpenSBI Version"
|
||||
help
|
||||
Select the specific OpenSBI version you want to use
|
||||
|
||||
config BR2_TARGET_OPENSBI_LATEST_VERSION
|
||||
bool "Latest version (1.8.1)"
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official versions
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE
|
||||
string "OpenSBI version"
|
||||
depends on BR2_TARGET_OPENSBI_CUSTOM_VERSION
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom OpenSBI tarball"
|
||||
depends on BR2_TARGET_OPENSBI_CUSTOM_TARBALL
|
||||
|
||||
if BR2_TARGET_OPENSBI_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_REPO_URL
|
||||
string "URL of custom repository"
|
||||
|
||||
config BR2_TARGET_OPENSBI_CUSTOM_REPO_VERSION
|
||||
string "Custom repository version"
|
||||
help
|
||||
Revision to use in the typical format used by Git. E.G. a
|
||||
sha id, a tag, branch, ..
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_OPENSBI_VERSION
|
||||
string
|
||||
default "1.8.1" if BR2_TARGET_OPENSBI_LATEST_VERSION
|
||||
default BR2_TARGET_OPENSBI_CUSTOM_VERSION_VALUE \
|
||||
if BR2_TARGET_OPENSBI_CUSTOM_VERSION
|
||||
default "custom" if BR2_TARGET_OPENSBI_CUSTOM_TARBALL
|
||||
default BR2_TARGET_OPENSBI_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_OPENSBI_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_OPENSBI_LICENSE_FILES
|
||||
string "OpenSBI license files" if BR2_TARGET_OPENSBI_CUSTOM_GIT || \
|
||||
BR2_TARGET_OPENSBI_CUSTOM_TARBALL
|
||||
default "COPYING.BSD"
|
||||
help
|
||||
A space-separated list of license files related to the OpenSBI
|
||||
package.
|
||||
|
||||
config BR2_TARGET_OPENSBI_PLAT
|
||||
string "OpenSBI Platform"
|
||||
default ""
|
||||
help
|
||||
Specifies the OpenSBI platform to build. If no platform is
|
||||
specified only the OpenSBI platform independent static
|
||||
library libsbi.a is built. If a platform is specified then
|
||||
the platform specific static library libplatsbi.a and firmware
|
||||
examples are built.
|
||||
|
||||
config BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG
|
||||
bool "Install fw_dynamic image"
|
||||
default y if BR2_TARGET_OPENSBI_PLAT != ""
|
||||
help
|
||||
This installs the fw_dynamic image.
|
||||
|
||||
config BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG
|
||||
bool "Install fw_jump image"
|
||||
default y if BR2_TARGET_OPENSBI_PLAT != ""
|
||||
help
|
||||
This installs the fw_jump image.
|
||||
|
||||
config BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
|
||||
bool "Install fw_payload image"
|
||||
help
|
||||
This option enables the installation of the fw_paylaod
|
||||
image.
|
||||
|
||||
config BR2_TARGET_OPENSBI_LINUX_PAYLOAD
|
||||
bool "Include Linux as OpenSBI Payload"
|
||||
depends on BR2_TARGET_OPENSBI_PLAT != ""
|
||||
depends on BR2_LINUX_KERNEL
|
||||
depends on BR2_LINUX_KERNEL_IMAGE
|
||||
select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
|
||||
help
|
||||
Build OpenSBI with the Linux kernel as a Payload.
|
||||
|
||||
config BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
|
||||
bool "Include U-Boot as OpenSBI Payload"
|
||||
depends on BR2_TARGET_OPENSBI_PLAT != ""
|
||||
depends on BR2_TARGET_UBOOT
|
||||
select BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG
|
||||
help
|
||||
Build OpenSBI with the U-Boot as a Payload.
|
||||
|
||||
config BR2_TARGET_OPENSBI_FW_FDT_PATH
|
||||
bool "Include U-Boot DTB in OpenSBI Payload"
|
||||
depends on BR2_TARGET_OPENSBI_UBOOT_PAYLOAD
|
||||
select BR2_TARGET_UBOOT_FORMAT_DTB
|
||||
help
|
||||
Build OpenSBI with FW_FDT_PATH set to
|
||||
$(BINARIES_DIR)/u-boot.dtb. Note that CONFIG_OF_SEPARATE
|
||||
must be set in the U-Boot configuration for this file to be
|
||||
produced.
|
||||
|
||||
config BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES
|
||||
string "Additional build variables"
|
||||
help
|
||||
Additional parameters for the build, which will be passed on
|
||||
the make command line. E.g: BUILD_INFO=1.
|
||||
|
||||
endif
|
||||
3
boot/opensbi/opensbi.hash
Normal file
3
boot/opensbi/opensbi.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# locally computed
|
||||
sha256 fb1ae61a85e966322101acb1c982f84d9eaafc4de7dd474a7d7546d9bb321c6f opensbi-1.8.1.tar.gz
|
||||
sha256 82d13fb1bf6bb162629deeea9eb9c117e74548d3b707e478967691fe79a68e21 COPYING.BSD
|
||||
90
boot/opensbi/opensbi.mk
Normal file
90
boot/opensbi/opensbi.mk
Normal file
@@ -0,0 +1,90 @@
|
||||
################################################################################
|
||||
#
|
||||
# opensbi
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPENSBI_VERSION = $(call qstrip,$(BR2_TARGET_OPENSBI_VERSION))
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_CUSTOM_TARBALL),y)
|
||||
# Handle custom OpenSBI tarballs as specified by the configuration
|
||||
OPENSBI_TARBALL = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_TARBALL_LOCATION))
|
||||
OPENSBI_SITE = $(patsubst %/,%,$(dir $(OPENSBI_TARBALL)))
|
||||
OPENSBI_SOURCE = $(notdir $(OPENSBI_TARBALL))
|
||||
else ifeq ($(BR2_TARGET_OPENSBI_CUSTOM_GIT),y)
|
||||
OPENSBI_SITE = $(call qstrip,$(BR2_TARGET_OPENSBI_CUSTOM_REPO_URL))
|
||||
OPENSBI_SITE_METHOD = git
|
||||
else
|
||||
# Handle official OpenSBI versions
|
||||
OPENSBI_SITE = $(call github,riscv-software-src,opensbi,v$(OPENSBI_VERSION))
|
||||
endif
|
||||
|
||||
OPENSBI_LICENSE = BSD-2-Clause
|
||||
OPENSBI_LICENSE_FILES = $(call qstrip,$(BR2_TARGET_OPENSBI_LICENSE_FILES))
|
||||
OPENSBI_INSTALL_TARGET = NO
|
||||
OPENSBI_INSTALL_STAGING = YES
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI)$(BR2_TARGET_OPENSBI_LATEST_VERSION),y)
|
||||
BR_NO_CHECK_HASH_FOR += $(OPENSBI_SOURCE)
|
||||
endif
|
||||
|
||||
OPENSBI_MAKE_ENV = \
|
||||
CROSS_COMPILE=$(TARGET_CROSS) \
|
||||
$(call qstrip,$(BR2_TARGET_OPENSBI_ADDITIONAL_VARIABLES))
|
||||
|
||||
OPENSBI_PLAT = $(call qstrip,$(BR2_TARGET_OPENSBI_PLAT))
|
||||
ifneq ($(OPENSBI_PLAT),)
|
||||
OPENSBI_MAKE_ENV += PLATFORM=$(OPENSBI_PLAT)
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_LINUX_PAYLOAD),y)
|
||||
OPENSBI_DEPENDENCIES += linux
|
||||
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/Image"
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_UBOOT_PAYLOAD),y)
|
||||
OPENSBI_DEPENDENCIES += uboot
|
||||
OPENSBI_MAKE_ENV += FW_PAYLOAD_PATH="$(BINARIES_DIR)/u-boot.bin"
|
||||
ifeq ($(BR2_TARGET_OPENSBI_FW_FDT_PATH),y)
|
||||
OPENSBI_MAKE_ENV += FW_FDT_PATH="$(BINARIES_DIR)/u-boot.dtb"
|
||||
endif
|
||||
endif
|
||||
|
||||
define OPENSBI_BUILD_CMDS
|
||||
$(TARGET_MAKE_ENV) $(OPENSBI_MAKE_ENV) $(MAKE) -C $(@D)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_DYNAMIC_IMG),y)
|
||||
OPENSBI_INSTALL_IMAGES = YES
|
||||
OPENSBI_FW_IMAGES += dynamic
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_JUMP_IMG),y)
|
||||
OPENSBI_INSTALL_IMAGES = YES
|
||||
OPENSBI_FW_IMAGES += jump
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPENSBI_INSTALL_PAYLOAD_IMG),y)
|
||||
OPENSBI_INSTALL_IMAGES = YES
|
||||
OPENSBI_FW_IMAGES += payload
|
||||
endif
|
||||
|
||||
ifneq ($(OPENSBI_PLAT),)
|
||||
define OPENSBI_INSTALL_IMAGES_CMDS
|
||||
$(foreach f,$(OPENSBI_FW_IMAGES),\
|
||||
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_$(f).bin \
|
||||
$(BINARIES_DIR)/fw_$(f).bin
|
||||
$(INSTALL) -m 0644 -D $(@D)/build/platform/$(OPENSBI_PLAT)/firmware/fw_$(f).elf \
|
||||
$(BINARIES_DIR)/fw_$(f).elf
|
||||
)
|
||||
endef
|
||||
endif
|
||||
|
||||
# libsbi.a is not a library meant to be linked in user-space code, but
|
||||
# with bare metal code, which is why we don't install it in
|
||||
# $(STAGING_DIR)/usr/lib
|
||||
define OPENSBI_INSTALL_STAGING_CMDS
|
||||
$(INSTALL) -m 0644 -D $(@D)/build/lib/libsbi.a $(STAGING_DIR)/usr/share/opensbi/libsbi.a
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,56 @@
|
||||
From 82becbadd5918ed7ad3c2b651ce479084b5feb2a Mon Sep 17 00:00:00 2001
|
||||
From: Etienne Carriere <etienne.carriere@linaro.org>
|
||||
Date: Mon, 10 May 2021 15:58:41 +0200
|
||||
Subject: core: zlib: fix build warning when _LFS64_LARGEFILE is not defined
|
||||
|
||||
In zlib, _LFS64_LARGEFILE is expected to be a boolean directive, either
|
||||
1 (true) or 0 (false). Depending on toolchain version and directives
|
||||
build may produces warnings (as shown below with gcc 9.3) when the macro
|
||||
is not defined hence this change to default it to value 0 (false).
|
||||
|
||||
core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef]
|
||||
196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
In file included from core/lib/zlib/adler32.c:9:
|
||||
core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef]
|
||||
196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
CC out/core/lib/zlib/zutil.o
|
||||
In file included from core/lib/zlib/inftrees.c:7:
|
||||
core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef]
|
||||
196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
In file included from core/lib/zlib/inflate.c:84:
|
||||
core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef]
|
||||
196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
In file included from core/lib/zlib/zutil.c:9:
|
||||
core/lib/zlib/zutil.h:196:39: warning: "_LFS64_LARGEFILE" is not defined, evaluates to 0 [-Wundef]
|
||||
196 | (!defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0)
|
||||
| ^~~~~~~~~~~~~~~~
|
||||
|
||||
Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
|
||||
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
|
||||
---
|
||||
core/lib/zlib/zconf.h | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/core/lib/zlib/zconf.h b/core/lib/zlib/zconf.h
|
||||
index 0bca18be..a7d13741 100644
|
||||
--- a/core/lib/zlib/zconf.h
|
||||
+++ b/core/lib/zlib/zconf.h
|
||||
@@ -487,6 +487,11 @@ typedef uLong FAR uLongf;
|
||||
# endif
|
||||
#endif
|
||||
|
||||
+/* Other places expect _LFS64_LARGEFILE to be defined with a valid value */
|
||||
+#ifndef _LFS64_LARGEFILE
|
||||
+#define _LFS64_LARGEFILE 0
|
||||
+#endif
|
||||
+
|
||||
#if defined(_LFS64_LARGEFILE) && _LFS64_LARGEFILE-0
|
||||
# define Z_LFS64
|
||||
#endif
|
||||
--
|
||||
2.17.1
|
||||
|
||||
183
boot/optee-os/Config.in
Normal file
183
boot/optee-os/Config.in
Normal file
@@ -0,0 +1,183 @@
|
||||
menuconfig BR2_TARGET_OPTEE_OS
|
||||
bool "optee_os"
|
||||
depends on BR2_ARM_CPU_ARMV8A || BR2_ARM_CPU_ARMV7A || BR2_RISCV_64
|
||||
help
|
||||
OP-TEE OS provides the secure world boot image and the trust
|
||||
application development kit of the OP-TEE project. OP-TEE OS
|
||||
also provides generic trusted application one can embedded
|
||||
into its system.
|
||||
|
||||
http://github.com/OP-TEE/optee_os
|
||||
|
||||
if BR2_TARGET_OPTEE_OS
|
||||
|
||||
choice
|
||||
prompt "OP-TEE OS version"
|
||||
default BR2_TARGET_OPTEE_OS_LATEST if BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
|
||||
help
|
||||
Select the version of OP-TEE OS you want to use
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_LATEST
|
||||
bool "4.9.0"
|
||||
depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
|
||||
select BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY
|
||||
help
|
||||
Use the latest release tag from the OP-TEE OS official Git
|
||||
repository.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
|
||||
bool "Custom version"
|
||||
help
|
||||
This option allows to use a specific official version
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
|
||||
bool "Custom tarball"
|
||||
help
|
||||
This option allows to specify a URL pointing to an OP-TEE OS
|
||||
source tarball. This URL can use any protocol recognized by
|
||||
Buildroot, like http://, ftp://, file:// or scp://.
|
||||
|
||||
When pointing to a local tarball using file://, you may want
|
||||
to use a make variable like $(TOPDIR) to reference the root of
|
||||
the Buildroot tree.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_GIT
|
||||
bool "Custom Git repository"
|
||||
help
|
||||
Use a custom version fetched from a Git repository.
|
||||
|
||||
endchoice
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_VERSION_VALUE
|
||||
string "OP-TEE version"
|
||||
depends on BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
|
||||
|
||||
if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION
|
||||
string "URL of custom OP-TEE OS tarball"
|
||||
|
||||
endif
|
||||
|
||||
if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL
|
||||
string "URL of custom repository"
|
||||
depends on BR2_TARGET_OPTEE_OS_CUSTOM_GIT
|
||||
help
|
||||
Specific location of the reference source tree Git
|
||||
repository.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION
|
||||
string "Custom repository version"
|
||||
depends on BR2_TARGET_OPTEE_OS_CUSTOM_GIT
|
||||
help
|
||||
Revision to use in the typical format used by Git, i.e a
|
||||
SHA1 or a tag.
|
||||
|
||||
endif
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_VERSION
|
||||
string
|
||||
default "4.9.0" if BR2_TARGET_OPTEE_OS_LATEST
|
||||
default BR2_TARGET_OPTEE_OS_CUSTOM_VERSION_VALUE \
|
||||
if BR2_TARGET_OPTEE_OS_CUSTOM_VERSION
|
||||
default "custom" if BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
|
||||
default BR2_TARGET_OPTEE_OS_CUSTOM_REPO_VERSION \
|
||||
if BR2_TARGET_OPTEE_OS_CUSTOM_GIT
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_LICENSE_FILES
|
||||
string "OP-TEE OS license files" if BR2_TARGET_OPTEE_OS_CUSTOM_GIT || \
|
||||
BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL
|
||||
default "LICENSE"
|
||||
help
|
||||
A space-separated list of license files related to the
|
||||
OPTEE-OS package.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_NEEDS_DTC
|
||||
bool "OP-TEE OS needs dtc"
|
||||
select BR2_PACKAGE_HOST_DTC
|
||||
help
|
||||
Select this option if your OP-TEE OS platform configuration
|
||||
requires the Device Tree compiler to be available.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY
|
||||
bool "OP-TEE OS needs host-python-cryptography"
|
||||
depends on BR2_PACKAGE_HOST_RUSTC_ARCH_SUPPORTS
|
||||
help
|
||||
OP-TEE OS version below 3.16 used python-pycryptodomex
|
||||
package in python scripts. Newer version uses
|
||||
python-cryptography. Select this option if optee-os needs
|
||||
python-cryptography to be built.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_NEEDS_CMAKE
|
||||
bool "OP-TEE OS needs cmake"
|
||||
help
|
||||
Select this option if your OP-TEE OS platform configuration
|
||||
requires the cmake build system to be available.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CORE
|
||||
bool "Build core"
|
||||
default y
|
||||
help
|
||||
This option will build and install the OP-TEE core
|
||||
boot images.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_SDK
|
||||
bool "Build TA devkit"
|
||||
default y
|
||||
help
|
||||
This option will build and install the OP-TEE development
|
||||
kit for building OP-TEE trusted application images. It is
|
||||
installed in the staging directory /lib/optee.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_SERVICES
|
||||
bool "Build service TAs and libs"
|
||||
default y
|
||||
select BR2_TARGET_OPTEE_OS_CORE
|
||||
help
|
||||
This option installs the service trusted applications and
|
||||
trusted shared libraries built from OP-TEE OS source tree.
|
||||
These are installed in target /lib/optee_armtz directory
|
||||
as other trusted applications. At runtime OP-TEE OS can
|
||||
load these from this non-secure filesystem/directory into
|
||||
the secure world for execution.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_PLATFORM
|
||||
string "Target platform (mandatory)"
|
||||
help
|
||||
Value for the mandated PLATFORM build directive provided to
|
||||
OP-TEE OS.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR
|
||||
string "Target platform flavor (optional)"
|
||||
help
|
||||
Value for the optional PLATFORM_FLAVOR build directive
|
||||
provided to OP-TEE OS.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CUSTOM_DTS_PATH
|
||||
string "Device Tree Source file paths"
|
||||
help
|
||||
Space-separated list of paths to device tree source files
|
||||
that will be copied to core/arch/arm/dts/ before starting
|
||||
the build.
|
||||
|
||||
To use this device tree source file, the OP-TEE OS
|
||||
configuration must refer to it with the
|
||||
CFG_EMBED_DTB_SOURCE_FILE option and no platform flavor
|
||||
needs to be specified.
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES
|
||||
string "Additional build variables"
|
||||
help
|
||||
Additional parameters for the OP-TEE OS build
|
||||
E.g. 'CFG_TEE_CORE_LOG_LEVEL=3 CFG_UNWIND=y'
|
||||
|
||||
config BR2_TARGET_OPTEE_OS_CORE_IMAGES
|
||||
string "Binary boot images"
|
||||
default "tee.bin tee-raw.bin tee-*_v2.bin"
|
||||
help
|
||||
Names of generated image files that are installed in the
|
||||
output images/ directory.
|
||||
|
||||
endif # BR2_TARGET_OPTEE_OS
|
||||
3
boot/optee-os/optee-os.hash
Normal file
3
boot/optee-os/optee-os.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally computed
|
||||
sha256 9400e16c45bfa45f15585b2c933b86c449e7de05def0ecaaa62a4f38973a3a45 optee-os-4.9.0.tar.gz
|
||||
sha256 1247ee90858f4037b6cac63cbffddfed435d0d73c631b37d78c1e6e6ab3e5d1a LICENSE
|
||||
176
boot/optee-os/optee-os.mk
Normal file
176
boot/optee-os/optee-os.mk
Normal file
@@ -0,0 +1,176 @@
|
||||
################################################################################
|
||||
#
|
||||
# optee-os
|
||||
#
|
||||
################################################################################
|
||||
|
||||
OPTEE_OS_VERSION = $(call qstrip,$(BR2_TARGET_OPTEE_OS_VERSION))
|
||||
OPTEE_OS_LICENSE = BSD-2-Clause
|
||||
OPTEE_OS_LICENSE_FILES = $(call qstrip,$(BR2_TARGET_OPTEE_OS_LICENSE_FILES))
|
||||
|
||||
OPTEE_OS_CPE_ID_PREFIX = cpe:2.3:o
|
||||
OPTEE_OS_CPE_ID_VENDOR = trustedfirmware
|
||||
OPTEE_OS_CPE_ID_PRODUCT = op-tee
|
||||
|
||||
OPTEE_OS_INSTALL_STAGING = YES
|
||||
OPTEE_OS_INSTALL_IMAGES = YES
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
|
||||
OPTEE_OS_TARBALL = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION))
|
||||
OPTEE_OS_SITE = $(patsubst %/,%,$(dir $(OPTEE_OS_TARBALL)))
|
||||
OPTEE_OS_SOURCE = $(notdir $(OPTEE_OS_TARBALL))
|
||||
else ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
|
||||
OPTEE_OS_SITE = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL))
|
||||
OPTEE_OS_SITE_METHOD = git
|
||||
else
|
||||
OPTEE_OS_SITE = $(call github,OP-TEE,optee_os,$(OPTEE_OS_VERSION))
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS):$(BR2_TARGET_OPTEE_OS_LATEST),y:)
|
||||
BR_NO_CHECK_HASH_FOR += $(OPTEE_OS_SOURCE)
|
||||
endif
|
||||
|
||||
OPTEE_OS_DEPENDENCIES = host-openssl host-python3 host-python-pyelftools
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_CMAKE),y)
|
||||
OPTEE_OS_DEPENDENCIES += $(BR2_CMAKE_HOST_DEPENDENCY)
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_PYTHON_CRYPTOGRAPHY),y)
|
||||
OPTEE_OS_DEPENDENCIES += host-python-cryptography
|
||||
else
|
||||
OPTEE_OS_DEPENDENCIES += host-python-pycryptodomex
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_NEEDS_DTC),y)
|
||||
OPTEE_OS_DEPENDENCIES += host-dtc
|
||||
endif
|
||||
|
||||
# On 64bit targets, OP-TEE OS can be built in 32bit mode, or
|
||||
# can be built in 64bit mode and support 32bit and 64bit
|
||||
# trusted applications. Since buildroot currently references
|
||||
# a single cross compiler, build exclusively in 32bit
|
||||
# or 64bit mode.
|
||||
OPTEE_OS_MAKE_OPTS = \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_core="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm64="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_arm32="$(TARGET_CROSS)" \
|
||||
CROSS_COMPILE_ta_rv64="$(TARGET_CROSS)" \
|
||||
PYTHON3="$(HOST_DIR)/bin/python3"
|
||||
|
||||
ifeq ($(BR2_riscv),y)
|
||||
OPTEE_OS_MAKE_OPTS += \
|
||||
ARCH=riscv \
|
||||
CFG_RV64_core=y \
|
||||
CFG_USER_TA_TARGETS=ta_rv64
|
||||
else
|
||||
ifeq ($(BR2_aarch64),y)
|
||||
OPTEE_OS_MAKE_OPTS += \
|
||||
ARCH=arm \
|
||||
CFG_ARM64_core=y \
|
||||
CFG_USER_TA_TARGETS=ta_arm64
|
||||
else
|
||||
OPTEE_OS_MAKE_OPTS += \
|
||||
ARCH=arm \
|
||||
CFG_ARM32_core=y
|
||||
endif
|
||||
endif
|
||||
|
||||
# Get mandatory PLATFORM and optional PLATFORM_FLAVOR and additional
|
||||
# variables
|
||||
OPTEE_OS_MAKE_OPTS += PLATFORM=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM))
|
||||
ifneq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR)),)
|
||||
OPTEE_OS_MAKE_OPTS += PLATFORM_FLAVOR=$(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM_FLAVOR))
|
||||
endif
|
||||
OPTEE_OS_MAKE_OPTS += $(call qstrip,$(BR2_TARGET_OPTEE_OS_ADDITIONAL_VARIABLES))
|
||||
|
||||
# Requests OP-TEE OS to build from subdirectory out/ of its sourcetree
|
||||
# root path otherwise the output directory path depends on the target
|
||||
# platform name.
|
||||
OPTEE_OS_BUILDDIR_OUT = out
|
||||
ifeq ($(BR2_riscv),y)
|
||||
OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_rv64
|
||||
OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_rv64
|
||||
endif
|
||||
ifeq ($(BR2_aarch64),y)
|
||||
OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_arm64
|
||||
OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm64
|
||||
endif
|
||||
ifeq ($(BR2_arm),y)
|
||||
OPTEE_OS_LOCAL_SDK = $(OPTEE_OS_BUILDDIR_OUT)/export-ta_arm32
|
||||
OPTEE_OS_SDK = $(STAGING_DIR)/lib/optee/export-ta_arm32
|
||||
endif
|
||||
|
||||
OPTEE_OS_IMAGE_FILES = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CORE_IMAGES))
|
||||
|
||||
OPTEE_OS_CUSTOM_DTS_PATH = $(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_DTS_PATH))
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_CORE),y)
|
||||
define OPTEE_OS_BUILD_CORE
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) O=$(OPTEE_OS_BUILDDIR_OUT) \
|
||||
$(TARGET_CONFIGURE_OPTS) $(OPTEE_OS_MAKE_OPTS) all
|
||||
endef
|
||||
define OPTEE_OS_INSTALL_IMAGES_CORE
|
||||
mkdir -p $(BINARIES_DIR)
|
||||
$(foreach f,$(OPTEE_OS_IMAGE_FILES), \
|
||||
cp -dpf $(wildcard $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/core/$(f)) $(BINARIES_DIR)/
|
||||
)
|
||||
endef
|
||||
endif # BR2_TARGET_OPTEE_OS_CORE
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_SERVICES),y)
|
||||
define OPTEE_OS_INSTALL_TARGET_CMDS
|
||||
$(if $(wildcard $(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta),
|
||||
$(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \
|
||||
$(@D)/$(OPTEE_OS_BUILDDIR_OUT)/ta/*/*.ta)
|
||||
$(if $(wildcard $(@D)/$(OPTEE_OS_LOCAL_SDK)/lib/*.ta),
|
||||
$(INSTALL) -D -m 444 -t $(TARGET_DIR)/lib/optee_armtz \
|
||||
$(@D)/$(OPTEE_OS_LOCAL_SDK)/lib/*.ta)
|
||||
endef
|
||||
endif # BR2_TARGET_OPTEE_OS_SERVICES
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_SDK),y)
|
||||
define OPTEE_OS_BUILD_SDK
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) O=$(OPTEE_OS_BUILDDIR_OUT) \
|
||||
$(TARGET_CONFIGURE_OPTS) $(OPTEE_OS_MAKE_OPTS) ta_dev_kit
|
||||
endef
|
||||
define OPTEE_OS_INSTALL_STAGING_CMDS
|
||||
mkdir -p $(OPTEE_OS_SDK)
|
||||
cp -ardpf $(@D)/$(OPTEE_OS_LOCAL_SDK)/* $(OPTEE_OS_SDK)
|
||||
endef
|
||||
endif # BR2_TARGET_OPTEE_OS_SDK
|
||||
|
||||
define OPTEE_OS_BUILD_CMDS
|
||||
$(if $(OPTEE_OS_CUSTOM_DTS_PATH),
|
||||
cp -f $(OPTEE_OS_CUSTOM_DTS_PATH) $(@D)/core/arch/arm/dts/
|
||||
)
|
||||
$(OPTEE_OS_BUILD_CORE)
|
||||
$(OPTEE_OS_BUILD_SDK)
|
||||
endef
|
||||
|
||||
define OPTEE_OS_INSTALL_IMAGES_CMDS
|
||||
$(OPTEE_OS_INSTALL_IMAGES_CORE)
|
||||
$(OPTEE_OS_INSTALL_IMAGES_SERVICES)
|
||||
endef
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS)$(BR_BUILDING),yy)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_PLATFORM)),)
|
||||
$(error No OP-TEE OS platform set. Check your BR2_TARGET_OPTEE_OS_PLATFORM setting)
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)),)
|
||||
$(error No tarball location specified. Please check BR2_TARGET_OPTEE_OS_CUSTOM_TARBALL_LOCATION)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BR2_TARGET_OPTEE_OS_CUSTOM_GIT),y)
|
||||
ifeq ($(call qstrip,$(BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL)),)
|
||||
$(error No repository specified. Please check BR2_TARGET_OPTEE_OS_CUSTOM_REPO_URL)
|
||||
endif
|
||||
endif
|
||||
|
||||
endif # BR2_TARGET_OPTEE_OS && BR2_BUILDING
|
||||
|
||||
$(eval $(generic-package))
|
||||
13
boot/palo/Config.in
Normal file
13
boot/palo/Config.in
Normal file
@@ -0,0 +1,13 @@
|
||||
config BR2_TARGET_PALO
|
||||
bool "palo"
|
||||
depends on BR2_hppa
|
||||
help
|
||||
Palo is a PA-RISC/Linux boot loader.
|
||||
|
||||
It comprises iplboot, a bootloader loaded by the HP firmware,
|
||||
and palo, a boot media management tool.
|
||||
|
||||
Palo allows to update disk images with a bootloader to make
|
||||
them bootable, or to create network bootable images.
|
||||
|
||||
https://parisc.docs.kernel.org
|
||||
3
boot/palo/palo.hash
Normal file
3
boot/palo/palo.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# Locally calculated
|
||||
sha256 bca096116d403b7d370794d84853c4f4a4703d604c01a645d1fbd1c5be42a7e0 palo-2.29.tar.gz
|
||||
sha256 fa5fc1d1eec39532ea517518eeefd7b6e3c14341a55e5880a0e2a49eee47a5b7 COPYING
|
||||
25
boot/palo/palo.mk
Normal file
25
boot/palo/palo.mk
Normal file
@@ -0,0 +1,25 @@
|
||||
################################################################################
|
||||
#
|
||||
# palo
|
||||
#
|
||||
################################################################################
|
||||
|
||||
PALO_VERSION = 2.29
|
||||
PALO_SITE = https://git.kernel.org/pub/scm/linux/kernel/git/deller/palo.git/snapshot
|
||||
PALO_LICENSE = GPL-2.0
|
||||
PALO_LICENSE_FILES = COPYING
|
||||
PALO_INSTALL_IMAGES = YES
|
||||
|
||||
define PALO_BUILD_CMDS
|
||||
# Dummy README to remove the dependency on lynx.
|
||||
touch $(@D)/README
|
||||
$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
|
||||
CROSS_COMPILE=$(TARGET_CROSS) all makeipl
|
||||
endef
|
||||
|
||||
define PALO_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -D -m 0644 $(@D)/iplboot $(BINARIES_DIR)/iplboot
|
||||
$(INSTALL) -D -m 0755 $(@D)/palo/palo $(HOST_DIR)/bin/palo
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
51
boot/shim/0001-Fix-build-with-binutils-2.46.patch
Normal file
51
boot/shim/0001-Fix-build-with-binutils-2.46.patch
Normal file
@@ -0,0 +1,51 @@
|
||||
From c4665d282072df2ed8ab6ae1d5fa0de41e5db02f Mon Sep 17 00:00:00 2001
|
||||
From: Luca Boccassi <luca.boccassi@gmail.com>
|
||||
Date: Tue, 6 Jan 2026 11:48:13 +0100
|
||||
Subject: [PATCH] Fix build with binutils 2.46
|
||||
|
||||
With the new binutils which is in development and in Fedora Rawhide:
|
||||
|
||||
objcopy -D -j .text -j .sdata -j .data -j .data.ident \
|
||||
-j .dynamic -j .rodata -j .rel* \
|
||||
-j .rela* -j .dyn -j .reloc -j .eh_frame \
|
||||
-j .vendor_cert -j .sbat -j .sbatlevel \
|
||||
--file-alignment 0x1000 \
|
||||
--target efi-app-x86_64 fbx64.so fbx64.efi
|
||||
objcopy: fbx64.so: file format not recognized
|
||||
|
||||
It seems it was an intentional compat break, according to the upstream
|
||||
commit:
|
||||
|
||||
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5e83077d552ed6f81dbc092eb3ccf827a43de42c
|
||||
|
||||
* Internal changes to plugin support, and stricter target checking may result
|
||||
in some errors being exposed in user options passed to the various binutils.
|
||||
For example objcopy --target=TARGET now will only work if the input file is
|
||||
for TARGET whereas prior versions of objcopy accepted other target input
|
||||
files and produced a TARGET output. If you do in fact want the old
|
||||
behaviour the correct usage is objcopy --output-target=TARGET.
|
||||
|
||||
Switch from --taget to --output-target as suggested.
|
||||
|
||||
Signed-off-by: Luca Boccassi <luca.boccassi@gmail.com>
|
||||
|
||||
Upstream: https://github.com/rhboot/shim/commit/c4665d282072df2ed8ab6ae1d5fa0de41e5db02f
|
||||
|
||||
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
|
||||
---
|
||||
Make.defaults | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Make.defaults b/Make.defaults
|
||||
index c5fa32bec..9b40b7f4a 100644
|
||||
--- a/Make.defaults
|
||||
+++ b/Make.defaults
|
||||
@@ -155,7 +155,7 @@ endif
|
||||
|
||||
LIB_GCC = $(shell $(CC) $(ARCH_CFLAGS) -print-libgcc-file-name)
|
||||
EFI_LIBS = -lefi -lgnuefi --start-group Cryptlib/libcryptlib.a Cryptlib/OpenSSL/libopenssl.a --end-group $(LIB_GCC)
|
||||
-FORMAT ?= --target efi-app-$(ARCH)
|
||||
+FORMAT ?= --output-target efi-app-$(ARCH)
|
||||
LOCAL_EFI_PATH = gnu-efi/$(ARCH_GNUEFI)/gnuefi
|
||||
LIBDIR = gnu-efi/$(ARCH_GNUEFI)/lib
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
From 7aee873d6f6b0737dfe566fc8c5cd4eaada9bd5e Mon Sep 17 00:00:00 2001
|
||||
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Date: Mon, 8 Apr 2024 11:56:06 +0200
|
||||
Subject: [PATCH] cmac.c: optimize make_kn and move zero_iv to const segment.
|
||||
|
||||
Backport
|
||||
https://github.com/openssl/openssl/commit/03cf7e784caa4c61febbf249be63cbae3e368ac9
|
||||
to fix the following k1 stringop-overflow:
|
||||
|
||||
In function 'make_kn',
|
||||
inlined from 'make_kn' at crypto/cmac/cmac.c:81:13,
|
||||
inlined from 'CMAC_Init' at crypto/cmac/cmac.c:205:9:
|
||||
crypto/cmac/cmac.c:92:20: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]
|
||||
92 | k1[bl - 1] ^= bl == 16 ? 0x87 : 0x1b;
|
||||
| ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
crypto/cmac/cmac.c: In function 'CMAC_Init':
|
||||
crypto/cmac/cmac.c:69:19: note: at offset [-2147483649, -1] into destination object 'k1' of size 32
|
||||
69 | unsigned char k1[EVP_MAX_BLOCK_LENGTH];
|
||||
| ^~
|
||||
|
||||
Fixes:
|
||||
- http://autobuild.buildroot.org/results/97b6333cdc7bad24aba7af1b04890679e0058299
|
||||
|
||||
Upstream: https://github.com/rhboot/shim/pull/652
|
||||
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
|
||||
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
|
||||
---
|
||||
Cryptlib/OpenSSL/crypto/cmac/cmac.c | 17 ++++++++---------
|
||||
1 file changed, 8 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/Cryptlib/OpenSSL/crypto/cmac/cmac.c b/Cryptlib/OpenSSL/crypto/cmac/cmac.c
|
||||
index 2954b6eb..27dbfaac 100644
|
||||
--- a/Cryptlib/OpenSSL/crypto/cmac/cmac.c
|
||||
+++ b/Cryptlib/OpenSSL/crypto/cmac/cmac.c
|
||||
@@ -78,18 +78,17 @@ struct CMAC_CTX_st {
|
||||
|
||||
/* Make temporary keys K1 and K2 */
|
||||
|
||||
-static void make_kn(unsigned char *k1, unsigned char *l, int bl)
|
||||
+static void make_kn(unsigned char *k1, const unsigned char *l, int bl)
|
||||
{
|
||||
int i;
|
||||
+ unsigned char c = l[0], carry = c>>7, cnext;
|
||||
+
|
||||
/* Shift block to left, including carry */
|
||||
- for (i = 0; i < bl; i++) {
|
||||
- k1[i] = l[i] << 1;
|
||||
- if (i < bl - 1 && l[i + 1] & 0x80)
|
||||
- k1[i] |= 1;
|
||||
- }
|
||||
+ for (i = 0; i < bl-1; i++, c = cnext)
|
||||
+ k1[i] = (c << 1) | ((cnext=l[i+1]) >> 7);
|
||||
+
|
||||
/* If MSB set fixup with R */
|
||||
- if (l[0] & 0x80)
|
||||
- k1[bl - 1] ^= bl == 16 ? 0x87 : 0x1b;
|
||||
+ k1[i] = (c << 1) ^ ((0-carry)&(bl==16?0x87:0x1b));
|
||||
}
|
||||
|
||||
CMAC_CTX *CMAC_CTX_new(void)
|
||||
@@ -151,7 +150,7 @@ int CMAC_CTX_copy(CMAC_CTX *out, const CMAC_CTX *in)
|
||||
int CMAC_Init(CMAC_CTX *ctx, const void *key, size_t keylen,
|
||||
const EVP_CIPHER *cipher, ENGINE *impl)
|
||||
{
|
||||
- static unsigned char zero_iv[EVP_MAX_BLOCK_LENGTH];
|
||||
+ static const unsigned char zero_iv[EVP_MAX_BLOCK_LENGTH] = {0};
|
||||
#ifdef OPENSSL_FIPS
|
||||
if (FIPS_mode()) {
|
||||
/* If we have an ENGINE need to allow non FIPS */
|
||||
--
|
||||
2.47.3
|
||||
|
||||
25
boot/shim/Config.in
Normal file
25
boot/shim/Config.in
Normal file
@@ -0,0 +1,25 @@
|
||||
config BR2_PACKAGE_SHIM_ARCH_SUPPORTS
|
||||
bool
|
||||
default y if BR2_aarch64
|
||||
default y if BR2_arm
|
||||
default y if BR2_i386
|
||||
default y if BR2_x86_64
|
||||
# it includes gnu-efi
|
||||
depends on BR2_PACKAGE_GNU_EFI_ARCH_SUPPORTS
|
||||
|
||||
config BR2_TARGET_SHIM
|
||||
bool "shim"
|
||||
depends on BR2_PACKAGE_SHIM_ARCH_SUPPORTS
|
||||
help
|
||||
Boot loader to chain-load signed boot loaders under Secure
|
||||
Boot.
|
||||
|
||||
This package provides a minimalist boot loader which allows
|
||||
verifying signatures of other UEFI binaries against either
|
||||
the Secure Boot DB/DBX or against a built-in signature
|
||||
database. Its purpose is to allow a small,
|
||||
infrequently-changing binary to be signed by the UEFI CA,
|
||||
while allowing an OS distributor to revision their main
|
||||
bootloader independently of the CA.
|
||||
|
||||
https://github.com/rhboot/shim
|
||||
3
boot/shim/shim.hash
Normal file
3
boot/shim/shim.hash
Normal file
@@ -0,0 +1,3 @@
|
||||
# locally computed hash
|
||||
sha256 46319cd228d8f2c06c744241c0f342412329a7c630436fce7f82cf6936b1d603 shim-16.1.tar.bz2
|
||||
sha256 15edf527919ddcb2f514ab9d16ad07ef219e4bb490e0b79560be510f0c159cc2 COPYRIGHT
|
||||
38
boot/shim/shim.mk
Normal file
38
boot/shim/shim.mk
Normal file
@@ -0,0 +1,38 @@
|
||||
################################################################################
|
||||
#
|
||||
# shim
|
||||
#
|
||||
################################################################################
|
||||
|
||||
SHIM_VERSION = 16.1
|
||||
SHIM_SITE = https://github.com/rhboot/shim/releases/download/$(SHIM_VERSION)
|
||||
SHIM_SOURCE = shim-$(SHIM_VERSION).tar.bz2
|
||||
SHIM_LICENSE = BSD-2-Clause
|
||||
SHIM_LICENSE_FILES = COPYRIGHT
|
||||
SHIM_CPE_ID_VENDOR = redhat
|
||||
SHIM_INSTALL_TARGET = NO
|
||||
SHIM_INSTALL_IMAGES = YES
|
||||
|
||||
SHIM_CFLAGS = $(TARGET_CFLAGS)
|
||||
SHIM_MAKE_OPTS = \
|
||||
ARCH="$(GNU_EFI_PLATFORM)" \
|
||||
CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||
DASHJ="-j$(PARALLEL_JOBS)" \
|
||||
OPTIMIZATIONS="$(SHIM_CFLAGS)"
|
||||
|
||||
# shim has some assembly function that is not present in Thumb mode:
|
||||
# Error: selected processor does not support `mrc p15,0,r2,c9,c13,0' in Thumb mode
|
||||
# so, we deactivate Thumb mode
|
||||
ifeq ($(BR2_ARM_INSTRUCTIONS_THUMB),y)
|
||||
SHIM_CFLAGS += -marm
|
||||
endif
|
||||
|
||||
define SHIM_BUILD_CMDS
|
||||
$(TARGET_CONFIGURE_OPTS) $(MAKE) -C $(@D) $(SHIM_MAKE_OPTS)
|
||||
endef
|
||||
|
||||
define SHIM_INSTALL_IMAGES_CMDS
|
||||
$(INSTALL) -m 0755 -t $(BINARIES_DIR) $(@D)/*.efi
|
||||
endef
|
||||
|
||||
$(eval $(generic-package))
|
||||
@@ -0,0 +1,82 @@
|
||||
From da5cbd1a3b248f2d32281a1766a3d1414c0e8e03 Mon Sep 17 00:00:00 2001
|
||||
From: Sylvain Gault <sylvain.gault@gmail.com>
|
||||
Date: Tue, 29 Sep 2015 02:38:25 +0200
|
||||
Subject: [PATCH] bios: Fix alignment change with gcc 5
|
||||
|
||||
The section aligment specified in the ld scripts have to be greater or
|
||||
equal to those in the .o files generated by gcc.
|
||||
|
||||
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
|
||||
Tested-by: poma <pomidorabelisima@gmail.com>
|
||||
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
||||
Signed-off-by: Frank Hunleth <fhunleth@troodon-software.com>
|
||||
---
|
||||
core/i386/syslinux.ld | 6 +++---
|
||||
core/x86_64/syslinux.ld | 6 +++---
|
||||
2 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/core/i386/syslinux.ld b/core/i386/syslinux.ld
|
||||
index 7b4e012..7390451 100644
|
||||
--- a/core/i386/syslinux.ld
|
||||
+++ b/core/i386/syslinux.ld
|
||||
@@ -266,7 +266,7 @@ SECTIONS
|
||||
__text_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(16);
|
||||
+ . = ALIGN(32);
|
||||
|
||||
__rodata_vma = .;
|
||||
__rodata_lma = __rodata_vma + __text_lma - __text_vma;
|
||||
@@ -361,7 +361,7 @@ SECTIONS
|
||||
__dynamic_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(16);
|
||||
+ . = ALIGN(32);
|
||||
|
||||
__data_vma = .;
|
||||
__data_lma = __data_vma + __text_lma - __text_vma;
|
||||
@@ -377,7 +377,7 @@ SECTIONS
|
||||
__pm_code_dwords = (__pm_code_len + 3) >> 2;
|
||||
|
||||
. = ALIGN(128);
|
||||
-
|
||||
+
|
||||
__bss_vma = .;
|
||||
__bss_lma = .; /* Dummy */
|
||||
.bss (NOLOAD) : AT (__bss_lma) {
|
||||
diff --git a/core/x86_64/syslinux.ld b/core/x86_64/syslinux.ld
|
||||
index 1057112..bf815c4 100644
|
||||
--- a/core/x86_64/syslinux.ld
|
||||
+++ b/core/x86_64/syslinux.ld
|
||||
@@ -266,7 +266,7 @@ SECTIONS
|
||||
__text_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(16);
|
||||
+ . = ALIGN(32);
|
||||
|
||||
__rodata_vma = .;
|
||||
__rodata_lma = __rodata_vma + __text_lma - __text_vma;
|
||||
@@ -361,7 +361,7 @@ SECTIONS
|
||||
__dynamic_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(16);
|
||||
+ . = ALIGN(32);
|
||||
|
||||
__data_vma = .;
|
||||
__data_lma = __data_vma + __text_lma - __text_vma;
|
||||
@@ -377,7 +377,7 @@ SECTIONS
|
||||
__pm_code_dwords = (__pm_code_len + 3) >> 2;
|
||||
|
||||
. = ALIGN(128);
|
||||
-
|
||||
+
|
||||
__bss_vma = .;
|
||||
__bss_lma = .; /* Dummy */
|
||||
.bss (NOLOAD) : AT (__bss_lma) {
|
||||
--
|
||||
2.7.4
|
||||
|
||||
30
boot/syslinux/0002-Disable-PIE-to-avoid-FTBFS-on-amd64.patch
Normal file
30
boot/syslinux/0002-Disable-PIE-to-avoid-FTBFS-on-amd64.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
From 250bf2c921713434627dc7bc8b0918fa0841f9b7 Mon Sep 17 00:00:00 2001
|
||||
From: Graham Inggs <ginggs@ubuntu.com>
|
||||
Date: Wed, 5 Apr 2017 22:03:12 +0200
|
||||
Subject: [PATCH] Disable PIE to avoid FTBFS on amd64
|
||||
|
||||
gcc 6.x has PIE support enabled by default, which causes a build issue
|
||||
with syslinux. This patch disables PIE support in the relevant
|
||||
syslinux Makefile.
|
||||
|
||||
Signed-off-by: Ryan Coe <bluemrp9@gmail.com>
|
||||
---
|
||||
gpxe/src/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/gpxe/src/Makefile b/gpxe/src/Makefile
|
||||
index cc91d78..077af64 100644
|
||||
--- a/gpxe/src/Makefile
|
||||
+++ b/gpxe/src/Makefile
|
||||
@@ -4,7 +4,7 @@
|
||||
#
|
||||
|
||||
CLEANUP :=
|
||||
-CFLAGS :=
|
||||
+CFLAGS := -fno-PIE
|
||||
ASFLAGS :=
|
||||
LDFLAGS :=
|
||||
MAKEDEPS := Makefile
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From c0287594239d5af2082cac20817f8e8b11a4b1b2 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Wed, 5 Apr 2017 14:18:09 +0200
|
||||
Subject: [PATCH] memdisk: Force ld output format to 32-bits
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
On toolchains where the default output is x86_64, we need to be
|
||||
consistent with the other .o files
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
memdisk/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/memdisk/Makefile b/memdisk/Makefile
|
||||
index e6557d8..06613ff 100644
|
||||
--- a/memdisk/Makefile
|
||||
+++ b/memdisk/Makefile
|
||||
@@ -78,7 +78,7 @@ memdisk16.o: memdisk16.asm
|
||||
$(NASM) -f bin $(NASMOPT) $(NFLAGS) $(NINCLUDE) -o $@ -l $*.lst $<
|
||||
|
||||
memdisk_%.o: memdisk_%.bin
|
||||
- $(LD) -r -b binary -o $@ $<
|
||||
+ $(LD) --oformat elf32-i386 -r -b binary -o $@ $<
|
||||
|
||||
memdisk16.elf: $(OBJS16)
|
||||
$(LD) -Ttext 0 -o $@ $^
|
||||
--
|
||||
2.7.4
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
From e000251144056c99e390a2a4449d06cbd2a19c0a Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Wed, 5 Apr 2017 14:25:02 +0200
|
||||
Subject: [PATCH] utils: Use the host toolchain to build.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The utilities are meant to run on the host machine, hence must be built using
|
||||
the host toolchain.
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
utils/Makefile | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/utils/Makefile b/utils/Makefile
|
||||
index dfe6259..ac91aaa 100644
|
||||
--- a/utils/Makefile
|
||||
+++ b/utils/Makefile
|
||||
@@ -17,8 +17,8 @@
|
||||
VPATH = $(SRC)
|
||||
include $(MAKEDIR)/syslinux.mk
|
||||
|
||||
-CFLAGS = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
|
||||
-LDFLAGS = -O2
|
||||
+CFLAGS = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64 -I$(SRC)
|
||||
+LDFLAGS = $(LDFLAGS_FOR_BUILD) -O2
|
||||
|
||||
C_TARGETS = isohybrid gethostip memdiskfind
|
||||
SCRIPT_TARGETS = mkdiskimage
|
||||
@@ -35,7 +35,7 @@ ISOHDPFX = $(addprefix $(OBJ)/,../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin \
|
||||
all: $(TARGETS)
|
||||
|
||||
%.o: %.c
|
||||
- $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
||||
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
||||
|
||||
mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
|
||||
$(PERL) $(SRC)/bin2hex.pl < $(OBJ)/../mbr/mbr.bin | cat $(SRC)/mkdiskimage.in - > $@
|
||||
@@ -51,13 +51,13 @@ isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
|
||||
$(PERL) $(SRC)/isohdpfxarray.pl $(ISOHDPFX) > $@
|
||||
|
||||
isohybrid: isohybrid.o isohdpfx.o
|
||||
- $(CC) $(LDFLAGS) -o $@ $^ -luuid
|
||||
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^ -luuid
|
||||
|
||||
gethostip: gethostip.o
|
||||
- $(CC) $(LDFLAGS) -o $@ $^
|
||||
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
memdiskfind: memdiskfind.o
|
||||
- $(CC) $(LDFLAGS) -o $@ $^
|
||||
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
tidy dist:
|
||||
rm -f *.o .*.d isohdpfx.c
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
From 83e1f00990c25554723609bb549e18b987034317 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Thu, 6 Apr 2017 09:43:46 +0200
|
||||
Subject: [PATCH] lzo: Use the host toolchain for prepcore
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
lzo/Makefile | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/lzo/Makefile b/lzo/Makefile
|
||||
index 29f1fa6..c016e5a 100644
|
||||
--- a/lzo/Makefile
|
||||
+++ b/lzo/Makefile
|
||||
@@ -11,10 +11,13 @@
|
||||
## -----------------------------------------------------------------------
|
||||
|
||||
VPATH = $(SRC)
|
||||
-include $(MAKEDIR)/build.mk
|
||||
+include $(MAKEDIR)/syslinux.mk
|
||||
|
||||
INCLUDES += -I$(SRC)/include
|
||||
|
||||
+%.o: %.c
|
||||
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS_FOR_BUILD) $(INCLUDES) -c -o $@ $<
|
||||
+
|
||||
LIBOBJS = $(patsubst %.c,%.o,$(subst $(SRC)/,,$(wildcard $(SRC)/src/*.c)))
|
||||
LIB = lzo.a
|
||||
BINS = prepcore
|
||||
@@ -30,7 +33,7 @@ $(LIB) : $(LIBOBJS)
|
||||
$(RANLIB) $@
|
||||
|
||||
prepcore : prepcore.o $(LIB)
|
||||
- $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
|
||||
+ $(CC_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $^ $(LIBS)
|
||||
|
||||
tidy dist clean spotless:
|
||||
rm -f $(BINS)
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 39274503292a6003b1b0c93f694e34f11e85ea44 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Fri, 9 Jun 2017 11:55:14 +0200
|
||||
Subject: [PATCH] The VPrint definition is now part of the exports of
|
||||
gnu-efi
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
efi/fio.h | 9 ---------
|
||||
1 file changed, 9 deletions(-)
|
||||
|
||||
diff --git a/efi/fio.h b/efi/fio.h
|
||||
index 65fff8d..a1bfe68 100644
|
||||
--- a/efi/fio.h
|
||||
+++ b/efi/fio.h
|
||||
@@ -11,15 +11,6 @@
|
||||
#define MAX_EFI_ARGS 64
|
||||
#define WS(c16) (c16 == L' ' || c16 == CHAR_TAB)
|
||||
|
||||
-/* VPrint is not in export declarations in gnu-efi lib yet
|
||||
- * although it is a global function; declare it here
|
||||
- */
|
||||
-extern UINTN
|
||||
-VPrint (
|
||||
- IN CHAR16 *fmt,
|
||||
- va_list args
|
||||
- );
|
||||
-
|
||||
extern EFI_STATUS efi_errno;
|
||||
|
||||
void efi_memcpy(unsigned char *dst, unsigned char *src, size_t len);
|
||||
--
|
||||
2.1.4
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
From 3bd5c2d951421a89f76b2423e5810862f53486c1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Fri, 9 Jun 2017 11:59:43 +0200
|
||||
Subject: [PATCH] Update the longjump calls to fit the new declaration
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
efi/main.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/efi/main.c b/efi/main.c
|
||||
index 208fee4f..71d31a5c 100644
|
||||
--- a/efi/main.c
|
||||
+++ b/efi/main.c
|
||||
@@ -10,7 +10,6 @@
|
||||
#include <syslinux/firmware.h>
|
||||
#include <syslinux/linux.h>
|
||||
#include <sys/ansi.h>
|
||||
-#include <setjmp.h>
|
||||
|
||||
#include "efi.h"
|
||||
#include "fio.h"
|
||||
@@ -30,7 +29,7 @@ uint32_t timer_irq;
|
||||
__export uint8_t KbdMap[256];
|
||||
char aux_seg[256];
|
||||
|
||||
-static jmp_buf load_error_buf;
|
||||
+static jmp_buf *load_error_buf;
|
||||
|
||||
static inline EFI_STATUS
|
||||
efi_close_protocol(EFI_HANDLE handle, EFI_GUID *guid, EFI_HANDLE agent,
|
||||
--
|
||||
2.13.3
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
From ca8aaded0c7c3900397029bd9520132b62629308 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Beno=C3=AEt=20Allard?= <benoit.allard@greenbone.net>
|
||||
Date: Mon, 12 Jun 2017 14:59:16 +0200
|
||||
Subject: [PATCH] efi/wrapper: build it with the host toolchain.
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
The wrapper program is executed on the build machine, so it should be
|
||||
built with CC_FOR_BUILD.
|
||||
|
||||
Signed-off-by: Benoît Allard <benoit.allard@greenbone.net>
|
||||
---
|
||||
efi/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/efi/Makefile b/efi/Makefile
|
||||
index d5443bd5..d24d16db 100644
|
||||
--- a/efi/Makefile
|
||||
+++ b/efi/Makefile
|
||||
@@ -79,7 +79,7 @@ syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
|
||||
# cp $^ $@
|
||||
|
||||
wrapper: wrapper.c
|
||||
- $(CC) $^ -o $@
|
||||
+ $(CC_FOR_BUILD) $^ -o $@
|
||||
|
||||
#
|
||||
# Build the wrapper app and wrap our .so to produce a .efi
|
||||
--
|
||||
2.13.3
|
||||
|
||||
@@ -0,0 +1,295 @@
|
||||
From 76946dd67bc856eaf4fe69d0826547a794176f78 Mon Sep 17 00:00:00 2001
|
||||
From: Sylvain Gault <sylvain.gault@gmail.com>
|
||||
Date: Tue, 29 Sep 2015 04:45:09 +0200
|
||||
Subject: [PATCH] bios: Don't try to guess the sections alignment
|
||||
|
||||
For the compression / decompression to succeed, the sections layout must
|
||||
be the same between the virtual memory and load memory. The section
|
||||
alignment was kept in sync by introducing aligment that should be
|
||||
greater or equal to the actual section alignment.
|
||||
|
||||
This patch compute the load memory addresses of the sections so that
|
||||
the layout is the same as the virtual memory addresses.
|
||||
|
||||
Signed-off-by: Sylvain Gault <sylvain.gault@gmail.com>
|
||||
Tested-by: poma <pomidorabelisima@gmail.com>
|
||||
Signed-off-by: Paulo Alcantara <pcacjr@zytor.com>
|
||||
|
||||
Upstream: 0cc9a99e560a2f52bcf052fd85b1efae35ee812f
|
||||
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
|
||||
---
|
||||
core/i386/syslinux.ld | 63 ++++++++++---------------------------------------
|
||||
core/x86_64/syslinux.ld | 63 ++++++++++---------------------------------------
|
||||
2 files changed, 24 insertions(+), 102 deletions(-)
|
||||
|
||||
diff --git a/core/i386/syslinux.ld b/core/i386/syslinux.ld
|
||||
index 73904510..92b75b11 100644
|
||||
--- a/core/i386/syslinux.ld
|
||||
+++ b/core/i386/syslinux.ld
|
||||
@@ -255,10 +255,9 @@ SECTIONS
|
||||
. = 0x100000;
|
||||
|
||||
__pm_code_start = .;
|
||||
+ __vma_to_lma = __pm_code_lma - __pm_code_start;
|
||||
|
||||
- __text_vma = .;
|
||||
- __text_lma = __pm_code_lma;
|
||||
- .text : AT(__text_lma) {
|
||||
+ .text : AT(ADDR(.text) + __vma_to_lma) {
|
||||
FILL(0x90909090)
|
||||
__text_start = .;
|
||||
*(.text)
|
||||
@@ -266,106 +265,68 @@ SECTIONS
|
||||
__text_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(32);
|
||||
-
|
||||
- __rodata_vma = .;
|
||||
- __rodata_lma = __rodata_vma + __text_lma - __text_vma;
|
||||
- .rodata : AT(__rodata_lma) {
|
||||
+ .rodata : AT(ADDR(.rodata) + __vma_to_lma) {
|
||||
__rodata_start = .;
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
__rodata_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __ctors_vma = .;
|
||||
- __ctors_lma = __ctors_vma + __text_lma - __text_vma;
|
||||
- .ctors : AT(__ctors_lma) {
|
||||
+ .ctors : AT(ADDR(.ctors) + __vma_to_lma) {
|
||||
__ctors_start = .;
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__ctors_end = .;
|
||||
}
|
||||
|
||||
- __dtors_vma = .;
|
||||
- __dtors_lma = __dtors_vma + __text_lma - __text_vma;
|
||||
- .dtors : AT(__dtors_lma) {
|
||||
+ .dtors : AT(ADDR(.dtors) + __vma_to_lma) {
|
||||
__dtors_start = .;
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__dtors_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynsym_vma = .;
|
||||
- __dynsym_lma = __dynsym_vma + __text_lma - __text_vma;
|
||||
- .dynsym : AT(__dynsym_lma) {
|
||||
+ .dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
|
||||
__dynsym_start = .;
|
||||
*(.dynsym)
|
||||
__dynsym_end = .;
|
||||
}
|
||||
__dynsym_len = __dynsym_end - __dynsym_start;
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynstr_vma = .;
|
||||
- __dynstr_lma = __dynstr_vma + __text_lma - __text_vma;
|
||||
- .dynstr : AT(__dynstr_lma) {
|
||||
+ .dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
|
||||
__dynstr_start = .;
|
||||
*(.dynstr)
|
||||
__dynstr_end = .;
|
||||
}
|
||||
__dynstr_len = __dynstr_end - __dynstr_start;
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __gnu_hash_vma = .;
|
||||
- __gnu_hash_lma = __gnu_hash_vma + __text_lma - __text_vma;
|
||||
- .gnu.hash : AT(__gnu_hash_lma) {
|
||||
+ .gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
|
||||
__gnu_hash_start = .;
|
||||
*(.gnu.hash)
|
||||
__gnu_hash_end = .;
|
||||
}
|
||||
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynlink_vma = .;
|
||||
- __dynlink_lma = __dynlink_vma + __text_lma - __text_vma;
|
||||
- .dynlink : AT(__dynlink_lma) {
|
||||
+ .dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
|
||||
__dynlink_start = .;
|
||||
*(.dynlink)
|
||||
__dynlink_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __got_vma = .;
|
||||
- __got_lma = __got_vma + __text_lma - __text_vma;
|
||||
- .got : AT(__got_lma) {
|
||||
+ .got : AT(ADDR(.got) + __vma_to_lma) {
|
||||
__got_start = .;
|
||||
KEEP (*(.got.plt))
|
||||
KEEP (*(.got))
|
||||
__got_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynamic_vma = .;
|
||||
- __dynamic_lma = __dynamic_vma + __text_lma - __text_vma;
|
||||
- .dynamic : AT(__dynamic_lma) {
|
||||
+ .dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
|
||||
__dynamic_start = .;
|
||||
*(.dynamic)
|
||||
__dynamic_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(32);
|
||||
-
|
||||
- __data_vma = .;
|
||||
- __data_lma = __data_vma + __text_lma - __text_vma;
|
||||
- .data : AT(__data_lma) {
|
||||
+ .data : AT(ADDR(.data) + __vma_to_lma) {
|
||||
__data_start = .;
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
diff --git a/core/x86_64/syslinux.ld b/core/x86_64/syslinux.ld
|
||||
index bf815c46..70c6e00a 100644
|
||||
--- a/core/x86_64/syslinux.ld
|
||||
+++ b/core/x86_64/syslinux.ld
|
||||
@@ -255,10 +255,9 @@ SECTIONS
|
||||
. = 0x100000;
|
||||
|
||||
__pm_code_start = .;
|
||||
+ __vma_to_lma = __pm_code_lma - __pm_code_start;
|
||||
|
||||
- __text_vma = .;
|
||||
- __text_lma = __pm_code_lma;
|
||||
- .text : AT(__text_lma) {
|
||||
+ .text : AT(ADDR(.text) + __vma_to_lma) {
|
||||
FILL(0x90909090)
|
||||
__text_start = .;
|
||||
*(.text)
|
||||
@@ -266,106 +265,68 @@ SECTIONS
|
||||
__text_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(32);
|
||||
-
|
||||
- __rodata_vma = .;
|
||||
- __rodata_lma = __rodata_vma + __text_lma - __text_vma;
|
||||
- .rodata : AT(__rodata_lma) {
|
||||
+ .rodata : AT(ADDR(.rodata) + __vma_to_lma) {
|
||||
__rodata_start = .;
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
__rodata_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __ctors_vma = .;
|
||||
- __ctors_lma = __ctors_vma + __text_lma - __text_vma;
|
||||
- .ctors : AT(__ctors_lma) {
|
||||
+ .ctors : AT(ADDR(.ctors) + __vma_to_lma) {
|
||||
__ctors_start = .;
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
__ctors_end = .;
|
||||
}
|
||||
|
||||
- __dtors_vma = .;
|
||||
- __dtors_lma = __dtors_vma + __text_lma - __text_vma;
|
||||
- .dtors : AT(__dtors_lma) {
|
||||
+ .dtors : AT(ADDR(.dtors) + __vma_to_lma) {
|
||||
__dtors_start = .;
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
__dtors_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynsym_vma = .;
|
||||
- __dynsym_lma = __dynsym_vma + __text_lma - __text_vma;
|
||||
- .dynsym : AT(__dynsym_lma) {
|
||||
+ .dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
|
||||
__dynsym_start = .;
|
||||
*(.dynsym)
|
||||
__dynsym_end = .;
|
||||
}
|
||||
__dynsym_len = __dynsym_end - __dynsym_start;
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynstr_vma = .;
|
||||
- __dynstr_lma = __dynstr_vma + __text_lma - __text_vma;
|
||||
- .dynstr : AT(__dynstr_lma) {
|
||||
+ .dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
|
||||
__dynstr_start = .;
|
||||
*(.dynstr)
|
||||
__dynstr_end = .;
|
||||
}
|
||||
__dynstr_len = __dynstr_end - __dynstr_start;
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __gnu_hash_vma = .;
|
||||
- __gnu_hash_lma = __gnu_hash_vma + __text_lma - __text_vma;
|
||||
- .gnu.hash : AT(__gnu_hash_lma) {
|
||||
+ .gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
|
||||
__gnu_hash_start = .;
|
||||
*(.gnu.hash)
|
||||
__gnu_hash_end = .;
|
||||
}
|
||||
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynlink_vma = .;
|
||||
- __dynlink_lma = __dynlink_vma + __text_lma - __text_vma;
|
||||
- .dynlink : AT(__dynlink_lma) {
|
||||
+ .dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
|
||||
__dynlink_start = .;
|
||||
*(.dynlink)
|
||||
__dynlink_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __got_vma = .;
|
||||
- __got_lma = __got_vma + __text_lma - __text_vma;
|
||||
- .got : AT(__got_lma) {
|
||||
+ .got : AT(ADDR(.got) + __vma_to_lma) {
|
||||
__got_start = .;
|
||||
KEEP (*(.got.plt))
|
||||
KEEP (*(.got))
|
||||
__got_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(4);
|
||||
-
|
||||
- __dynamic_vma = .;
|
||||
- __dynamic_lma = __dynamic_vma + __text_lma - __text_vma;
|
||||
- .dynamic : AT(__dynamic_lma) {
|
||||
+ .dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
|
||||
__dynamic_start = .;
|
||||
*(.dynamic)
|
||||
__dynamic_end = .;
|
||||
}
|
||||
|
||||
- . = ALIGN(32);
|
||||
-
|
||||
- __data_vma = .;
|
||||
- __data_lma = __data_vma + __text_lma - __text_vma;
|
||||
- .data : AT(__data_lma) {
|
||||
+ .data : AT(ADDR(.data) + __vma_to_lma) {
|
||||
__data_start = .;
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
--
|
||||
2.13.3
|
||||
|
||||
622
boot/syslinux/0010-core-Clean-up-the-i386-bios-build.patch
Normal file
622
boot/syslinux/0010-core-Clean-up-the-i386-bios-build.patch
Normal file
@@ -0,0 +1,622 @@
|
||||
From a14b1b3d3e375d2e8af8804171ef5e52574dbb2a Mon Sep 17 00:00:00 2001
|
||||
From: "H. Peter Anvin" <hpa@zytor.com>
|
||||
Date: Tue, 9 Feb 2016 18:15:50 -0800
|
||||
Subject: [PATCH] core: Clean up the i386-bios build
|
||||
|
||||
Remove symbols and data structures not used in the i386-bios build,
|
||||
and clean up the linker script so that most internal symbols are
|
||||
HIDDEN.
|
||||
|
||||
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
||||
|
||||
Upstream: ff859050fa4e6535cae098dc35d88a265466448d
|
||||
|
||||
This patch fixes the following build failure with i386 binutils 2.28.1:
|
||||
|
||||
/builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld -Bsymbolic -pie -E --hash-style=gnu -T
|
||||
/builds/arnout/buildroot/output/build/syslinux-6.03/core/i386/syslinux.ld -M -o ldlinux.elf ldlinux.o \
|
||||
--start-group libcom32.a --whole-archive /builds/arnout/buildroot/output/build/syslinux-6.03/bios/com32/lib/libcom32core.a libldlinux.a --end-group -N
|
||||
--no-omagic \
|
||||
> ldlinux.map
|
||||
/builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld: ldlinux.elf: Not enough room for program headers, try linking with -N
|
||||
/builds/arnout/buildroot/output/host/bin/i586-buildroot-linux-uclibc-ld: final link failed: Bad value
|
||||
/builds/arnout/buildroot/output/build/syslinux-6.03/core/Makefile:167: recipe for target 'ldlinux.elf' failed
|
||||
|
||||
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
|
||||
---
|
||||
core/extern.inc | 17 +--
|
||||
core/i386/syslinux.ld | 287 +++++++++++++++++++++++++-------------------------
|
||||
core/layout.inc | 11 --
|
||||
3 files changed, 143 insertions(+), 172 deletions(-)
|
||||
|
||||
diff --git a/core/extern.inc b/core/extern.inc
|
||||
index af8eb04c..ce4abfab 100644
|
||||
--- a/core/extern.inc
|
||||
+++ b/core/extern.inc
|
||||
@@ -12,27 +12,17 @@
|
||||
; hello.c
|
||||
extern hello
|
||||
|
||||
- ;abort.c
|
||||
- extern abort_load_new
|
||||
-
|
||||
; elflink/load_env32.c
|
||||
extern load_env32, pm_env32_run
|
||||
|
||||
- ; memscan.c
|
||||
- extern highmem_init
|
||||
-
|
||||
- extern linux_kernel
|
||||
-
|
||||
extern mp1, mp2, mp3, mp4, mp5
|
||||
|
||||
- extern hexdump, mydump
|
||||
+ extern hexdump
|
||||
|
||||
extern mem_init
|
||||
|
||||
; fs.c
|
||||
- extern pm_fs_init, pm_searchdir, getfssec, getfsbytes
|
||||
- extern pm_mangle_name, pm_load_config
|
||||
- extern pm_open_file, pm_close_file
|
||||
+ extern pm_fs_init
|
||||
extern SectorSize, SectorShift
|
||||
|
||||
; chdir.c
|
||||
@@ -41,9 +31,6 @@
|
||||
; readdir.c
|
||||
extern opendir, readdir, closedir
|
||||
|
||||
- ; newconfig.c
|
||||
- extern pm_is_config_file
|
||||
-
|
||||
; idle.c
|
||||
extern __idle
|
||||
|
||||
diff --git a/core/i386/syslinux.ld b/core/i386/syslinux.ld
|
||||
index 92b75b11..39198d75 100644
|
||||
--- a/core/i386/syslinux.ld
|
||||
+++ b/core/i386/syslinux.ld
|
||||
@@ -1,7 +1,7 @@
|
||||
/* -----------------------------------------------------------------------
|
||||
*
|
||||
* Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
|
||||
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
|
||||
+ * Copyright 2009-2016 Intel Corporation; author: H. Peter Anvin
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -12,7 +12,7 @@
|
||||
* ----------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
- * Linker script for the SYSLINUX core
|
||||
+ * Linker script for the SYSLINUX core when built for i386-bios
|
||||
*/
|
||||
|
||||
OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
|
||||
@@ -26,7 +26,7 @@ SECTIONS
|
||||
{
|
||||
/* Prefix structure for the compression program */
|
||||
. = 0;
|
||||
- __module_start = .;
|
||||
+ HIDDEN(__module_start = ABSOLUTE(.));
|
||||
.prefix : {
|
||||
*(.prefix)
|
||||
}
|
||||
@@ -35,81 +35,82 @@ SECTIONS
|
||||
. = 0x1000;
|
||||
|
||||
.earlybss (NOLOAD) : {
|
||||
- __earlybss_start = .;
|
||||
+ HIDDEN(__earlybss_start = .);
|
||||
*(.earlybss)
|
||||
- __earlybss_end = .;
|
||||
+ HIDDEN(__earlybss_end = .);
|
||||
}
|
||||
- __earlybss_len = ABSOLUTE(__earlybss_end) - ABSOLUTE(__earlybss_start);
|
||||
- __earlybss_dwords = (__earlybss_len + 3) >> 2;
|
||||
+ HIDDEN(__earlybss_len = ABSOLUTE(__earlybss_end) - ABSOLUTE(__earlybss_start));
|
||||
+ HIDDEN(__earlybss_dwords = (__earlybss_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(4);
|
||||
.bss16 (NOLOAD) : {
|
||||
- __bss16_start = .;
|
||||
+ HIDDEN(__bss16_start = .);
|
||||
*(.bss16)
|
||||
- __bss16_end = .;
|
||||
+ HIDDEN(__bss16_end = .);
|
||||
}
|
||||
- __bss16_len = ABSOLUTE(__bss16_end) - ABSOLUTE(__bss16_start);
|
||||
- __bss16_dwords = (__bss16_len + 3) >> 2;
|
||||
+ HIDDEN(__bss16_len = ABSOLUTE(__bss16_end) - ABSOLUTE(__bss16_start));
|
||||
+ HIDDEN(__bss16_dwords = (__bss16_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(4);
|
||||
.config : AT (__config_lma) {
|
||||
- __config_start = .;
|
||||
+ HIDDEN(__config_start = .);
|
||||
*(.config)
|
||||
- __config_end = .;
|
||||
+ HIDDEN(__config_end = .);
|
||||
}
|
||||
- __config_len = ABSOLUTE(__config_end) - ABSOLUTE(__config_start);
|
||||
- __config_dwords = (__config_len + 3) >> 2;
|
||||
+ HIDDEN(__config_len = ABSOLUTE(__config_end) - ABSOLUTE(__config_start));
|
||||
+ HIDDEN(__config_dwords = (__config_len + 3) >> 2);
|
||||
|
||||
/* Generated and/or copied code */
|
||||
|
||||
. = ALIGN(128); /* Minimum separation from mutable data */
|
||||
.replacestub : AT (__replacestub_lma) {
|
||||
- __replacestub_start = .;
|
||||
+ HIDDEN(__replacestub_start = .);
|
||||
*(.replacestub)
|
||||
- __replacestub_end = .;
|
||||
+ HIDDEN(__replacestub_end = .);
|
||||
}
|
||||
- __replacestub_len = ABSOLUTE(__replacestub_end) - ABSOLUTE(__replacestub_start);
|
||||
- __replacestub_dwords = (__replacestub_len + 3) >> 2;
|
||||
+ HIDDEN(__replacestub_len = ABSOLUTE(__replacestub_end) - ABSOLUTE(__replacestub_start));
|
||||
+ HIDDEN(__replacestub_dwords = (__replacestub_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(16);
|
||||
- __gentextnr_lma = .;
|
||||
+ HIDDEN(__gentextnr_lma = .);
|
||||
.gentextnr : AT(__gentextnr_lma) {
|
||||
- __gentextnr_start = .;
|
||||
+ HIDDEN(__gentextnr_start = .);
|
||||
*(.gentextnr)
|
||||
- __gentextnr_end = .;
|
||||
+ HIDDEN(__gentextnr_end = .);
|
||||
}
|
||||
- __gentextnr_len = ABSOLUTE(__gentextnr_end) - ABSOLUTE(__gentextnr_start);
|
||||
- __gentextnr_dwords = (__gentextnr_len + 3) >> 2;
|
||||
+ HIDDEN(__gentextnr_len = ABSOLUTE(__gentextnr_end) - ABSOLUTE(__gentextnr_start));
|
||||
+ HIDDEN(__gentextnr_dwords = (__gentextnr_len + 3) >> 2);
|
||||
|
||||
. = STACK_BASE;
|
||||
.stack16 : AT(STACK_BASE) {
|
||||
- __stack16_start = .;
|
||||
+ HIDDEN(__stack16_start = .);
|
||||
. += STACK_LEN;
|
||||
- __stack16_end = .;
|
||||
+ HIDDEN(__stack16_end = .);
|
||||
}
|
||||
- __stack16_len = ABSOLUTE(__stack16_end) - ABSOLUTE(__stack16_start);
|
||||
- __stack16_dwords = (__stack16_len + 3) >> 2;
|
||||
+ HIDDEN(__stack16_len = ABSOLUTE(__stack16_end) - ABSOLUTE(__stack16_start));
|
||||
+ HIDDEN(__stack16_dwords = (__stack16_len + 3) >> 2);
|
||||
|
||||
/* Initialized sections */
|
||||
|
||||
. = 0x7c00;
|
||||
.init : {
|
||||
FILL(0x90909090)
|
||||
- __init_start = .;
|
||||
+ HIDDEN(__init_start = .);
|
||||
*(.init)
|
||||
- __init_end = .;
|
||||
+ HIDDEN(__init_end = .);
|
||||
}
|
||||
- __init_len = ABSOLUTE(__init_end) - ABSOLUTE(__init_start);
|
||||
- __init_dwords = (__init_len + 3) >> 2;
|
||||
+ HIDDEN(__init_len = ABSOLUTE(__init_end) - ABSOLUTE(__init_start));
|
||||
+ HIDDEN(__init_dwords = (__init_len + 3) >> 2);
|
||||
|
||||
+ . = ALIGN(4);
|
||||
.text16 : {
|
||||
FILL(0x90909090)
|
||||
- __text16_start = .;
|
||||
+ HIDDEN(__text16_start = .);
|
||||
*(.text16)
|
||||
- __text16_end = .;
|
||||
+ HIDDEN(__text16_end = .);
|
||||
}
|
||||
- __text16_len = ABSOLUTE(__text16_end) - ABSOLUTE(__text16_start);
|
||||
- __text16_dwords = (__text16_len + 3) >> 2;
|
||||
+ HIDDEN(__text16_len = ABSOLUTE(__text16_end) - ABSOLUTE(__text16_start));
|
||||
+ HIDDEN(__text16_dwords = (__text16_len + 3) >> 2);
|
||||
|
||||
/*
|
||||
* .textnr is used for 32-bit code that is used on the code
|
||||
@@ -118,99 +119,92 @@ SECTIONS
|
||||
. = ALIGN(16);
|
||||
.textnr : {
|
||||
FILL(0x90909090)
|
||||
- __textnr_start = .;
|
||||
+ HIDDEN(__textnr_start = .);
|
||||
*(.textnr)
|
||||
- __textnr_end = .;
|
||||
+ HIDDEN(__textnr_end = .);
|
||||
}
|
||||
- __textnr_len = ABSOLUTE(__textnr_end) - ABSOLUTE(__textnr_start);
|
||||
- __textnr_dwords = (__textnr_len + 3) >> 2;
|
||||
+ HIDDEN(__textnr_len = ABSOLUTE(__textnr_end) - ABSOLUTE(__textnr_start));
|
||||
+ HIDDEN(__textnr_dwords = (__textnr_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(16);
|
||||
- __bcopyxx_start = .;
|
||||
+ HIDDEN(__bcopyxx_start = .);
|
||||
|
||||
.bcopyxx.text : {
|
||||
FILL(0x90909090)
|
||||
- __bcopyxx_text_start = .;
|
||||
+ HIDDEN(__bcopyxx_text_start = .);
|
||||
*(.bcopyxx.text)
|
||||
- __bcopyxx_text_end = .;
|
||||
+ HIDDEN(__bcopyxx_text_end = .);
|
||||
}
|
||||
- __bcopyxx_text_len = ABSOLUTE(__bcopyxx_text_end) - ABSOLUTE(__bcopyxx_text_start);
|
||||
- __bcopyxx_text_dwords = (__bcopyxx_text_len + 3) >> 2;
|
||||
+ HIDDEN(__bcopyxx_text_len = ABSOLUTE(__bcopyxx_text_end) - ABSOLUTE(__bcopyxx_text_start));
|
||||
+ HIDDEN(__bcopyxx_text_dwords = (__bcopyxx_text_len + 3) >> 2);
|
||||
|
||||
.bcopyxx.data : {
|
||||
- __bcopyxx_data_start = .;
|
||||
+ HIDDEN(__bcopyxx_data_start = .);
|
||||
*(.bcopyxx.text)
|
||||
- __bcopyxx_data_end = .;
|
||||
+ HIDDEN(__bcopyxx_data_end = .);
|
||||
}
|
||||
- __bcopyxx_data_len = ABSOLUTE(__bcopyxx_data_end) - ABSOLUTE(__bcopyxx_data_start);
|
||||
- __bcopyxx_data_dwords = (__bcopyxx_data_len + 3) >> 2;
|
||||
+ HIDDEN(__bcopyxx_data_len = ABSOLUTE(__bcopyxx_data_end) - ABSOLUTE(__bcopyxx_data_start));
|
||||
+ HIDDEN(__bcopyxx_data_dwords = (__bcopyxx_data_len + 3) >> 2);
|
||||
|
||||
- __bcopyxx_end = .;
|
||||
- __bcopyxx_len = ABSOLUTE(__bcopyxx_end) - ABSOLUTE(__bcopyxx_start);
|
||||
- __bcopyxx_dwords = (__bcopyxx_len + 3) >> 2;
|
||||
+ HIDDEN(__bcopyxx_end = .);
|
||||
+ HIDDEN(__bcopyxx_len = ABSOLUTE(__bcopyxx_end) - ABSOLUTE(__bcopyxx_start));
|
||||
+ HIDDEN(__bcopyxx_dwords = (__bcopyxx_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(4);
|
||||
.data16 : {
|
||||
- __data16_start = .;
|
||||
+ HIDDEN(__data16_start = .);
|
||||
*(.data16)
|
||||
- __data16_end = .;
|
||||
+ HIDDEN(__data16_end = .);
|
||||
}
|
||||
- __data16_len = ABSOLUTE(__data16_end) - ABSOLUTE(__data16_start);
|
||||
- __data16_dwords = (__data16_len + 3) >> 2;
|
||||
+ HIDDEN(__data16_len = ABSOLUTE(__data16_end) - ABSOLUTE(__data16_start));
|
||||
+ HIDDEN(__data16_dwords = (__data16_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(4);
|
||||
- __config_lma = .;
|
||||
+ HIDDEN(__config_lma = ABSOLUTE(.));
|
||||
. += SIZEOF(.config);
|
||||
|
||||
. = ALIGN(4);
|
||||
- __replacestub_lma = .;
|
||||
+ HIDDEN(__replacestub_lma = ABSOLUTE(.));
|
||||
. += SIZEOF(.replacestub);
|
||||
|
||||
/* The 32-bit code loads above the non-progbits sections */
|
||||
|
||||
. = ALIGN(16);
|
||||
- __pm_code_lma = .;
|
||||
+ HIDDEN(__pm_code_lma = ABSOLUTE(.));
|
||||
|
||||
- __high_clear_start = .;
|
||||
+ HIDDEN(__high_clear_start = .);
|
||||
|
||||
. = ALIGN(512);
|
||||
.adv (NOLOAD) : {
|
||||
- __adv_start = .;
|
||||
+ HIDDEN(__adv_start = .);
|
||||
*(.adv)
|
||||
- __adv_end = .;
|
||||
+ HIDDEN(__adv_end = .);
|
||||
}
|
||||
- __adv_len = ABSOLUTE(__adv_end) - ABSOLUTE(__adv_start);
|
||||
- __adv_dwords = (__adv_len + 3) >> 2;
|
||||
+ HIDDEN(__adv_len = ABSOLUTE(__adv_end) - ABSOLUTE(__adv_start));
|
||||
+ HIDDEN(__adv_dwords = (__adv_len + 3) >> 2);
|
||||
|
||||
/* Late uninitialized sections */
|
||||
|
||||
. = ALIGN(4);
|
||||
.uibss (NOLOAD) : {
|
||||
- __uibss_start = .;
|
||||
+ HIDDEN(__uibss_start = .);
|
||||
*(.uibss)
|
||||
- __uibss_end = .;
|
||||
+ HIDDEN(__uibss_end = .);
|
||||
}
|
||||
- __uibss_len = ABSOLUTE(__uibss_end) - ABSOLUTE(__uibss_start);
|
||||
- __uibss_dwords = (__uibss_len + 3) >> 2;
|
||||
+ HIDDEN(__uibss_len = ABSOLUTE(__uibss_end) - ABSOLUTE(__uibss_start));
|
||||
+ HIDDEN(__uibss_dwords = (__uibss_len + 3) >> 2);
|
||||
|
||||
- _end16 = .;
|
||||
- __assert_end16 = ASSERT(_end16 <= 0x10000, "64K overflow");
|
||||
+ HIDDEN(_end16 = .);
|
||||
+ HIDDEN(__assert_end16 = ASSERT(_end16 <= 0x10000, "64K overflow"));
|
||||
|
||||
/*
|
||||
* Special 16-bit segments
|
||||
*/
|
||||
-
|
||||
- . = ALIGN(65536);
|
||||
- .real_mode (NOLOAD) : {
|
||||
- *(.real_mode)
|
||||
- }
|
||||
- real_mode_seg = core_real_mode >> 4;
|
||||
-
|
||||
. = ALIGN(65536);
|
||||
.xfer_buf (NOLOAD) : {
|
||||
*(.xfer_buf)
|
||||
}
|
||||
- xfer_buf_seg = core_xfer_buf >> 4;
|
||||
+ HIDDEN(xfer_buf_seg = core_xfer_buf >> 4);
|
||||
|
||||
/*
|
||||
* The auxilliary data segment is used by the 16-bit code
|
||||
@@ -219,33 +213,33 @@ SECTIONS
|
||||
|
||||
. = ALIGN(16);
|
||||
.auxseg (NOLOAD) : {
|
||||
- __auxseg_start = .;
|
||||
+ HIDDEN(__auxseg_start = .);
|
||||
*(.auxseg)
|
||||
- __auxseg_end = .;
|
||||
+ HIDDEN(__auxseg_end = .);
|
||||
}
|
||||
- __auxseg_len = ABSOLUTE(__auxseg_end) - ABSOLUTE(__auxseg_start);
|
||||
- __auxseg_dwords = (__auxseg_len + 3) >> 2;
|
||||
- aux_seg = __auxseg_start >> 4;
|
||||
+ HIDDEN(__auxseg_len = ABSOLUTE(__auxseg_end) - ABSOLUTE(__auxseg_start));
|
||||
+ HIDDEN(__auxseg_dwords = (__auxseg_len + 3) >> 2);
|
||||
+ HIDDEN(aux_seg = __auxseg_start >> 4);
|
||||
|
||||
/*
|
||||
* Used to allocate lowmem buffers from 32-bit code
|
||||
*/
|
||||
.lowmem (NOLOAD) : {
|
||||
- __lowmem_start = .;
|
||||
+ HIDDEN(__lowmem_start = .);
|
||||
*(.lowmem)
|
||||
- __lowmem_end = .;
|
||||
+ HIDDEN(__lowmem_end = .);
|
||||
}
|
||||
- __lowmem_len = ABSOLUTE(__lowmem_end) - ABSOLUTE(__lowmem_start);
|
||||
- __lowmem_dwords = (__lowmem_len + 3) >> 2;
|
||||
+ HIDDEN(__lowmem_len = ABSOLUTE(__lowmem_end) - ABSOLUTE(__lowmem_start));
|
||||
+ HIDDEN(__lowmem_dwords = (__lowmem_len + 3) >> 2);
|
||||
|
||||
- __high_clear_end = .;
|
||||
+ HIDDEN(__high_clear_end = .);
|
||||
|
||||
- __high_clear_len = ABSOLUTE(__high_clear_end) - ABSOLUTE(__high_clear_start);
|
||||
- __high_clear_dwords = (__high_clear_len + 3) >> 2;
|
||||
+ HIDDEN(__high_clear_len = ABSOLUTE(__high_clear_end) - ABSOLUTE(__high_clear_start));
|
||||
+ HIDDEN(__high_clear_dwords = (__high_clear_len + 3) >> 2);
|
||||
|
||||
/* Start of the lowmem heap */
|
||||
. = ALIGN(16);
|
||||
- __lowmem_heap = .;
|
||||
+ HIDDEN(__lowmem_heap = .);
|
||||
|
||||
/*
|
||||
* 32-bit code. This is a hack for the moment due to the
|
||||
@@ -254,136 +248,137 @@ SECTIONS
|
||||
|
||||
. = 0x100000;
|
||||
|
||||
- __pm_code_start = .;
|
||||
- __vma_to_lma = __pm_code_lma - __pm_code_start;
|
||||
+ HIDDEN(__pm_code_start = .);
|
||||
+ HIDDEN(__vma_to_lma = ABSOLUTE(__pm_code_lma - __pm_code_start));
|
||||
|
||||
.text : AT(ADDR(.text) + __vma_to_lma) {
|
||||
FILL(0x90909090)
|
||||
- __text_start = .;
|
||||
+ HIDDEN(__text_start = .);
|
||||
*(.text)
|
||||
*(.text.*)
|
||||
- __text_end = .;
|
||||
+ HIDDEN(__text_end = .);
|
||||
}
|
||||
|
||||
.rodata : AT(ADDR(.rodata) + __vma_to_lma) {
|
||||
- __rodata_start = .;
|
||||
+ HIDDEN(__rodata_start = .);
|
||||
*(.rodata)
|
||||
*(.rodata.*)
|
||||
- __rodata_end = .;
|
||||
+ HIDDEN(__rodata_end = .);
|
||||
}
|
||||
|
||||
.ctors : AT(ADDR(.ctors) + __vma_to_lma) {
|
||||
- __ctors_start = .;
|
||||
+ HIDDEN(__ctors_start = .);
|
||||
KEEP (*(SORT(.ctors.*)))
|
||||
KEEP (*(.ctors))
|
||||
- __ctors_end = .;
|
||||
+ HIDDEN(__ctors_end = .);
|
||||
}
|
||||
|
||||
.dtors : AT(ADDR(.dtors) + __vma_to_lma) {
|
||||
- __dtors_start = .;
|
||||
+ HIDDEN(__dtors_start = .);
|
||||
KEEP (*(SORT(.dtors.*)))
|
||||
KEEP (*(.dtors))
|
||||
- __dtors_end = .;
|
||||
+ HIDDEN(__dtors_end = .);
|
||||
}
|
||||
|
||||
.dynsym : AT(ADDR(.dynsym) + __vma_to_lma) {
|
||||
- __dynsym_start = .;
|
||||
- *(.dynsym)
|
||||
- __dynsym_end = .;
|
||||
+ HIDDEN(__dynsym_start = .);
|
||||
+ KEEP (*(.dynsym))
|
||||
+ HIDDEN(__dynsym_end = .);
|
||||
}
|
||||
- __dynsym_len = __dynsym_end - __dynsym_start;
|
||||
+ HIDDEN(__dynsym_len = __dynsym_end - __dynsym_start);
|
||||
|
||||
.dynstr : AT(ADDR(.dynstr) + __vma_to_lma) {
|
||||
- __dynstr_start = .;
|
||||
- *(.dynstr)
|
||||
- __dynstr_end = .;
|
||||
+ HIDDEN(__dynstr_start = .);
|
||||
+ KEEP (*(.dynstr))
|
||||
+ HIDDEN(__dynstr_end = .);
|
||||
}
|
||||
- __dynstr_len = __dynstr_end - __dynstr_start;
|
||||
+ HIDDEN(__dynstr_len = __dynstr_end - __dynstr_start);
|
||||
|
||||
.gnu.hash : AT(ADDR(.gnu.hash) + __vma_to_lma) {
|
||||
- __gnu_hash_start = .;
|
||||
- *(.gnu.hash)
|
||||
- __gnu_hash_end = .;
|
||||
+ HIDDEN(__gnu_hash_start = .);
|
||||
+ KEEP (*(.gnu.hash))
|
||||
+ HIDDEN(__gnu_hash_end = .);
|
||||
}
|
||||
|
||||
|
||||
.dynlink : AT(ADDR(.dynlink) + __vma_to_lma) {
|
||||
- __dynlink_start = .;
|
||||
- *(.dynlink)
|
||||
- __dynlink_end = .;
|
||||
+ HIDDEN(__dynlink_start = .);
|
||||
+ KEEP (*(.dynlink))
|
||||
+ HIDDEN(__dynlink_end = .);
|
||||
}
|
||||
|
||||
.got : AT(ADDR(.got) + __vma_to_lma) {
|
||||
- __got_start = .;
|
||||
- KEEP (*(.got.plt))
|
||||
+ HIDDEN(__got_start = .);
|
||||
KEEP (*(.got))
|
||||
- __got_end = .;
|
||||
+ KEEP (*(.got.plt))
|
||||
+ HIDDEN(__got_end = .);
|
||||
}
|
||||
|
||||
.dynamic : AT(ADDR(.dynamic) + __vma_to_lma) {
|
||||
- __dynamic_start = .;
|
||||
- *(.dynamic)
|
||||
- __dynamic_end = .;
|
||||
+ HIDDEN(__dynamic_start = .);
|
||||
+ KEEP (*(.dynamic))
|
||||
+ HIDDEN(__dynamic_end = .);
|
||||
}
|
||||
|
||||
.data : AT(ADDR(.data) + __vma_to_lma) {
|
||||
- __data_start = .;
|
||||
+ HIDDEN(__data_start = .);
|
||||
*(.data)
|
||||
*(.data.*)
|
||||
- __data_end = .;
|
||||
+ HIDDEN(__data_end = .);
|
||||
}
|
||||
|
||||
- __pm_code_end = .;
|
||||
- __pm_code_len = ABSOLUTE(__pm_code_end) - ABSOLUTE(__pm_code_start);
|
||||
- __pm_code_dwords = (__pm_code_len + 3) >> 2;
|
||||
+ HIDDEN(__pm_code_end = .);
|
||||
+ HIDDEN(__pm_code_len = ABSOLUTE(__pm_code_end) - ABSOLUTE(__pm_code_start));
|
||||
+ HIDDEN(__pm_code_dwords = (__pm_code_len + 3) >> 2);
|
||||
|
||||
. = ALIGN(128);
|
||||
|
||||
- __bss_vma = .;
|
||||
- __bss_lma = .; /* Dummy */
|
||||
+ HIDDEN(__bss_vma = .);
|
||||
+ HIDDEN(__bss_lma = ABSOLUTE(.)); /* Dummy */
|
||||
.bss (NOLOAD) : AT (__bss_lma) {
|
||||
- __bss_start = .;
|
||||
+ HIDDEN(__bss_start = .);
|
||||
*(.bss)
|
||||
*(.bss.*)
|
||||
*(COMMON)
|
||||
- __bss_end = .;
|
||||
+ HIDDEN(__bss_end = .);
|
||||
}
|
||||
- __bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start);
|
||||
- __bss_dwords = (__bss_len + 3) >> 2;
|
||||
+ HIDDEN(__bss_len = ABSOLUTE(__bss_end) - ABSOLUTE(__bss_start));
|
||||
+ HIDDEN(__bss_dwords = (__bss_len + 3) >> 2);
|
||||
|
||||
/* Very large objects which don't need to be zeroed */
|
||||
|
||||
- __hugebss_vma = .;
|
||||
- __hugebss_lma = .; /* Dummy */
|
||||
+ HIDDEN(__hugebss_vma = .);
|
||||
+ HIDDEN(__hugebss_lma = ABSOLUTE(.)); /* Dummy */
|
||||
.hugebss (NOLOAD) : AT (__hugebss_lma) {
|
||||
- __hugebss_start = .;
|
||||
+ HIDDEN(__hugebss_start = .);
|
||||
*(.hugebss)
|
||||
*(.hugebss.*)
|
||||
- __hugebss_end = .;
|
||||
+ HIDDEN(__hugebss_end = .);
|
||||
}
|
||||
- __hugebss_len = ABSOLUTE(__hugebss_end) - ABSOLUTE(__hugebss_start);
|
||||
- __hugebss_dwords = (__hugebss_len + 3) >> 2;
|
||||
+ HIDDEN(__hugebss_len = ABSOLUTE(__hugebss_end) - ABSOLUTE(__hugebss_start));
|
||||
+ HIDDEN(__hugebss_dwords = (__hugebss_len + 3) >> 2);
|
||||
|
||||
|
||||
/* XXX: This stack should be unified with the COM32 stack */
|
||||
- __stack_vma = .;
|
||||
- __stack_lma = .; /* Dummy */
|
||||
+ HIDDEN(__stack_vma = .);
|
||||
+ HIDDEN(__stack_lma = ABSOLUTE(.)); /* Dummy */
|
||||
.stack (NOLOAD) : AT(__stack_lma) {
|
||||
- __stack_start = .;
|
||||
+ HIDDEN(__stack_start = .);
|
||||
*(.stack)
|
||||
- __stack_end = .;
|
||||
+ HIDDEN(__stack_end = .);
|
||||
}
|
||||
- __stack_len = ABSOLUTE(__stack_end) - ABSOLUTE(__stack_start);
|
||||
- __stack_dwords = (__stack_len + 3) >> 2;
|
||||
+ HIDDEN(__stack_len = ABSOLUTE(__stack_end) - ABSOLUTE(__stack_start));
|
||||
+ HIDDEN(__stack_dwords = (__stack_len + 3) >> 2);
|
||||
|
||||
- _end = .;
|
||||
+ HIDDEN(_end = .);
|
||||
|
||||
/* COM32R and kernels are loaded after our own PM code */
|
||||
. = ALIGN(65536);
|
||||
- free_high_memory = .;
|
||||
+ HIDDEN(free_high_memory = .);
|
||||
|
||||
/* Stuff we don't need... */
|
||||
/DISCARD/ : {
|
||||
*(.eh_frame)
|
||||
+ *(.interp)
|
||||
}
|
||||
}
|
||||
diff --git a/core/layout.inc b/core/layout.inc
|
||||
index 53ca783d..635df537 100644
|
||||
--- a/core/layout.inc
|
||||
+++ b/core/layout.inc
|
||||
@@ -139,17 +139,6 @@ serial_buf_size equ 4096 ; Should be a power of 2
|
||||
core_xfer_buf resb 65536
|
||||
|
||||
;
|
||||
-; Segment for the real mode code (needed as long as we have a in-kernel
|
||||
-; loader and/or COM16 support.
|
||||
-; One symbol for the segment number, one for the absolute address
|
||||
-;
|
||||
- extern real_mode_seg
|
||||
- section .real_mode write nobits align=65536
|
||||
- global core_real_mode:data hidden
|
||||
-core_real_mode resb 65536
|
||||
-comboot_seg equ real_mode_seg ; COMBOOT image loading zone
|
||||
-
|
||||
-;
|
||||
; At the very end, the lowmem heap
|
||||
;
|
||||
extern __lowmem_heap
|
||||
--
|
||||
2.13.3
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
From 4df2e7c0ae84bfbdba0ed285c0664aa089b38b7e Mon Sep 17 00:00:00 2001
|
||||
From: Carlos Santos <casantos@datacom.ind.br>
|
||||
Date: Sat, 30 Sep 2017 19:49:55 -0300
|
||||
Subject: [PATCH] extlinux: Use the host toolchain to build.
|
||||
|
||||
It is meant to run on the host machine, hence must be built using the
|
||||
host toolchain.
|
||||
|
||||
Signed-off-by: Carlos Santos <casantos@datacom.ind.br>
|
||||
---
|
||||
extlinux/Makefile | 12 ++++++------
|
||||
1 file changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/extlinux/Makefile b/extlinux/Makefile
|
||||
index 02d1db51..5c4baa5a 100644
|
||||
--- a/extlinux/Makefile
|
||||
+++ b/extlinux/Makefile
|
||||
@@ -18,9 +18,9 @@ include $(MAKEDIR)/syslinux.mk
|
||||
|
||||
OPTFLAGS = -g -Os
|
||||
INCLUDES = -I$(SRC) -I$(objdir) -I$(SRC)/../libinstaller
|
||||
-CFLAGS = $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
|
||||
+CFLAGS = $(CFLAGS_FOR_BUILD) $(GCCWARN) -Wno-sign-compare -D_FILE_OFFSET_BITS=64 \
|
||||
$(OPTFLAGS) $(INCLUDES)
|
||||
-LDFLAGS =
|
||||
+LDFLAGS = $(LDFLAGS_FOR_BUILD)
|
||||
|
||||
SRCS = main.c \
|
||||
mountinfo.c \
|
||||
@@ -52,16 +52,16 @@ spotless: clean
|
||||
installer: extlinux
|
||||
|
||||
extlinux: $(OBJS)
|
||||
- $(CC) $(LDFLAGS) -o $@ $^
|
||||
+ $(CC_FOR_BUILD) $(LDFLAGS) -o $@ $^
|
||||
|
||||
strip:
|
||||
$(STRIP) extlinux
|
||||
|
||||
%.o: %.c
|
||||
- $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
||||
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
|
||||
%.i: %.c
|
||||
- $(CC) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
|
||||
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -E -o $@ $<
|
||||
%.s: %.c
|
||||
- $(CC) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
|
||||
+ $(CC_FOR_BUILD) $(UMAKEDEPS) $(CFLAGS) -S -o $@ $<
|
||||
|
||||
-include .*.d
|
||||
--
|
||||
2.13.5
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user