2020-07-15 01:59:55 +02:00
|
|
|
From 61eb4a33dfbffbf19ab5aca62533d20b0e4cba43 Mon Sep 17 00:00:00 2001
|
2020-01-18 00:25:34 +01:00
|
|
|
From: dhivael <dhivael.git@eno.space>
|
|
|
|
Date: Sat, 11 Jan 2020 15:04:46 +0100
|
2020-07-15 01:59:55 +02:00
|
|
|
Subject: [PATCH] rk3399: light pinebook power and standby leds during early
|
|
|
|
boot
|
2020-01-18 00:25:34 +01:00
|
|
|
|
|
|
|
this is a hack, but it works for now.
|
2020-07-15 01:59:55 +02:00
|
|
|
|
|
|
|
Origin: https://git.eno.space/pbp-uboot.git/commit/?id=1a01021c9361c4e017cb5b032300f5555c393710
|
2020-01-18 00:25:34 +01:00
|
|
|
---
|
|
|
|
arch/arm/mach-rockchip/rk3399/rk3399.c | 12 +++++++++++-
|
|
|
|
1 file changed, 11 insertions(+), 1 deletion(-)
|
|
|
|
|
|
|
|
diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c
|
2020-07-15 01:59:55 +02:00
|
|
|
index 4fda93b1527..952ac881711 100644
|
2020-01-18 00:25:34 +01:00
|
|
|
--- a/arch/arm/mach-rockchip/rk3399/rk3399.c
|
|
|
|
+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c
|
2020-06-22 02:13:39 +02:00
|
|
|
@@ -19,6 +19,8 @@
|
2020-01-18 00:25:34 +01:00
|
|
|
#include <asm/arch-rockchip/hardware.h>
|
2020-06-22 02:13:39 +02:00
|
|
|
#include <linux/bitops.h>
|
2020-01-18 00:25:34 +01:00
|
|
|
#include <power/regulator.h>
|
|
|
|
+#include <dt-bindings/gpio/gpio.h>
|
|
|
|
+#include <dt-bindings/pinctrl/rockchip.h>
|
|
|
|
|
|
|
|
DECLARE_GLOBAL_DATA_PTR;
|
|
|
|
|
2020-06-22 02:13:39 +02:00
|
|
|
@@ -119,8 +121,8 @@ void board_debug_uart_init(void)
|
2020-01-18 00:25:34 +01:00
|
|
|
struct rk3399_grf_regs * const grf = (void *)GRF_BASE;
|
|
|
|
#ifdef CONFIG_TARGET_CHROMEBOOK_BOB
|
|
|
|
struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
|
|
|
|
- struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
|
|
|
|
#endif
|
|
|
|
+ struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
|
|
|
|
|
|
|
|
#if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
|
|
|
|
/* Enable early UART0 on the RK3399 */
|
2020-06-22 02:13:39 +02:00
|
|
|
@@ -153,6 +155,14 @@ void board_debug_uart_init(void)
|
2020-01-18 00:25:34 +01:00
|
|
|
spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NORMAL);
|
|
|
|
#endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
|
|
|
|
|
|
|
|
+ {
|
|
|
|
+ // set GPIO0_A2/B3 to GPIO_ACTIVE_HIGH
|
|
|
|
+ // set GPIO0_A2/B3 to OUTPUT
|
2020-07-15 01:59:55 +02:00
|
|
|
+ int mask = (1UL << RK_PA2)/* | (1UL << RK_PB3) green LED */;
|
2020-01-18 00:25:34 +01:00
|
|
|
+ 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,
|
|
|
|
--
|
2020-07-15 01:59:55 +02:00
|
|
|
2.25.4
|
2020-01-18 00:25:34 +01:00
|
|
|
|