uboot-tools: Update to 2020.07.
Signed-off-by: chengguipeng <chengguipeng1@huawei.com>
This commit is contained in:
parent
13b4c937be
commit
6a3ff631f4
@ -1,194 +0,0 @@
|
|||||||
From patchwork Thu Aug 30 21:43:43 2018
|
|
||||||
Content-Type: text/plain; charset="utf-8"
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Transfer-Encoding: 7bit
|
|
||||||
Subject: [U-Boot,V3,1/3] efi_loader: simplify ifdefs
|
|
||||||
X-Patchwork-Submitter: Stephen Warren <swarren@wwwdotorg.org>
|
|
||||||
X-Patchwork-Id: 964248
|
|
||||||
X-Patchwork-Delegate: agraf@suse.de
|
|
||||||
Message-Id: <20180830214345.2475-1-swarren@wwwdotorg.org>
|
|
||||||
To: Tom Rini <trini@konsulko.com>
|
|
||||||
Cc: Stephen Warren <swarren@nvidia.com>, xypron.glpk@gmx.de, agraf@suse.de,
|
|
||||||
u-boot@lists.denx.de, Tom Warren <twarren@nvidia.com>
|
|
||||||
Date: Thu, 30 Aug 2018 15:43:43 -0600
|
|
||||||
From: Stephen Warren <swarren@wwwdotorg.org>
|
|
||||||
List-Id: U-Boot discussion <u-boot.lists.denx.de>
|
|
||||||
|
|
||||||
From: Stephen Warren <swarren@nvidia.com>
|
|
||||||
|
|
||||||
Use CONFIG_IS_ENABLED(EFI_LOADER) to avoid explicitly checking CONFIG_SPL
|
|
||||||
too. This simplifies the conditional.
|
|
||||||
|
|
||||||
Signed-off-by: Stephen Warren <swarren@nvidia.com>
|
|
||||||
---
|
|
||||||
v3: New patch.
|
|
||||||
---
|
|
||||||
arch/arm/cpu/armv8/fsl-layerscape/cpu.c | 2 +-
|
|
||||||
arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 2 +-
|
|
||||||
arch/x86/lib/e820.c | 4 ++--
|
|
||||||
include/efi_loader.h | 6 +++---
|
|
||||||
4 files changed, 7 insertions(+), 7 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
|
|
||||||
index 052e0708d454..be00bd55ab68 100644
|
|
||||||
--- a/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
|
|
||||||
+++ b/arch/arm/cpu/armv8/fsl-layerscape/cpu.c
|
|
||||||
@@ -835,7 +835,7 @@ int dram_init_banksize(void)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
|
|
||||||
+#if CONFIG_IS_ENABLED(EFI_LOADER)
|
|
||||||
void efi_add_known_memory(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
diff --git a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
|
|
||||||
index fc9de73bcef4..c9c2c3f6d3e8 100644
|
|
||||||
--- a/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
|
|
||||||
+++ b/arch/arm/cpu/armv8/fsl-layerscape/fdt.c
|
|
||||||
@@ -135,7 +135,7 @@ remove_psci_node:
|
|
||||||
|
|
||||||
fdt_add_mem_rsv(blob, (uintptr_t)&secondary_boot_code,
|
|
||||||
*boot_code_size);
|
|
||||||
-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
|
|
||||||
+#if CONFIG_IS_ENABLED(EFI_LOADER)
|
|
||||||
efi_add_memory_map((uintptr_t)&secondary_boot_code,
|
|
||||||
ALIGN(*boot_code_size, EFI_PAGE_SIZE) >> EFI_PAGE_SHIFT,
|
|
||||||
EFI_RESERVED_MEMORY_TYPE, false);
|
|
||||||
diff --git a/arch/x86/lib/e820.c b/arch/x86/lib/e820.c
|
|
||||||
index 8b34f677d96d..d6ae2c4e9d77 100644
|
|
||||||
--- a/arch/x86/lib/e820.c
|
|
||||||
+++ b/arch/x86/lib/e820.c
|
|
||||||
@@ -36,7 +36,7 @@ __weak unsigned int install_e820_map(unsigned int max_entries,
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
|
|
||||||
-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
|
|
||||||
+#if CONFIG_IS_ENABLED(EFI_LOADER)
|
|
||||||
void efi_add_known_memory(void)
|
|
||||||
{
|
|
||||||
struct e820_entry e820[E820MAX];
|
|
||||||
@@ -72,4 +72,4 @@ void efi_add_known_memory(void)
|
|
||||||
efi_add_memory_map(start, pages, type, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-#endif /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */
|
|
||||||
+#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */
|
|
||||||
diff --git a/include/efi_loader.h b/include/efi_loader.h
|
|
||||||
index f162adfff7e2..b46babf9316f 100644
|
|
||||||
--- a/include/efi_loader.h
|
|
||||||
+++ b/include/efi_loader.h
|
|
||||||
@@ -13,7 +13,7 @@
|
|
||||||
#include <efi_api.h>
|
|
||||||
|
|
||||||
/* No need for efi loader support in SPL */
|
|
||||||
-#if defined(CONFIG_EFI_LOADER) && !defined(CONFIG_SPL_BUILD)
|
|
||||||
+#if CONFIG_IS_ENABLED(EFI_LOADER)
|
|
||||||
|
|
||||||
#include <linux/list.h>
|
|
||||||
|
|
||||||
@@ -460,7 +460,7 @@ efi_status_t EFIAPI efi_set_variable(u16 *variable_name, efi_guid_t *vendor,
|
|
||||||
void *efi_bootmgr_load(struct efi_device_path **device_path,
|
|
||||||
struct efi_device_path **file_path);
|
|
||||||
|
|
||||||
-#else /* defined(EFI_LOADER) && !defined(CONFIG_SPL_BUILD) */
|
|
||||||
+#else /* CONFIG_IS_ENABLED(EFI_LOADER) */
|
|
||||||
|
|
||||||
/* Without CONFIG_EFI_LOADER we don't have a runtime section, stub it out */
|
|
||||||
#define __efi_runtime_data
|
|
||||||
@@ -477,6 +477,6 @@ static inline void efi_set_bootdev(const char *dev, const char *devnr,
|
|
||||||
static inline void efi_net_set_dhcp_ack(void *pkt, int len) { }
|
|
||||||
static inline void efi_print_image_infos(void *pc) { }
|
|
||||||
|
|
||||||
-#endif /* CONFIG_EFI_LOADER && !CONFIG_SPL_BUILD */
|
|
||||||
+#endif /* CONFIG_IS_ENABLED(EFI_LOADER) */
|
|
||||||
|
|
||||||
#endif /* _EFI_LOADER_H */
|
|
||||||
|
|
||||||
From patchwork Thu Aug 30 21:43:44 2018
|
|
||||||
Content-Type: text/plain; charset="utf-8"
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Transfer-Encoding: 7bit
|
|
||||||
Subject: [U-Boot, V3,
|
|
||||||
2/3] ARM: tegra: reserve unmapped RAM so EFI doesn't use it
|
|
||||||
X-Patchwork-Submitter: Stephen Warren <swarren@wwwdotorg.org>
|
|
||||||
X-Patchwork-Id: 964249
|
|
||||||
X-Patchwork-Delegate: agraf@suse.de
|
|
||||||
Message-Id: <20180830214345.2475-2-swarren@wwwdotorg.org>
|
|
||||||
To: Tom Rini <trini@konsulko.com>
|
|
||||||
Cc: Stephen Warren <swarren@nvidia.com>, xypron.glpk@gmx.de, agraf@suse.de,
|
|
||||||
u-boot@lists.denx.de, Tom Warren <twarren@nvidia.com>
|
|
||||||
Date: Thu, 30 Aug 2018 15:43:44 -0600
|
|
||||||
From: Stephen Warren <swarren@wwwdotorg.org>
|
|
||||||
List-Id: U-Boot discussion <u-boot.lists.denx.de>
|
|
||||||
|
|
||||||
From: Stephen Warren <swarren@nvidia.com>
|
|
||||||
|
|
||||||
Tegra U-Boot ensures that board_get_usable_ram_top() never returns a value
|
|
||||||
over 4GB, since some peripherals can't access such addresses. However, on
|
|
||||||
systems with more than 2GB of RAM, RAM bank 1 does describe this extra
|
|
||||||
RAM, so that Linux (or whatever OS) can use it, subject to DMA
|
|
||||||
limitations. Since board_get_usable_ram_top() points at the top of RAM
|
|
||||||
bank 0, the memory locations describes by RAM bank 1 are not mapped by
|
|
||||||
U-Boot's MMU configuration, and so cannot be used for anything.
|
|
||||||
|
|
||||||
For some completely inexplicable reason, U-Boot's EFI support ignores the
|
|
||||||
value returned by board_get_usable_ram_top(), and EFI memory allocation
|
|
||||||
routines will return values above U-Boot's RAM top. This causes U-Boot to
|
|
||||||
crash when it accesses that RAM, since it isn't mapped by the MMU. One
|
|
||||||
use-case where this happens is TFTP download of a file on Jetson TX1
|
|
||||||
(p2371-2180).
|
|
||||||
|
|
||||||
This change explicitly tells the EFI code that this extra RAM should not
|
|
||||||
be used, thus avoiding the crash.
|
|
||||||
|
|
||||||
A previous attempt to make EFI honor board_get_usable_ram_top() was
|
|
||||||
rejected. So, this patch will need to be replicated for any board that
|
|
||||||
implements board_get_usable_ram_top().
|
|
||||||
|
|
||||||
Fixes: aa909462d018 ("efi_loader: efi_allocate_pages is too restrictive")
|
|
||||||
Signed-off-by: Stephen Warren <swarren@nvidia.com>
|
|
||||||
---
|
|
||||||
v3:
|
|
||||||
- Use shift not divide for page count calculation.
|
|
||||||
- Enhance ifdef to avoid EFI references from SPL builds.
|
|
||||||
v2:
|
|
||||||
- Don't hard-code EFI page size.
|
|
||||||
- Register RAM as a boot services data rather than reserved.
|
|
||||||
---
|
|
||||||
arch/arm/mach-tegra/board2.c | 14 ++++++++++++++
|
|
||||||
1 file changed, 14 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/arch/arm/mach-tegra/board2.c b/arch/arm/mach-tegra/board2.c
|
|
||||||
index 421a71b3014d..12257a42b51b 100644
|
|
||||||
--- a/arch/arm/mach-tegra/board2.c
|
|
||||||
+++ b/arch/arm/mach-tegra/board2.c
|
|
||||||
@@ -6,6 +6,7 @@
|
|
||||||
|
|
||||||
#include <common.h>
|
|
||||||
#include <dm.h>
|
|
||||||
+#include <efi_loader.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <ns16550.h>
|
|
||||||
#include <usb.h>
|
|
||||||
@@ -210,6 +211,19 @@ int board_early_init_f(void)
|
|
||||||
|
|
||||||
int board_late_init(void)
|
|
||||||
{
|
|
||||||
+#if CONFIG_IS_ENABLED(EFI_LOADER)
|
|
||||||
+ if (gd->bd->bi_dram[1].start) {
|
|
||||||
+ /*
|
|
||||||
+ * Only bank 0 is below board_get_usable_ram_top(), so all of
|
|
||||||
+ * bank 1 is not mapped by the U-Boot MMU configuration, and so
|
|
||||||
+ * we must prevent EFI from using it.
|
|
||||||
+ */
|
|
||||||
+ efi_add_memory_map(gd->bd->bi_dram[1].start,
|
|
||||||
+ gd->bd->bi_dram[1].size >> EFI_PAGE_SHIFT,
|
|
||||||
+ EFI_BOOT_SERVICES_DATA, false);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
#if defined(CONFIG_TEGRA_SUPPORT_NON_SECURE)
|
|
||||||
if (tegra_cpu_is_non_secure()) {
|
|
||||||
printf("CPU is in NS mode\n");
|
|
||||||
|
|
||||||
@ -13,9 +13,6 @@ Source4: aarch64-chromebooks
|
|||||||
Source5: 10-devicetree.install
|
Source5: 10-devicetree.install
|
||||||
|
|
||||||
Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
|
Patch1: uefi-distro-load-FDT-from-any-partition-on-boot-device.patch
|
||||||
# Needed due to issues with shim
|
|
||||||
#Patch2: uefi-use-Fedora-specific-path-name.patch
|
|
||||||
|
|
||||||
# Board fixes and enablement
|
# Board fixes and enablement
|
||||||
Patch4: usb-kbd-fixes.patch
|
Patch4: usb-kbd-fixes.patch
|
||||||
Patch5: dragonboard-fixes.patch
|
Patch5: dragonboard-fixes.patch
|
||||||
@ -32,7 +29,6 @@ Patch16: USB-host-support-for-Raspberry-Pi-4-board-64-bit.patch
|
|||||||
Patch17: usb-xhci-Load-Raspberry-Pi-4-VL805-s-firmware.patch
|
Patch17: usb-xhci-Load-Raspberry-Pi-4-VL805-s-firmware.patch
|
||||||
Patch18: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
|
Patch18: rpi-Enable-using-the-DT-provided-by-the-Raspberry-Pi.patch
|
||||||
|
|
||||||
|
|
||||||
BuildRequires: bc dtc gcc make flex bison git-core openssl-devel gdb
|
BuildRequires: bc dtc gcc make flex bison git-core openssl-devel gdb
|
||||||
BuildRequires: python-unversioned-command python3-devel python3-setuptools
|
BuildRequires: python-unversioned-command python3-devel python3-setuptools
|
||||||
BuildRequires: python3-libfdt python3-pyelftools SDL-devel swig
|
BuildRequires: python3-libfdt python3-pyelftools SDL-devel swig
|
||||||
@ -90,25 +86,10 @@ u-boot bootloader ELF images for use with qemu and other platforms
|
|||||||
%package_help
|
%package_help
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
#%setup -q -n u-boot-%{version} -p1
|
|
||||||
%autosetup -p1 -n u-boot-%{version}
|
%autosetup -p1 -n u-boot-%{version}
|
||||||
|
|
||||||
#git init
|
|
||||||
#git config --global gc.auto 0
|
|
||||||
#git config user.email "noone@example.com"
|
|
||||||
#git config user.name "no one"
|
|
||||||
#git add .
|
|
||||||
#git commit -a -q -m "%{version} baseline"
|
|
||||||
#git am %{patches} </dev/null
|
|
||||||
#git config --unset user.email
|
|
||||||
#git config --unset user.name
|
|
||||||
#rm -rf .git
|
|
||||||
|
|
||||||
cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 .
|
cp %SOURCE1 %SOURCE2 %SOURCE3 %SOURCE4 .
|
||||||
|
|
||||||
# use python2 shebang explicitly
|
|
||||||
#find . -name "*.py" -exec sed -i -r 's!/usr/bin/python(\s|$)!/usr/bin/python2\1!' {} \;
|
|
||||||
|
|
||||||
%build
|
%build
|
||||||
mkdir builds
|
mkdir builds
|
||||||
|
|
||||||
@ -200,50 +181,6 @@ do
|
|||||||
done
|
done
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
#/////////////////////////////////////////
|
|
||||||
%if 0
|
|
||||||
%ifarch aarch64
|
|
||||||
for board in $(cat %{_arch}-boards)
|
|
||||||
do
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/uboot/$(echo $board)/
|
|
||||||
for file in MLO SPL spl/arndale-spl.bin spl/origen-spl.bin spl/smdkv310-spl.bin u-boot.bin u-boot.dtb u-boot-dtb-tegra.bin u-boot.img u-boot.imx u-boot-nodtb-tegra.bin u-boot-spl.kwb u-boot-sunxi-with-spl.bin spl_sd.img spl_spi.img
|
|
||||||
do
|
|
||||||
if [ -f builds/$(echo $board)/$(echo $file) ]; then
|
|
||||||
install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/$(echo $board)/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifarch %{arm}
|
|
||||||
for board in vexpress_ca15_tc2 vexpress_ca9x4
|
|
||||||
do
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/uboot/elf/$(echo $board)/
|
|
||||||
for file in u-boot
|
|
||||||
do
|
|
||||||
if [ -f builds/$(echo $board)/$(echo $file) ]; then
|
|
||||||
install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/elf/$(echo $board)/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%ifarch aarch64
|
|
||||||
for board in $(cat %{_arch}-boards)
|
|
||||||
do
|
|
||||||
mkdir -p %{buildroot}%{_datadir}/uboot/elf/$(echo $board)/
|
|
||||||
for file in u-boot
|
|
||||||
do
|
|
||||||
if [ -f builds/$(echo $board)/$(echo $file) ]; then
|
|
||||||
install -p -m 0644 builds/$(echo $board)/$(echo $file) %{buildroot}%{_datadir}/uboot/elf/$(echo $board)/
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%endif
|
|
||||||
#/////////////////////////////////////////
|
|
||||||
|
|
||||||
for tool in bmp_logo dumpimage env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc img2srec mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder ubsha1 xway-swap-bytes
|
for tool in bmp_logo dumpimage env/fw_printenv fit_check_sign fit_info gdb/gdbcont gdb/gdbsend gen_eth_addr gen_ethaddr_crc img2srec mkenvimage mkimage mksunxiboot ncb proftool sunxi-spl-image-builder ubsha1 xway-swap-bytes
|
||||||
do
|
do
|
||||||
install -p -m 0755 builds/tools/$tool %{buildroot}%{_bindir}
|
install -p -m 0755 builds/tools/$tool %{buildroot}%{_bindir}
|
||||||
@ -259,7 +196,6 @@ mkdir -p %{buildroot}/lib/kernel/install.d/
|
|||||||
install -p -m 0755 %{SOURCE5} %{buildroot}/lib/kernel/install.d/
|
install -p -m 0755 %{SOURCE5} %{buildroot}/lib/kernel/install.d/
|
||||||
|
|
||||||
mkdir -p builds/docs
|
mkdir -p builds/docs
|
||||||
#cp -p board/amlogic/odroid-c2/README builds/docs/README.odroid-c2
|
|
||||||
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
|
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
|
||||||
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
|
cp -p board/hisilicon/hikey/README builds/docs/README.hikey
|
||||||
cp -p board/Marvell/db-88f6820-gp/README builds/docs/README.mvebu-db-88f6820
|
cp -p board/Marvell/db-88f6820-gp/README builds/docs/README.mvebu-db-88f6820
|
||||||
@ -287,20 +223,17 @@ cp -p board/warp7/README builds/docs/README.warp7
|
|||||||
%files -n uboot-images-armv8
|
%files -n uboot-images-armv8
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_datadir}/uboot/*
|
%{_datadir}/uboot/*
|
||||||
#%exclude %{_datadir}/uboot/elf
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifarch %{arm}
|
%ifarch %{arm}
|
||||||
%files -n uboot-images-armv7
|
%files -n uboot-images-armv7
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%{_datadir}/uboot/*
|
%{_datadir}/uboot/*
|
||||||
#%exclude %{_datadir}/uboot/elf
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%ifarch %{arm} aarch64
|
%ifarch %{arm} aarch64
|
||||||
%files -n uboot-images-elf
|
%files -n uboot-images-elf
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
#%{_datadir}/uboot/elf/*
|
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%files help
|
%files help
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user