void-packages/srcpkgs/pinebookpro-uboot/patches/rk3399-power-led.patch

52 lines
1.6 KiB
Diff

Source: https://gitlab.manjaro.org/manjaro-arm/packages/core/uboot-pinebookpro/-/raw/master/0003-Turn-power-and-standby-LEDs-on-early.patch
Upstream: no
From 354d4f9072b5c41e91d70d1569ba364603889868 Mon Sep 17 00:00:00 2001
From: Dragan Simic <dragan.simic@gmail.com>
Date: Fri, 22 Apr 2022 03:51:56 +0200
Subject: [PATCH] Turn power and standby LEDs on early
Temporary (and ugly) hack to turn the Pinebook Pro's RGB status
LED on as early as possible during boot.
Based on a patch created by dhivael <dhivael.git@eno.space>.
---
arch/arm/mach-rockchip/rk3399/rk3399.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
index 01a05599cd..58b5cd1ce7 100644
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
@@ -20,6 +20,7 @@
#include <asm/arch-rockchip/hardware.h>
#include <linux/bitops.h>
#include <power/regulator.h>
+#include <dt-bindings/pinctrl/rockchip.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -157,6 +158,19 @@ void board_debug_uart_init(void)
GPIO_PULL_NORMAL);
}
+ {
+ /*
+ * Temporary (and ugly) hack to turn the Pinebook Pro's
+ * RGB status LED on as early as possible during boot:
+ * - 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);
+ }
+
/* Enable early UART2 channel C on the RK3399 */
rk_clrsetreg(&grf->gpio4c_iomux,
GRF_GPIO4C3_SEL_MASK,
--
2.33.1