summaryrefslogtreecommitdiff
path: root/sysutils
diff options
context:
space:
mode:
authorjmcneill <jmcneill@pkgsrc.org>2017-09-10 17:00:41 +0000
committerjmcneill <jmcneill@pkgsrc.org>2017-09-10 17:00:41 +0000
commitb9c906754ed416e2683f085604190a2628cf0bf3 (patch)
tree1e68e91637d0623847e9abd1dd6caf08aef50639 /sysutils
parent6ecfedcbe451d4f231663f187b23261ccecda84b (diff)
downloadpkgsrc-b9c906754ed416e2683f085604190a2628cf0bf3.tar.gz
Initial import of u-boot-pinebook version 2017.09rc2.
U-Boot is a bootloader 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. This package provides U-Boot for the Pine64 Pinebook.
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/u-boot-pinebook/DESCR5
-rw-r--r--sysutils/u-boot-pinebook/Makefile30
-rw-r--r--sysutils/u-boot-pinebook/PLIST2
-rw-r--r--sysutils/u-boot-pinebook/distinfo10
-rw-r--r--sysutils/u-boot-pinebook/patches/patch-arch_arm_cpu_armv8_Kconfig15
-rw-r--r--sysutils/u-boot-pinebook/patches/patch-drivers_video_sunxi_sunxi__de2.c100
-rw-r--r--sysutils/u-boot-pinebook/patches/patch-include_configs_sunxi-common.h19
-rw-r--r--sysutils/u-boot-pinebook/patches/patch-lib_bch.c13
8 files changed, 194 insertions, 0 deletions
diff --git a/sysutils/u-boot-pinebook/DESCR b/sysutils/u-boot-pinebook/DESCR
new file mode 100644
index 00000000000..dbf032fc26c
--- /dev/null
+++ b/sysutils/u-boot-pinebook/DESCR
@@ -0,0 +1,5 @@
+U-Boot is a bootloader 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.
+
+This package provides U-Boot for the Pine64 Pinebook.
diff --git a/sysutils/u-boot-pinebook/Makefile b/sysutils/u-boot-pinebook/Makefile
new file mode 100644
index 00000000000..f3ef41e3f05
--- /dev/null
+++ b/sysutils/u-boot-pinebook/Makefile
@@ -0,0 +1,30 @@
+# $NetBSD: Makefile,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+UBOOT_VERSION= 2017.09rc2
+UBOOT_TARGET= pinebook
+UBOOT_CONFIG= pinebook_defconfig
+UBOOT_BIN= u-boot-sunxi-with-spl.bin
+
+# Use anarsoul's fork of mainline U-Boot with Pinebook support patched in
+MASTER_SITES= ${MASTER_SITE_GITHUB:=anarsoul/}
+GITHUB_PROJECT= u-boot-pine64
+GITHUB_TAG= ccba9fb2248b6206cb55452b7623b964b0e02cf4
+DISTNAME= u-boot-${UBOOT_TARGET}-${UBOOT_VERSION}
+EXTRACT_SUFX= .tar.gz
+
+# Switch to EL1 before booting kernel (required for 32-bit support)
+PKG_DEFAULT_OPTIONS+= el1
+
+post-extract:
+ ${CP} ${PREFIX}/share/arm-trusted-firmware/sun50iw1p1/bl31.bin ${WRKSRC}
+
+BUILD_DEPENDS+= arm-trusted-firmware-sun50iw1p1-[0-9]*:../../sysutils/arm-trusted-firmware-sun50iw1p1
+
+post-build:
+ ${CAT} ${WRKSRC}/spl/sunxi-spl.bin ${WRKSRC}/u-boot.itb > ${WRKSRC}/u-boot-sunxi-with-spl.bin
+
+.include "../../sysutils/u-boot/u-boot-arm64.mk"
+
+# Override U-Boot defaults
+DISTINFO_FILE= ${.CURDIR}/distinfo
+PATCHDIR= ${.CURDIR}/patches
diff --git a/sysutils/u-boot-pinebook/PLIST b/sysutils/u-boot-pinebook/PLIST
new file mode 100644
index 00000000000..04b07d3e1be
--- /dev/null
+++ b/sysutils/u-boot-pinebook/PLIST
@@ -0,0 +1,2 @@
+@comment $NetBSD: PLIST,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+share/u-boot/pinebook/u-boot-sunxi-with-spl.bin
diff --git a/sysutils/u-boot-pinebook/distinfo b/sysutils/u-boot-pinebook/distinfo
new file mode 100644
index 00000000000..9610639da7c
--- /dev/null
+++ b/sysutils/u-boot-pinebook/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+SHA1 (u-boot-pinebook-2017.09rc2-ccba9fb2248b6206cb55452b7623b964b0e02cf4.tar.gz) = 7739ac071f86cd2ef61afe89390956dc05ca2ff4
+RMD160 (u-boot-pinebook-2017.09rc2-ccba9fb2248b6206cb55452b7623b964b0e02cf4.tar.gz) = b3fa5901238ac78b90c7b911f1c8a8068f57b921
+SHA512 (u-boot-pinebook-2017.09rc2-ccba9fb2248b6206cb55452b7623b964b0e02cf4.tar.gz) = 0c0c3f45b8c390c8d1e2af4db89085a0eaf6a10cda2cecdabc23db0ca4ff813229ab787f06615d89abcb8dacf5131af5d3740c26ca47e287b38f4e14411758c8
+Size (u-boot-pinebook-2017.09rc2-ccba9fb2248b6206cb55452b7623b964b0e02cf4.tar.gz) = 14440630 bytes
+SHA1 (patch-arch_arm_cpu_armv8_Kconfig) = 63cbbf2e3cebd46793fc03cc8e62297f6dc01aa9
+SHA1 (patch-drivers_video_sunxi_sunxi__de2.c) = a64bd9d6fbe075d9d01d196cfca8658d9ecd4bd2
+SHA1 (patch-include_configs_sunxi-common.h) = b71c28480cc084860d63e95af33bc7eead8ac6ac
+SHA1 (patch-lib_bch.c) = e346680a94696713f6d0e71e965283b9bdfbbdbf
diff --git a/sysutils/u-boot-pinebook/patches/patch-arch_arm_cpu_armv8_Kconfig b/sysutils/u-boot-pinebook/patches/patch-arch_arm_cpu_armv8_Kconfig
new file mode 100644
index 00000000000..b37137ac8e5
--- /dev/null
+++ b/sysutils/u-boot-pinebook/patches/patch-arch_arm_cpu_armv8_Kconfig
@@ -0,0 +1,15 @@
+$NetBSD: patch-arch_arm_cpu_armv8_Kconfig,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+--- arch/arm/cpu/armv8/Kconfig.orig 2017-07-10 17:07:38.000000000 +0000
++++ arch/arm/cpu/armv8/Kconfig
+@@ -130,6 +130,10 @@ config ARMV8_PSCI_CPUS_PER_CLUSTER
+ A value 0 or no definition of it works for single cluster system.
+ System with multi-cluster should difine their own exact value.
+
++config ARMV8_SWITCH_TO_EL1
++ bool "Switch to EL1 before booting kernel"
++ default n
++
+ if SYS_HAS_ARMV8_SECURE_BASE
+
+ config ARMV8_SECURE_BASE
diff --git a/sysutils/u-boot-pinebook/patches/patch-drivers_video_sunxi_sunxi__de2.c b/sysutils/u-boot-pinebook/patches/patch-drivers_video_sunxi_sunxi__de2.c
new file mode 100644
index 00000000000..478c7e91b9a
--- /dev/null
+++ b/sysutils/u-boot-pinebook/patches/patch-drivers_video_sunxi_sunxi__de2.c
@@ -0,0 +1,100 @@
+$NetBSD: patch-drivers_video_sunxi_sunxi__de2.c,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+sunxi: setup simplefb for Allwinner DE2
+
+Obtained from https://patchwork.ozlabs.org/patch/759922/
+
+--- drivers/video/sunxi/sunxi_de2.c.orig 2017-09-01 04:53:54.000000000 +0000
++++ drivers/video/sunxi/sunxi_de2.c
+@@ -11,6 +11,8 @@
+ #include <display.h>
+ #include <dm.h>
+ #include <edid.h>
++#include <fdtdec.h>
++#include <fdt_support.h>
+ #include <video.h>
+ #include <asm/global_data.h>
+ #include <asm/io.h>
+@@ -310,3 +312,82 @@ U_BOOT_DRIVER(sunxi_de2) = {
+ U_BOOT_DEVICE(sunxi_de2) = {
+ .name = "sunxi_de2"
+ };
++
++/*
++ * Simplefb support.
++ */
++#if defined(CONFIG_OF_BOARD_SETUP) && defined(CONFIG_VIDEO_DT_SIMPLEFB)
++int sunxi_simplefb_setup(void *blob)
++{
++ struct udevice *de2, *hdmi;
++ struct video_priv *de2_priv;
++ struct video_uc_platdata *de2_plat;
++ int mux;
++ int offset, ret;
++ u64 start, size;
++ const char *pipeline = NULL;
++
++ debug("Setting up simplefb\n");
++
++ if (IS_ENABLED(CONFIG_MACH_SUNXI_H3_H5))
++ mux = 0;
++ else
++ mux = 1;
++
++ /* Skip simplefb setting if DE2 / HDMI is not present */
++ ret = uclass_find_device_by_name(UCLASS_VIDEO,
++ "sunxi_de2", &de2);
++ if (ret) {
++ debug("DE2 not present\n");
++ return 0;
++ }
++
++ ret = uclass_find_device_by_name(UCLASS_DISPLAY,
++ "sunxi_lcd", &hdmi);
++ if (ret) {
++ debug("HDMI not present\n");
++ return 0;
++ }
++
++ if (mux == 0)
++ pipeline = "mixer0-lcd0-hdmi";
++ else
++ pipeline = "mixer1-lcd1-hdmi";
++
++ de2_priv = dev_get_uclass_priv(de2);
++ de2_plat = dev_get_uclass_platdata(de2);
++
++ /* Find a prefilled simpefb node, matching out pipeline config */
++ offset = fdt_node_offset_by_compatible(blob, -1,
++ "allwinner,simple-framebuffer");
++ while (offset >= 0) {
++ ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline",
++ pipeline);
++ if (ret == 0)
++ break;
++ offset = fdt_node_offset_by_compatible(blob, offset,
++ "allwinner,simple-framebuffer");
++ }
++ if (offset < 0) {
++ eprintf("Cannot setup simplefb: node not found\n");
++ return 0; /* Keep older kernels working */
++ }
++
++ start = gd->bd->bi_dram[0].start;
++ size = de2_plat->base - start;
++ ret = fdt_fixup_memory_banks(blob, &start, &size, 1);
++ if (ret) {
++ eprintf("Cannot setup simplefb: Error reserving memory\n");
++ return ret;
++ }
++
++ ret = fdt_setup_simplefb_node(blob, offset, de2_plat->base,
++ de2_priv->xsize, de2_priv->ysize,
++ (1 << de2_priv->bpix) / 8 * de2_priv->xsize,
++ "x8r8g8b8");
++ if (ret)
++ eprintf("Cannot setup simplefb: Error setting properties\n");
++
++ return ret;
++}
++#endif /* CONFIG_OF_BOARD_SETUP && CONFIG_VIDEO_DT_SIMPLEFB */
diff --git a/sysutils/u-boot-pinebook/patches/patch-include_configs_sunxi-common.h b/sysutils/u-boot-pinebook/patches/patch-include_configs_sunxi-common.h
new file mode 100644
index 00000000000..fadf91d12d4
--- /dev/null
+++ b/sysutils/u-boot-pinebook/patches/patch-include_configs_sunxi-common.h
@@ -0,0 +1,19 @@
+$NetBSD: patch-include_configs_sunxi-common.h,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+sunxi: setup simplefb for Allwinner DE2
+
+Obtained from https://patchwork.ozlabs.org/patch/759922/
+
+--- include/configs/sunxi-common.h.orig 2017-07-10 17:07:38.000000000 +0000
++++ include/configs/sunxi-common.h
+@@ -293,6 +293,10 @@ extern int soft_i2c_gpio_scl;
+
+ #endif /* CONFIG_VIDEO */
+
++#ifdef CONFIG_VIDEO_DE2
++#define CONFIG_VIDEO_DT_SIMPLEFB
++#endif
++
+ /* Ethernet support */
+ #ifdef CONFIG_SUNXI_EMAC
+ #define CONFIG_PHY_ADDR 1
diff --git a/sysutils/u-boot-pinebook/patches/patch-lib_bch.c b/sysutils/u-boot-pinebook/patches/patch-lib_bch.c
new file mode 100644
index 00000000000..6d15d2464f8
--- /dev/null
+++ b/sysutils/u-boot-pinebook/patches/patch-lib_bch.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-lib_bch.c,v 1.1 2017/09/10 17:00:41 jmcneill Exp $
+
+--- lib/bch.c.orig 2017-07-10 17:07:38.000000000 +0000
++++ lib/bch.c
+@@ -61,7 +61,7 @@
+ #include <linux/bitops.h>
+ #else
+ #include <errno.h>
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__) || defined(__NetBSD__)
+ #include <sys/endian.h>
+ #else
+ #include <endian.h>