diff --git a/device/testing/u-boot-samsung-i9100/0001-ARM-Use-armv7-a-instruction-set-for-ARMv7-CPUs.patch b/device/testing/u-boot-samsung-i9100/0001-ARM-Use-armv7-a-instruction-set-for-ARMv7-CPUs.patch new file mode 100644 index 000000000..79c01ae67 --- /dev/null +++ b/device/testing/u-boot-samsung-i9100/0001-ARM-Use-armv7-a-instruction-set-for-ARMv7-CPUs.patch @@ -0,0 +1,26 @@ +From 789072d9fe7d79cb04449da731c07f998255a1ed Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 12 Apr 2020 15:12:44 +0200 +Subject: [PATCH 1/3] ARM: Use armv7-a instruction set for ARMv7 CPUs + +Signed-off-by: Paul Cercueil +--- + arch/arm/cpu/armv7/config.mk | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk +index 83ddf10f1f..1aba9274b8 100644 +--- a/arch/arm/cpu/armv7/config.mk ++++ b/arch/arm/cpu/armv7/config.mk +@@ -23,7 +23,7 @@ + PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float + + # Make ARMv5 to allow more compilers to work, even though its v7a. +-PLATFORM_CPPFLAGS += -march=armv5 ++PLATFORM_CPPFLAGS += -march=armv7-a + # ========================================================================= + # + # Supply options according to compiler version +-- +2.25.1 + diff --git a/device/testing/u-boot-samsung-i9100/0002-Fix-ulong-type-not-defined.patch b/device/testing/u-boot-samsung-i9100/0002-Fix-ulong-type-not-defined.patch new file mode 100644 index 000000000..16c250948 --- /dev/null +++ b/device/testing/u-boot-samsung-i9100/0002-Fix-ulong-type-not-defined.patch @@ -0,0 +1,32 @@ +From e89504dba59f7f59f57d3346a06e708c03a1b7ca Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 12 Apr 2020 15:32:23 +0200 +Subject: [PATCH 2/3] Fix ulong type not defined + +Signed-off-by: Paul Cercueil +--- + include/compiler.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/compiler.h b/include/compiler.h +index 0734ed4942..50214ffe56 100644 +--- a/include/compiler.h ++++ b/include/compiler.h +@@ -46,13 +46,13 @@ + # include + #elif defined(__MACH__) || defined(__FreeBSD__) + # include +-typedef unsigned long ulong; + #endif + + typedef uint8_t __u8; + typedef uint16_t __u16; + typedef uint32_t __u32; + typedef unsigned int uint; ++typedef unsigned long ulong; + + #define uswap_16(x) \ + ((((x) & 0xff00) >> 8) | \ +-- +2.25.1 + diff --git a/device/testing/u-boot-samsung-i9100/0003-Galaxy-S2-Load-kernel-from-KERNEL-partition.patch b/device/testing/u-boot-samsung-i9100/0003-Galaxy-S2-Load-kernel-from-KERNEL-partition.patch new file mode 100644 index 000000000..7b22c9b21 --- /dev/null +++ b/device/testing/u-boot-samsung-i9100/0003-Galaxy-S2-Load-kernel-from-KERNEL-partition.patch @@ -0,0 +1,29 @@ +From f755c330b4062a4c3fa057f68da2a141f6e431f1 Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Sun, 12 Apr 2020 15:52:20 +0200 +Subject: [PATCH 3/3] Galaxy S2: Load kernel from KERNEL partition + +Load the kernel at a +512K offset after the start of the KERNEL +partition, the first 512 KiB being reserved for u-boot. + +Signed-off-by: Paul Cercueil +--- + include/configs/galaxys2.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/configs/galaxys2.h b/include/configs/galaxys2.h +index 2d09c584a6..70938c615f 100644 +--- a/include/configs/galaxys2.h ++++ b/include/configs/galaxys2.h +@@ -152,7 +152,7 @@ + "setenv android_cmd ${android_cmd} bootmode=2; " \ + "fi ;" \ + "mmc dev 0; " \ +- "mmc read ${loadaddr} 0x16000 0x4000; " \ ++ "mmc read ${loadaddr} 0x12400 0x3c00; " \ + "setenv bootargs ${android_cmd}; "\ + "echo Command Line: ${bootargs}; " \ + "bootm ${loadaddr}\0" \ +-- +2.25.1 + diff --git a/device/testing/u-boot-samsung-i9100/APKBUILD b/device/testing/u-boot-samsung-i9100/APKBUILD new file mode 100644 index 000000000..bc404f14f --- /dev/null +++ b/device/testing/u-boot-samsung-i9100/APKBUILD @@ -0,0 +1,42 @@ +# Reference: +# Contributor: Paul Cercueil +pkgname=u-boot-samsung-i9100 +pkgver=2012.04_rc1 +pkgrel=0 +pkgdesc="U-Boot for Samsung Galaxy SII" +arch="armv7" +_carch="arm" +license="GPL-2.0-only" +url="https://github.com/Talustus" +options="!check" +makedepends="gcc4" + +_repository="i9100-uboot" +_commit="8a10be9b0698f800cd80e6ef4be976ade0abc4da" +source="$pkgname-$_commit.tar.gz::$url/$_repository/archive/$_commit.tar.gz + 0001-ARM-Use-armv7-a-instruction-set-for-ARMv7-CPUs.patch + 0002-Fix-ulong-type-not-defined.patch + 0003-Galaxy-S2-Load-kernel-from-KERNEL-partition.patch + " + +builddir="$srcdir/$_repository-$_commit" + +prepare() { + default_prepare +} + +build() { + unset LDFLAGS + make ARCH="$_carch" HOSTCC=gcc4-gcc CC=gcc4-gcc galaxys2_config + make ARCH="$_carch" HOSTCC=gcc4-gcc CC=gcc4-gcc u-boot.bin +} + +package() { + unset LDFLAGS + install -D -m644 "$builddir"/u-boot.bin "$pkgdir"/boot/u-boot.bin +} + +sha512sums="52c1fbadf80650c508ca5d23abf37e0de7357878681200925a5971df304f4e6e093fdd6dd8e6ebf907e902390a01708dfbb7553a19c52288fbdce17a15789d8e u-boot-samsung-i9100-8a10be9b0698f800cd80e6ef4be976ade0abc4da.tar.gz +ffe9ee32de615edcab9d4f00ad3c4786fb1ba5f3d53e04554d9d202c49fece6cce8f54d2d90313e428ac023e96f14888f0b26275e029059974a5e19ecb8c6264 0001-ARM-Use-armv7-a-instruction-set-for-ARMv7-CPUs.patch +0ee5646a99f1124b37ba2e256f6f3768aaaebc6b247778f1d8e9e391840273662e48c4cac910dd4bccb7569d2be2527e8e19dfbada01a1ffff2d1fe3035c0fe8 0002-Fix-ulong-type-not-defined.patch +dcf8be0c0bbbe8ef4f34b5dd6b9ac1dee9554041dfb65da36178fb9540652a9e98663e369098764ef5bc15d799a658b3986da9bcd43f88a9dc0d855ee59db989 0003-Galaxy-S2-Load-kernel-from-KERNEL-partition.patch"