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> and dhivael <dhivael.git@eno.space> and some minor massaging from myself.diff -r1.2 -r1.3 pkgsrc/sysutils/u-boot-pinebook-pro/MESSAGE
(mrg)
@@ -1,13 +1,17 @@ | @@ -1,13 +1,17 @@ | |||
1 | =========================================================================== | 1 | =========================================================================== | |
2 | $NetBSD: MESSAGE,v 1.2 2020/01/06 09:43:16 mrg Exp $ | 2 | $NetBSD: MESSAGE,v 1.3 2020/01/14 08:44:03 mrg Exp $ | |
3 | 3 | |||
4 | Examples command to install U-Boot to an empty SD card: | 4 | Examples command to install U-Boot to an empty SD card: | |
5 | 5 | |||
6 | # dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rksd_loader.img seek=64 of=/dev/rld0d | 6 | # dd if=${LOCALBASE}/share/u-boot/pinebook-pro/rksd_loader.img seek=64 of=/dev/rld0d | |
7 | 7 | |||
8 | Alternatively, to install to SPI flash: | |||
9 | ||||
10 | dd if=${LOCALBASE}/share/u-boot/rockpro64/rkspi_loader.img bs=64k of=/dev/spiflash0 | |||
11 | ||||
8 | You should make sure that the space is otherwise cleared of data, as old | 12 | You should make sure that the space is otherwise cleared of data, as old | |
9 | images may fool the boot loader paths. | 13 | images may fool the boot loader paths. | |
10 | 14 | |||
11 | See also http://opensource.rock-chips.com/wiki_Boot_option | 15 | See also http://opensource.rock-chips.com/wiki_Boot_option | |
12 | 16 | |||
13 | =========================================================================== | 17 | =========================================================================== |
@@ -1,23 +1,11 @@ | @@ -1,23 +1,11 @@ | |||
1 | # $NetBSD: Makefile,v 1.2 2020/01/06 09:43:16 mrg Exp $ | 1 | # $NetBSD: Makefile,v 1.3 2020/01/14 08:44:03 mrg Exp $ | |
2 | ||||
3 | PKGREVISION= 1 | |||
2 | 4 | |||
3 | PKGREVISION= 1 | |||
4 | UBOOT_TARGET= pinebook-pro | 5 | UBOOT_TARGET= pinebook-pro | |
5 | UBOOT_CONFIG= pinebook_pro-rk3399_defconfig | 6 | UBOOT_CONFIG= pinebook_pro-rk3399_defconfig | |
6 | UBOOT_BIN= idbloader.img u-boot.itb rksd_loader.img | 7 | UBOOT_BIN= idbloader.img rksd_loader.img rkspi_loader.img u-boot.itb | |
7 | ||||
8 | UBOOT_VERSION= 2020.01-rc5 | |||
9 | ||||
10 | DISTINFO_FILE= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/distinfo | |||
11 | PATCHDIR= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/patches | |||
12 | ||||
13 | USE_TOOLS+= gawk | |||
14 | ||||
15 | MAKE_ENV+= BL31=${PREFIX}/share/arm-trusted-firmware/rk3399/bl31.elf | |||
16 | 8 | |||
17 | post-build: | 9 | U_BOOT_IMAGE_TYPE= rk3399 | |
18 | # wrap everything up into a single file that can be written to an SD card | |||
19 | cp ${WRKSRC}/idbloader.img ${WRKSRC}/rksd_loader.img | |||
20 | dd if=${WRKSRC}/u-boot.itb seek=448 conv=notrunc of=${WRKSRC}/rksd_loader.img | |||
21 | 10 | |||
22 | .include "../../sysutils/arm-trusted-firmware-rk3399/buildlink3.mk" | 11 | .include "../../sysutils/u-boot-pinebook-pro/u-boot-rockchip.mk" | |
23 | .include "../../sysutils/u-boot/u-boot-arm64.mk" |
@@ -1,4 +1,5 @@ | @@ -1,4 +1,5 @@ | |||
1 | @comment $NetBSD: PLIST,v 1.2 2020/01/06 09:43:16 mrg Exp $ | 1 | @comment $NetBSD: PLIST,v 1.3 2020/01/14 08:44:03 mrg Exp $ | |
2 | share/u-boot/pinebook-pro/idbloader.img | 2 | share/u-boot/pinebook-pro/idbloader.img | |
3 | share/u-boot/pinebook-pro/rksd_loader.img | 3 | share/u-boot/pinebook-pro/rksd_loader.img | |
4 | share/u-boot/pinebook-pro/rkspi_loader.img | |||
4 | share/u-boot/pinebook-pro/u-boot.itb | 5 | share/u-boot/pinebook-pro/u-boot.itb |
@@ -1,16 +1,20 @@ | @@ -1,16 +1,20 @@ | |||
1 | $NetBSD: distinfo,v 1.2 2020/01/06 09:43:16 mrg Exp $ | 1 | $NetBSD: distinfo,v 1.3 2020/01/14 08:44:03 mrg Exp $ | |
2 | 2 | |||
3 | SHA1 (u-boot-2020.01-rc5.tar.bz2) = 464dec492bd12bf561468b5560d5465bee708de1 | 3 | SHA1 (u-boot-2020.01-rc5.tar.bz2) = 464dec492bd12bf561468b5560d5465bee708de1 | |
4 | RMD160 (u-boot-2020.01-rc5.tar.bz2) = 2fd9b608a182a783e7e1e07003d2303376de7b4f | 4 | RMD160 (u-boot-2020.01-rc5.tar.bz2) = 2fd9b608a182a783e7e1e07003d2303376de7b4f | |
5 | SHA512 (u-boot-2020.01-rc5.tar.bz2) = f39ef40e4a8a030a779d1732bb588fba808140c91d4d92b6228f752b58ecbbdb90a4b8feae1646a42c64ba044d6c503228f877b33e221330b3f96f3c9006d60a | 5 | SHA512 (u-boot-2020.01-rc5.tar.bz2) = f39ef40e4a8a030a779d1732bb588fba808140c91d4d92b6228f752b58ecbbdb90a4b8feae1646a42c64ba044d6c503228f877b33e221330b3f96f3c9006d60a | |
6 | Size (u-boot-2020.01-rc5.tar.bz2) = 14703368 bytes | 6 | Size (u-boot-2020.01-rc5.tar.bz2) = 14703368 bytes | |
7 | SHA1 (patch-arch_arm_dts_Makefile) = b0f39f16c87b51490fcc5f27dc2b720c2b5a5076 | 7 | SHA1 (patch-arch_arm_dts_Makefile) = b0f39f16c87b51490fcc5f27dc2b720c2b5a5076 | |
8 | SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro-u-boot.dtsi) = 50e461b2da4b763a853fa66e90fe39465d8f65cc | 8 | SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro-u-boot.dtsi) = 50e461b2da4b763a853fa66e90fe39465d8f65cc | |
9 | SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro.dts) = a8dd5b7569a5ca849fb907633b57f249ac68f2a7 | 9 | SHA1 (patch-arch_arm_dts_rk3399-pinebook-pro.dts) = d5e240e5a6c79fbc33ab838bf33c356adc7a5b55 | |
10 | SHA1 (patch-arch_arm_mach-rockchip_rk3399_Kconfig) = 5db42b2120030bd6deae15bad020bc216283606e | 10 | SHA1 (patch-arch_arm_mach-rockchip_rk3399_Kconfig) = 5db42b2120030bd6deae15bad020bc216283606e | |
11 | SHA1 (patch-arch_arm_mach-rockchip_rk3399_rk3399.c) = 109ab42dd22ffb23d19f2cf77bc8bb113749d867 | |||
11 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_Kconfig) = 50f0a64ec93446bc962712643b6d9734321be0ff | 12 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_Kconfig) = 50f0a64ec93446bc962712643b6d9734321be0ff | |
12 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_MAINTAINERS) = 81933bcfb75ec0a28f92d7c9823982dae075b699 | 13 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_MAINTAINERS) = 81933bcfb75ec0a28f92d7c9823982dae075b699 | |
13 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_Makefile) = 9dca0a93221ae2a7fa6a6a1794e22750ab105e07 | 14 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_Makefile) = 9dca0a93221ae2a7fa6a6a1794e22750ab105e07 | |
14 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_pinebook-pro-rk3399.c) = f06846db31ce5f07f9aa77019efb5b6ca6dc8966 | 15 | SHA1 (patch-board_pine64_pinebook_pro_rk3399_pinebook-pro-rk3399.c) = f06846db31ce5f07f9aa77019efb5b6ca6dc8966 | |
15 | SHA1 (patch-configs-pinebook_pro-rk3399_defconfig) = 33232c1b62e6ce5974251b2e477f28413ef99d0d | 16 | SHA1 (patch-configs-pinebook_pro-rk3399_defconfig) = 0dbc684b30470f96d10db914e9c3631948be5528 | |
17 | SHA1 (patch-configs_rock64-rk3328_defconfig) = a32cd0e440b0bfd0b8bb00d463eac3b3c99ce9d0 | |||
18 | SHA1 (patch-configs_rockpro64-rk3399_defconfig) = 0775662b76d8875845d75294e43a2897fad6740e | |||
16 | SHA1 (patch-include-configs-pinebook_pro_rk3399.h) = a8edaa170fb6403a912d6ddda11e3e37c8b2442c | 19 | SHA1 (patch-include-configs-pinebook_pro_rk3399.h) = a8edaa170fb6403a912d6ddda11e3e37c8b2442c | |
20 | SHA1 (patch-include_configs_rockchip-common.h) = c619b01d9f1303ed2105b2673122be10b6d141aa |
# $NetBSD: u-boot-rockchip.mk,v 1.1 2020/01/14 08:44:03 mrg Exp $
#
# should be used by sysutils/u-boot-rock64/Makefile
# used by sysutils/u-boot-rockpro64/Makefile
# used by sysutils/u-boot-pinebook-pro/Makefile
# Common makefile fragment for rockchip based u-boot targets.
#
# Set these variables:
#
# U_BOOT_IMAGE_TYPE ("rk3399", "rk3328")
#
UBOOT_VERSION?= 2020.01-rc5
# Patches kept in pinebook-pro; first worked there.
DISTINFO_FILE?= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/distinfo
PATCHDIR?= ${.CURDIR}/../../sysutils/u-boot-pinebook-pro/patches
MAKE_ENV+= BL31=${PREFIX}/share/arm-trusted-firmware/${U_BOOT_IMAGE_TYPE}/bl31.elf
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
# build SPI NOR flash image. See dev-ayufan/build.mk.
set -e; b=0; while [ "$$b" != 128 ]; do \
dd bs=2k count=1; \
dd if=/dev/zero bs=2k count=1; \
b=$$(expr $$b + 1); \
done < ${WRKSRC}/idbloader.img > ${WRKSRC}/rkspi_loader.img 2> /dev/null
dd if=${WRKSRC}/u-boot.itb seek=1024 conv=notrunc of=${WRKSRC}/rkspi_loader.img
SUBST_CLASSES+= makefitpath
SUBST_STAGE.makefitpath= pre-configure
SUBST_FILES.makefitpath= arch/arm/mach-rockchip/make_fit_atf.py
SUBST_SED.makefitpath= -e "s| python3| python|g"
PYTHON_VERSIONS_ACCEPTED+= 37 38
REPLACE_INTERPRETER+= python3
REPLACE.python3.old= python3
REPLACE.python3.new= ${PYTHON3BIN}
REPLACE_FILES.python2= arch/arm/mach-rockchip/make_fit_atf.py
.include "../../sysutils/u-boot/u-boot-arm64.mk"
.include "../../sysutils/arm-trusted-firmware-${U_BOOT_IMAGE_TYPE}/buildlink3.mk"
@@ -1,23 +1,45 @@ | @@ -1,23 +1,45 @@ | |||
1 | $NetBSD: patch-arch_arm_dts_rk3399-pinebook-pro.dts,v 1.1 2020/01/06 08:41:44 mrg Exp $ | 1 | $NetBSD: patch-arch_arm_dts_rk3399-pinebook-pro.dts,v 1.2 2020/01/14 08:44:03 mrg Exp $ | |
2 | 2 | |||
3 | Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/ | 3 | Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/ | |
4 | 4 | |||
5 | diff --git arch/arm/dts/rk3399-pinebook-pro.dts arch/arm/dts/rk3399-pinebook-pro.dts | 5 | commit 2778aa7cb70946c4729ed6ae13dea5bd1cc688dc | |
6 | new file mode 100644 | 6 | Author: dhivael <dhivael.git@eno.space> | |
7 | index 0000000000..85ce0206d7 | 7 | Date: Sat Jan 11 15:02:44 2020 +0100 | |
8 | --- /dev/null | 8 | ||
9 | +++ arch/arm/dts/rk3399-pinebook-pro.dts | 9 | rk3399: pinebook: fix sdcard boot from emmc | |
10 | @@ -0,0 +1,631 @@ | 10 | ||
11 | booting from emmc does not set all DT properties required for the sd | |||
12 | slot to function properly. this is a copy of the linux DT configuration | |||
13 | for the slot now. | |||
14 | ||||
15 | commit fd41e9330cf1635fa3bf4dabdfac42ee1bba963c | |||
16 | Author: Emmanuel Vadot <manu@freebsd.org> | |||
17 | Date: Tue Dec 31 22:13:03 2019 +0100 | |||
18 | ||||
19 | PBP: Add regulator needed for usb | |||
20 | ||||
21 | The schematics indicate that the vcc3v3_s0 voltage is controlled by | |||
22 | the LDO2 of the RK808 but this isn't true. | |||
23 | It's controller by a gpio (named lcdvcc_en). | |||
24 | Remove the name from the RK808 regulator and add a regulator-fixed | |||
25 | controller by this gpio. | |||
26 | ||||
27 | Signed-off-by: Emmanuel Vadot <manu@freebsd.org> | |||
28 | ||||
29 | ||||
30 | --- arch/arm/dts/rk3399-pinebook-pro.dts.orig 2020-01-13 16:59:26.353181190 -0800 | |||
31 | +++ arch/arm/dts/rk3399-pinebook-pro.dts 2020-01-13 23:16:08.263344492 -0800 | |||
32 | @@ -0,0 +1,660 @@ | |||
11 | +/* | 33 | +/* | |
12 | + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. | 34 | + * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. | |
13 | + * | 35 | + * | |
14 | + * SPDX-License-Identifier: GPL-2.0+ | 36 | + * SPDX-License-Identifier: GPL-2.0+ | |
15 | + */ | 37 | + */ | |
16 | + | 38 | + | |
17 | +/dts-v1/; | 39 | +/dts-v1/; | |
18 | +#include <dt-bindings/input/linux-event-codes.h> | 40 | +#include <dt-bindings/input/linux-event-codes.h> | |
19 | +#include <dt-bindings/pwm/pwm.h> | 41 | +#include <dt-bindings/pwm/pwm.h> | |
20 | +#include <dt-bindings/pinctrl/rockchip.h> | 42 | +#include <dt-bindings/pinctrl/rockchip.h> | |
21 | +#include "rk3399.dtsi" | 43 | +#include "rk3399.dtsi" | |
22 | +#include "rk3399-opp.dtsi" | 44 | +#include "rk3399-opp.dtsi" | |
23 | + | 45 | + | |
@@ -44,47 +66,51 @@ index 0000000000..85ce0206d7 | @@ -44,47 +66,51 @@ index 0000000000..85ce0206d7 | |||
44 | + autorepeat; | 66 | + autorepeat; | |
45 | + pinctrl-names = "default"; | 67 | + pinctrl-names = "default"; | |
46 | + pinctrl-0 = <&pwrbtn>; | 68 | + pinctrl-0 = <&pwrbtn>; | |
47 | + | 69 | + | |
48 | + power { | 70 | + power { | |
49 | + debounce-interval = <100>; | 71 | + debounce-interval = <100>; | |
50 | + gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; | 72 | + gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; | |
51 | + label = "GPIO Key Power"; | 73 | + label = "GPIO Key Power"; | |
52 | + linux,code = <KEY_POWER>; | 74 | + linux,code = <KEY_POWER>; | |
53 | + wakeup-source; | 75 | + wakeup-source; | |
54 | + }; | 76 | + }; | |
55 | + }; | 77 | + }; | |
56 | + | 78 | + | |
79 | + /* | |||
57 | + leds { | 80 | + leds { | |
58 | + status = "okay"; | 81 | + status = "okay"; | |
59 | + compatible = "gpio-leds"; | 82 | + compatible = "gpio-leds"; | |
60 | + | 83 | + | |
61 | + work-led { | 84 | + work-led { | |
62 | + label = "work"; | 85 | + label = "work"; | |
63 | + gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; | 86 | + gpios = <&gpio0 RK_PB3 GPIO_ACTIVE_HIGH>; | |
64 | + }; | 87 | + }; | |
65 | + | 88 | + | |
66 | + standby-led { | 89 | + standby-led { | |
67 | + label = "standby"; | 90 | + label = "standby"; | |
68 | + gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; | 91 | + gpios = <&gpio0 RK_PA2 GPIO_ACTIVE_HIGH>; | |
69 | + }; | 92 | + }; | |
70 | + }; | 93 | + }; | |
94 | + */ | |||
71 | + | 95 | + | |
72 | + sdio_pwrseq: sdio-pwrseq { | 96 | + sdio_pwrseq: sdio-pwrseq { | |
73 | + compatible = "mmc-pwrseq-simple"; | 97 | + compatible = "mmc-pwrseq-simple"; | |
74 | + clocks = <&rk808 1>; | 98 | + clocks = <&rk808 1>; | |
75 | + clock-names = "ext_clock"; | 99 | + clock-names = "ext_clock"; | |
76 | + pinctrl-names = "default"; | 100 | + pinctrl-names = "default"; | |
77 | + pinctrl-0 = <&wifi_enable_h>; | 101 | + pinctrl-0 = <&wifi_enable_h>; | |
102 | + power-off-delay-us = <500000>; | |||
103 | + post-power-on-delay-ms = <100>; | |||
78 | + | 104 | + | |
79 | + /* | 105 | + /* | |
80 | + * On the module itself this is one of these (depending | 106 | + * On the module itself this is one of these (depending | |
81 | + * on the actual card populated): | 107 | + * on the actual card populated): | |
82 | + * - SDIO_RESET_L_WL_REG_ON | 108 | + * - SDIO_RESET_L_WL_REG_ON | |
83 | + * - PDN (power down when low) | 109 | + * - PDN (power down when low) | |
84 | + */ | 110 | + */ | |
85 | + reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; | 111 | + reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; | |
86 | + }; | 112 | + }; | |
87 | + | 113 | + | |
88 | + /* switched by pmic_sleep */ | 114 | + /* switched by pmic_sleep */ | |
89 | + vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 { | 115 | + vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 { | |
90 | + compatible = "regulator-fixed"; | 116 | + compatible = "regulator-fixed"; | |
@@ -123,26 +149,36 @@ index 0000000000..85ce0206d7 | @@ -123,26 +149,36 @@ index 0000000000..85ce0206d7 | |||
123 | + regulator-name = "vcc5v0_host"; | 149 | + regulator-name = "vcc5v0_host"; | |
124 | + }; | 150 | + }; | |
125 | + | 151 | + | |
126 | + vcc5v0_usb3_host: vcc5v0-usb3-host-regulator { | 152 | + vcc5v0_usb3_host: vcc5v0-usb3-host-regulator { | |
127 | + compatible = "regulator-fixed"; | 153 | + compatible = "regulator-fixed"; | |
128 | + enable-active-high; | 154 | + enable-active-high; | |
129 | + gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>; | 155 | + gpio = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>; | |
130 | + pinctrl-names = "default"; | 156 | + pinctrl-names = "default"; | |
131 | + pinctrl-0 = <&host_usb3_drv>; | 157 | + pinctrl-0 = <&host_usb3_drv>; | |
132 | + regulator-name = "vcc5v0_usb3_host"; | 158 | + regulator-name = "vcc5v0_usb3_host"; | |
133 | + regulator-always-on; | 159 | + regulator-always-on; | |
134 | + }; | 160 | + }; | |
135 | + | 161 | + | |
162 | + vcc3v3_s0: vcc3v3-s0-regulator { | |||
163 | + compatible = "regulator-fixed"; | |||
164 | + enable-active-high; | |||
165 | + gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>; | |||
166 | + pinctrl-names = "default"; | |||
167 | + pinctrl-0 = <&lcdvcc_en>; | |||
168 | + regulator-name = "vcc3v3_s0"; | |||
169 | + regulator-always-on; | |||
170 | + }; | |||
171 | + | |||
136 | + vcc_sys: vcc-sys { | 172 | + vcc_sys: vcc-sys { | |
137 | + compatible = "regulator-fixed"; | 173 | + compatible = "regulator-fixed"; | |
138 | + regulator-name = "vcc_sys"; | 174 | + regulator-name = "vcc_sys"; | |
139 | + regulator-always-on; | 175 | + regulator-always-on; | |
140 | + regulator-boot-on; | 176 | + regulator-boot-on; | |
141 | + regulator-min-microvolt = <5000000>; | 177 | + regulator-min-microvolt = <5000000>; | |
142 | + regulator-max-microvolt = <5000000>; | 178 | + regulator-max-microvolt = <5000000>; | |
143 | + vin-supply = <&dc_12v>; | 179 | + vin-supply = <&dc_12v>; | |
144 | + }; | 180 | + }; | |
145 | + | 181 | + | |
146 | + vdd_log: vdd-log { | 182 | + vdd_log: vdd-log { | |
147 | + compatible = "pwm-regulator"; | 183 | + compatible = "pwm-regulator"; | |
148 | + pwms = <&pwm2 0 25000 1>; | 184 | + pwms = <&pwm2 0 25000 1>; | |
@@ -345,28 +381,28 @@ index 0000000000..85ce0206d7 | @@ -345,28 +381,28 @@ index 0000000000..85ce0206d7 | |||
345 | + regulator-suspend-microvolt = <3000000>; | 381 | + regulator-suspend-microvolt = <3000000>; | |
346 | + }; | 382 | + }; | |
347 | + }; | 383 | + }; | |
348 | + | 384 | + | |
349 | + vcc3v3_s3: SWITCH_REG1 { | 385 | + vcc3v3_s3: SWITCH_REG1 { | |
350 | + regulator-name = "vcc3v3_s3"; | 386 | + regulator-name = "vcc3v3_s3"; | |
351 | + regulator-always-on; | 387 | + regulator-always-on; | |
352 | + regulator-boot-on; | 388 | + regulator-boot-on; | |
353 | + regulator-state-mem { | 389 | + regulator-state-mem { | |
354 | + regulator-off-in-suspend; | 390 | + regulator-off-in-suspend; | |
355 | + }; | 391 | + }; | |
356 | + }; | 392 | + }; | |
357 | + | 393 | + | |
358 | + vcc3v3_s0: SWITCH_REG2 { | 394 | + unused: SWITCH_REG2 { | |
359 | + regulator-name = "vcc3v3_s0"; | 395 | + regulator-name = "SWITCH_REG2"; | |
360 | + regulator-always-on; | 396 | + regulator-always-on; | |
361 | + regulator-boot-on; | 397 | + regulator-boot-on; | |
362 | + regulator-state-mem { | 398 | + regulator-state-mem { | |
363 | + regulator-off-in-suspend; | 399 | + regulator-off-in-suspend; | |
364 | + }; | 400 | + }; | |
365 | + }; | 401 | + }; | |
366 | + }; | 402 | + }; | |
367 | + }; | 403 | + }; | |
368 | + | 404 | + | |
369 | + vdd_cpu_b: regulator@40 { | 405 | + vdd_cpu_b: regulator@40 { | |
370 | + compatible = "silergy,syr827"; | 406 | + compatible = "silergy,syr827"; | |
371 | + reg = <0x40>; | 407 | + reg = <0x40>; | |
372 | + fcs,suspend-voltage-selector = <1>; | 408 | + fcs,suspend-voltage-selector = <1>; | |
@@ -482,49 +518,62 @@ index 0000000000..85ce0206d7 | @@ -482,49 +518,62 @@ index 0000000000..85ce0206d7 | |||
482 | + | 518 | + | |
483 | + usb2 { | 519 | + usb2 { | |
484 | + vcc5v0_host_en: vcc5v0-host-en { | 520 | + vcc5v0_host_en: vcc5v0-host-en { | |
485 | + rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; | 521 | + rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>; | |
486 | + }; | 522 | + }; | |
487 | + | 523 | + | |
488 | + host_vbus_drv: host-vbus-drv { | 524 | + host_vbus_drv: host-vbus-drv { | |
489 | + rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; | 525 | + rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; | |
490 | + }; | 526 | + }; | |
491 | + | 527 | + | |
492 | + host_usb3_drv: host-usb3-drv { | 528 | + host_usb3_drv: host-usb3-drv { | |
493 | + rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; | 529 | + rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; | |
494 | + }; | 530 | + }; | |
531 | + | |||
532 | + /* Shared between LCD and usb */ | |||
533 | + lcdvcc_en: lcdvcc-en { | |||
534 | + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; | |||
535 | + }; | |||
495 | + }; | 536 | + }; | |
496 | +}; | 537 | +}; | |
497 | + | 538 | + | |
498 | +&pwm0 { | 539 | +&pwm0 { | |
499 | + status = "okay"; | 540 | + status = "okay"; | |
500 | +}; | 541 | +}; | |
501 | + | 542 | + | |
502 | +&pwm1 { | 543 | +&pwm1 { | |
503 | + status = "okay"; | 544 | + status = "okay"; | |
504 | +}; | 545 | +}; | |
505 | + | 546 | + | |
506 | +&pwm2 { | 547 | +&pwm2 { | |
507 | + status = "okay"; | 548 | + status = "okay"; | |
508 | +}; | 549 | +}; | |
509 | + | 550 | + | |
510 | +&saradc { | 551 | +&saradc { | |
511 | + status = "okay"; | 552 | + status = "okay"; | |
512 | +}; | 553 | +}; | |
513 | + | 554 | + | |
514 | +&sdmmc { | 555 | +&sdmmc { | |
515 | + bus-width = <4>; | 556 | + bus-width = <4>; | |
516 | + status = "okay"; | 557 | + cap-mmc-highspeed; | |
558 | + cap-sd-highspeed; | |||
559 | + cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>; | |||
560 | + disable-wp; | |||
561 | + sd-uhs-sdr104; | |||
517 | + max-frequency = <20000000>; | 562 | + max-frequency = <20000000>; | |
563 | + vqmmc-supply = <&vcc_sdio>; | |||
564 | + pinctrl-names = "default"; | |||
565 | + pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>; | |||
566 | + status = "okay"; | |||
518 | +}; | 567 | +}; | |
519 | + | 568 | + | |
520 | +&sdhci { | 569 | +&sdhci { | |
521 | + bus-width = <8>; | 570 | + bus-width = <8>; | |
522 | + max-frequency = <25000000>; | 571 | + max-frequency = <25000000>; | |
523 | + mmc-hs400-1_8v; | 572 | + mmc-hs400-1_8v; | |
524 | + mmc-hs400-enhanced-strobe; | 573 | + mmc-hs400-enhanced-strobe; | |
525 | + non-removable; | 574 | + non-removable; | |
526 | + status = "okay"; | 575 | + status = "okay"; | |
527 | +}; | 576 | +}; | |
528 | + | 577 | + | |
529 | +&tcphy0 { | 578 | +&tcphy0 { | |
530 | + status = "okay"; | 579 | + status = "okay"; | |
@@ -571,30 +620,32 @@ index 0000000000..85ce0206d7 | @@ -571,30 +620,32 @@ index 0000000000..85ce0206d7 | |||
571 | +&uart2 { | 620 | +&uart2 { | |
572 | + status = "okay"; | 621 | + status = "okay"; | |
573 | +}; | 622 | +}; | |
574 | + | 623 | + | |
575 | +&usb_host0_ehci { | 624 | +&usb_host0_ehci { | |
576 | + status = "okay"; | 625 | + status = "okay"; | |
577 | +}; | 626 | +}; | |
578 | + | 627 | + | |
579 | +&usb_host0_ohci { | 628 | +&usb_host0_ohci { | |
580 | + status = "okay"; | 629 | + status = "okay"; | |
581 | +}; | 630 | +}; | |
582 | + | 631 | + | |
583 | +&usb_host1_ehci { | 632 | +&usb_host1_ehci { | |
633 | + phy-supply = <&vcc3v3_s0>; | |||
584 | + status = "okay"; | 634 | + status = "okay"; | |
585 | +}; | 635 | +}; | |
586 | + | 636 | + | |
587 | +&usb_host1_ohci { | 637 | +&usb_host1_ohci { | |
638 | + phy-supply = <&vcc3v3_s0>; | |||
588 | + status = "okay"; | 639 | + status = "okay"; | |
589 | +}; | 640 | +}; | |
590 | + | 641 | + | |
591 | +&usbdrd3_0 { | 642 | +&usbdrd3_0 { | |
592 | + status = "okay"; | 643 | + status = "okay"; | |
593 | +}; | 644 | +}; | |
594 | + | 645 | + | |
595 | +&usbdrd_dwc3_0 { | 646 | +&usbdrd_dwc3_0 { | |
596 | + status = "okay"; | 647 | + status = "okay"; | |
597 | + dr_mode = "otg"; | 648 | + dr_mode = "otg"; | |
598 | +}; | 649 | +}; | |
599 | + | 650 | + | |
600 | +&usbdrd3_1 { | 651 | +&usbdrd3_1 { |
$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,
$NetBSD: patch-configs_rock64-rk3328_defconfig,v 1.1 2020/01/14 08:44:03 mrg Exp $
Put u-boot at 256KB.
--- configs/rock64-rk3328_defconfig.orig 2019-12-16 04:39:56.000000000 -0800
+++ configs/rock64-rk3328_defconfig 2020-01-09 12:47:03.348721688 -0800
@@ -1,6 +1,7 @@
CONFIG_ARM=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
CONFIG_ROCKCHIP_RK3328=y
CONFIG_TPL_ROCKCHIP_COMMON_BOARD=y
CONFIG_TPL_LIBCOMMON_SUPPORT=y
$NetBSD: patch-configs_rockpro64-rk3399_defconfig,v 1.1 2020/01/14 08:44:03 mrg Exp $
Put u-boot at 256KB.
--- configs/rockpro64-rk3399_defconfig.orig 2019-12-16 04:39:56.000000000 -0800
+++ configs/rockpro64-rk3399_defconfig 2020-01-09 12:44:48.889763217 -0800
@@ -1,6 +1,7 @@
CONFIG_ARM=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_SYS_TEXT_BASE=0x00200000
+CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200
CONFIG_ROCKCHIP_RK3399=y
CONFIG_ENV_OFFSET=0x3F8000
CONFIG_TARGET_ROCKPRO64_RK3399=y
$NetBSD: patch-include_configs_rockchip-common.h,v 1.1 2020/01/14 08:44:03 mrg Exp $
Author: dhivael <dhivael.git@eno.space>
Date: Sat Jan 11 15:04:04 2020 +0100
rockchip: move usb0 after mmc1 in default boot order
now that we support booting from USB we should prefer USB boot over eMMC
boot. we still try to boot from SD cards first.
commit 908d441fefc2203affe1bb0d79f75f611888fc1f
Author: dhivael <dhivael.git@eno.space>
Date: Sat Jan 11 15:04:04 2020 +0100
rockchip: move usb0 after mmc1 in default boot order
now that we support booting from USB we should prefer USB boot over eMMC
boot. we still try to boot from SD cards first.
--- include/configs/rockchip-common.h.orig 2019-12-16 04:39:56.000000000 -0800
+++ include/configs/rockchip-common.h 2020-01-13 23:17:05.743249968 -0800
@@ -13,11 +13,10 @@
/* First try to boot from SD (index 0), then eMMC (index 1) */
#if CONFIG_IS_ENABLED(CMD_MMC)
- #define BOOT_TARGET_MMC(func) \
- func(MMC, mmc, 0) \
- func(MMC, mmc, 1)
+ #define BOOT_TARGET_MMC(func, idx) \
+ func(MMC, mmc, idx)
#else
- #define BOOT_TARGET_MMC(func)
+ #define BOOT_TARGET_MMC(func, idx)
#endif
#if CONFIG_IS_ENABLED(CMD_USB)
@@ -39,8 +38,9 @@
#endif
#define BOOT_TARGET_DEVICES(func) \
- BOOT_TARGET_MMC(func) \
+ BOOT_TARGET_MMC(func, 1) \
BOOT_TARGET_USB(func) \
+ BOOT_TARGET_MMC(func, 0) \
BOOT_TARGET_PXE(func) \
BOOT_TARGET_DHCP(func)
@@ -1,22 +1,23 @@ | @@ -1,22 +1,23 @@ | |||
1 | $NetBSD: patch-configs-pinebook_pro-rk3399_defconfig,v 1.2 2020/01/06 09:43:16 mrg Exp $ | 1 | $NetBSD: patch-configs-pinebook_pro-rk3399_defconfig,v 1.3 2020/01/14 08:44:03 mrg Exp $ | |
2 | 2 | |||
3 | Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/ | 3 | Pinebook Pro support from https://patchwork.ozlabs.org/patch/1194525/ | |
4 | 4 | |||
5 | diff --git configs/pinebook_pro-rk3399_defconfig configs/pinebook_pro-rk3399_defconfig | 5 | reduce pinebook_pro bootdelay to 2 | |
6 | new file mode 100644 | 6 | put uboot at 256K. | |
7 | index 0000000000..28577256e7 | 7 | ||
8 | --- /dev/null | 8 | ||
9 | +++ configs/pinebook_pro-rk3399_defconfig | 9 | --- configs/pinebook_pro-rk3399_defconfig.orig 2020-01-13 16:59:26.374914888 -0800 | |
10 | +++ configs/pinebook_pro-rk3399_defconfig 2020-01-13 23:15:39.294542172 -0800 | |||
10 | @@ -0,0 +1,77 @@ | 11 | @@ -0,0 +1,77 @@ | |
11 | +CONFIG_ARM=y | 12 | +CONFIG_ARM=y | |
12 | +CONFIG_ARCH_ROCKCHIP=y | 13 | +CONFIG_ARCH_ROCKCHIP=y | |
13 | +CONFIG_SYS_TEXT_BASE=0x00200000 | 14 | +CONFIG_SYS_TEXT_BASE=0x00200000 | |
14 | +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 | 15 | +CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR=0x200 | |
15 | +CONFIG_ROCKCHIP_RK3399=y | 16 | +CONFIG_ROCKCHIP_RK3399=y | |
16 | +CONFIG_TARGET_PINEBOOK_PRO_RK3399=y | 17 | +CONFIG_TARGET_PINEBOOK_PRO_RK3399=y | |
17 | +CONFIG_SPL_SPI_FLASH_SUPPORT=y | 18 | +CONFIG_SPL_SPI_FLASH_SUPPORT=y | |
18 | +CONFIG_SPL_SPI_SUPPORT=y | 19 | +CONFIG_SPL_SPI_SUPPORT=y | |
19 | +CONFIG_DEBUG_UART_BASE=0xFF1A0000 | 20 | +CONFIG_DEBUG_UART_BASE=0xFF1A0000 | |
20 | +CONFIG_DEBUG_UART_CLOCK=24000000 | 21 | +CONFIG_DEBUG_UART_CLOCK=24000000 | |
21 | +CONFIG_DEBUG_UART=y | 22 | +CONFIG_DEBUG_UART=y | |
22 | +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" | 23 | +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" | |
@@ -37,27 +38,27 @@ index 0000000000..28577256e7 | @@ -37,27 +38,27 @@ index 0000000000..28577256e7 | |||
37 | +CONFIG_CMD_I2C=y | 38 | +CONFIG_CMD_I2C=y | |
38 | +CONFIG_CMD_MMC=y | 39 | +CONFIG_CMD_MMC=y | |
39 | +CONFIG_CMD_SF=y | 40 | +CONFIG_CMD_SF=y | |
40 | +CONFIG_CMD_USB=y | 41 | +CONFIG_CMD_USB=y | |
41 | +# CONFIG_CMD_SETEXPR is not set | 42 | +# CONFIG_CMD_SETEXPR is not set | |
42 | +CONFIG_CMD_PMIC=y | 43 | +CONFIG_CMD_PMIC=y | |
43 | +CONFIG_CMD_REGULATOR=y | 44 | +CONFIG_CMD_REGULATOR=y | |
44 | +CONFIG_CMD_MTDPARTS=y | 45 | +CONFIG_CMD_MTDPARTS=y | |
45 | +CONFIG_SPL_OF_CONTROL=y | 46 | +CONFIG_SPL_OF_CONTROL=y | |
46 | +CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" | 47 | +CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinebook-pro" | |
47 | +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" | 48 | +CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" | |
48 | +CONFIG_ROCKCHIP_GPIO=y | 49 | +CONFIG_ROCKCHIP_GPIO=y | |
49 | +CONFIG_SYS_I2C_ROCKCHIP=y | 50 | +CONFIG_SYS_I2C_ROCKCHIP=y | |
50 | +CONFIG_BOOTDELAY=3 | 51 | +CONFIG_BOOTDELAY=2 | |
51 | +CONFIG_LED=y | 52 | +CONFIG_LED=y | |
52 | +CONFIG_LED_GPIO=y | 53 | +CONFIG_LED_GPIO=y | |
53 | +CONFIG_MISC=y | 54 | +CONFIG_MISC=y | |
54 | +CONFIG_ROCKCHIP_EFUSE=y | 55 | +CONFIG_ROCKCHIP_EFUSE=y | |
55 | +CONFIG_MMC_DW=y | 56 | +CONFIG_MMC_DW=y | |
56 | +CONFIG_MMC_DW_ROCKCHIP=y | 57 | +CONFIG_MMC_DW_ROCKCHIP=y | |
57 | +CONFIG_MMC_SDHCI=y | 58 | +CONFIG_MMC_SDHCI=y | |
58 | +CONFIG_MMC_SDHCI_SDMA=y | 59 | +CONFIG_MMC_SDHCI_SDMA=y | |
59 | +CONFIG_MMC_SDHCI_ROCKCHIP=y | 60 | +CONFIG_MMC_SDHCI_ROCKCHIP=y | |
60 | +CONFIG_SPI_FLASH=y | 61 | +CONFIG_SPI_FLASH=y | |
61 | +CONFIG_SPI_FLASH_GIGADEVICE=y | 62 | +CONFIG_SPI_FLASH_GIGADEVICE=y | |
62 | +CONFIG_SPI_FLASH_WINBOND=y | 63 | +CONFIG_SPI_FLASH_WINBOND=y | |
63 | +CONFIG_DM_ETH=y | 64 | +CONFIG_DM_ETH=y |