Sync from SUSE:SLFO:Main u-boot revision 62e67e6119c885fb373d63e8c0bb63dc

This commit is contained in:
Adrian Schröter 2024-05-04 01:33:57 +02:00
commit 18424bcd26
25 changed files with 5295 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1,35 @@
From 113d5bd59da4e43700aea71eae96321d65586471 Mon Sep 17 00:00:00 2001
From: Guillaume GARDET <guillaume.gardet@free.fr>
Date: Wed, 13 Apr 2016 13:44:29 +0200
Subject: [PATCH] XXX openSUSE XXX: Prepend partition 3 (and 4 for chromebook
snow) to the list of boot partition to load DTB before EFI. It used to be 2
and 3 up to python-kiwi 9.18.34, since swap was the last partition at that
time. Keep #2 for compatibility purpose. Fix boo#1163723 Also add new folders
to find DTB
---
include/config_distro_bootcmd.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/include/config_distro_bootcmd.h b/include/config_distro_bootcmd.h
index 9d2a225e7e..399968fca8 100644
--- a/include/config_distro_bootcmd.h
+++ b/include/config_distro_bootcmd.h
@@ -158,7 +158,7 @@
"load ${devtype} ${devnum}:${distro_bootpart} " \
"${fdt_addr_r} ${prefix}${efi_fdtfile}\0" \
\
- "efi_dtb_prefixes=/ /dtb/ /dtb/current/\0" \
+ "efi_dtb_prefixes=/ /dtb/ /dtb/current/ /boot/ /boot/dtb/ /boot/dtb/current/\0" \
"scan_dev_for_efi=" \
"setenv efi_fdtfile ${fdtfile}; " \
BOOTENV_EFI_SET_FDTFILE_FALLBACK \
@@ -517,7 +517,7 @@
"scan_dev_for_boot_part=" \
"part list ${devtype} ${devnum} -bootable devplist; " \
"env exists devplist || setenv devplist 1; " \
- "for distro_bootpart in ${devplist}; do " \
+ "for distro_bootpart in 3 4 2 ${devplist}; do " \
"if fstype ${devtype} " \
"${devnum}:${distro_bootpart} " \
"bootfstype; then " \

View File

@ -0,0 +1,23 @@
From a9f62e4e79728a3fefbd67f1e825b7b4a146f336 Mon Sep 17 00:00:00 2001
From: Alexander Graf <agraf@suse.de>
Date: Mon, 2 May 2016 23:25:07 +0200
Subject: [PATCH] Revert "Revert "omap3: Use raw SPL by default for mmc1""
This reverts commit 7fa75d0ac5502db813d109c1df7bd0da34688685.
---
arch/arm/mach-omap2/boot-common.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 9a342a1bf9..a7e62b80ee 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -143,8 +143,6 @@ void save_omap_boot_params(void)
(boot_device <= MMC_BOOT_DEVICES_END)) {
switch (boot_device) {
case BOOT_DEVICE_MMC1:
- boot_mode = MMCSD_MODE_FS;
- break;
case BOOT_DEVICE_MMC2:
boot_mode = MMCSD_MODE_RAW;
break;

View File

@ -0,0 +1,94 @@
From b2c0b8dbe9e52e835fa770e95509ef74c0e95304 Mon Sep 17 00:00:00 2001
From: Guillaume Gardet <guillaume.gardet@arm.com>
Date: Fri, 18 Sep 2020 15:27:37 +0200
Subject: [PATCH] rpi: Use firmware provided device tree
Currently the firmware generates a device tree for us that we could
just use to adjust ourselves. We then on boot throw that away and
use our own built-in device tree to configure device access.
This is bad for a multitude of reasons. For starters, it breaks
overlay support in config.txt, confusing users. Much worse however
is that we are stuck with individual U-Boot builds per board.
The firmware can easily give us the right DT depending on the
target board and revision though.
So let's use the firmware provided device tree instead. That way
U-Boot as well as payloads loaded by it can automatically adapt
to variants of RPi hardware.
Signed-off-by: Alexander Graf <agraf@suse.de>
Signed-off-by: Guillaume Gardet <guillaume.gardet@free.fr>
---
configs/rpi_0_w_defconfig | 2 +-
configs/rpi_2_defconfig | 2 +-
configs/rpi_3_32b_defconfig | 2 +-
configs/rpi_3_defconfig | 2 +-
configs/rpi_defconfig | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/configs/rpi_0_w_defconfig b/configs/rpi_0_w_defconfig
index 2a442373f1..1b5c5eb977 100644
--- a/configs/rpi_0_w_defconfig
+++ b/configs/rpi_0_w_defconfig
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_2_defconfig b/configs/rpi_2_defconfig
index 1c462f36b4..7ca996d86c 100644
--- a/configs/rpi_2_defconfig
+++ b/configs/rpi_2_defconfig
@@ -24,7 +24,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_3_32b_defconfig b/configs/rpi_3_32b_defconfig
index ed14571d20..9fbf376b63 100644
--- a/configs/rpi_3_32b_defconfig
+++ b/configs/rpi_3_32b_defconfig
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_3_defconfig b/configs/rpi_3_defconfig
index eb92519371..b91574ab39 100644
--- a/configs/rpi_3_defconfig
+++ b/configs/rpi_3_defconfig
@@ -22,7 +22,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y
diff --git a/configs/rpi_defconfig b/configs/rpi_defconfig
index dfd0c6bbae..182a93736d 100644
--- a/configs/rpi_defconfig
+++ b/configs/rpi_defconfig
@@ -23,7 +23,7 @@ CONFIG_CMD_GPIO=y
CONFIG_CMD_MMC=y
CONFIG_CMD_USB=y
CONFIG_CMD_FS_UUID=y
-CONFIG_OF_EMBED=y
+CONFIG_OF_BOARD=y
CONFIG_ENV_FAT_DEVICE_AND_PART="0:1"
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y

View File

@ -0,0 +1,24 @@
From 8664fa0475922d0265ef1db88d9b6428b93f5267 Mon Sep 17 00:00:00 2001
From: Guillaume GARDET <guillaume.gardet@free.fr>
Date: Mon, 9 Apr 2018 10:28:26 +0200
Subject: [PATCH] Temp workaround for Chromebook snow to avoid the 'unable to
select a mode' error
---
drivers/mmc/dw_mmc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
index 5085a3b491..6c098475be 100644
--- a/drivers/mmc/dw_mmc.c
+++ b/drivers/mmc/dw_mmc.c
@@ -609,7 +609,8 @@ void dwmci_setup_cfg(struct mmc_config *cfg, struct dwmci_host *host,
cfg->host_caps |= MMC_MODE_4BIT;
cfg->host_caps &= ~MMC_MODE_8BIT;
}
- cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
+ /* Temp workaround for Chromebook snow to avoid the 'unable to select a mode' error */
+// cfg->host_caps |= MMC_MODE_HS | MMC_MODE_HS_52MHz;
cfg->b_max = CONFIG_SYS_MMC_MAX_BLK_COUNT;
}

View File

@ -0,0 +1,75 @@
From 6a56358a5a0179689888ebf22cca3dc2f30c2457 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)) {

View File

@ -0,0 +1,26 @@
From f871287c2816f989f8d61ac4e3ef4efedbd473d5 Mon Sep 17 00:00:00 2001
From: Guillaume Gardet <guillaume.gardet@arm.com>
Date: Wed, 5 Apr 2023 14:25:29 +0200
Subject: [PATCH] Kconfig: add btrfs to distro boot
Some distributions use btrfs as the default file system.
Enable btrfs support by default when using distro boot for all
architectures but riscv, as it breaks compilation due to size problems.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
boot/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/boot/Kconfig b/boot/Kconfig
index ad035695a4..f462ab0e88 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -838,6 +838,7 @@ config DISTRO_DEFAULTS
select CMD_SYSBOOT
select HUSH_PARSER
select SYS_LONGHELP
+ imply CMD_BTRFS if !RISCV && !MIPS
help
Select this to enable various options and commands which are suitable
for building u-boot for booting general purpose Linux distributions.

View File

@ -0,0 +1,77 @@
From bc484cdfa38a3c60f94cfde7ccfa5a928ea30472 Mon Sep 17 00:00:00 2001
From: Matthias Brugger <mbrugger@suse.com>
Date: Wed, 29 Jan 2020 09:56:06 +0100
Subject: [PATCH] configs: Re-sync with CONFIG_DISTRO_DEFAULTS
CONFIG_DISTRO_DEFAULTS now enables CMD_BTRFS by default,
we can delete the config option in the corresponding default
configs. Other boards won't build with btrfs enabled so disable
the support by default.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
configs/sandbox64_defconfig | 1 -
configs/sandbox_defconfig | 1 -
configs/socfpga_arria10_defconfig | 2 ++
configs/turris_mox_defconfig | 1 -
configs/turris_omnia_defconfig | 1 -
5 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/configs/sandbox64_defconfig b/configs/sandbox64_defconfig
index 89cba40713..846894a2a6 100644
--- a/configs/sandbox64_defconfig
+++ b/configs/sandbox64_defconfig
@@ -84,7 +84,6 @@ CONFIG_CMD_REGULATOR=y
CONFIG_CMD_AES=y
CONFIG_CMD_TPM=y
CONFIG_CMD_TPM_TEST=y
-CONFIG_CMD_BTRFS=y
CONFIG_CMD_CBFS=y
CONFIG_CMD_CRAMFS=y
CONFIG_CMD_EXT4_WRITE=y
diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig
index ce32dfc23a..aff6da2d73 100644
--- a/configs/sandbox_defconfig
+++ b/configs/sandbox_defconfig
@@ -115,7 +115,6 @@ CONFIG_CMD_REGULATOR=y
CONFIG_CMD_AES=y
CONFIG_CMD_TPM=y
CONFIG_CMD_TPM_TEST=y
-CONFIG_CMD_BTRFS=y
CONFIG_CMD_CBFS=y
CONFIG_CMD_CRAMFS=y
CONFIG_CMD_EROFS=y
diff --git a/configs/socfpga_arria10_defconfig b/configs/socfpga_arria10_defconfig
index 82b16418a6..73e89da98e 100644
--- a/configs/socfpga_arria10_defconfig
+++ b/configs/socfpga_arria10_defconfig
@@ -69,3 +69,5 @@ CONFIG_DESIGNWARE_APB_TIMER=y
CONFIG_USB=y
CONFIG_USB_DWC2=y
# CONFIG_SPL_WDT is not set
+# CONFIG_CMD_BTRFS is not set
+# CONFIG_FS_BTRFS is not set
diff --git a/configs/turris_mox_defconfig b/configs/turris_mox_defconfig
index db442a1ebc..5c3e2fe486 100644
--- a/configs/turris_mox_defconfig
+++ b/configs/turris_mox_defconfig
@@ -50,7 +50,6 @@ CONFIG_CMD_TIME=y
CONFIG_CMD_MVEBU_BUBT=y
CONFIG_CMD_AES=y
CONFIG_CMD_HASH=y
-CONFIG_CMD_BTRFS=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_MAC_PARTITION=y
CONFIG_ENV_OVERWRITE=y
diff --git a/configs/turris_omnia_defconfig b/configs/turris_omnia_defconfig
index 70a1fadc02..ef5f3dd83f 100644
--- a/configs/turris_omnia_defconfig
+++ b/configs/turris_omnia_defconfig
@@ -72,7 +72,6 @@ CONFIG_CMD_CACHE=y
CONFIG_CMD_TIME=y
CONFIG_CMD_AES=y
CONFIG_CMD_HASH=y
-CONFIG_CMD_BTRFS=y
CONFIG_CMD_FS_UUID=y
CONFIG_ENV_OVERWRITE=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y

View File

@ -0,0 +1,42 @@
From 4480a4b55b939c1be7608fe7d2e9534f4b9ab699 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Tue, 29 Sep 2020 10:13:33 +0200
Subject: [PATCH] sunxi: dts: OrangePi Zero: Add SPI aliases to make bus usable
with u-boot.
The u-boot code relies on aliases to assign bus number.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 1 +
arch/arm/dts/sunxi-spi-u-boot.dtsi | 8 ++++++++
2 files changed, 9 insertions(+)
create mode 100644 arch/arm/dts/sunxi-spi-u-boot.dtsi
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
index 3706216ffb..c3660f72d9 100644
--- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
+++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -46,6 +46,7 @@
/dts-v1/;
#include "sun8i-h3.dtsi"
#include "sunxi-common-regulators.dtsi"
+#include "sunxi-spi-u-boot.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
diff --git a/arch/arm/dts/sunxi-spi-u-boot.dtsi b/arch/arm/dts/sunxi-spi-u-boot.dtsi
new file mode 100644
index 0000000000..df89d02ff2
--- /dev/null
+++ b/arch/arm/dts/sunxi-spi-u-boot.dtsi
@@ -0,0 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0+
+/ {
+
+ aliases {
+ spi0 = &spi0;
+ spi1 = &spi1;
+ };
+};

View File

@ -0,0 +1,29 @@
From d6e08d9277b271ef4a7bf44dc8959cd2ba1c3712 Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Mon, 28 Sep 2020 23:02:01 +0200
Subject: [PATCH] sunxi: dts: OrangePi Zero: Enable SPI flash.
This flash is optional but new boards do have it, and on boards that
don't the pins are routed to the flash pads anyway.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
index c3660f72d9..80c1e66b38 100644
--- a/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
+++ b/arch/arm/dts/sun8i-h2-plus-orangepi-zero.dts
@@ -164,8 +164,8 @@
};
&spi0 {
- /* Disable SPI NOR by default: it optional on Orange Pi Zero boards */
- status = "disabled";
+ /* Enable SPI NOR by default: it optional on Orange Pi Zero boards */
+ status = "okay";
flash@0 {
#address-cells = <1>;

View File

@ -0,0 +1,22 @@
From 57bebd36592bfc2b7a178d7f92c711f3ac3bfb90 Mon Sep 17 00:00:00 2001
From: Guillaume Gardet <guillaume.gardet@arm.com>
Date: Wed, 18 Nov 2020 13:42:04 +0000
Subject: [PATCH] Disable CONFIG_CMD_BTRFS in xilinx_zynqmp_virt_defconfig to
fix compilation - bsc#1178884
---
configs/xilinx_zynqmp_virt_defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/configs/xilinx_zynqmp_virt_defconfig b/configs/xilinx_zynqmp_virt_defconfig
index fb91449ef7..da221f0b83 100644
--- a/configs/xilinx_zynqmp_virt_defconfig
+++ b/configs/xilinx_zynqmp_virt_defconfig
@@ -94,6 +94,7 @@ CONFIG_CMD_TIMER=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_TPM=y
CONFIG_CMD_EXT4_WRITE=y
+# CONFIG_CMD_BTRFS is not set
CONFIG_CMD_SQUASHFS=y
CONFIG_CMD_MTDPARTS=y
CONFIG_CMD_MTDPARTS_SPREAD=y

View File

@ -0,0 +1,33 @@
From c6536334c219d2290129c5c54b54aac5fabf9e64 Mon Sep 17 00:00:00 2001
From: Matthias Brugger <mbrugger@suse.com>
Date: Wed, 17 Mar 2021 12:20:32 +0100
Subject: [PATCH] smbios: Fix table when no string is present
When no string is present in a table, next_ptr points to the same
location as eos. When calculating the string table length, we would only
reserve one \0. By spec a SMBIOS table has to end with two \0\0 when no
strings a present.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
Series-to: sjg@chromium.org
Series-cc: bmeng.cn@gmail.com
Series-cc: xypron.glpk@gmx.de
Series-cc: u-boot@lists.denx.de
---
lib/smbios.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/smbios.c b/lib/smbios.c
index d7f4999e8b..2cdfef7a2c 100644
--- a/lib/smbios.c
+++ b/lib/smbios.c
@@ -172,7 +172,7 @@ static int smbios_add_prop(struct smbios_ctx *ctx, const char *prop)
static void smbios_set_eos(struct smbios_ctx *ctx, char *eos)
{
ctx->eos = eos;
- ctx->next_ptr = eos;
+ ctx->next_ptr = eos + 1;
ctx->last_str = NULL;
}

View File

@ -0,0 +1,23 @@
From 44939288ab16748b84e31241684e0b8563749156 Mon Sep 17 00:00:00 2001
From: Guillaume Gardet <guillaume.gardet@arm.com>
Date: Wed, 5 Apr 2023 14:27:09 +0200
Subject: [PATCH] riscv: enable CMD_BTRFS
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
boot/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/boot/Kconfig b/boot/Kconfig
index f462ab0e88..fe5d91dc64 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -838,7 +838,7 @@ config DISTRO_DEFAULTS
select CMD_SYSBOOT
select HUSH_PARSER
select SYS_LONGHELP
- imply CMD_BTRFS if !RISCV && !MIPS
+ imply CMD_BTRFS if !MIPS
help
Select this to enable various options and commands which are suitable
for building u-boot for booting general purpose Linux distributions.

View File

@ -0,0 +1,48 @@
From 94ffe4f51fb990760d68eb2f5eb8fa0dda3a7e7a Mon Sep 17 00:00:00 2001
From: Michael Chang <mchang@suse.com>
Date: Tue, 25 May 2021 06:45:01 +0000
Subject: [PATCH] Disable timer check in file loading
The u-boot efi console service registers a timer to poll the keyboard
input in every 50ns. In the efi block io service, this timer is
evaluated on each block read, and since the timer interval is much less
than the time needed to reading out a block (32kB) from the disk, the
keyboard polling is therefore in the wake of each block read.
Unfortunately USB keyboard spends too much time in polling. In my test
usb_kbd_poll_for_event costs 40ms in usb_kbd_testc() to test if a
character is in the queue. In combination with the number of blocks to
be read from the disk, the extra amound of time delayed could be around
30 seconds to load linux and initrd.
For that matters, the timer check is disabled in file loading to speed
it up. The consequence would be losing the keystroke during the time
file is loading, but that is acceptable IMHO.
Signed-off-by: Matthias Brugger <mbrugger@suse.com>
---
lib/efi_loader/efi_disk.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index d2256713a8..4f82b5397c 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -19,6 +19,7 @@
#include <log.h>
#include <part.h>
#include <malloc.h>
+#include <watchdog.h>
struct efi_system_partition efi_system_partition = {
.uclass_id = UCLASS_INVALID,
@@ -142,8 +143,7 @@ static efi_status_t efi_disk_rw_blocks(struct efi_block_io *this,
n = blk_dwrite(desc, lba, blocks, buffer);
}
- /* We don't do interrupts, so check for timers cooperatively */
- efi_timer_check();
+ schedule();
EFI_PRINT("n=%lx blocks=%x\n", n, blocks);

View File

@ -0,0 +1,24 @@
From a62d08f11ec8b06eb31bb7ce3e3923c69fd009a6 Mon Sep 17 00:00:00 2001
From: Guillaume Gardet <guillaume.gardet@arm.com>
Date: Thu, 21 Oct 2021 09:55:50 +0200
Subject: [PATCH] Enable EFI and ISO partitions support on socfpga_de0_nano_soc
to fix boot This is a partial revert of
f369e1564cf4f81654b8a806fdc325b62b6627dc
---
configs/socfpga_de0_nano_soc_defconfig | 2 --
1 file changed, 2 deletions(-)
diff --git a/configs/socfpga_de0_nano_soc_defconfig b/configs/socfpga_de0_nano_soc_defconfig
index 364ae912ca..f41e8fa0b8 100644
--- a/configs/socfpga_de0_nano_soc_defconfig
+++ b/configs/socfpga_de0_nano_soc_defconfig
@@ -45,8 +45,6 @@ CONFIG_CMD_EXT4_WRITE=y
CONFIG_MTDIDS_DEFAULT="nor0=ff705000.spi.0"
CONFIG_MTDPARTS_DEFAULT="mtdparts=ff705000.spi.0:1m(u-boot),256k(env1),256k(env2),14848k(boot),16m(rootfs),-@1536k(UBI)"
CONFIG_CMD_UBI=y
-# CONFIG_ISO_PARTITION is not set
-# CONFIG_EFI_PARTITION is not set
CONFIG_ENV_IS_IN_MMC=y
CONFIG_SYS_RELOC_GD_ENV_ADDR=y
CONFIG_VERSION_VARIABLE=y

View File

@ -0,0 +1,66 @@
From aa75cb09f8616f4234e71a2abe73f095bf3ee7c0 Mon Sep 17 00:00:00 2001
From: Andy Yan <andy.yan@rock-chips.com>
Date: Tue, 6 Feb 2018 09:51:12 +0800
Subject: [PATCH] cmd: boot: add brom cmd to reboot to brom dnl mode
Change-Id: I797491ebe25af1013732aeee87e61e3ba4bc1689
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
.../arm/include/asm/arch-rockchip/boot_mode.h | 1 +
cmd/boot.c | 20 +++++++++++++++++++
2 files changed, 21 insertions(+)
diff --git a/arch/arm/include/asm/arch-rockchip/boot_mode.h b/arch/arm/include/asm/arch-rockchip/boot_mode.h
index 6b2a610cf4..bcdf4420cf 100644
--- a/arch/arm/include/asm/arch-rockchip/boot_mode.h
+++ b/arch/arm/include/asm/arch-rockchip/boot_mode.h
@@ -19,6 +19,7 @@
#define BOOT_BROM_DOWNLOAD 0xEF08A53C
#ifndef __ASSEMBLY__
+void set_back_to_bootrom_dnl_flag(void);
int setup_boot_mode(void);
#endif
diff --git a/cmd/boot.c b/cmd/boot.c
index 14839c1ced..d7c7db449c 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -44,16 +44,36 @@ static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
printf ("## Application terminated, rc = 0x%lX\n", rc);
return rcode;
}
+#endif
+
+#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+#include <asm/arch-rockchip/boot_mode.h>
+static int do_reboot_brom(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ set_back_to_bootrom_dnl_flag();
+ do_reset(NULL, 0, 0, NULL);
+
+ return 0;
+}
+#endif
/* -------------------------------------------------------------------- */
+#ifdef CONFIG_CMD_GO
U_BOOT_CMD(
go, CONFIG_SYS_MAXARGS, 1, do_go,
"start application at address 'addr'",
"addr [arg ...]\n - start application at address 'addr'\n"
" passing 'arg' as arguments"
);
+#endif
+#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+U_BOOT_CMD(
+ rbrom, 1, 0, do_reboot_brom,
+ "Perform RESET of the CPU and enter boot rom",
+ ""
+);
#endif
U_BOOT_CMD(

View File

@ -0,0 +1,149 @@
From 47e88407164dec3f5e89edcc2bf81f0cfe52412b Mon Sep 17 00:00:00 2001
From: Michal Suchanek <msuchanek@suse.de>
Date: Sun, 3 Jul 2022 18:25:39 +0200
Subject: [PATCH] cmd: boot: add brom cmd to reboot to FEL mode
p-boot uses RTC GPR 1 value 0xb0010fe1 to flag FEL boot on A64
Default to the same.
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
---
arch/arm/include/asm/arch-sunxi/cpu.h | 11 +++++++++++
arch/arm/mach-sunxi/Kconfig | 16 ++++++++++++++++
arch/arm/mach-sunxi/board.c | 24 ++++++++++++++++++++++++
cmd/boot.c | 17 ++++++++++++++++-
4 files changed, 67 insertions(+), 1 deletion(-)
diff --git a/arch/arm/include/asm/arch-sunxi/cpu.h b/arch/arm/include/asm/arch-sunxi/cpu.h
index b08f202374..36e7697b1c 100644
--- a/arch/arm/include/asm/arch-sunxi/cpu.h
+++ b/arch/arm/include/asm/arch-sunxi/cpu.h
@@ -20,4 +20,15 @@
#define SOCID_H5 0x1718
#define SOCID_R40 0x1701
+#if defined(CONFIG_SUNXI_RTC_FEL_ENTRY_GPR) && (CONFIG_SUNXI_RTC_FEL_ENTRY_GPR >= 0)
+#ifdef CONFIG_MACH_SUN8I_H3
+#define SUNXI_FEL_ENTRY_ADDRESS 0xffff0020
+#define SUNXI_RTC_GPR_OFFSET 0x100
+#define SUNXI_FEL_REG (SUNXI_RTC_BASE + SUNXI_RTC_GPR_OFFSET + CONFIG_SUNXI_RTC_FEL_ENTRY_GPR * 4)
+#endif
+#endif
+#ifndef __ASSEMBLY__
+void set_rtc_fel_flag(void);
+#endif
+
#endif /* _SUNXI_CPU_H */
diff --git a/arch/arm/mach-sunxi/Kconfig b/arch/arm/mach-sunxi/Kconfig
index 6417aee944..2c5f2e4dcb 100644
--- a/arch/arm/mach-sunxi/Kconfig
+++ b/arch/arm/mach-sunxi/Kconfig
@@ -1023,6 +1023,22 @@ source "board/sunxi/Kconfig"
endif
+config SUNXI_RTC_FEL_ENTRY_GPR
+ int "Use a RTC GPR to enter FEL"
+ depends on MACH_SUN8I_H3
+ range -1 7
+ default 1
+ help
+ Add rbrom command to set a RTC general purpose register before reboot.
+ Check the GPR value in SPL and jump to FEL if set.
+ Value -1 disables the feature.
+
+config SUNXI_RTC_FEL_ENTRY_VALUE
+ hex "Value to set in the RTC GPR"
+ depends on SUNXI_RTC_FEL_ENTRY_GPR >= 0
+ range 0x1 0xffffffff
+ default 0xb0010fe1
+
config CHIP_DIP_SCAN
bool "Enable DIPs detection for CHIP board"
select SUPPORT_EXTENSION_SCAN
diff --git a/arch/arm/mach-sunxi/board.c b/arch/arm/mach-sunxi/board.c
index 391a65a549..eebdebf41f 100644
--- a/arch/arm/mach-sunxi/board.c
+++ b/arch/arm/mach-sunxi/board.c
@@ -300,7 +300,30 @@ uint32_t sunxi_get_boot_device(void)
return -1; /* Never reached */
}
+void set_rtc_fel_flag(void)
+{
+#ifdef SUNXI_FEL_REG
+ volatile long *check_reg = (void *)SUNXI_FEL_REG;
+
+ *check_reg = CONFIG_SUNXI_RTC_FEL_ENTRY_VALUE;
+#endif
+}
+
#ifdef CONFIG_SPL_BUILD
+
+void check_rtc_fel_flag(void)
+{
+#ifdef SUNXI_FEL_REG
+ volatile long *check_reg = (void *)SUNXI_FEL_REG;
+ void (*entry)(void) = (void*)SUNXI_FEL_ENTRY_ADDRESS;
+
+ if (*check_reg == CONFIG_SUNXI_RTC_FEL_ENTRY_VALUE) {
+ *check_reg = 0;
+ return entry();
+ }
+#endif
+}
+
uint32_t sunxi_get_spl_size(void)
{
struct boot_file_head *egon_head = (void *)SPL_ADDR;
@@ -442,6 +465,7 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
void board_init_f(ulong dummy)
{
+ check_rtc_fel_flag();
sunxi_sram_init();
#if defined CONFIG_MACH_SUN6I || defined CONFIG_MACH_SUN8I_H3
diff --git a/cmd/boot.c b/cmd/boot.c
index d7c7db449c..111c9d9409 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -47,6 +47,7 @@ static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
#endif
#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+#define RBROM
#include <asm/arch-rockchip/boot_mode.h>
static int do_reboot_brom(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
{
@@ -57,6 +58,20 @@ static int do_reboot_brom(struct cmd_tbl *cmdtp, int flag, int argc, char * cons
}
#endif
+#ifdef CONFIG_ARCH_SUNXI
+#include <asm/arch-sunxi/cpu.h>
+#ifdef SUNXI_FEL_REG
+#define RBROM
+static int do_reboot_brom(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[])
+{
+ set_rtc_fel_flag();
+ do_reset(NULL, 0, 0, NULL);
+
+ return 0;
+}
+#endif
+#endif
+
/* -------------------------------------------------------------------- */
#ifdef CONFIG_CMD_GO
@@ -68,7 +83,7 @@ U_BOOT_CMD(
);
#endif
-#if defined(CONFIG_ROCKCHIP_BOOT_MODE_REG) && CONFIG_ROCKCHIP_BOOT_MODE_REG
+#ifdef RBROM
U_BOOT_CMD(
rbrom, 1, 0, do_reboot_brom,
"Perform RESET of the CPU and enter boot rom",

101
_multibuild Normal file
View File

@ -0,0 +1,101 @@
<multibuild>
<flavor>tools</flavor>
<flavor>a10-olinuxino-lime</flavor>
<flavor>a13-olinuxino</flavor>
<flavor>a13-olinuxinom</flavor>
<flavor>a20-olinuxino-lime</flavor>
<flavor>a20-olinuxino-lime2</flavor>
<flavor>a20-olinuxinomicro</flavor>
<flavor>am335xevm</flavor>
<flavor>am57xxevm</flavor>
<flavor>avnetultra96rev1</flavor>
<flavor>arndale</flavor>
<flavor>bananapi</flavor>
<flavor>bananapim2plush3</flavor>
<flavor>bananapim2zero</flavor>
<flavor>bananapim64</flavor>
<flavor>clearfog</flavor>
<flavor>colibrit20</flavor>
<flavor>cubieboard</flavor>
<flavor>cubieboard2</flavor>
<flavor>cubietruck</flavor>
<flavor>dragonboard410c</flavor>
<flavor>dragonboard820c</flavor>
<flavor>evb-rk3399</flavor>
<flavor>firefly-rk3288</flavor>
<flavor>firefly-rk3399</flavor>
<flavor>geekbox</flavor>
<flavor>highbank</flavor>
<flavor>hikey</flavor>
<flavor>hyundaia7hd</flavor>
<flavor>jetson-tk1</flavor>
<flavor>khadas-vim</flavor>
<flavor>khadas-vim2</flavor>
<flavor>lamobor1</flavor>
<flavor>libretech-ac</flavor>
<flavor>libretech-cc</flavor>
<flavor>ls1012afrdmqspi</flavor>
<flavor>melea1000</flavor>
<flavor>merriia80optimus</flavor>
<flavor>mt7623nbpir2</flavor>
<flavor>mvebudb-88f3720</flavor>
<flavor>mvebudbarmada8k</flavor>
<flavor>mvebuespressobin-88f3720</flavor>
<flavor>mvebumcbin-88f8040</flavor>
<flavor>mx53loco</flavor>
<flavor>mx6cuboxi</flavor>
<flavor>mx6qsabrelite</flavor>
<flavor>nanopc-t4-rk3399</flavor>
<flavor>nanopi-m4b-rk3399</flavor>
<flavor>nanopia64</flavor>
<flavor>nanopineo</flavor>
<flavor>nanopineoair</flavor>
<flavor>odroid</flavor>
<flavor>odroid-c2</flavor>
<flavor>odroid-c4</flavor>
<flavor>odroid-n2</flavor>
<flavor>odroid-xu3</flavor>
<flavor>omap3beagle</flavor>
<flavor>omap4panda</flavor>
<flavor>orangepipc</flavor>
<flavor>orangepipc2</flavor>
<flavor>orangepizero</flavor>
<flavor>orangepizero2</flavor>
<flavor>p2371-2180</flavor>
<flavor>p2771-0000-500</flavor>
<flavor>p3450-0000</flavor>
<flavor>paz00</flavor>
<flavor>pcm051rev3</flavor>
<flavor>pine64plus</flavor>
<flavor>pinebook</flavor>
<flavor>pinebook-pro-rk3399</flavor>
<flavor>pineh64</flavor>
<flavor>pinephone</flavor>
<flavor>poplar</flavor>
<flavor>qemu-ppce500</flavor>
<flavor>qemu-riscv64</flavor>
<flavor>qemu-riscv64smode</flavor>
<flavor>rock-pi-4-rk3399</flavor>
<flavor>rock-pi-n10-rk3399pro</flavor>
<flavor>rock64-rk3328</flavor>
<flavor>rock960-rk3399</flavor>
<flavor>rockpro64-rk3399</flavor>
<flavor>rpi</flavor>
<flavor>rpi2</flavor>
<flavor>rpi3</flavor>
<flavor>rpi4</flavor>
<flavor>rpiarm64</flavor>
<flavor>sifiveunleashed</flavor>
<flavor>sifiveunmatched</flavor>
<flavor>snow</flavor>
<flavor>socfpgade0nanosoc</flavor>
<flavor>spring</flavor>
<flavor>tinker-rk3288</flavor>
<flavor>turrisomnia</flavor>
<flavor>udoo</flavor>
<flavor>udooneo</flavor>
<flavor>xilinxzynqvirt</flavor>
<flavor>xilinxzynqmpvirt</flavor>
<flavor>xilinxzynqmpzcu102rev10</flavor>
<flavor>zynqzturnv5</flavor>
</multibuild>

BIN
arndale-bl1.img Normal file

Binary file not shown.

BIN
u-boot-2023.04.tar.bz2 (Stored with Git LFS) Normal file

Binary file not shown.

BIN
u-boot-2023.04.tar.bz2.sig Normal file

Binary file not shown.

8
u-boot-rpmlintrc Normal file
View File

@ -0,0 +1,8 @@
# This line is mandatory to access the configuration functions
from Config import *
addFilter("no-binary")
addFilter("name-repeated-in-summary")
addFilter("incorrect-fsf-address")
addFilter("file-contains-date-and-time")
addFilter("strict-aliasing-punning")

3602
u-boot.changes Normal file

File diff suppressed because it is too large Load Diff

624
u-boot.spec Normal file
View File

@ -0,0 +1,624 @@
#
# spec file for package u-boot
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2010 Texas Instruments Inc by Nishanth Menon
# Copyright (c) 2007-2010 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define target @BUILD_FLAVOR@
%define mvebu_spl 0
%define x_loader 0
%define rockchip_spl 0
%define rockchip_tpl 0
%define rockchip_idb 0
%define sunxi_spl 0
%define arndale_spl 0
%define origen_spl 0
%define imx6_spl 0
%define socfpga_spl 0
%define binext .bin
%define is_armv6 0
%define is_armv7 0
%define is_armv8 0
%define is_ppc 0
%define is_riscv64 0
%define is_zynq 0
%define is_zynqmp 0
%define tools_only 0
%if "%target" == "rpi" || "%target" == "rpi2" || "%target" == "rpi3" || "%target" == "rpi4" || "%target" == "rpiarm64"
%define is_rpi 1
%if "%target" == "rpi"
%define is_armv6 1
%endif
%if "%target" == "rpi2"
%define is_armv7 1
%endif
%if "%target" == "rpi3" || "%target" == "rpi4" || "%target" == "rpiarm64"
%define is_armv8 1
%endif
%endif
%if "%target" == "firefly-rk3288" || "%target" == "tinker-rk3288"
%define is_armv7 1
%define rockchip_tpl 1
%define soc_name "rk3288"
%if "%target" == "firefly-rk3288"
%define rkimages rksd rkimage
%else
%define rkimages rksd
%endif
%endif
%if "%target" == "rock64-rk3328"
%define is_rk3328 1
%define is_armv8 1
%define rockchip_idb 1
%define rockchip_spl 1
%define rkimages $()
%endif
%if "%target" == "evb-rk3399" || "%target" == "firefly-rk3399" || "%target" == "rock-pi-4-rk3399" || "%target" == "nanopc-t4-rk3399" || "%target" == "nanopi-m4b-rk3399"
%define is_rk3399 1
%define is_armv8 1
%define rockchip_idb 1
%define rockchip_spl 1
%define rkimages $()
%endif
%if "%target" == "pinebook-pro-rk3399" || "%target" == "puma-rk3399" || "%target" == "rock960-rk3399" || "%target" == "rockpro64-rk3399" || "%target" == "rock-pi-n10-rk3399pro"
%define is_rk3399 1
%define is_armv8 1
%define rockchip_idb 1
%define binext .itb
%endif
%if "%target" == "bananapim64" || "%target" == "nanopia64" || "%target" == "pine64plus" || "%target" == "pinebook"
%define is_a64 1
%define is_armv8 1
%define sunxi_spl 1
%define binext .img
%endif
%if "%target" == "mt7623nbpir2"
%define is_armv7 1
%endif
%if "%target" == "orangepipc2"
%define is_h5 1
%define is_armv8 1
%define sunxi_spl 1
%define binext .img
%endif
%if "%target" == "pineh64"
%define is_h6 1
%define is_armv8 1
%define sunxi_spl 1
%define binext .img
%endif
%if "%target" == "pinephone"
%define is_armv8 1
%define is_a64 1
%define sunxi_spl 1
%endif
%if "%target" == "orangepizero2"
%define is_h616 1
%define is_armv8 1
%define sunxi_spl 1
%endif
%if "%target" == "bananapi" || "%target" == "cubieboard" || "%target" == "cubieboard2" || "%target" == "cubietruck" || "%target" == "melea1000" || "%target" == "a10-olinuxino-lime" || "%target" == "a13-olinuxino" || "%target" == "a13-olinuxinom" || "%target" == "a20-olinuxino-lime" || "%target" == "a20-olinuxino-lime2" || "%target" == "a20-olinuxinomicro" || "%target" == "nanopineo" || "%target" == "orangepipc" || "%target" == "hyundaia7hd" || "%target" == "lamobor1" || "%target" == "bananapim2plush3" || "%target" == "bananapim2zero" || "%target" == "orangepizero"
%define is_armv7 1
%define binext .img
%define sunxi_spl 1
%endif
%if "%target" == "clearfog" || "%target" == "turrisomnia"
%define mvebu_spl 1
%define is_armv7 1
%define binext .img
%endif
%if "%target" == "mx53loco" || "%target" == "mx6qsabrelite"
%define is_armv7 1
%define binext -dtb.imx
%endif
%if "%target" == "mx6cuboxi" || "%target" == "udoo" || "%target" == "udooneo"
%define imx6_spl 1
%define is_armv7 1
%define binext .img
%endif
%if "%target" == "omap3beagle" || "%target" == "omap4panda" || "%target" == "am335xevm" || "%target" == "pcm051rev3"
%define x_loader 1
%define is_armv7 1
%define binext .img
%endif
%if "%target" == "colibrit20" || "%target" == "am57xxevm"
%define is_armv7 1
%endif
%if "%target" == "arndale"
%define is_armv7 1
%define arndale_spl 1
%endif
%if "%target" == "dragonboard410c" || "%target" == "dragonboard820c"
%define is_armv8 1
%endif
%if "%target" == "geekbox" || "%target" == "hikey" || "%target" == "khadas-vim" || "%target" == "khadas-vim2" || "%target" == "libretech-ac" || "%target" == "libretech-cc" || "%target" == "ls1012afrdmqspi" || "%target" == "mvebudb-88f3720" || "%target" == "mvebudbarmada8k" || "%target" == "mvebuespressobin-88f3720" || "%target" == "mvebumcbin-88f8040" || "%target" == "odroid-c2" || "%target" == "odroid-c4" || "%target" == "odroid-n2" || "%target" == "p2371-2180" || "%target" == "p2771-0000-500" || "%target" == "p3450-0000" || "%target" == "poplar"
%define is_armv8 1
%endif
%if "%target" == "avnetultra96rev1" || "%target" == "xilinxzynqmpvirt" || "%target" == "xilinxzynqmpzcu102rev10"
%define is_zynqmp 1
%define is_armv8 1
%define binext .elf
%endif
%if "%target" == "highbank" || "%target" == "jetson-tk1" || "%target" == "merriia80optimus" || "%target" == "nanopineoair" || "%target" == "odroid" || "%target" == "odroid-xu3" || "%target" == "paz00" || "%target" == "socfpgade0nanosoc"
%define is_armv7 1
%if "%target" == "socfpgade0nanosoc"
%define socfpga_spl 1
%endif
%endif
%if "%target" == "snow" || "%target" == "spring"
%define is_armv7 1
%define binext .img
%endif
%if "%target" == "zynqzturnv5" || "%target" == "xilinxzynqvirt"
%define is_zynq 1
%define is_armv7 1
%define binext .img
%endif
%if "%target" == "qemu-riscv64" || "%target" == "qemu-riscv64smode" || "%target" == "sifiveunleashed" || "%target" == "sifiveunmatched"
%define is_riscv64 1
%if "%target" == "sifiveunleashed" || "%target" == "sifiveunmatched"
%define binext .itb
%endif
%endif
%if "%target" == "qemu-ppce500"
%define is_ppc 1
%endif
# archive_version differs from version for RC version only
%define archive_version 2023.04
%if "%{target}" == ""
ExclusiveArch: do_not_build
%else
%if "%{target}" == "tools"
%define tools_only 1
%else
%if %is_armv8
ExclusiveArch: aarch64
%else
%if %is_armv7
ExclusiveArch: armv7l armv7hl
%else
%if %is_armv6
ExclusiveArch: armv6l armv6hl
%else
%if %is_ppc
ExclusiveArch: ppc
%else
%if %is_riscv64
ExclusiveArch: riscv64
%else
ExclusiveArch: do_not_build
%endif
%endif
%endif
%endif
%endif
%endif
%endif
Version: 2023.04
Release: 0
Summary: The U-Boot firmware for the %target platform
License: GPL-2.0-only
Group: System/Boot
URL: http://www.denx.de/wiki/U-Boot
Source: http://ftp.denx.de/pub/u-boot/u-boot-%{archive_version}.tar.bz2
Source1: http://ftp.denx.de/pub/u-boot/u-boot-%{archive_version}.tar.bz2.sig
Source2: arndale-bl1.img
Source300: u-boot-rpmlintrc
Source900: update_git.sh
# Patches: start
Patch0001: 0001-XXX-openSUSE-XXX-Prepend-partition-.patch
Patch0002: 0002-Revert-Revert-omap3-Use-raw-SPL-by-.patch
Patch0003: 0003-rpi-Use-firmware-provided-device-tr.patch
Patch0004: 0004-Temp-workaround-for-Chromebook-snow.patch
Patch0005: 0005-tools-zynqmpbif-Add-support-for-loa.patch
Patch0006: 0006-Kconfig-add-btrfs-to-distro-boot.patch
Patch0007: 0007-configs-Re-sync-with-CONFIG_DISTRO_.patch
Patch0008: 0008-sunxi-dts-OrangePi-Zero-Add-SPI-ali.patch
Patch0009: 0009-sunxi-dts-OrangePi-Zero-Enable-SPI-.patch
Patch0010: 0010-Disable-CONFIG_CMD_BTRFS-in-xilinx_.patch
Patch0011: 0011-smbios-Fix-table-when-no-string-is-.patch
Patch0012: 0012-riscv-enable-CMD_BTRFS.patch
Patch0013: 0013-Disable-timer-check-in-file-loading.patch
Patch0014: 0014-Enable-EFI-and-ISO-partitions-suppo.patch
Patch0015: 0015-cmd-boot-add-brom-cmd-to-reboot-to-.patch
Patch0016: 0016-cmd-boot-add-brom-cmd-to-reboot-to-.patch
# Patches: end
BuildRequires: bc
BuildRequires: bison
# Arndale board needs DTC >= 1.4
BuildRequires: dtc >= 1.4.0
BuildRequires: flex
BuildRequires: pkgconfig
# gnutls/gnutls.h required for tools/mkeficapsule.c
BuildRequires: pkgconfig(gnutls)
# u-boot-clearfog (tools/kwbimage.c) needs openssl to build
BuildRequires: pkgconfig(openssl)
# uuid/uuid.h required for tools/mkeficapsule.c
BuildRequires: pkgconfig(uuid)
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: swig
Conflicts: u-boot-loader
Provides: u-boot-loader
%if "%_project" == "hardware:boot" || "%_project" == "hardware:boot:staging" || "%_project" == "openSUSE:Factory" || "%_project" == "openSUSE:Factory:ARM" || "%_project" == "openSUSE:Factory:PowerPC" || "%_project" == "openSUSE:Factory:RISCV" || "%_project" == "openSUSE:Leap:15.2" || "%_project" == "openSUSE:Leap:15.2:ARM" || "%_project" == "openSUSE:Leap:15.2:PowerPC"
# A complete multibuild-flavoured package is only built in above projects.
# In order to build a defined subset in forked projects, add the
# following to the respective project config (without the "#|"):
#|Macros:
#|%prjconf_multibuild_selection patch
#|:Macros
#|BuildFlags: onlybuild:u-boot:my-flavor1 onlybuild:u-boot:my-flavor2
#|BuildFlags: onlybuild:u-boot:my-flavor3 onlybuild:u-boot:my-flavor4
# If you opt to use onlybuild: to select U-Boot flavours and also
# have additional packages in that project, these need to be listed, too:
#|BuildFlags: onlybuild:package onlybuild:otherpackage onlybuild:thirdpackage
# Any packages not included in that list will neither build in that project
# nor in subprojects!
# It is still possible to enable the full multiboot set plus eventual
# additional packages by adding the Macros: [...] :Macros section and
# omitting the "onlybuild:"-lines.
%else
%if "%target" == "tools" || "%target" == ""
# At least build the tools.
%else
BuildRequires: %prjconf_multibuild_selection
%endif
%endif
%if "%target" == "tools" || "%target" == ""
Name: u-boot
%else
Name: u-boot-%target
%endif
%if 0%{?is_rk3328}
BuildRequires: arm-trusted-firmware-rk3328
# make_fit_atf.py
BuildRequires: python3-pyelftools
%endif
%if 0%{?is_rk3399}
BuildRequires: arm-trusted-firmware-rk3399
# make_fit_atf.py
BuildRequires: python3-pyelftools
%endif
%if (0%{?is_a64} || 0%{?is_h5})
BuildRequires: arm-trusted-firmware-sun50i_a64
%endif
%if 0%{?is_h6}
BuildRequires: arm-trusted-firmware-sun50i_h6
%endif
%if 0%{?is_h616}
BuildRequires: arm-trusted-firmware-sun50i_h616
%endif
%if "%target" == "tools" || "%target" == "avnetultra96rev1" || "%target" == "clearfog" || "%target" == "mvebudb-88f3720" || "%target" == "mvebudbarmada8k" || "%target" == "mvebudbarmada8k3" || "%target" == "mvebuespressobin-88f3720" || "%target" == "mvebumcbin-88f8040" || "%target" == "turrisomnia"
# Fixes ld: cannot find -ltinfo: No such file or directory
BuildRequires: ncurses-devel
%endif
%if "%{name}" == "u-boot-qemu-ppce500"
# Owns /usr/share/qemu directory
BuildRequires: qemu
Provides: qemu-ppc:%{_datadir}/qemu/u-boot.e500
%endif
%if 0%{?is_rpi}
# Owns /boot/vc directory
BuildRequires: raspberrypi-firmware
%endif
%if "%{name}" == "u-boot-zynqmp"
BuildRequires: zynqmp-dts
%endif
%if 0%{?is_rpi}
# For mountpoint
Requires(post): util-linux
%endif
%if "%{name}" == "u-boot-sifiveunleashed" || "%{name}" == "u-boot-sifiveunmatched"
BuildRequires: opensbi >= 0.9
%endif
%if %x_loader == 1
Obsoletes: x-loader-%target
Provides: x-loader-%target
%endif
%if "%{name}" == "u-boot-am335xevm"
# http://git.denx.de/?p=u-boot.git;a=commit;h=8fa7f65dd02c176ee6021eaf40114560b8954ba2
Obsoletes: am335x_boneblack
Provides: am335x_boneblack
%endif
%if "%{name}" == "u-boot-bananapim2plush3"
# http://git.denx.de/?p=u-boot.git;a=commit;h=268ae6548779ccd8ba38ce39d43f41be7e0bc133
Obsoletes: Sinovoip_BPI_M2_Plus
Provides: Sinovoip_BPI_M2_Plus
%endif
%if "%{name}" == "u-boot-rpiarm64"
Supplements: modalias(of:NfirmwareT*Craspberrypi%2Cbcm2835-firmwareC*)
# Provides one u-boot image for both RPi3 and RPi4
Obsoletes: u-boot-rpi3 < %{version}
Provides: u-boot-rpi3 = %{version}
Obsoletes: u-boot-rpi4 < %{version}
Provides: u-boot-rpi4 = %{version}
%endif
%if "%{name}" == "u-boot-xilinxzynqmpvirt"
Obsoletes: u-boot-xilinxzynqmpgeneric < %{version}
Provides: u-boot-xilinxzynqmpgeneric = %{version}
%endif
%if "%{name}" == "u-boot-sifiveunleashed"
Obsoletes: u-boot-sifivefu540 < %{version}
Provides: u-boot-sifivefu540 = %{version}
%endif
%description
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
This package contains the firmware for the %target platform.
%if %tools_only
%package tools
Summary: Tools for the U-Boot Firmware
Group: System/Boot
%description tools
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
This package contains:
mkimage- a tool that creates kernel bootable images for U-Boot.
%else
%package doc
Summary: Documentation for the U-Boot Firmware
Group: Documentation/Other
%description doc
Das U-Boot (or just "U-Boot" for short) is Open Source Firmware for Embedded PowerPC, ARM, MIPS and x86 processors.
This package contains documentation for U-Boot firmware.
%endif
%prep
%setup -q -n u-boot-%{archive_version}
%autopatch -p1
%build
%if %tools_only
# needed for include/config/auto.conf
make defconfig
make syncconfig
make %{?_smp_mflags} CFLAGS="%{optflags}" tools-only NO_SDL=y
%else
%if 0%{?is_a64} || 0%{?is_h5}
export BL31=%{_datadir}/arm-trusted-firmware-sun50i_a64/bl31.bin
export SCP=/dev/null
%endif
%if 0%{?is_h6}
export BL31=%{_datadir}/arm-trusted-firmware-sun50i_h6/bl31.bin
export SCP=/dev/null
%endif
%if 0%{?is_h616}
export BL31=%{_datadir}/arm-trusted-firmware-sun50i_h616/bl31.bin
export SCP=/dev/null
%endif
%if "%{name}" == "u-boot-sifiveunleashed" || "%{name}" == "u-boot-sifiveunmatched"
export OPENSBI=%{_datadir}/opensbi/opensbi.bin
%endif
%if 0%{?is_rk3328}
cp %{_datadir}/arm-trusted-firmware-rk3328/bl31.elf ./atf-bl31
%endif
%if 0%{?is_rk3399}
cp %{_datadir}/arm-trusted-firmware-rk3399/bl31.elf ./atf-bl31
%endif
%if %{is_zynq}
confname="xilinx_zynq_virt_defconfig"
%else
%if %{is_zynqmp}
confname="xilinx_zynqmp_virt_defconfig"
%else
confname=$(ls configs | perl -ne '$l=lc; $l=~ s,_,,g; $l eq "%{target}defconfig\n" && print;')
%endif
%endif
%if "%target" == "avnetultra96rev1"
export DEVICE_TREE=avnet-ultra96-rev1
%endif
%if "%target" == "xilinxzynqmpzcu102rev10"
export DEVICE_TREE=zynqmp-zcu102-rev1.0
%endif
%if "%target" == "zynqzturnv5"
export DEVICE_TREE=zynq-zturn-v5
%endif
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="%{optflags}" $confname
echo "Attempting to enable fdt apply command (.dtbo) support."
echo "CONFIG_OF_LIBFDT_OVERLAY=y" >> .config
%if "%target" == "rpi3"
echo "Tweaking text base for TF-A."
echo "CONFIG_SYS_TEXT_BASE=0x11000000" >> .config
%endif
make %{?_smp_mflags} CROSS_COMPILE= HOSTCFLAGS="%{optflags}" $extra_makeflags all
%if "%{name}" == "u-boot-snow" || "%{name}" == "u-boot-spring"
# Chromebook ARM (snow) and HP Chromebook 11 (spring) need a uImage format
export TEXT_START=$(awk '$NF == "_start" { printf "0x"$1 }' System.map)
./tools/mkimage -A arm -O linux -T kernel -C none -a $TEXT_START -e $TEXT_START -n uboot -d u-boot-dtb.bin u-boot.img
%endif
%if %rockchip_spl == 1
for t in %{rkimages}; do
./tools/mkimage -n %soc_name -d spl/u-boot-spl.bin -T $t u-boot-spl.$t || exit 1
done
%endif
%if %rockchip_tpl == 1
for t in %{rkimages}; do
./tools/mkimage -n %soc_name -d tpl/u-boot-tpl.bin -T $t u-boot-tpl.$t || exit 1
cat spl/u-boot-spl-dtb.bin >> u-boot-tpl.$t
done
%endif
%endif
%install
%if %tools_only
install -D -m 0755 tools/mkenvimage %{buildroot}%{_bindir}/mkenvimage
install -D -m 0755 tools/gen_ethaddr_crc %{buildroot}%{_bindir}/gen_ethaddr_crc
install -D -m 0755 tools/dumpimage %{buildroot}%{_bindir}/dumpimage
install -D -m 0755 tools/fit_info %{buildroot}%{_bindir}/fit_info
install -D -m 0755 tools/fit_check_sign %{buildroot}%{_bindir}/fit_check_sign
install -D -m 0755 tools/fdtgrep %{buildroot}%{_bindir}/fdtgrep
install -D -m 0755 tools/ifwitool %{buildroot}%{_bindir}/ifwitool
install -D -m 0755 tools/mkimage %{buildroot}%{_bindir}/mkimage
install -D -m 0644 doc/mkimage.1 %{buildroot}%{_mandir}/man1/mkimage.1
%else
export NO_BRP_STRIP_DEBUG=true
export NO_DEBUGINFO_STRIP_DEBUG=true
%define uboot_dir /boot
%if 0%{?is_rpi}
%define uboot_dir /boot/vc
%endif
%if "%{name}" == "u-boot-qemu-ppce500"
%define uboot_dir %{_datadir}/qemu
%endif
%if "%{name}" == "u-boot-jetson-tk1"
# tegra-uboot-flasher needs several intermediate files, under their original name.
for f in u-boot u-boot.dtb u-boot-dtb-tegra.bin u-boot-nodtb-tegra.bin spl/u-boot-spl; do
install -D -m 0644 $f %{buildroot}%{uboot_dir}/$f
done
%else
%if "%{name}" == "u-boot-p2371-2180"
# Jetson TX1 Driver Pack flash.sh needs several intermediate files, under their original name.
for f in u-boot u-boot.bin u-boot.dtb u-boot-dtb.bin; do
install -D -m 0644 $f %{buildroot}%{uboot_dir}/$f
done
%else
install -D -m 0644 u-boot%{binext} %{buildroot}%{uboot_dir}/u-boot%{binext}
%if 0%{?rockchip_spl}
install -D -m 0644 u-boot.itb %{buildroot}%{uboot_dir}/u-boot.itb
%endif
%if "%{name}" == "u-boot-qemu-ppce500"
mv %{buildroot}%{uboot_dir}/u-boot%{binext} %{buildroot}%{uboot_dir}/u-boot.e500
%endif
%endif
%endif
%if %x_loader == 1
install -D -m 0644 MLO %{buildroot}%{uboot_dir}/MLO
install -D -m 0644 spl/u-boot-spl.bin %{buildroot}%{uboot_dir}/u-boot-spl.bin
%endif
%if %origen_spl == 1
install -D -m 0644 spl/origen-spl.bin %{buildroot}%{uboot_dir}/origen-spl.bin
%endif
%if %arndale_spl == 1
install -D -m 0644 spl/arndale-spl.bin %{buildroot}%{uboot_dir}/arndale-spl.bin
install -D -m 0644 %{SOURCE2} %{buildroot}%{uboot_dir}/arndale-bl1.img
%endif
%if %mvebu_spl == 1
install -D -m 0644 u-boot-with-spl.kwb %{buildroot}%{uboot_dir}/u-boot-with-spl.kwb
%endif
%if %rockchip_spl == 1
install -D -m 0644 spl/u-boot-spl.bin %{buildroot}%{uboot_dir}/u-boot-spl.bin
for t in %{rkimages}; do
install -D -m 0644 u-boot-spl.$t %{buildroot}%{uboot_dir}/u-boot-spl.$t
done
%endif
%if %rockchip_tpl == 1
install -D -m 0644 tpl/u-boot-tpl.bin %{buildroot}%{uboot_dir}/u-boot-tpl.bin
for t in %{rkimages}; do
install -D -m 0644 u-boot-tpl.$t %{buildroot}%{uboot_dir}/u-boot-tpl.$t
done
%endif
%if %rockchip_idb == 1
install -D -m 0644 idbloader.img %{buildroot}%{uboot_dir}/idbloader.img
%endif
%if %sunxi_spl == 1
install -D -m 0644 spl/sunxi-spl.bin %{buildroot}%{uboot_dir}/sunxi-spl.bin
install -D -m 0644 u-boot-sunxi-with-spl.bin %{buildroot}%{uboot_dir}/u-boot-sunxi-with-spl.bin
%endif
%if %imx6_spl == 1
install -D -m 0644 SPL %{buildroot}%{uboot_dir}/imx6-spl.bin
%endif
%if %socfpga_spl == 1
install -D -m 0644 u-boot-with-spl.sfp %{buildroot}%{uboot_dir}/u-boot-with-spl.sfp
%endif
%if "%{name}" == "u-boot-zynqzturnv5"
install -D -m 0644 spl/boot.bin %{buildroot}%{uboot_dir}/boot.bin
%endif
%if "%{name}" == "u-boot-rpi3"
echo -e "# Boot in AArch64 mode\narm_64bit=1" > %{buildroot}%{uboot_dir}/ubootconfig.txt
echo -e "\nkernel_address=0x11000000" >> %{buildroot}%{uboot_dir}/ubootconfig.txt
%endif
%if "%{name}" == "u-boot-rpi4" || "%{name}" == "u-boot-rpiarm64"
echo -e "# Boot in AArch64 mode\narm_64bit=1" > %{buildroot}%{uboot_dir}/ubootconfig.txt
%endif
%if "%{name}" == "u-boot-sifiveunleashed" || "%{name}" == "u-boot-sifiveunmatched"
install -D -m 0644 spl/u-boot-spl.bin %{buildroot}%{uboot_dir}/u-boot-spl.bin
%endif
%if 0%{?is_rpi}
%post
# On the Raspberry Pi we chain-load u-boot.bin from bootcode.bin via config.txt.
# It needs to be on the first FAT partition, wherever we mounted it.
# a) Unmounted, then do nothing.
# b) Mounted as /boot/vc, then they're in the right place already.
# c) Mounted as /boot/efi, with /boot/vc as symlink, then nothing to be done.
# d) Mounted as /boot/efi, with /boot/vc a directory, then copy files over.
if mountpoint -q /boot/efi; then
if ! [[ "$(readlink -f /boot/efi)" -ef "$(readlink -f %{uboot_dir})" ]]; then
[ -f %{uboot_dir}/ubootconfig.txt ] && cp %{uboot_dir}/ubootconfig.txt /boot/efi
cp %{uboot_dir}/u-boot%{binext} /boot/efi/
fi
fi
%endif
%endif
%if %tools_only
%files tools
%else
%files
%endif
%defattr(-,root,root)
%license Licenses/gpl-2.0.txt
%if %tools_only
%{_bindir}/mkenvimage
%{_bindir}/gen_ethaddr_crc
%{_bindir}/dumpimage
%{_bindir}/fit_info
%{_bindir}/fit_check_sign
%{_bindir}/fdtgrep
%{_bindir}/ifwitool
%{_bindir}/mkimage
%{_mandir}/man1/mkimage.1.gz
%else
%doc README
%{uboot_dir}/*
%files doc
%defattr(-,root,root)
# Generic documents
%doc doc/develop/index.rst
%doc doc/usage/index.rst doc/usage/netconsole.rst
%doc doc/README.JFFS2_NAND
%doc doc/README.autoboot doc/README.console doc/README.dns
%doc doc/README.hwconfig doc/README.nand doc/README.serial_multi
%doc doc/README.SNTP doc/README.standalone doc/README.update doc/README.usb
%doc doc/README.video doc/README.VLAN doc/README.silent doc/README.POST
%doc doc/usage/*
%doc doc/board/*
# Copy some useful kermit scripts as well
%doc tools/kermit/dot.kermrc tools/kermit/flash_param tools/kermit/send_cmd tools/kermit/send_image
# Now any h/w dependent Documentation
%endif
%changelog

144
update_git.sh Normal file
View File

@ -0,0 +1,144 @@
#!/bin/bash
#
# Instead of a quilt workflow, we use a git tree that contains
# all the commits on top of a stable tarball.
#
# When updating this package, just either update the git tree
# below (use rebase!) or change the tree path and use your own
#
# That way we can easily rebase against the next stable release
# when it comes.
set -e
GIT_TREE=https://github.com/openSUSE/u-boot.git
GIT_LOCAL_TREE=~/src/opensuse/u-boot-opensuse
GIT_BRANCH=tumbleweed-2023.04
GIT_UPSTREAM_TAG=v2023.04
GIT_DIR=`mktemp -d -p /dev/shm`
CMP_DIR=`mktemp -d -p /dev/shm`
trap 'rm -rf "$GIT_DIR" "$CMP_DIR"' EXIT
if [ -d "$GIT_LOCAL_TREE" ] || [ -L "$GIT_LOCAL_TREE" ]; then
echo "Processing $GIT_BRANCH branch of local git tree, using tag:" \
"$GIT_UPSTREAM_TAG"
if ! (cd $GIT_LOCAL_TREE && git show-branch $GIT_BRANCH &>/dev/null); then
echo "Error: Branch $GIT_BRANCH not found - please create a remote" \
"tracking branch of origin/$GIT_BRANCH"
exit
fi
git clone -ls $GIT_LOCAL_TREE $GIT_DIR -b $GIT_BRANCH
if ! (cd $GIT_LOCAL_TREE && git remote show upstream &>/dev/null); then
echo "Remote for upstream git tree not found. Next time add remote" \
"named upstream for git://git.denx.de/u-boot.git and update"
(cd $GIT_DIR && git remote add upstream git://git.denx.de/u-boot.git)
(cd $GIT_DIR && git remote update)
fi
else
echo "Processing $GIT_BRANCH branch of remote git tree, using tag:" \
"$GIT_UPSTREAM_TAG"
echo "(For much faster processing, consider establishing a local git tree" \
"at $GIT_LOCAL_TREE)"
git clone $GIT_TREE $GIT_DIR -b $GIT_BRANCH
(cd $GIT_DIR && git remote add upstream git://git.denx.de/u-boot.git)
(cd $GIT_DIR && git remote update)
fi
(cd $GIT_DIR && git format-patch -N $GIT_UPSTREAM_TAG --suffix= -o $CMP_DIR >/dev/null)
UBOOT_VERSION=$(egrep '^VERSION = ' $GIT_DIR/Makefile | cut -d ' ' -f 3)
UBOOT_PATCHLEVEL=$(egrep '^PATCHLEVEL = ' $GIT_DIR/Makefile | cut -d ' ' -f 3)
UBOOT_SUBLEVEL=$(egrep '^SUBLEVEL = ' $GIT_DIR/Makefile | cut -d ' ' -f 3)
UBOOT_EXTRAVERSION=$(egrep '^EXTRAVERSION = ' $GIT_DIR/Makefile | cut -d ' ' -f 3)
UBOOT_VERSION="${UBOOT_VERSION}.${UBOOT_PATCHLEVEL}"
if [ -n "${UBOOT_SUBLEVEL}" ]; then
UBOOT_VERSION="${UBOOT_VERSION}.${UBOOT_SUBLEVEL}"
fi
UBOOT_VERSION="${UBOOT_VERSION}${UBOOT_EXTRAVERSION}"
echo "U-Boot version: $UBOOT_VERSION"
(
CHANGED_COUNT=0
UNCHANGED_COUNT=0
DELETED_COUNT=0
ADDED_COUNT=0
shopt -s nullglob
# Process patches to eliminate useless differences: limit file names to 40 chars
# before extension and remove git signature. ('32' below gets us past dir prefix)
for i in $CMP_DIR/*; do
base=`basename "$i"`
# format-patch may append a signature, which per default contains the git version
# wipe everything starting from the signature tag
sed '/^-- $/Q' $i > $CMP_DIR/${base:0:40}.patch
rm $i
done
for i in 0???-*.patch; do
if [ -e $CMP_DIR/$i ]; then
if cmp -s $CMP_DIR/$i $i; then
rm $CMP_DIR/$i
let UNCHANGED_COUNT+=1
else
mv $CMP_DIR/$i .
let CHANGED_COUNT+=1
fi
else
osc rm --force $i
let DELETED_COUNT+=1
echo " ${i##*/}" >> u-boot.changes.deleted
fi
done
for i in $CMP_DIR/*; do
mv $i .
osc add ${i##*/}
let ADDED_COUNT+=1
echo " ${i##*/}" >> u-boot.changes.added
done
# Factory requires all deleted and added patches to be mentioned
if [ -e u-boot.changes.deleted ] || [ -e u-boot.changes.added ]; then
echo "Patch queue updated from ${GIT_TREE} ${GIT_BRANCH}" > u-boot.changes.proposed
fi
if [ -e u-boot.changes.deleted ]; then
echo "* Patches dropped:" >> u-boot.changes.proposed
cat u-boot.changes.deleted >> u-boot.changes.proposed
fi
if [ -e u-boot.changes.added ]; then
echo "* Patches added:" >> u-boot.changes.proposed
cat u-boot.changes.added >> u-boot.changes.proposed
fi
if [ -e u-boot.changes.proposed ]; then
osc vc --file=u-boot.changes.proposed u-boot
rm -f u-boot.changes.proposed
fi
if [ -e u-boot.changes.deleted ]; then
rm -f u-boot.changes.deleted
fi
if [ -e u-boot.changes.added ]; then
rm -f u-boot.changes.added
fi
echo "git patch summary"
echo " unchanged: $UNCHANGED_COUNT"
echo " changed: $CHANGED_COUNT"
echo " deleted: $DELETED_COUNT"
echo " added: $ADDED_COUNT"
)
echo "Updating patch list"
# Handle patch list automatically in spec file
patch_list=`ls 0*.patch`
# Remove current patches from spec file
sed -i '/# Patches: start/,/# Patches: end/ {//!d}' u-boot.spec
# Add patches to spec file
for file in $patch_list; do
i=`echo $file | awk -F'[-.]' '{print $1}'`
sed -i "/# Patches: end/i Patch$i: $file" u-boot.spec
done
osc service localrun format_spec_file
echo "Please update version in u-boot.spec, if needed"