From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: dhivael <dhivael.git@eno.space>
Date: Sat, 11 Jan 2020 15:04:46 +0100
Subject: rk3399: light pinebook power and standby leds during early boot

this is a hack, but it works for now.
---
 arch/arm/mach-rockchip/rk3399/rk3399.c | 12 ++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 01a05599cd..8127e95216 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -20,6 +20,8 @@
 #include <asm/arch-rockchip/hardware.h>
 #include <linux/bitops.h>
 #include <power/regulator.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/pinctrl/rockchip.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -157,6 +159,16 @@ void board_debug_uart_init(void)
 				  GPIO_PULL_NORMAL);
 	}
 
+#ifdef CONFIG_TARGET_PINEBOOK_PRO_RK3399
+	{
+		// set GPIO0_A2/B3 to GPIO_ACTIVE_HIGH
+		// set GPIO0_A2/B3 to OUTPUT
+		int mask = (1UL << RK_PA2) | (1UL << RK_PB3);
+		setbits_le32(&gpio->swport_dr, mask);
+		setbits_le32(&gpio->swport_ddr, mask);
+	}
+#endif
+
 	/* Enable early UART2 channel C on the RK3399 */
 	rk_clrsetreg(&grf->gpio4c_iomux,
 		     GRF_GPIO4C3_SEL_MASK,
-- 
Armbian

