From 872109cf952be0c73d6ad41007a2bae2023f04f5 Mon Sep 17 00:00:00 2001 From: Adrien Destugues Date: Sun, 13 Mar 2022 17:32:14 +0100 Subject: [PATCH] u-boot: new recipe This may become useful for the ARM port if we want something like writembr to include an u-boot image to put on install media. Until then, haikuports is just a convenient way to store my patches. --- .../patches/u_boot-2022.04.rc3.patchset | 91 +++++++++++++++++++ sys-boot/u-boot/u_boot-2022.04.rc3.recipe | 73 +++++++++++++++ 2 files changed, 164 insertions(+) create mode 100644 sys-boot/u-boot/patches/u_boot-2022.04.rc3.patchset create mode 100644 sys-boot/u-boot/u_boot-2022.04.rc3.recipe diff --git a/sys-boot/u-boot/patches/u_boot-2022.04.rc3.patchset b/sys-boot/u-boot/patches/u_boot-2022.04.rc3.patchset new file mode 100644 index 000000000..2a25ffd73 --- /dev/null +++ b/sys-boot/u-boot/patches/u_boot-2022.04.rc3.patchset @@ -0,0 +1,91 @@ +From c0f42ed759b403c785faf2b519f8d79ea6b0ad7e Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 13 Mar 2022 13:09:45 +0100 +Subject: Fix build under Haiku + +- We already define umode_t, don't redefine it. +- We have an header file named image.h which gets included instead of + the uboot one, use a more specific path. + +diff --git a/arch/arm/include/asm/types.h b/arch/arm/include/asm/types.h +index 900b261..0b7b3fa 100644 +--- a/arch/arm/include/asm/types.h ++++ b/arch/arm/include/asm/types.h +@@ -3,7 +3,7 @@ + + #include + +-typedef unsigned short umode_t; ++//typedef unsigned short umode_t; + + /* + * These aren't exported outside the kernel to avoid name space clashes +diff --git a/include/u-boot/ecdsa.h b/include/u-boot/ecdsa.h +index 6e0269e..c6bda3f 100644 +--- a/include/u-boot/ecdsa.h ++++ b/include/u-boot/ecdsa.h +@@ -7,7 +7,7 @@ + #define _ECDSA_H + + #include +-#include ++#include "../include/image.h" + #include + + /** +diff --git a/lib/hash-checksum.c b/lib/hash-checksum.c +index 8f2a42f..cf99255 100644 +--- a/lib/hash-checksum.c ++++ b/lib/hash-checksum.c +@@ -14,7 +14,7 @@ + #include "fdt_host.h" + #endif + #include +-#include ++#include "../include/image.h" + + int hash_calculate(const char *name, + const struct image_region *region, +diff --git a/tools/imagetool.h b/tools/imagetool.h +index 5169b02..4ab9f29 100644 +--- a/tools/imagetool.h ++++ b/tools/imagetool.h +@@ -21,7 +21,7 @@ + #include + #include + +-#include ++#include "../include/image.h" + + #include "fdt_host.h" + +-- +2.30.2 + + +From 30cee83e2807f1469a00376d751841b75e20e19c Mon Sep 17 00:00:00 2001 +From: Adrien Destugues +Date: Sun, 13 Mar 2022 15:04:42 +0100 +Subject: Quirk to ignore invalid video mode + +My TV has an invalid video mode in its EDID data, using it results in +incorrect timings and a black screen. Just ignore that mode (with a +pretty crude detection). + +diff --git a/drivers/video/sunxi/sunxi_display.c b/drivers/video/sunxi/sunxi_display.c +index 5a21f7a..757cd74 100644 +--- a/drivers/video/sunxi/sunxi_display.c ++++ b/drivers/video/sunxi/sunxi_display.c +@@ -289,6 +289,9 @@ static int sunxi_hdmi_edid_get_mode(struct sunxi_display_priv *sunxi_display, + + /* Take the first usable detailed timing */ + for (i = 0; i < 4; i++, t++) { ++ /* Ignore bogus EDID mode we can't handle */ ++ if (EDID_DETAILED_TIMING_VERTICAL_ACTIVE(*t) == 540 && EDID_DETAILED_TIMING_HORIZONTAL_ACTIVE(*t) == 1920) ++ continue; + r = video_edid_dtd_to_ctfb_res_modes(t, mode); + if (r == 0) + break; +-- +2.30.2 + diff --git a/sys-boot/u-boot/u_boot-2022.04.rc3.recipe b/sys-boot/u-boot/u_boot-2022.04.rc3.recipe new file mode 100644 index 000000000..4edd705de --- /dev/null +++ b/sys-boot/u-boot/u_boot-2022.04.rc3.recipe @@ -0,0 +1,73 @@ +SUMMARY="Boot loader for embedded boards" +DESCRIPTION="boot loader for embedded boards based on PowerPC, ARM, MIPS and several other \ +processors, which can be installed in a boot ROM and used to \ +initialize and test the hardware or to download and run application code. + +The development of U-Boot is closely related to Linux: some parts of \ +the source code originate in the Linux source tree, we have some \ +header files in common, and special provision has been made to \ +support booting of Linux images. + +Some attention has been paid to make this software easily \ +configurable and extendable. For instance, all monitor commands are \ +implemented with the same call interface, so that it's very easy to \ +add new commands. Also, instead of permanently adding rarely used \ +code (for instance hardware test utilities) to the monitor, you can \ +load and run it dynamically." +HOMEPAGE="https://www.denx.de/wiki/U-Boot" +COPYRIGHT="2000-2022 Wolfgang Denk, DENX Software Engineering" +LICENSE="GNU GPL v2" +SOURCE_URI="https://ftp.denx.de/pub/u-boot/u-boot-2022.04-rc3.tar.bz2" +SOURCE_DIR="u-boot-2022.04-rc3" +CHECKSUM_SHA256="4731da5228dc35827a9d9ebc8f541b01aa6af36c27be24e10aff06e596bee2de" +REVISION="1" + +ARCHITECTURES="any" + +PROVIDES=" + u_boot$secondaryArchSuffix = $portVersion + " +REQUIRES=" + " + +# The package is "any" because the result is only binaries. However, on gcc2 systems, we still need +# to build it using a modern compiler and set of libraries. +if [ "$targetArchitecture" = x86_gcc2 ]; then + hostArchSuffix="_x86" +else + hostArchSuffix="$secondaryArchSuffix" +fi + +BUILD_REQUIRES=" + haiku${hostArchSuffix}_devel + devel:libssl$hostArchSuffix + setuptools_python3 + " +BUILD_PREREQUIRES=" + cmd:arm_none_eabi_gcc + cmd:awk + cmd:bison + cmd:cmp + cmd:find + cmd:flex + cmd:gcc$hostArchSuffix + cmd:make + cmd:python3 + cmd:swig + cmd:xargs + " + +BUILD() +{ + export PATH=/bin/x86:$PATH + export HOME=/tmp + # TODO figure out how to add more boards. Are out-of-tree builds possible? + CROSS_COMPILE=arm-none-eabi- make mk802ii_defconfig + CROSS_COMPILE=arm-none-eabi- make $jobArgs +} + +INSTALL() +{ + mkdir -p $dataDir/platform_loaders + cp u-boot-sunxi-with-spl.bin $dataDir/platform_loaders/ +}