u-boot/0005-tools-zynqmpbif-Add-support-for-loa.patch
Matthias Brugger 3f5ae570bf Accepting request 795564 from hardware👢staging
- Drop downstream zynqmp generic patches since zynqmp virt config
  superseed it:
Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2020.04
* Patches dropped:
  0005-zynqmp-Add-generic-target.patch
  0006-tools-zynqmpbif-Add-support-for-loa.patch
  0007-boo-1123170-Remove-ubifs-support-fr.patch
  0008-zynqmp-generic-fix-compilation.patch
  0009-boo-1144161-Remove-nand-mtd-spi-dfu.patch
  0010-Kconfig-add-btrfs-to-distro-boot.patch
  0011-configs-Re-sync-with-CONFIG_DISTRO_.patch
  0012-configs-am335x_evm-disable-BTRFS.patch
  0013-net-bcmgenet-Don-t-set-ID_MODE_DIS-.patch
  0014-uboot-fs-btrfs-Use-LZO_LEN-to-repla.patch
  0015-uboot-fs-btrfs-Fix-LZO-false-decomp.patch
* Patches added:
  0005-tools-zynqmpbif-Add-support-for-loa.patch
  0006-boo-1123170-Remove-ubifs-support-fr.patch
  0007-boo-1144161-Remove-nand-mtd-spi-dfu.patch
  0008-Kconfig-add-btrfs-to-distro-boot.patch
  0009-configs-Re-sync-with-CONFIG_DISTRO_.patch
  0010-configs-am335x_evm-disable-BTRFS.patch
  0011-net-bcmgenet-Don-t-set-ID_MODE_DIS-.patch
  0012-uboot-fs-btrfs-Use-LZO_LEN-to-repla.patch
  0013-uboot-fs-btrfs-Fix-LZO-false-decomp.patch
- Follow upstream commits f7c6ee7f and be1b6c32 to unify 
  zynq/zynqmp configs:
  * Update zynq configs to use generic config + device tree for
    u-boot-avnetultra96rev1 and u-boot-xilinxzynqmpzcu102rev10
  * Use upstream u-boot-xilinxzynqmpvirt instead of downstream
    u-boot-xilinxzynqmpgeneric
- Switch to http URLs, ftp is obsolete
- Update to v2020.04:
  * Platfrom fixes: Amlogic, Atmel, fsl, iMX, Marvell, Mediatek,
    rockchip, RPi, samsung, socfpga, sunxi, Tegra, TI
  * EFI fixes
  * I2C fixes
  * GPIO fixes
  * MMC fixes
  * SPI fixes
  * USB fixes
  * Filesystem fixes
Patch queue updated from git://github.com/openSUSE/u-boot.git tumbleweed-2020.04
* Patches dropped:
  0010-ARM-tegra-Add-NVIDIA-Jetson-Nano-De.patch
  0011-net-Add-support-for-Broadcom-GENETv.patch
  0012-rpi4-Update-memory-map-to-accommoda.patch
  0013-rpi4-Enable-GENET-Ethernet-controll.patch
  0014-Kconfig-add-btrfs-to-distro-boot.patch
  0015-configs-Re-sync-with-CONFIG_DISTRO_.patch
  0016-configs-am335x_evm-disable-BTRFS.patch
  0017-net-phy-Fix-overlong-PHY-timeout.patch
  0018-net-bcmgenet-Don-t-set-ID_MODE_DIS-.patch
  0019-uboot-fs-btrfs-Use-LZO_LEN-to-repla.patch
  0020-uboot-fs-btrfs-Fix-LZO-false-decomp.patch
* Patches added:
  0010-Kconfig-add-btrfs-to-distro-boot.patch
  0011-configs-Re-sync-with-CONFIG_DISTRO_.patch
  0012-configs-am335x_evm-disable-BTRFS.patch
  0013-net-bcmgenet-Don-t-set-ID_MODE_DIS-.patch
  0014-uboot-fs-btrfs-Use-LZO_LEN-to-repla.patch
  0015-uboot-fs-btrfs-Fix-LZO-false-decomp.patch

OBS-URL: https://build.opensuse.org/request/show/795564
OBS-URL: https://build.opensuse.org/package/show/hardware:boot/u-boot?expand=0&rev=96
2020-04-20 09:32:05 +00:00

76 lines
2.1 KiB
Diff

From f4562a3ff7fa2116a443cf040ed9ed878a7a2d11 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Thu, 26 Apr 2018 13:30:32 +0200
Subject: [PATCH] tools: zynqmpbif: Add support for load=after
Some times it's handy to have a partition loaded immediately after
the end of the previous blob. The most obvious example for this is
a U-Boot binary (coming from .elf) and a device tree file.
This patch adds that logic. With this, the following bif snippet
does what you would expect:
[destination_cpu=a5x-0, exception_level=el-2] u-boot.elf
[load=after] u-boot.dtb
converts to
FSBL payload on CPU a5x-0 (PS):
Offset : 0x00590500
Size : 577768 (0x8d0e8) bytes
Load : 0x08000000
Attributes : EL2
Checksum : 0xefca2cad
FSBL payload on CPU none (PS):
Offset : 0x0061d640
Size : 129760 (0x1fae0) bytes
Load : 0x0808d0e8 (entry=0x00000000)
Attributes : EL3
Checksum : 0xf7dd3d49
Signed-off-by: Alexander Graf <agraf@suse.de>
---
tools/zynqmpbif.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/tools/zynqmpbif.c b/tools/zynqmpbif.c
index 82ce0ac1a5..b4302fa67e 100644
--- a/tools/zynqmpbif.c
+++ b/tools/zynqmpbif.c
@@ -42,6 +42,7 @@ enum bif_flag {
BIF_FLAG_PUF_FILE,
BIF_FLAG_AARCH32,
BIF_FLAG_PART_OWNER_UBOOT,
+ BIF_FLAG_LOAD_AFTER,
/* Internal flags */
BIF_FLAG_BIT_FILE,
@@ -151,6 +152,11 @@ static char *parse_load(char *line, struct bif_entry *bf)
{
char *endptr;
+ if (!strncmp(line, "after", strlen("after"))) {
+ bf->flags |= (1ULL << BIF_FLAG_LOAD_AFTER);
+ return line + strlen("after");
+ }
+
bf->load = strtoll(line, &endptr, 0);
return endptr;
@@ -345,6 +351,15 @@ static int bif_add_part(struct bif_entry *bf, const char *data, size_t len)
if (r)
return r;
+ if (bf->flags & (1ULL << BIF_FLAG_LOAD_AFTER) &&
+ bif_output.last_part) {
+ struct partition_header *p = bif_output.last_part;
+ uint64_t load = le64_to_cpu(p->load_address);
+
+ load += le32_to_cpu(p->len) * 4;
+ parthdr.load_address = cpu_to_le64(load);
+ }
+
parthdr.offset = cpu_to_le32(bf->offset / 4);
if (bf->flags & (1ULL << BIF_FLAG_BOOTLOADER)) {