initial buildroot for linux 5.15

This commit is contained in:
Huan.Feng
2021-12-06 14:12:13 +08:00
parent d7767d594e
commit 7b6fc358fa
12736 changed files with 508822 additions and 0 deletions
@@ -0,0 +1,37 @@
From f5871e1f3650d6c8a032928cb5d8ca00c275c377 Mon Sep 17 00:00:00 2001
From: Alistair Francis <alistair.francis@wdc.com>
Date: Fri, 15 Feb 2019 14:57:41 -0800
Subject: [PATCH] Makefile: Don't specify mabi or march
To avoid
can't link double-float modules with soft-float modules
errors when building 32-bit openSBI don't specify mabi or march.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
---
Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/Makefile b/Makefile
index ae68f55..10851fc 100644
--- a/Makefile
+++ b/Makefile
@@ -145,7 +145,6 @@ GENFLAGS += $(firmware-genflags-y)
CFLAGS = -g -Wall -Werror -nostdlib -fno-strict-aliasing -O2
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
CFLAGS += -mno-save-restore -mstrict-align
-CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
CFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL)
CFLAGS += $(GENFLAGS)
CFLAGS += $(platform-cflags-y)
@@ -158,7 +157,6 @@ CPPFLAGS += $(firmware-cppflags-y)
ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__
ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
ASFLAGS += -mno-save-restore -mstrict-align
-ASFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
ASFLAGS += -mcmodel=$(PLATFORM_RISCV_CODE_MODEL)
ASFLAGS += $(GENFLAGS)
ASFLAGS += $(platform-asflags-y)
--
2.20.1
@@ -0,0 +1,53 @@
From e389d5fbc296e496db15368b2b621e0f178f7f34 Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Sat, 8 May 2021 21:28:10 +0200
Subject: [PATCH] Makefile: unconditionally disable SSP
Though -nostdlib is passed in {C,+AS,DTSCPP}FLAGS, -fno-stack-protector
must also be passed to avoid linking errors related to undefined
references to '__stack_chk_guard' and '__stack_chk_fail' if toolchain
enforces -fstack-protector.
Fixes:
- https://gitlab.com/kubu93/buildroot/-/jobs/1247043359
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/riscv/opensbi/pull/211]
---
Makefile | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index eeffe6b..1419360 100644
--- a/Makefile
+++ b/Makefile
@@ -203,7 +203,7 @@ GENFLAGS += $(libsbiutils-genflags-y)
GENFLAGS += $(platform-genflags-y)
GENFLAGS += $(firmware-genflags-y)
-CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-strict-aliasing -O2
+CFLAGS = -g -Wall -Werror -ffreestanding -nostdlib -fno-stack-protector -fno-strict-aliasing -O2
CFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
CFLAGS += -mno-save-restore -mstrict-align
CFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
@@ -217,7 +217,7 @@ CPPFLAGS += $(GENFLAGS)
CPPFLAGS += $(platform-cppflags-y)
CPPFLAGS += $(firmware-cppflags-y)
-ASFLAGS = -g -Wall -nostdlib -D__ASSEMBLY__
+ASFLAGS = -g -Wall -nostdlib -fno-stack-protector -D__ASSEMBLY__
ASFLAGS += -fno-omit-frame-pointer -fno-optimize-sibling-calls
ASFLAGS += -mno-save-restore -mstrict-align
ASFLAGS += -mabi=$(PLATFORM_RISCV_ABI) -march=$(PLATFORM_RISCV_ISA)
@@ -236,7 +236,7 @@ MERGEFLAGS += -r
MERGEFLAGS += -b elf$(PLATFORM_RISCV_XLEN)-littleriscv
MERGEFLAGS += -m elf$(PLATFORM_RISCV_XLEN)lriscv
-DTSCPPFLAGS = $(CPPFLAGS) -nostdinc -nostdlib -fno-builtin -D__DTS__ -x assembler-with-cpp
+DTSCPPFLAGS = $(CPPFLAGS) -nostdinc -nostdlib -fno-stack-protector -fno-builtin -D__DTS__ -x assembler-with-cpp
# Setup functions for compilation
define dynamic_flags
--
2.30.2
+122
View File
@@ -0,0 +1,122 @@
config 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/opensbi.git
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 "0.9"
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 "0.9" 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_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.
endif
+3
View File
@@ -0,0 +1,3 @@
# locally computed
sha256 60f995cb3cd03e3cf5e649194d3395d0fe67499fd960a36cf7058a4efde686f0 opensbi-0.9.tar.gz
sha256 82d13fb1bf6bb162629deeea9eb9c117e74548d3b707e478967691fe79a68e21 COPYING.BSD
+89
View File
@@ -0,0 +1,89 @@
################################################################################
#
# opensbi
#
################################################################################
OPENSBI_VERSION = $(call qstrip,$(BR2_TARGET_OPENSBI_VERSION))
ifeq ($(OPENSBI_VERSION),custom)
# 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,opensbi,v$(OPENSBI_VERSION))
endif
OPENSBI_LICENSE = BSD-2-Clause
ifeq ($(BR2_TARGET_OPENSBI_LATEST_VERSION),y)
OPENSBI_LICENSE_FILES = COPYING.BSD
endif
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)
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
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
# 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))