Skip to content

Instantly share code, notes, and snippets.

@jsm222
Created February 24, 2022 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jsm222/5b9e110fce4e49d32667331e06428d23 to your computer and use it in GitHub Desktop.
Save jsm222/5b9e110fce4e49d32667331e06428d23 to your computer and use it in GitHub Desktop.
diff --git a/sysutils/u-boot-pinebookpro/Makefile b/sysutils/u-boot-pinebookpro/Makefile
--- a/sysutils/u-boot-pinebookpro/Makefile
+++ b/sysutils/u-boot-pinebookpro/Makefile
@@ -1,7 +1,8 @@
MASTERDIR= ${.CURDIR}/../u-boot-master
-
+PORTREVISION= 1
MODEL= pinebookpro
BOARD_CONFIG= pinebook-pro-rk3399_defconfig
FAMILY= rk3399
+EXTRA_PATCHES= ${.CURDIR}/files/
.include "${MASTERDIR}/Makefile"
diff --git a/sysutils/u-boot-pinebookpro/files/patch-board_pine64_pinebook-pro-rk3399_pinebook-pro-rk3399.c b/sysutils/u-boot-pinebookpro/files/patch-board_pine64_pinebook-pro-rk3399_pinebook-pro-rk3399.c
new file mode 100644
--- /dev/null
+++ b/sysutils/u-boot-pinebookpro/files/patch-board_pine64_pinebook-pro-rk3399_pinebook-pro-rk3399.c
@@ -0,0 +1,39 @@
+--- board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c.orig 2022-02-14 16:52:05 UTC
++++ board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c
+@@ -7,13 +7,15 @@
+ #include <common.h>
+ #include <dm.h>
+ #include <syscon.h>
++#include <linux/delay.h>
++#include <asm/gpio.h>
+ #include <asm/io.h>
+ #include <asm/arch-rockchip/clock.h>
+ #include <asm/arch-rockchip/grf_rk3399.h>
++#include <asm/arch-rockchip/gpio.h>
+ #include <asm/arch-rockchip/hardware.h>
+ #include <asm/arch-rockchip/misc.h>
+ #include <power/regulator.h>
+-
+ #define GRF_IO_VSEL_BT565_SHIFT 0
+ #define PMUGRF_CON0_VSEL_SHIFT 8
+
+@@ -59,6 +61,7 @@ int misc_init_r(void)
+ const u32 cpuid_length = 0x10;
+ u8 cpuid[cpuid_length];
+ int ret;
++ unsigned int gpio;
+
+ setup_iodomain();
+
+@@ -69,6 +72,11 @@ int misc_init_r(void)
+ ret = rockchip_cpuid_set(cpuid, cpuid_length);
+ if (ret)
+ return ret;
++
++ gpio_lookup_name("B22", NULL, NULL, &gpio);
++ gpio_direction_output(gpio, 0);
++ udelay(500000);
++ gpio_direction_output(gpio, 1);
+
+ return ret;
+ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment