Sat Sep 2 17:38:15 2017 UTC ()
Add support for sunxi DE2 simple framebuffers.
(jmcneill)
diff -r1.2 -r1.3 pkgsrc/sysutils/u-boot/distinfo
diff -r1.1 -r1.2 pkgsrc/sysutils/u-boot-orangepi-plus2e/Makefile
diff -r0 -r1.1 pkgsrc/sysutils/u-boot/patches/patch-drivers_video_sunxi_sunxi__de2.c
diff -r0 -r1.1 pkgsrc/sysutils/u-boot/patches/patch-include_configs_sunxi-common.h
--- pkgsrc/sysutils/u-boot/distinfo 2017/08/12 16:44:33 1.2
+++ pkgsrc/sysutils/u-boot/distinfo 2017/09/02 17:38:15 1.3
| @@ -1,7 +1,9 @@ | | | @@ -1,7 +1,9 @@ |
1 | $NetBSD: distinfo,v 1.2 2017/08/12 16:44:33 jmcneill Exp $ | | 1 | $NetBSD: distinfo,v 1.3 2017/09/02 17:38:15 jmcneill Exp $ |
2 | | | 2 | |
3 | SHA1 (u-boot-2017.07.tar.bz2) = 517c33f41e2969f3b5b88e9ae3c042acfe1bde05 | | 3 | SHA1 (u-boot-2017.07.tar.bz2) = 517c33f41e2969f3b5b88e9ae3c042acfe1bde05 |
4 | RMD160 (u-boot-2017.07.tar.bz2) = b0d83a55b6daabdec28d85fdfb814a529c8d5eb9 | | 4 | RMD160 (u-boot-2017.07.tar.bz2) = b0d83a55b6daabdec28d85fdfb814a529c8d5eb9 |
5 | SHA512 (u-boot-2017.07.tar.bz2) = 821175dd414e1fd0e5b6d9293a5766cbc8ae63a2361e82309f67e92c02b881263a7832dba0bcfc820b036a582981ddc20a8f484f2995d110f3240907a3ff7a95 | | 5 | SHA512 (u-boot-2017.07.tar.bz2) = 821175dd414e1fd0e5b6d9293a5766cbc8ae63a2361e82309f67e92c02b881263a7832dba0bcfc820b036a582981ddc20a8f484f2995d110f3240907a3ff7a95 |
6 | Size (u-boot-2017.07.tar.bz2) = 11282262 bytes | | 6 | Size (u-boot-2017.07.tar.bz2) = 11282262 bytes |
| | | 7 | SHA1 (patch-drivers_video_sunxi_sunxi__de2.c) = 0e1ff9965703ef18c5e6a54a858217ad99617ea6 |
| | | 8 | SHA1 (patch-include_configs_sunxi-common.h) = b71c28480cc084860d63e95af33bc7eead8ac6ac |
7 | SHA1 (patch-lib_bch.c) = e346680a94696713f6d0e71e965283b9bdfbbdbf | | 9 | SHA1 (patch-lib_bch.c) = e346680a94696713f6d0e71e965283b9bdfbbdbf |
--- pkgsrc/sysutils/u-boot-orangepi-plus2e/Makefile 2017/08/12 14:29:11 1.1
+++ pkgsrc/sysutils/u-boot-orangepi-plus2e/Makefile 2017/09/02 17:38:15 1.2
| @@ -1,7 +1,9 @@ | | | @@ -1,7 +1,9 @@ |
1 | # $NetBSD: Makefile,v 1.1 2017/08/12 14:29:11 jmcneill Exp $ | | 1 | # $NetBSD: Makefile,v 1.2 2017/09/02 17:38:15 jmcneill Exp $ |
2 | | | 2 | |
3 | UBOOT_TARGET= orangepi-plus2e | | 3 | UBOOT_TARGET= orangepi-plus2e |
4 | UBOOT_CONFIG= orangepi_plus2e_defconfig | | 4 | UBOOT_CONFIG= orangepi_plus2e_defconfig |
5 | UBOOT_BIN= u-boot-sunxi-with-spl.bin | | 5 | UBOOT_BIN= u-boot-sunxi-with-spl.bin |
6 | | | 6 | |
| | | 7 | PKGREVISION= 1 |
| | | 8 | |
7 | .include "../../sysutils/u-boot/u-boot-arm.mk" | | 9 | .include "../../sysutils/u-boot/u-boot-arm.mk" |
$NetBSD: patch-drivers_video_sunxi_sunxi__de2.c,v 1.1 2017/09/02 17:38:15 jmcneill Exp $
sunxi: setup simplefb for Allwinner DE2
Obtained from https://patchwork.ozlabs.org/patch/759922/
--- drivers/video/sunxi/sunxi_de2.c.orig 2017-07-10 17:07:38.000000000 +0000
+++ drivers/video/sunxi/sunxi_de2.c
@@ -10,6 +10,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>
@@ -292,3 +294,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_dw_hdmi", &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 */
$NetBSD: patch-include_configs_sunxi-common.h,v 1.1 2017/09/02 17:38:15 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