pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/sysutils/u-boot-pinebook-pro pull in various patches f...
details: https://anonhg.NetBSD.org/pkgsrc/rev/b39b6e93f93f
branches: trunk
changeset: 408950:b39b6e93f93f
user: mrg <mrg%pkgsrc.org@localhost>
date: Tue Jan 14 08:44:03 2020 +0000
description:
pull in various patches for pinebook pro that:
- turn on the power led
- reduce a timeout slightly
- possibly enable usb boot (untested)
- possibly enable sd boot from emmc uboot (untested)
from Emmanuel Vadot <manu%freebsd.org@localhost> and dhivael <dhivael.git@eno.space>
and some minor massaging from myself.
diffstat:
sysutils/u-boot-pinebook-pro/MESSAGE | 6 +-
sysutils/u-boot-pinebook-pro/Makefile | 24 +--
sysutils/u-boot-pinebook-pro/PLIST | 3 +-
sysutils/u-boot-pinebook-pro/distinfo | 10 +-
sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_dts_rk3399-pinebook-pro.dts | 71 ++++++++-
sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_mach-rockchip_rk3399_rk3399.c | 51 +++++++
sysutils/u-boot-pinebook-pro/patches/patch-configs-pinebook_pro-rk3399_defconfig | 15 +-
sysutils/u-boot-pinebook-pro/patches/patch-configs_rock64-rk3328_defconfig | 14 +
sysutils/u-boot-pinebook-pro/patches/patch-configs_rockpro64-rk3399_defconfig | 14 +
sysutils/u-boot-pinebook-pro/patches/patch-include_configs_rockchip-common.h | 48 ++++++
sysutils/u-boot-pinebook-pro/u-boot-rockchip.mk | 46 ++++++
11 files changed, 262 insertions(+), 40 deletions(-)
diffs (truncated from 456 to 300 lines):
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/MESSAGE
--- a/sysutils/u-boot-pinebook-pro/MESSAGE Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/MESSAGE Tue Jan 14 08:44:03 2020 +0000
@@ -1,10 +1,14 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.2 2020/01/06 09:43:16 mrg Exp $
+$NetBSD: MESSAGE,v 1.3 2020/01/14 08:44:03 mrg Exp $
Examples command to install U-Boot to an empty SD card:
# dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rksd_loader.img seek=64 of=/dev/rld0d
+Alternatively, to install to SPI flash:
+
+dd if=${LOCALBASE}/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0
+
You should make sure that the space is otherwise cleared of data, as old
images may fool the boot loader paths.
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/Makefile
--- a/sysutils/u-boot-pinebook-pro/Makefile Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/Makefile Tue Jan 14 08:44:03 2020 +0000
@@ -1,23 +1,11 @@
-# $NetBSD: Makefile,v 1.2 2020/01/06 09:43:16 mrg Exp $
+# $NetBSD: Makefile,v 1.3 2020/01/14 08:44:03 mrg Exp $
-PKGREVISION= 1
+PKGREVISION= 1
+
UBOOT_TARGET= pinebook-pro
UBOOT_CONFIG= pinebook_pro-rk3399_defconfig
-UBOOT_BIN= idbloader.img u-boot.itb rksd_loader.img
-
-UBOOT_VERSION= 2020.01-rc5
-
-DISTINFO_FILE= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/distinfo
-PATCHDIR= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/patches
-
-USE_TOOLS+= gawk
+UBOOT_BIN= idbloader.img rksd_loader.img rkspi_loader.img u-boot.itb
-MAKE_ENV+= BL31=${PREFIX}/share/arm-trusted-firmware/rk3399/bl31.elf
+U_BOOT_IMAGE_TYPE= rk3399
-post-build:
-# wrap everything up into a single file that can be written to an SD card
- cp ${WRKSRC}/idbloader.img ${WRKSRC}/rksd_loader.img
- dd if=${WRKSRC}/u-boot.itb seek=448 conv=notrunc of=${WRKSRC}/rksd_loader.img
-
-.include "../../sysutils/arm-trusted-firmware-rk3399/buildlink3.mk"
-.include "../../sysutils/u-boot/u-boot-arm64.mk"
+.include "../../sysutils/u-boot-pinebook-pro/u-boot-rockchip.mk"
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/PLIST
--- a/sysutils/u-boot-pinebook-pro/PLIST Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/PLIST Tue Jan 14 08:44:03 2020 +0000
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.2 2020/01/06 09:43:16 mrg Exp $
+@comment $NetBSD: PLIST,v 1.3 2020/01/14 08:44:03 mrg Exp $
share/u-boot/pinebook-pro/idbloader.img
share/u-boot/pinebook-pro/rksd_loader.img
+share/u-boot/pinebook-pro/rkspi_loader.img
share/u-boot/pinebook-pro/u-boot.itb
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/distinfo
--- a/sysutils/u-boot-pinebook-pro/distinfo Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/distinfo Tue Jan 14 08:44:03 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.2 2020/01/06 09:43:16 mrg Exp $
+$NetBSD: distinfo,v 1.3 2020/01/14 08:44:03 mrg Exp $
SHA1 (u-boot-2020.01-rc5.tar.bz2) = 464dec492bd12bf561468b5560d5465bee708de1
RMD160 (u-boot-2020.01-rc5.tar.bz2) = 2fd9b608a182a783e7e1e07003d2303376de7b4f
@@ -6,11 +6,15 @@
Size (u-boot-2020.01-rc5.tar.bz2) = 14703368 bytes
SHA1 (patch-arch_arm_dts_Makefile) = b0f39f16c87b51490fcc5f27dc2b720c2b5a5076
SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro-u-boot.dtsi) = 50e461b2da4b763a853fa66e90fe39465d8f65cc
-SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro.dts) = a8dd5b7569a5ca849fb907633b57f249ac68f2a7
+SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro.dts) = d5e240e5a6c79fbc33ab838bf33c356adc7a5b55
SHA1 (patch-arch_arm_mach-rockchip_rk3399_Kconfig) = 5db42b2120030bd6deae15bad020bc216283606e
+SHA1 (patch-arch_arm_mach-rockchip_rk3399_rk3399.c) = 109ab42dd22ffb23d19f2cf77bc8bb113749d867
SHA1 (patch-board_pine64_pinebook_pro_rk3399_Kconfig) = 50f0a64ec93446bc962712643b6d9734321be0ff
SHA1 (patch-board_pine64_pinebook_pro_rk3399_MAINTAINERS) = 81933bcfb75ec0a28f92d7c9823982dae075b699
SHA1 (patch-board_pine64_pinebook_pro_rk3399_Makefile) = 9dca0a93221ae2a7fa6a6a1794e22750ab105e07
SHA1 (patch-board_pine64_pinebook_pro_rk3399_pinebook-pro-rk3399.c) = f06846db31ce5f07f9aa77019efb5b6ca6dc8966
-SHA1 (patch-configs-pinebook_pro-rk3399_defconfig) = 33232c1b62e6ce5974251b2e477f28413ef99d0d
+SHA1 (patch-configs-pinebook_pro-rk3399_defconfig) = 0dbc684b30470f96d10db914e9c3631948be5528
+SHA1 (patch-configs_rock64-rk3328_defconfig) = a32cd0e440b0bfd0b8bb00d463eac3b3c99ce9d0
+SHA1 (patch-configs_rockpro64-rk3399_defconfig) = 0775662b76d8875845d75294e43a2897fad6740e
SHA1 (patch-include-configs-pinebook_pro_rk3399.h) = a8edaa170fb6403a912d6ddda11e3e37c8b2442c
+SHA1 (patch-include_configs_rockchip-common.h) = c619b01d9f1303ed2105b2673122be10b6d141aa
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_dts_rk3399-pinebook-pro.dts
--- a/sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_dts_rk3399-pinebook-pro.dts Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_dts_rk3399-pinebook-pro.dts Tue Jan 14 08:44:03 2020 +0000
@@ -1,13 +1,35 @@
-$NetBSD: patch-arch_arm_dts_rk3399-pinebook-pro.dts,v 1.1 2020/01/06 08:41:44 mrg Exp $
+$NetBSD: patch-arch_arm_dts_rk3399-pinebook-pro.dts,v 1.2 2020/01/14 08:44:03 mrg Exp $
Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/
-diff --git arch/arm/dts/rk3399-pinebook-pro.dts arch/arm/dts/rk3399-pinebook-pro.dts
-new file mode 100644
-index 0000000000..85ce0206d7
---- /dev/null
-+++ arch/arm/dts/rk3399-pinebook-pro.dts
-@@ -0,0 +1,631 @@
+commit 2778aa7cb70946c4729ed6ae13dea5bd1cc688dc
+Author: dhivael <dhivael.git@eno.space>
+Date: Sat Jan 11 15:02:44 2020 +0100
+
+ rk3399: pinebook: fix sdcard boot from emmc
+
+ booting from emmc does not set all DT properties required for the sd
+ slot to function properly. this is a copy of the linux DT configuration
+ for the slot now.
+
+commit fd41e9330cf1635fa3bf4dabdfac42ee1bba963c
+Author: Emmanuel Vadot <manu%freebsd.org@localhost>
+Date: Tue Dec 31 22:13:03 2019 +0100
+
+ PBP: Add regulator needed for usb
+
+ The schematics indicate that the vcc3v3_s0 voltage is controlled by
+ the LDO2 of the RK808 but this isn't true.
+ It's controller by a gpio (named lcdvcc_en).
+ Remove the name from the RK808 regulator and add a regulator-fixed
+ controller by this gpio.
+
+ Signed-off-by: Emmanuel Vadot <manu%freebsd.org@localhost>
+
+
+--- arch/arm/dts/rk3399-pinebook-pro.dts.orig 2020-01-13 16:59:26.353181190 -0800
++++ arch/arm/dts/rk3399-pinebook-pro.dts 2020-01-13 23:16:08.263344492 -0800
+@@ -0,0 +1,660 @@
+/*
+ * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
+ *
@@ -54,6 +76,7 @@
+ };
+ };
+
++ /*
+ leds {
+ status = "okay";
+ compatible = "gpio-leds";
@@ -68,6 +91,7 @@
+ gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>;
+ };
+ };
++ */
+
+ sdio_pwrseq: sdio-pwrseq {
+ compatible = "mmc-pwrseq-simple";
@@ -75,6 +99,8 @@
+ clock-names = "ext_clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_enable_h>;
++ power-off-delay-us = <500000>;
++ post-power-on-delay-ms = <100>;
+
+ /*
+ * On the module itself this is one of these (depending
@@ -133,6 +159,16 @@
+ regulator-always-on;
+ };
+
++ vcc3v3_s0: vcc3v3-s0-regulator {
++ compatible = "regulator-fixed";
++ enable-active-high;
++ gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&lcdvcc_en>;
++ regulator-name = "vcc3v3_s0";
++ regulator-always-on;
++ };
++
+ vcc_sys: vcc-sys {
+ compatible = "regulator-fixed";
+ regulator-name = "vcc_sys";
@@ -355,8 +391,8 @@
+ };
+ };
+
-+ vcc3v3_s0: SWITCH_REG2 {
-+ regulator-name = "vcc3v3_s0";
++ unused: SWITCH_REG2 {
++ regulator-name = "SWITCH_REG2";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-state-mem {
@@ -492,6 +528,11 @@
+ host_usb3_drv: host-usb3-drv {
+ rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
++
++ /* Shared between LCD and usb */
++ lcdvcc_en: lcdvcc-en {
++ rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>;
++ };
+ };
+};
+
@@ -513,8 +554,16 @@
+
+&sdmmc {
+ bus-width = <4>;
++ cap-mmc-highspeed;
++ cap-sd-highspeed;
++ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
++ disable-wp;
++ sd-uhs-sdr104;
++ max-frequency = <20000000>;
++ vqmmc-supply = <&vcc_sdio>;
++ pinctrl-names = "default";
++ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
+ status = "okay";
-+ max-frequency = <20000000>;
+};
+
+&sdhci {
@@ -581,10 +630,12 @@
+};
+
+&usb_host1_ehci {
++ phy-supply = <&vcc3v3_s0>;
+ status = "okay";
+};
+
+&usb_host1_ohci {
++ phy-supply = <&vcc3v3_s0>;
+ status = "okay";
+};
+
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_mach-rockchip_rk3399_rk3399.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysutils/u-boot-pinebook-pro/patches/patch-arch_arm_mach-rockchip_rk3399_rk3399.c Tue Jan 14 08:44:03 2020 +0000
@@ -0,0 +1,51 @@
+$NetBSD: patch-arch_arm_mach-rockchip_rk3399_rk3399.c,v 1.1 2020/01/14 08:44:03 mrg Exp $
+
+adjusted by mrg to restrict to CONFIG_TARGET_PINEBOOK_PRO_RK3399.
+
+
+Author: dhivael <dhivael.git@eno.space>
+Date: Sat Jan 11 15:04:46 2020 +0100
+
+ 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.orig 2019-12-16 04:39:56.000000000 -0800
++++ arch/arm/mach-rockchip/rk3399/rk3399.c 2020-01-13 23:15:15.174280309 -0800
+@@ -15,6 +15,8 @@
+ #include <asm/arch-rockchip/grf_rk3399.h>
+ #include <asm/arch-rockchip/hardware.h>
+ #include <power/regulator.h>
++#include <dt-bindings/gpio/gpio.h>
++#include <dt-bindings/pinctrl/rockchip.h>
+
+ DECLARE_GLOBAL_DATA_PTR;
+
+@@ -117,6 +119,9 @@
+ struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE;
+ struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
+ #endif
++#ifdef CONFIG_TARGET_PINEBOOK_PRO_RK3399
++ struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE;
++#endif
+
+ #if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000)
+ /* Enable early UART0 on the RK3399 */
+@@ -149,6 +154,16 @@
+ spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NORMAL);
+ #endif /* CONFIG_TARGET_CHROMEBOOK_BOB */
+
++#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,
diff -r b1516662ca2d -r b39b6e93f93f sysutils/u-boot-pinebook-pro/patches/patch-configs-pinebook_pro-rk3399_defconfig
--- a/sysutils/u-boot-pinebook-pro/patches/patch-configs-pinebook_pro-rk3399_defconfig Tue Jan 14 08:30:20 2020 +0000
+++ b/sysutils/u-boot-pinebook-pro/patches/patch-configs-pinebook_pro-rk3399_defconfig Tue Jan 14 08:44:03 2020 +0000
@@ -1,12 +1,13 @@
-$NetBSD: patch-configs-pinebook_pro-rk3399_defconfig,v 1.2 2020/01/06 09:43:16 mrg Exp $
+$NetBSD: patch-configs-pinebook_pro-rk3399_defconfig,v 1.3 2020/01/14 08:44:03 mrg Exp $
Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/
-diff --git configs/pinebook_pro-rk3399_defconfig configs/pinebook_pro-rk3399_defconfig
-new file mode 100644
-index 0000000000..28577256e7
---- /dev/null
-+++ configs/pinebook_pro-rk3399_defconfig
Home |
Main Index |
Thread Index |
Old Index