├── .gitmodules └── patches ├── u-boot ├── 0004-rockchip-common-Fix-MMC-boot-order-to-be-SD-eMMC.patch ├── 0006-set-BOOTDELAY-to-1.patch ├── 0007-address-NVMe-instability.patch ├── 0001-Add-regulator-needed-for-usage-of-USB.patch ├── 0002-rk3399-light-pinebook-power-and-standby-leds-during-.patch ├── 0005-PBP-Fix-Panel-reset.patch └── 0003-support-SPI-flash-boot.patch └── atf └── atf-rk3399-baudrate.patch /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "arm-trusted-firmware"] 2 | path = arm-trusted-firmware 3 | url = https://github.com/ARM-software/arm-trusted-firmware.git 4 | [submodule "u-boot"] 5 | path = u-boot 6 | url = https://gitlab.denx.de/u-boot/u-boot 7 | -------------------------------------------------------------------------------- /patches/u-boot/0004-rockchip-common-Fix-MMC-boot-order-to-be-SD-eMMC.patch: -------------------------------------------------------------------------------- 1 | From 4cd75868c92da374618b2dfee81034a5d6112621 Mon Sep 17 00:00:00 2001 2 | From: pcm720 3 | Date: Sun, 28 Jun 2020 21:05:04 +0300 4 | Subject: [PATCH 4/4] rockchip-common: fix MMC boot order to be SD -> eMMC 5 | 6 | --- 7 | include/configs/rockchip-common.h | 4 ++-- 8 | 1 file changed, 2 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h 11 | index 0b9e24d1db..6610f95b7b 100644 12 | --- a/include/configs/rockchip-common.h 13 | +++ b/include/configs/rockchip-common.h 14 | @@ -17,8 +17,8 @@ 15 | /* First try to boot from SD (index 0), then eMMC (index 1) */ 16 | #if CONFIG_IS_ENABLED(CMD_MMC) 17 | #define BOOT_TARGET_MMC(func) \ 18 | - func(MMC, mmc, 0) \ 19 | - func(MMC, mmc, 1) 20 | + func(MMC, mmc, 1) \ 21 | + func(MMC, mmc, 0) 22 | #else 23 | #define BOOT_TARGET_MMC(func) 24 | #endif 25 | -- 26 | 2.27.0 27 | 28 | -------------------------------------------------------------------------------- /patches/atf/atf-rk3399-baudrate.patch: -------------------------------------------------------------------------------- 1 | From 1edcdf8dd00b6f00bc310bcd4a22c02e49f2f33a Mon Sep 17 00:00:00 2001 2 | From: Hugh Cole-Baker 3 | Date: Tue, 15 Oct 2019 21:25:13 +0000 4 | Subject: [PATCH] Set RK3399 baud rate to 1.5Mbps 5 | 6 | --- 7 | plat/rockchip/rk3399/rk3399_def.h | 2 +- 8 | 1 file changed, 1 insertion(+), 1 deletion(-) 9 | 10 | diff --git a/plat/rockchip/rk3399/rk3399_def.h b/plat/rockchip/rk3399/rk3399_def.h 11 | index ba83242e..8d6ecfbe 100644 12 | --- a/plat/rockchip/rk3399/rk3399_def.h 13 | +++ b/plat/rockchip/rk3399/rk3399_def.h 14 | @@ -17,7 +17,7 @@ 15 | /************************************************************************** 16 | * UART related constants 17 | **************************************************************************/ 18 | -#define RK3399_BAUDRATE 115200 19 | +#define RK3399_BAUDRATE 1500000 20 | #define RK3399_UART_CLOCK 24000000 21 | 22 | /****************************************************************************** 23 | -- 24 | 2.20.1 25 | 26 | -------------------------------------------------------------------------------- /patches/u-boot/0006-set-BOOTDELAY-to-1.patch: -------------------------------------------------------------------------------- 1 | From 8cbca64f7db1dda2c4154e75a76777a5e9e5c225 Mon Sep 17 00:00:00 2001 2 | From: pcm720 3 | Date: Sun, 19 Jul 2020 12:08:33 +0300 4 | Subject: [PATCH] defconfig: pinebook-pro: set BOOTDELAY to 1 5 | 6 | Shorten boot delay to speed up the boot process 7 | 8 | --- 9 | configs/pinebook-pro-rk3399_defconfig | 2 +- 10 | 1 file changed, 1 insertion(+), 1 deletion(-) 11 | 12 | diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig 13 | index 76e5f36d58..d1765ac131 100644 14 | --- a/configs/pinebook-pro-rk3399_defconfig 15 | +++ b/configs/pinebook-pro-rk3399_defconfig 16 | @@ -9,7 +9,7 @@ CONFIG_DEBUG_UART_CLOCK=24000000 17 | CONFIG_SPL_SPI_FLASH_SUPPORT=y 18 | CONFIG_SPL_SPI_SUPPORT=y 19 | CONFIG_DEBUG_UART=y 20 | -CONFIG_BOOTDELAY=3 21 | +CONFIG_BOOTDELAY=1 22 | CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinebook-pro.dtb" 23 | CONFIG_MISC_INIT_R=y 24 | CONFIG_DISPLAY_BOARDINFO_LATE=y 25 | -- 26 | 2.27.0 27 | 28 | -------------------------------------------------------------------------------- /patches/u-boot/0007-address-NVMe-instability.patch: -------------------------------------------------------------------------------- 1 | From 656ccd6ac62714b11b163b6eb62370a78c7bc808 Mon Sep 17 00:00:00 2001 2 | From: pcm720 3 | Date: Mon, 20 Jul 2020 20:33:26 +0300 4 | Subject: [PATCH] drivers: nvme: address NVMe instability for Pinebook Pro 5 | 6 | Apparently, some NVMe SSDs on Pinebook Pro don't become ready before timeout specified in drive's CAP register expires. 7 | The workaround is to increase timeout. Tested and confirmed to work on Intel 660p. 8 | --- 9 | drivers/nvme/nvme.c | 6 ++++++ 10 | 1 file changed, 6 insertions(+) 11 | 12 | diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c 13 | index fc64d93ab8..138b9f8fbb 100644 14 | --- a/drivers/nvme/nvme.c 15 | +++ b/drivers/nvme/nvme.c 16 | @@ -61,6 +61,12 @@ static int nvme_wait_ready(struct nvme_dev *dev, bool enabled) 17 | 18 | /* Timeout field in the CAP register is in 500 millisecond units */ 19 | timeout = NVME_CAP_TIMEOUT(dev->cap) * 500; 20 | + 21 | + #ifdef CONFIG_TARGET_PINEBOOK_PRO_RK3399 22 | + /* Some NVMe SSDs on Pinebook Pro don't become ready before timeout expires. 23 | + Workaround: increase timeout */ 24 | + timeout *= 2; 25 | + #endif 26 | 27 | start = get_timer(0); 28 | while (get_timer(start) < timeout) { 29 | -- 30 | 2.27.0 31 | 32 | -------------------------------------------------------------------------------- /patches/u-boot/0001-Add-regulator-needed-for-usage-of-USB.patch: -------------------------------------------------------------------------------- 1 | From 6ad924ab3b6b2a4d8c73a9871d0e94245cce6fcf Mon Sep 17 00:00:00 2001 2 | From: Nadia Holmquist Pedersen 3 | Date: Sat, 20 Jun 2020 01:41:22 +0200 4 | Subject: [PATCH 1/3] Add regulator needed for usage of USB 5 | 6 | --- 7 | arch/arm/dts/rk3399-pinebook-pro.dts | 21 +++++++++++++++++++-- 8 | 1 file changed, 19 insertions(+), 2 deletions(-) 9 | 10 | diff --git a/arch/arm/dts/rk3399-pinebook-pro.dts b/arch/arm/dts/rk3399-pinebook-pro.dts 11 | index 294d21bf45..6214887a1c 100644 12 | --- a/arch/arm/dts/rk3399-pinebook-pro.dts 13 | +++ b/arch/arm/dts/rk3399-pinebook-pro.dts 14 | @@ -207,6 +207,16 @@ 15 | }; 16 | }; 17 | 18 | + vcc3v3_s0: vcc3v3-s0-regulator { 19 | + compatible = "regulator-fixed"; 20 | + enable-active-high; 21 | + gpio = <&gpio1 RK_PC6 GPIO_ACTIVE_HIGH>; 22 | + pinctrl-names = "default"; 23 | + pinctrl-0 = <&lcdvcc_en>; 24 | + regulator-name = "vcc3v3_s0"; 25 | + regulator-always-on; 26 | + }; 27 | + 28 | /* 5 V USB power supply */ 29 | vcc5v0_usb: pa_5v: vcc5v0-usb-regulator { 30 | compatible = "regulator-fixed"; 31 | @@ -610,8 +620,8 @@ 32 | }; 33 | }; 34 | 35 | - vcc3v3_s0: SWITCH_REG2 { 36 | - regulator-name = "vcc3v3_s0"; 37 | + unused: SWITCH_REG2 { 38 | + regulator-name = "SWITCH_REG2"; 39 | regulator-always-on; 40 | regulator-boot-on; 41 | 42 | @@ -872,6 +882,11 @@ 43 | rockchip,pins = <1 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; 44 | }; 45 | 46 | + /* Shared between LCD and usb */ 47 | + lcdvcc_en: lcdvcc-en { 48 | + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_none>; 49 | + }; 50 | + 51 | vcc5v0_host_en_gpio: vcc5v0-host-en-gpio { 52 | rockchip,pins = <4 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; 53 | }; 54 | @@ -1054,10 +1069,12 @@ 55 | }; 56 | 57 | &usb_host1_ehci { 58 | + phy-supply = <&vcc3v3_s0>; 59 | status = "okay"; 60 | }; 61 | 62 | &usb_host1_ohci { 63 | + phy-supply = <&vcc3v3_s0>; 64 | status = "okay"; 65 | }; 66 | 67 | -- 68 | 2.27.0 69 | 70 | 71 | -------------------------------------------------------------------------------- /patches/u-boot/0002-rk3399-light-pinebook-power-and-standby-leds-during-.patch: -------------------------------------------------------------------------------- 1 | From 1a01021c9361c4e017cb5b032300f5555c393710 Mon Sep 17 00:00:00 2001 2 | From: dhivael 3 | Date: Sat, 11 Jan 2020 15:04:46 +0100 4 | Subject: rk3399: light pinebook power and standby leds during early boot 5 | 6 | this is a hack, but it works for now. 7 | --- 8 | arch/arm/mach-rockchip/rk3399/rk3399.c | 12 +++++++++++- 9 | 1 file changed, 11 insertions(+), 1 deletion(-) 10 | 11 | diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c 12 | index 4fda93b152..e24b39486d 100644 13 | --- a/arch/arm/mach-rockchip/rk3399/rk3399.c 14 | +++ b/arch/arm/mach-rockchip/rk3399/rk3399.c 15 | @@ -19,6 +19,8 @@ 16 | #include 17 | #include 18 | #include 19 | +#include 20 | +#include 21 | 22 | DECLARE_GLOBAL_DATA_PTR; 23 | 24 | @@ -119,8 +121,8 @@ void board_debug_uart_init(void) 25 | struct rk3399_grf_regs * const grf = (void *)GRF_BASE; 26 | #ifdef CONFIG_TARGET_CHROMEBOOK_BOB 27 | struct rk3399_pmugrf_regs * const pmugrf = (void *)PMUGRF_BASE; 28 | - struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE; 29 | #endif 30 | + struct rockchip_gpio_regs * const gpio = (void *)GPIO0_BASE; 31 | 32 | #if defined(CONFIG_DEBUG_UART_BASE) && (CONFIG_DEBUG_UART_BASE == 0xff180000) 33 | /* Enable early UART0 on the RK3399 */ 34 | @@ -153,6 +155,14 @@ void board_debug_uart_init(void) 35 | spl_gpio_set_pull(&pmugrf->gpio0_p, GPIO(BANK_B, 4), GPIO_PULL_NORMAL); 36 | #endif /* CONFIG_TARGET_CHROMEBOOK_BOB */ 37 | 38 | + { 39 | + // set GPIO0_A2/B3 to GPIO_ACTIVE_HIGH 40 | + // set GPIO0_A2/B3 to OUTPUT 41 | + int mask = (1UL << RK_PA2) | (1UL << RK_PB3); 42 | + setbits_le32(&gpio->swport_dr, mask); 43 | + setbits_le32(&gpio->swport_ddr, mask); 44 | + } 45 | + 46 | /* Enable early UART2 channel C on the RK3399 */ 47 | rk_clrsetreg(&grf->gpio4c_iomux, 48 | GRF_GPIO4C3_SEL_MASK, 49 | -- 50 | 2.27.0 51 | 52 | -------------------------------------------------------------------------------- /patches/u-boot/0005-PBP-Fix-Panel-reset.patch: -------------------------------------------------------------------------------- 1 | From 352cb7b28bf4a16330f148043e8d10b0141bbfcb Mon Sep 17 00:00:00 2001 2 | From: Arnaud Patard 3 | Date: Wed, 8 Jul 2020 21:43:36 -0400 4 | Subject: [PATCH 4/4] PBP: Fix panel reset 5 | 6 | On warm reset, the pinebook pro panel is not working correctly. 7 | The issue is not yet debugged so, for now, this hack seems to be 8 | enough. It toggles the GPIO1_C6 gpio [ LCDVCC_EN signal in the 9 | schematics ] used by the vcc3v3_panel regulator. 10 | 11 | There's no gpio_request, since the gpio is already in use at this 12 | stage, so it can only fail. 13 | 14 | Origin: http://people.hupstream.com/~rtp/pbp/20200706/patches/hack-reset.patch 15 | --- 16 | board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c | 10 +++++++++- 17 | 1 file changed, 9 insertions(+), 1 deletion(-) 18 | 19 | diff --git a/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c 20 | index 516292aaa59..ff9c916bcb7 100644 21 | --- a/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c 22 | +++ b/board/pine64/pinebook-pro-rk3399/pinebook-pro-rk3399.c 23 | @@ -7,13 +7,15 @@ 24 | #include 25 | #include 26 | #include 27 | +#include 28 | +#include 29 | #include 30 | #include 31 | #include 32 | +#include 33 | #include 34 | #include 35 | #include 36 | - 37 | #define GRF_IO_VSEL_BT565_SHIFT 0 38 | #define PMUGRF_CON0_VSEL_SHIFT 8 39 | 40 | @@ -59,6 +61,7 @@ int misc_init_r(void) 41 | const u32 cpuid_length = 0x10; 42 | u8 cpuid[cpuid_length]; 43 | int ret; 44 | + unsigned int gpio; 45 | 46 | setup_iodomain(); 47 | 48 | @@ -70,6 +73,11 @@ int misc_init_r(void) 49 | if (ret) 50 | return ret; 51 | 52 | + gpio_lookup_name("B22", NULL, NULL, &gpio); 53 | + gpio_direction_output(gpio, 0); 54 | + udelay(500000); 55 | + gpio_direction_output(gpio, 1); 56 | + 57 | return ret; 58 | } 59 | #endif 60 | -- 61 | 2.25.4 62 | 63 | 64 | -------------------------------------------------------------------------------- /patches/u-boot/0003-support-SPI-flash-boot.patch: -------------------------------------------------------------------------------- 1 | From 662f6044341d0435cf238cfa683ec6b8868ecb22 Mon Sep 17 00:00:00 2001 2 | From: pcm720 3 | Date: Sun, 28 Jun 2020 21:00:59 +0300 4 | Subject: [PATCH 3/4] support SPI flash boot 5 | 6 | Port dhivael's commit to current upstream 7 | 8 | Original commit contents: 9 | From: dhivael 10 | Date: Thu, 6 Feb 2020 22:34:34 +0100 11 | Subject: support SPI flash boot 12 | 13 | SPI uboot images can be built with 14 | 15 | tools/mkimage -n rk3399 -T rkspi -d tpl/u-boot-tpl-dtb.bin:spl/u-boot-spl-dtb.bin spl.bin 16 | cat <(dd if=spl.bin bs=512K conv=sync) u-boot.itb >spiflash.bin 17 | 18 | and written to spi flash with uboot sf commands, any hardware flasher 19 | available, rkdeveloptool, or possibly other methods. 20 | --- 21 | arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi | 6 +++++- 22 | configs/pinebook-pro-rk3399_defconfig | 9 +++++++++ 23 | 2 files changed, 14 insertions(+), 1 deletion(-) 24 | 25 | diff --git a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi 26 | index 1a2e24d3ef..4a5a0969b5 100644 27 | --- a/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi 28 | +++ b/arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi 29 | @@ -12,7 +12,7 @@ 30 | }; 31 | 32 | chosen { 33 | - u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; 34 | + u-boot,spl-boot-order = "same-as-spl", &spiflash, &sdhci, &sdmmc; 35 | }; 36 | }; 37 | 38 | @@ -41,3 +41,7 @@ 39 | &vdd_log { 40 | regulator-init-microvolt = <950000>; 41 | }; 42 | + 43 | +&pcie0 { 44 | + u-boot,dm-pre-reloc; 45 | +}; 46 | diff --git a/configs/pinebook-pro-rk3399_defconfig b/configs/pinebook-pro-rk3399_defconfig 47 | index 0c129b9aeb..76e5f36d58 100644 48 | --- a/configs/pinebook-pro-rk3399_defconfig 49 | +++ b/configs/pinebook-pro-rk3399_defconfig 50 | @@ -78,3 +78,12 @@ CONFIG_VIDEO_ROCKCHIP=y 51 | CONFIG_DISPLAY_ROCKCHIP_EDP=y 52 | CONFIG_SPL_TINY_MEMSET=y 53 | CONFIG_ERRNO_STR=y 54 | +CONFIG_CMD_NVME=y 55 | +CONFIG_MTD=y 56 | +CONFIG_DM_MTD=y 57 | +CONFIG_SPI_FLASH_SFDP_SUPPORT=y 58 | +CONFIG_SPL_DM_SPI=y 59 | +CONFIG_SPL_SPI_FLASH_TINY=n 60 | +CONFIG_SPL_SPI_FLASH_SFDP_SUPPORT=y 61 | +CONFIG_SPL_SPI_LOAD=y 62 | +CONFIG_SYS_SPI_U_BOOT_OFFS=0x80000 63 | -- 64 | 2.27.0 65 | 66 | --------------------------------------------------------------------------------