diff --git a/dev-embedded/u-boot-pinephone-pro/files/0001-PPP.patch b/dev-embedded/u-boot-pinephone-pro/files/0001-PPP.patch new file mode 100644 index 0000000..f2326a6 --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0001-PPP.patch @@ -0,0 +1,241 @@ +From c4d3ac73a3f19d2372e3d35e833665b2ee1f11fa Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sat, 12 Dec 2020 13:31:03 +0100 +Subject: [PATCH 1/8] PPP + +--- + arch/arm/mach-rockchip/rk3399/Kconfig | 7 ++ + board/pine64/pinephone-pro-rk3399/Kconfig | 15 +++ + board/pine64/pinephone-pro-rk3399/MAINTAINERS | 8 ++ + board/pine64/pinephone-pro-rk3399/Makefile | 1 + + .../pinephone-pro-rk3399.c | 56 +++++++++++ + configs/pinephone-pro-rk3399_defconfig | 92 +++++++++++++++++++ + 6 files changed, 179 insertions(+) + create mode 100644 board/pine64/pinephone-pro-rk3399/Kconfig + create mode 100644 board/pine64/pinephone-pro-rk3399/MAINTAINERS + create mode 100644 board/pine64/pinephone-pro-rk3399/Makefile + create mode 100644 board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c + create mode 100644 configs/pinephone-pro-rk3399_defconfig + +diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig +index 17628f9171..35b1125906 100644 +--- a/arch/arm/mach-rockchip/rk3399/Kconfig ++++ b/arch/arm/mach-rockchip/rk3399/Kconfig +@@ -28,6 +28,13 @@ config TARGET_PINEBOOK_PRO_RK3399 + with 4Gb RAM, onboard eMMC, USB-C, a USB3 and USB2 port, + 1920*1080 screen and all the usual laptop features. + ++config TARGET_PINEPHONE_PRO_RK3399 ++ bool "PinePhone Pro" ++ help ++ PinePhone Pro is a phone based on the Rockchip rk3399 SoC ++ with 4Gb RAM, onboard eMMC, USB-C, a headphone jack, ++ 720x1440 screen and an external Quectel USB modem. ++ + config TARGET_PUMA_RK3399 + bool "Theobroma Systems RK3399-Q7 (Puma)" + help +diff --git a/board/pine64/pinephone-pro-rk3399/Kconfig b/board/pine64/pinephone-pro-rk3399/Kconfig +new file mode 100644 +index 0000000000..13d6465ae6 +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/Kconfig +@@ -0,0 +1,15 @@ ++if TARGET_PINEPHONE_PRO_RK3399 ++ ++config SYS_BOARD ++ default "pinephone-pro-rk3399" ++ ++config SYS_VENDOR ++ default "pine64" ++ ++config SYS_CONFIG_NAME ++ default "pinephone-pro-rk3399" ++ ++config BOARD_SPECIFIC_OPTIONS ++ def_bool y ++ ++endif +diff --git a/board/pine64/pinephone-pro-rk3399/MAINTAINERS b/board/pine64/pinephone-pro-rk3399/MAINTAINERS +new file mode 100644 +index 0000000000..227c1c0bea +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/MAINTAINERS +@@ -0,0 +1,8 @@ ++PINEBOOK_PRO ++M: Peter Robinson ++S: Maintained ++F: board/pine64/rk3399-pinebook-pro/ ++F: include/configs/rk3399-pinebook-pro.h ++F: arch/arm/dts/rk3399-pinebook-pro.dts ++F: arch/arm/dts/rk3399-pinebook-pro-u-boot.dtsi ++F: configs/pinebook-pro-rk3399_defconfig +diff --git a/board/pine64/pinephone-pro-rk3399/Makefile b/board/pine64/pinephone-pro-rk3399/Makefile +new file mode 100644 +index 0000000000..8d9203053e +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/Makefile +@@ -0,0 +1 @@ ++obj-y += pinephone-pro-rk3399.o +diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c +new file mode 100644 +index 0000000000..d79084614f +--- /dev/null ++++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c +@@ -0,0 +1,56 @@ ++// SPDX-License-Identifier: GPL-2.0+ ++/* ++ * (C) Copyright 2019 Vasily Khoruzhick ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#define GRF_IO_VSEL_BT565_SHIFT 0 ++#define PMUGRF_CON0_VSEL_SHIFT 8 ++ ++#ifdef CONFIG_MISC_INIT_R ++static void setup_iodomain(void) ++{ ++ struct rk3399_grf_regs *grf = ++ syscon_get_first_range(ROCKCHIP_SYSCON_GRF); ++ struct rk3399_pmugrf_regs *pmugrf = ++ syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); ++ ++ /* BT565 is in 1.8v domain */ ++ rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); ++ ++ /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ ++ rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); ++} ++ ++int misc_init_r(void) ++{ ++ const u32 cpuid_offset = 0x7; ++ const u32 cpuid_length = 0x10; ++ u8 cpuid[cpuid_length]; ++ int ret; ++ ++ setup_iodomain(); ++ ++ ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); ++ if (ret) ++ return ret; ++ ++ ret = rockchip_cpuid_set(cpuid, cpuid_length); ++ if (ret) ++ return ret; ++ ++ ret = rockchip_setup_macaddr(); ++ ++ return ret; ++} ++ ++#endif +diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig +new file mode 100644 +index 0000000000..320ce65ffb +--- /dev/null ++++ b/configs/pinephone-pro-rk3399_defconfig +@@ -0,0 +1,92 @@ ++CONFIG_ARM=y ++CONFIG_ARCH_ROCKCHIP=y ++CONFIG_SYS_TEXT_BASE=0x00200000 ++CONFIG_NR_DRAM_BANKS=1 ++CONFIG_ENV_SIZE=0x8000 ++CONFIG_ROCKCHIP_RK3399=y ++CONFIG_TARGET_PINEPHONE_PRO_RK3399=y ++CONFIG_DEBUG_UART_BASE=0xFF1A0000 ++CONFIG_DEBUG_UART_CLOCK=24000000 ++CONFIG_SPL_SPI_FLASH_SUPPORT=y ++CONFIG_SPL_SPI_SUPPORT=y ++CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinephone-pro" ++CONFIG_DEBUG_UART=y ++CONFIG_BOOTDELAY=3 ++CONFIG_USE_PREBOOT=y ++CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinephone-pro.dtb" ++CONFIG_DISPLAY_BOARDINFO_LATE=y ++CONFIG_MISC_INIT_R=y ++# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set ++CONFIG_SPL_STACK_R=y ++CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 ++CONFIG_SPL_MTD_SUPPORT=y ++CONFIG_SPL_SPI_LOAD=y ++CONFIG_TPL=y ++CONFIG_CMD_BOOTZ=y ++CONFIG_CMD_GPIO=y ++CONFIG_CMD_GPT=y ++CONFIG_CMD_I2C=y ++CONFIG_CMD_MMC=y ++CONFIG_CMD_PCI=y ++CONFIG_CMD_USB=y ++# CONFIG_CMD_SETEXPR is not set ++CONFIG_CMD_TIME=y ++CONFIG_CMD_PMIC=y ++CONFIG_CMD_REGULATOR=y ++CONFIG_SPL_OF_CONTROL=y ++CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" ++CONFIG_ENV_IS_IN_SPI_FLASH=y ++CONFIG_SYS_RELOC_GD_ENV_ADDR=y ++CONFIG_ROCKCHIP_GPIO=y ++CONFIG_SYS_I2C_ROCKCHIP=y ++CONFIG_DM_KEYBOARD=y ++CONFIG_LED=y ++CONFIG_LED_GPIO=y ++CONFIG_MISC=y ++CONFIG_ROCKCHIP_EFUSE=y ++CONFIG_MMC_DW=y ++CONFIG_MMC_DW_ROCKCHIP=y ++CONFIG_MMC_SDHCI=y ++CONFIG_MMC_SDHCI_SDMA=y ++CONFIG_MMC_SDHCI_ROCKCHIP=y ++CONFIG_SF_DEFAULT_SPEED=20000000 ++CONFIG_SPI_FLASH_GIGADEVICE=y ++CONFIG_SPI_FLASH_WINBOND=y ++CONFIG_DM_ETH=y ++CONFIG_NVME=y ++CONFIG_PCI=y ++CONFIG_PHY_ROCKCHIP_INNO_USB2=y ++CONFIG_PHY_ROCKCHIP_TYPEC=y ++CONFIG_DM_PMIC_FAN53555=y ++CONFIG_PMIC_RK8XX=y ++CONFIG_REGULATOR_PWM=y ++CONFIG_REGULATOR_RK8XX=y ++CONFIG_PWM_ROCKCHIP=y ++CONFIG_RAM_RK3399_LPDDR4=y ++CONFIG_DM_RESET=y ++CONFIG_DM_RNG=y ++CONFIG_RNG_ROCKCHIP=y ++CONFIG_BAUDRATE=1500000 ++CONFIG_DEBUG_UART_SHIFT=2 ++CONFIG_ROCKCHIP_SPI=y ++CONFIG_SYSRESET=y ++CONFIG_USB=y ++CONFIG_USB_XHCI_HCD=y ++CONFIG_USB_XHCI_DWC3=y ++CONFIG_USB_EHCI_HCD=y ++CONFIG_USB_EHCI_GENERIC=y ++CONFIG_USB_OHCI_HCD=y ++CONFIG_USB_OHCI_GENERIC=y ++CONFIG_USB_DWC3=y ++CONFIG_USB_DWC3_GENERIC=y ++CONFIG_USB_KEYBOARD=y ++CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y ++CONFIG_USB_HOST_ETHER=y ++CONFIG_USB_ETHER_ASIX=y ++CONFIG_USB_ETHER_RTL8152=y ++CONFIG_DM_VIDEO=y ++CONFIG_DISPLAY=y ++CONFIG_VIDEO_ROCKCHIP=y ++CONFIG_DISPLAY_ROCKCHIP_EDP=y ++CONFIG_SPL_TINY_MEMSET=y ++CONFIG_ERRNO_STR=y +-- +2.33.0 diff --git a/dev-embedded/u-boot-pinephone-pro/files/0001-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch b/dev-embedded/u-boot-pinephone-pro/files/0002-Add-ppp-dt.patch similarity index 55% rename from dev-embedded/u-boot-pinephone-pro/files/0001-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch rename to dev-embedded/u-boot-pinephone-pro/files/0002-Add-ppp-dt.patch index 3e48d2e..997d0aa 100644 --- a/dev-embedded/u-boot-pinephone-pro/files/0001-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch +++ b/dev-embedded/u-boot-pinephone-pro/files/0002-Add-ppp-dt.patch @@ -1,65 +1,24 @@ -From eea38c80ff858222e15ba4d79a0cb811adbdfc23 Mon Sep 17 00:00:00 2001 +From 98b43f8c80a3ce16363f6a386b23bda10a738ffa Mon Sep 17 00:00:00 2001 From: Martijn Braam -Date: Sat, 12 Dec 2020 13:31:03 +0100 -Subject: [PATCH] rockchip: Add initial support for the PinePhone Pro +Date: Sun, 13 Dec 2020 19:21:12 +0100 +Subject: [PATCH 2/8] Add ppp dt -This is a new device by PINE64 that's very similar to the Pinebook Pro -that's already supported. - -Specification: -- Rockchip RK3399 -- 4GB Dual-Channel LPDDR4 -- 128GB eMMC -- mSD card slot -- AP6255 for 802.11ac WiFi and Bluetooth -- 6 inch 720*1440 DSI display -- Quectel EG25g usb modem -- Type-C port with alt-mode display (DP 1.2) and PD charging. - -Signed-off-by: Martijn Braam --- - arch/arm/dts/Makefile | 1 + - arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 44 ++ - arch/arm/dts/rk3399-pinephone-pro.dts | 520 ++++++++++++++++++ - arch/arm/mach-rockchip/rk3399/Kconfig | 8 + - board/pine64/pinephone-pro-rk3399/Kconfig | 15 + - board/pine64/pinephone-pro-rk3399/MAINTAINERS | 8 + - board/pine64/pinephone-pro-rk3399/Makefile | 1 + - .../pinephone-pro-rk3399.c | 57 ++ - configs/pinephone-pro-rk3399_defconfig | 92 ++++ - include/configs/pinephone-pro-rk3399.h | 23 + - 10 files changed, 769 insertions(+) + arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 43 ++ + arch/arm/dts/rk3399-pinephone-pro.dts | 520 +++++++++++++++++++ + 2 files changed, 563 insertions(+) create mode 100644 arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi create mode 100644 arch/arm/dts/rk3399-pinephone-pro.dts - create mode 100644 board/pine64/pinephone-pro-rk3399/Kconfig - create mode 100644 board/pine64/pinephone-pro-rk3399/MAINTAINERS - create mode 100644 board/pine64/pinephone-pro-rk3399/Makefile - create mode 100644 board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c - create mode 100644 configs/pinephone-pro-rk3399_defconfig - create mode 100644 include/configs/pinephone-pro-rk3399.h -diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index aeaec713..6f123425 100644 ---- a/arch/arm/dts/Makefile -+++ b/arch/arm/dts/Makefile -@@ -145,6 +145,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ - rk3399-nanopi-r4s.dtb \ - rk3399-orangepi.dtb \ - rk3399-pinebook-pro.dtb \ -+ rk3399-pinephone-pro.dtb \ - rk3399-puma-haikou.dtb \ - rk3399-roc-pc.dtb \ - rk3399-roc-pc-mezzanine.dtb \ diff --git a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi new file mode 100644 -index 00000000..9d44db59 +index 0000000000..7a058477db --- /dev/null +++ b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi -@@ -0,0 +1,44 @@ +@@ -0,0 +1,43 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Peter Robinson -+ * Copyright (C) 2021 Martijn Braam + */ + +#include "rk3399-u-boot.dtsi" @@ -71,7 +30,7 @@ index 00000000..9d44db59 + }; + + chosen { -+ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; ++ u-boot,spl-boot-order = "same-as-spl", &sdhci, &spiflash, &sdmmc; + }; + + config { @@ -102,13 +61,13 @@ index 00000000..9d44db59 +}; diff --git a/arch/arm/dts/rk3399-pinephone-pro.dts b/arch/arm/dts/rk3399-pinephone-pro.dts new file mode 100644 -index 00000000..3fe1845c +index 0000000000..78d4760c8e --- /dev/null +++ b/arch/arm/dts/rk3399-pinephone-pro.dts @@ -0,0 +1,520 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* -+ * Copyright (c) 2021 Martijn Braam ++ * Copyright (c) 2020 Martijn Braam + */ + +/dts-v1/; @@ -116,8 +75,8 @@ index 00000000..3fe1845c +#include "rk3399-opp.dtsi" + +/ { -+ model = "Pine64 PinePhone Pro"; -+ compatible = "pine64,pinephone-pro", "rockchip,rk3399"; ++ model = "Pine64 PinePhonePro"; ++ compatible = "pine64,pinephonepro", "rockchip,rk3399"; + + chosen { + stdout-path = "serial2:1500000n8"; @@ -626,264 +585,5 @@ index 00000000..3fe1845c +&vopl_mmu { + status = "okay"; +}; -diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig -index 17628f91..3ba603ca 100644 ---- a/arch/arm/mach-rockchip/rk3399/Kconfig -+++ b/arch/arm/mach-rockchip/rk3399/Kconfig -@@ -28,6 +28,13 @@ config TARGET_PINEBOOK_PRO_RK3399 - with 4Gb RAM, onboard eMMC, USB-C, a USB3 and USB2 port, - 1920*1080 screen and all the usual laptop features. - -+config TARGET_PINEPHONE_PRO_RK3399 -+ bool "PinePhone Pro" -+ help -+ PinePhone Pro is a phone based on the Rockchip rk3399 SoC -+ with 4Gb RAM, onboard eMMC, USB-C, a headphone jack, -+ 720x1440 screen and an external Quectel USB modem. -+ - config TARGET_PUMA_RK3399 - bool "Theobroma Systems RK3399-Q7 (Puma)" - help -@@ -154,6 +161,7 @@ endif # BOOTCOUNT_LIMIT - source "board/firefly/roc-pc-rk3399/Kconfig" - source "board/google/gru/Kconfig" - source "board/pine64/pinebook-pro-rk3399/Kconfig" -+source "board/pine64/pinephone-pro-rk3399/Kconfig" - source "board/pine64/rockpro64_rk3399/Kconfig" - source "board/rockchip/evb_rk3399/Kconfig" - source "board/theobroma-systems/puma_rk3399/Kconfig" -diff --git a/board/pine64/pinephone-pro-rk3399/Kconfig b/board/pine64/pinephone-pro-rk3399/Kconfig -new file mode 100644 -index 00000000..13d6465a ---- /dev/null -+++ b/board/pine64/pinephone-pro-rk3399/Kconfig -@@ -0,0 +1,15 @@ -+if TARGET_PINEPHONE_PRO_RK3399 -+ -+config SYS_BOARD -+ default "pinephone-pro-rk3399" -+ -+config SYS_VENDOR -+ default "pine64" -+ -+config SYS_CONFIG_NAME -+ default "pinephone-pro-rk3399" -+ -+config BOARD_SPECIFIC_OPTIONS -+ def_bool y -+ -+endif -diff --git a/board/pine64/pinephone-pro-rk3399/MAINTAINERS b/board/pine64/pinephone-pro-rk3399/MAINTAINERS -new file mode 100644 -index 00000000..9ca4fc4c ---- /dev/null -+++ b/board/pine64/pinephone-pro-rk3399/MAINTAINERS -@@ -0,0 +1,8 @@ -+PINEPHONE_PRO -+M: Martijn Braam -+S: Maintained -+F: board/pine64/rk3399-pinephone-pro/ -+F: include/configs/rk3399-pinephone-pro.h -+F: arch/arm/dts/rk3399-pinephone-pro.dts -+F: arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi -+F: configs/pinephone-pro-rk3399_defconfig -diff --git a/board/pine64/pinephone-pro-rk3399/Makefile b/board/pine64/pinephone-pro-rk3399/Makefile -new file mode 100644 -index 00000000..8d920305 ---- /dev/null -+++ b/board/pine64/pinephone-pro-rk3399/Makefile -@@ -0,0 +1 @@ -+obj-y += pinephone-pro-rk3399.o -diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -new file mode 100644 -index 00000000..8efeb6ea ---- /dev/null -+++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -@@ -0,0 +1,57 @@ -+// SPDX-License-Identifier: GPL-2.0+ -+/* -+ * (C) Copyright 2019 Vasily Khoruzhick -+ * (C) Copyright 2021 Martijn Braam -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#define GRF_IO_VSEL_BT565_SHIFT 0 -+#define PMUGRF_CON0_VSEL_SHIFT 8 -+ -+#ifdef CONFIG_MISC_INIT_R -+static void setup_iodomain(void) -+{ -+ struct rk3399_grf_regs *grf = -+ syscon_get_first_range(ROCKCHIP_SYSCON_GRF); -+ struct rk3399_pmugrf_regs *pmugrf = -+ syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); -+ -+ /* BT565 is in 1.8v domain */ -+ rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); -+ -+ /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ -+ rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); -+} -+ -+int misc_init_r(void) -+{ -+ const u32 cpuid_offset = 0x7; -+ const u32 cpuid_length = 0x10; -+ u8 cpuid[cpuid_length]; -+ int ret; -+ -+ setup_iodomain(); -+ -+ ret = rockchip_cpuid_from_efuse(cpuid_offset, cpuid_length, cpuid); -+ if (ret) -+ return ret; -+ -+ ret = rockchip_cpuid_set(cpuid, cpuid_length); -+ if (ret) -+ return ret; -+ -+ ret = rockchip_setup_macaddr(); -+ -+ return ret; -+} -+ -+#endif -diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig -new file mode 100644 -index 00000000..2cf80f7d ---- /dev/null -+++ b/configs/pinephone-pro-rk3399_defconfig -@@ -0,0 +1,92 @@ -+CONFIG_ARM=y -+CONFIG_SKIP_LOWLEVEL_INIT=y -+CONFIG_ARCH_ROCKCHIP=y -+CONFIG_SYS_TEXT_BASE=0x00200000 -+CONFIG_NR_DRAM_BANKS=1 -+CONFIG_ENV_SIZE=0x8000 -+CONFIG_ROCKCHIP_RK3399=y -+CONFIG_TARGET_PINEPHONE_PRO_RK3399=y -+CONFIG_DEBUG_UART_BASE=0xFF1A0000 -+CONFIG_DEBUG_UART_CLOCK=24000000 -+CONFIG_SPL_SPI_FLASH_SUPPORT=y -+CONFIG_SPL_SPI_SUPPORT=y -+CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinephone-pro" -+CONFIG_DEBUG_UART=y -+CONFIG_SYS_LOAD_ADDR=0x800800 -+CONFIG_BOOTDELAY=3 -+CONFIG_USE_PREBOOT=y -+CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-pinephone-pro.dtb" -+CONFIG_DISPLAY_BOARDINFO_LATE=y -+CONFIG_MISC_INIT_R=y -+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set -+CONFIG_SPL_STACK_R=y -+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 -+CONFIG_SPL_MTD_SUPPORT=y -+CONFIG_SPL_SPI_LOAD=y -+CONFIG_TPL=y -+CONFIG_CMD_BOOTZ=y -+CONFIG_CMD_GPIO=y -+CONFIG_CMD_GPT=y -+CONFIG_CMD_I2C=y -+CONFIG_CMD_MMC=y -+CONFIG_CMD_PCI=y -+CONFIG_CMD_USB=y -+# CONFIG_CMD_SETEXPR is not set -+CONFIG_CMD_TIME=y -+CONFIG_CMD_PMIC=y -+CONFIG_CMD_REGULATOR=y -+CONFIG_SPL_OF_CONTROL=y -+CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -+CONFIG_ENV_IS_IN_SPI_FLASH=y -+CONFIG_SYS_RELOC_GD_ENV_ADDR=y -+CONFIG_ROCKCHIP_GPIO=y -+CONFIG_SYS_I2C_ROCKCHIP=y -+CONFIG_DM_KEYBOARD=y -+CONFIG_LED=y -+CONFIG_LED_GPIO=y -+CONFIG_MISC=y -+CONFIG_ROCKCHIP_EFUSE=y -+CONFIG_MMC_DW=y -+CONFIG_MMC_DW_ROCKCHIP=y -+CONFIG_MMC_SDHCI=y -+CONFIG_MMC_SDHCI_SDMA=y -+CONFIG_MMC_SDHCI_ROCKCHIP=y -+CONFIG_SF_DEFAULT_SPEED=20000000 -+CONFIG_SPI_FLASH_GIGADEVICE=y -+CONFIG_SPI_FLASH_WINBOND=y -+CONFIG_DM_ETH=y -+CONFIG_PHY_ROCKCHIP_INNO_USB2=y -+CONFIG_PHY_ROCKCHIP_TYPEC=y -+CONFIG_DM_PMIC_FAN53555=y -+CONFIG_PMIC_RK8XX=y -+CONFIG_REGULATOR_PWM=y -+CONFIG_REGULATOR_RK8XX=y -+CONFIG_PWM_ROCKCHIP=y -+CONFIG_RAM_RK3399_LPDDR4=y -+CONFIG_DM_RESET=y -+CONFIG_DM_RNG=y -+CONFIG_RNG_ROCKCHIP=y -+CONFIG_BAUDRATE=1500000 -+CONFIG_DEBUG_UART_SHIFT=2 -+CONFIG_ROCKCHIP_SPI=y -+CONFIG_SYSRESET=y -+CONFIG_USB=y -+CONFIG_USB_XHCI_HCD=y -+CONFIG_USB_XHCI_DWC3=y -+CONFIG_USB_EHCI_HCD=y -+CONFIG_USB_EHCI_GENERIC=y -+CONFIG_USB_OHCI_HCD=y -+CONFIG_USB_OHCI_GENERIC=y -+CONFIG_USB_DWC3=y -+CONFIG_USB_DWC3_GENERIC=y -+CONFIG_USB_KEYBOARD=y -+CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE=y -+CONFIG_USB_HOST_ETHER=y -+CONFIG_USB_ETHER_ASIX=y -+CONFIG_USB_ETHER_RTL8152=y -+CONFIG_DM_VIDEO=y -+CONFIG_DISPLAY=y -+CONFIG_VIDEO_ROCKCHIP=y -+CONFIG_DISPLAY_ROCKCHIP_EDP=y -+CONFIG_SPL_TINY_MEMSET=y -+CONFIG_ERRNO_STR=y -diff --git a/include/configs/pinephone-pro-rk3399.h b/include/configs/pinephone-pro-rk3399.h -new file mode 100644 -index 00000000..fefa793f ---- /dev/null -+++ b/include/configs/pinephone-pro-rk3399.h -@@ -0,0 +1,23 @@ -+/* SPDX-License-Identifier: GPL-2.0+ */ -+/* -+ * Copyright (C) 2016 Rockchip Electronics Co., Ltd -+ * Copyright (C) 2020 Peter Robinson -+ * Copyright (C) 2021 Martijn Braam -+ */ -+ -+#ifndef __PINEPHONE_PRO_RK3399_H -+#define __PINEPHONE_PRO_RK3399_H -+ -+#define ROCKCHIP_DEVICE_SETTINGS \ -+ "stdin=serial,usbkbd\0" \ -+ "stdout=serial,vidconsole\0" \ -+ "stderr=serial,vidconsole\0" -+ -+#include -+ -+#define SDRAM_BANK_SIZE (2UL << 30) -+ -+#define CONFIG_USB_OHCI_NEW -+#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 -+ -+#endif -- -2.34.1 - +2.33.0 diff --git a/dev-embedded/u-boot-pinephone-pro/files/0003-Config-changes.patch b/dev-embedded/u-boot-pinephone-pro/files/0003-Config-changes.patch new file mode 100644 index 0000000..da45a05 --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0003-Config-changes.patch @@ -0,0 +1,25 @@ +From 6e64cdb39e4452315cf9a4d1e9e89691403c3089 Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sun, 13 Dec 2020 19:36:14 +0100 +Subject: [PATCH 3/8] Config changes + +--- + configs/pinephone-pro-rk3399_defconfig | 2 -- + 1 file changed, 2 deletions(-) + +diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig +index 320ce65ffb..1c2e7f278d 100644 +--- a/configs/pinephone-pro-rk3399_defconfig ++++ b/configs/pinephone-pro-rk3399_defconfig +@@ -53,8 +53,6 @@ CONFIG_SF_DEFAULT_SPEED=20000000 + CONFIG_SPI_FLASH_GIGADEVICE=y + CONFIG_SPI_FLASH_WINBOND=y + CONFIG_DM_ETH=y +-CONFIG_NVME=y +-CONFIG_PCI=y + CONFIG_PHY_ROCKCHIP_INNO_USB2=y + CONFIG_PHY_ROCKCHIP_TYPEC=y + CONFIG_DM_PMIC_FAN53555=y +-- +2.33.0 + diff --git a/dev-embedded/u-boot-pinephone-pro/files/0003-Configure-USB-power-settings-for-PinePhone-Pro.patch b/dev-embedded/u-boot-pinephone-pro/files/0003-Configure-USB-power-settings-for-PinePhone-Pro.patch deleted file mode 100644 index d2eb998..0000000 --- a/dev-embedded/u-boot-pinephone-pro/files/0003-Configure-USB-power-settings-for-PinePhone-Pro.patch +++ /dev/null @@ -1,228 +0,0 @@ -From 8ee2257dda6bed2f1ae117e614637036003785d4 Mon Sep 17 00:00:00 2001 -From: Dragan Simic -Date: Thu, 30 Dec 2021 00:08:51 +0100 -Subject: [PATCH] Configure USB power settings for PinePhone Pro - ---- - arch/arm/mach-rockchip/rk3399/rk3399.c | 5 ++ - .../pinephone-pro-rk3399.c | 58 ++++++++++++++++--- - configs/pinephone-pro-rk3399_defconfig | 6 ++ - drivers/power/regulator/rk8xx.c | 21 ++++--- - 4 files changed, 72 insertions(+), 18 deletions(-) - -diff --git a/arch/arm/mach-rockchip/rk3399/rk3399.c b/arch/arm/mach-rockchip/rk3399/rk3399.c -index d40969c8..644e4ab2 100644 ---- a/arch/arm/mach-rockchip/rk3399/rk3399.c -+++ b/arch/arm/mach-rockchip/rk3399/rk3399.c -@@ -248,9 +248,14 @@ void __weak led_setup(void) - { - } - -+void __weak power_setup(void) -+{ -+} -+ - void spl_board_init(void) - { - led_setup(); -+ power_setup(); - - #if defined(SPL_GPIO) - struct rockchip_cru *cru = rockchip_get_cru(); -diff --git a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -index 8efeb6ea..88583e31 100644 ---- a/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -+++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c -@@ -2,8 +2,14 @@ - /* - * (C) Copyright 2019 Vasily Khoruzhick - * (C) Copyright 2021 Martijn Braam -+ * (C) Copyright 2021 Dragan Simic - */ - -+/* -+ * TODO: Disable debugging -+ */ -+#define DEBUG -+ - #include - #include - #include -@@ -13,6 +19,8 @@ - #include - #include - #include -+#include -+#include - - #define GRF_IO_VSEL_BT565_SHIFT 0 - #define PMUGRF_CON0_VSEL_SHIFT 8 -@@ -20,15 +28,13 @@ - #ifdef CONFIG_MISC_INIT_R - static void setup_iodomain(void) - { -- struct rk3399_grf_regs *grf = -- syscon_get_first_range(ROCKCHIP_SYSCON_GRF); -- struct rk3399_pmugrf_regs *pmugrf = -- syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); -+ struct rk3399_grf_regs *grf = syscon_get_first_range(ROCKCHIP_SYSCON_GRF); -+ struct rk3399_pmugrf_regs *pmugrf = syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF); - -- /* BT565 is in 1.8v domain */ -+ /* BT565 is in 1.8 V domain */ - rk_setreg(&grf->io_vsel, 1 << GRF_IO_VSEL_BT565_SHIFT); - -- /* Set GPIO1 1.8v/3.0v source select to PMU1830_VOL */ -+ /* Set GPIO1 1.8/3.0 V source select to PMU1830_VOL */ - rk_setreg(&pmugrf->soc_con0, 1 << PMUGRF_CON0_VSEL_SHIFT); - } - -@@ -53,5 +59,43 @@ int misc_init_r(void) - - return ret; - } -+#endif /* CONFIG_MISC_INIT_R */ - --#endif -+/* -+ * TODO: Change CONFIG_SPL_POWER_SUPPORT to CONFIG_SPL_POWER, to match newer U-Boot versions. -+ * The same applies to CONFIG_SPL_I2C_SUPPORT. -+ */ -+ -+#if defined(CONFIG_SPL_BUILD) && \ -+ CONFIG_IS_ENABLED(POWER_SUPPORT) && !CONFIG_IS_ENABLED(OF_PLATDATA) -+static int setup_usb_power(void) -+{ -+ struct udevice *pmic; -+ int ret; -+ -+ ret = uclass_first_device_err(UCLASS_PMIC, &pmic); -+ if (ret) -+ return ret; -+ -+ /* set USB current limit to 2.5 A */ -+ ret = rk818_spl_configure_usb_input_current(pmic, 2500); -+ if (ret) -+ return ret; -+ -+ /* set USB low voltage threshold to 3.26 V */ -+ ret = rk818_spl_configure_usb_chrg_shutdown(pmic, 3260000); -+ if (ret) -+ return ret; -+ -+ return 0; -+} -+ -+void power_setup(void) -+{ -+ int ret; -+ -+ ret = setup_usb_power(); -+ if (ret) -+ debug("Failed to configure USB power settings: %d\n", ret); -+} -+#endif /* CONFIG_SPL_BUILD && POWER_SUPPORT && !OF_PLATDATA */ -diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig -index 2cf80f7d..b7ca9317 100644 ---- a/configs/pinephone-pro-rk3399_defconfig -+++ b/configs/pinephone-pro-rk3399_defconfig -@@ -23,6 +23,11 @@ CONFIG_SPL_STACK_R=y - CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000 - CONFIG_SPL_MTD_SUPPORT=y - CONFIG_SPL_SPI_LOAD=y -+CONFIG_SPL_I2C_SUPPORT=y -+CONFIG_SPL_POWER_SUPPORT=y -+CONFIG_SPL_GPIO_SUPPORT=y -+CONFIG_SPL_DM=y -+CONFIG_SPL_DM_REGULATOR=y - CONFIG_TPL=y - CONFIG_CMD_BOOTZ=y - CONFIG_CMD_GPIO=y -@@ -34,6 +39,7 @@ CONFIG_CMD_USB=y - # CONFIG_CMD_SETEXPR is not set - CONFIG_CMD_TIME=y - CONFIG_CMD_PMIC=y -+# CONFIG_SPL_PMIC_CHILDREN is not set - CONFIG_CMD_REGULATOR=y - CONFIG_SPL_OF_CONTROL=y - CONFIG_OF_SPL_REMOVE_PROPS="pinctrl-0 pinctrl-names clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents" -diff --git a/drivers/power/regulator/rk8xx.c b/drivers/power/regulator/rk8xx.c -index 0ee07ad2..9d42a6ca 100644 ---- a/drivers/power/regulator/rk8xx.c -+++ b/drivers/power/regulator/rk8xx.c -@@ -16,14 +16,10 @@ - #include - #include - --#ifndef CONFIG_SPL_BUILD --#define ENABLE_DRIVER --#endif -- - /* Not used or exisit register and configure */ - #define NA 0xff - --/* Field Definitions */ -+/* Field definitions */ - #define RK808_BUCK_VSEL_MASK 0x3f - #define RK808_BUCK4_VSEL_MASK 0xf - #define RK808_LDO_VSEL_MASK 0x1f -@@ -145,7 +141,7 @@ static const struct rk8xx_reg_info rk818_buck[] = { - { 1800000, 100000, REG_BUCK4_ON_VSEL, REG_BUCK4_SLP_VSEL, REG_BUCK4_CONFIG, RK818_BUCK4_VSEL_MASK, }, - }; - --#ifdef ENABLE_DRIVER -+#if CONFIG_IS_ENABLED(PMIC_CHILDREN) - static const struct rk8xx_reg_info rk808_ldo[] = { - { 1800000, 100000, REG_LDO1_ON_VSEL, REG_LDO1_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, }, - { 1800000, 100000, REG_LDO2_ON_VSEL, REG_LDO2_SLP_VSEL, NA, RK808_LDO_VSEL_MASK, }, -@@ -206,8 +202,9 @@ static const struct rk8xx_reg_info rk818_ldo[] = { - { 800000, 100000, REG_LDO7_ON_VSEL, REG_LDO7_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, }, - { 1800000, 100000, REG_LDO8_ON_VSEL, REG_LDO8_SLP_VSEL, NA, RK818_LDO_VSEL_MASK, }, - }; --#endif -+#endif /* PMIC_CHILDREN */ - -+#ifdef CONFIG_SPL_BUILD - static const u16 rk818_chrg_cur_input_array[] = { - 450, 800, 850, 1000, 1250, 1500, 1750, 2000, 2250, 2500, 2750, 3000 - }; -@@ -215,6 +212,7 @@ static const u16 rk818_chrg_cur_input_array[] = { - static const uint rk818_chrg_shutdown_vsel_array[] = { - 2780000, 2850000, 2920000, 2990000, 3060000, 3130000, 3190000, 3260000 - }; -+#endif /* CONFIG_SPL_BUILD */ - - static const struct rk8xx_reg_info *get_buck_reg(struct udevice *pmic, - int num, int uvolt) -@@ -357,7 +355,7 @@ static int _buck_set_enable(struct udevice *pmic, int buck, bool enable) - return ret; - } - --#ifdef ENABLE_DRIVER -+#if CONFIG_IS_ENABLED(PMIC_CHILDREN) - static int _buck_set_suspend_value(struct udevice *pmic, int buck, int uvolt) - { - const struct rk8xx_reg_info *info = get_buck_reg(pmic, buck, uvolt); -@@ -1121,8 +1119,9 @@ U_BOOT_DRIVER(rk8xx_switch) = { - .ops = &rk8xx_switch_ops, - .probe = rk8xx_switch_probe, - }; --#endif -+#endif /* PMIC_CHILDREN */ - -+#ifdef CONFIG_SPL_BUILD - int rk8xx_spl_configure_buck(struct udevice *pmic, int buck, int uvolt) - { - int ret; -@@ -1153,6 +1152,6 @@ int rk818_spl_configure_usb_chrg_shutdown(struct udevice *pmic, int uvolt) - if (uvolt <= rk818_chrg_shutdown_vsel_array[i]) - break; - -- return pmic_clrsetbits(pmic, REG_USB_CTRL, RK818_USB_CHG_SD_VSEL_MASK, -- i); -+ return pmic_clrsetbits(pmic, REG_USB_CTRL, RK818_USB_CHG_SD_VSEL_MASK, i); - } -+#endif /* CONFIG_SPL_BUILD */ --- -2.34.1 - diff --git a/dev-embedded/u-boot-pinephone-pro/files/0004-Add-kconfig-include.patch b/dev-embedded/u-boot-pinephone-pro/files/0004-Add-kconfig-include.patch new file mode 100644 index 0000000..efed2f7 --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0004-Add-kconfig-include.patch @@ -0,0 +1,24 @@ +From 4101d635fb8d82a5f6e63decccddfcfdea9f081e Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sun, 13 Dec 2020 19:48:37 +0100 +Subject: [PATCH 4/8] Add kconfig include + +--- + arch/arm/mach-rockchip/rk3399/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig +index 35b1125906..3ba603ca80 100644 +--- a/arch/arm/mach-rockchip/rk3399/Kconfig ++++ b/arch/arm/mach-rockchip/rk3399/Kconfig +@@ -161,6 +161,7 @@ endif # BOOTCOUNT_LIMIT + source "board/firefly/roc-pc-rk3399/Kconfig" + source "board/google/gru/Kconfig" + source "board/pine64/pinebook-pro-rk3399/Kconfig" ++source "board/pine64/pinephone-pro-rk3399/Kconfig" + source "board/pine64/rockpro64_rk3399/Kconfig" + source "board/rockchip/evb_rk3399/Kconfig" + source "board/theobroma-systems/puma_rk3399/Kconfig" +-- +2.33.0 + diff --git a/dev-embedded/u-boot-pinephone-pro/files/0005-Add-pinephone-pro-rk3399.h.patch b/dev-embedded/u-boot-pinephone-pro/files/0005-Add-pinephone-pro-rk3399.h.patch new file mode 100644 index 0000000..d28fba1 --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0005-Add-pinephone-pro-rk3399.h.patch @@ -0,0 +1,41 @@ +From 13c8c6945856e57958fdf7e4ef338c21e1199f19 Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sun, 13 Dec 2020 19:52:09 +0100 +Subject: [PATCH 5/8] Add pinephone-pro-rk3399.h + +--- + include/configs/pinephone-pro-rk3399.h | 22 ++++++++++++++++++++++ + 1 file changed, 22 insertions(+) + create mode 100644 include/configs/pinephone-pro-rk3399.h + +diff --git a/include/configs/pinephone-pro-rk3399.h b/include/configs/pinephone-pro-rk3399.h +new file mode 100644 +index 0000000000..aaaa344839 +--- /dev/null ++++ b/include/configs/pinephone-pro-rk3399.h +@@ -0,0 +1,22 @@ ++/* SPDX-License-Identifier: GPL-2.0+ */ ++/* ++ * Copyright (C) 2016 Rockchip Electronics Co., Ltd ++ * Copyright (C) 2020 Peter Robinson ++ */ ++ ++#ifndef __PINEPHONE_PRO_RK3399_H ++#define __PINEPHONE_PRO_RK3399_H ++ ++#define ROCKCHIP_DEVICE_SETTINGS \ ++ "stdin=serial,usbkbd\0" \ ++ "stdout=serial,vidconsole\0" \ ++ "stderr=serial,vidconsole\0" ++ ++#include ++ ++#define SDRAM_BANK_SIZE (2UL << 30) ++ ++#define CONFIG_USB_OHCI_NEW ++#define CONFIG_SYS_USB_OHCI_MAX_ROOT_PORTS 2 ++ ++#endif +-- +2.33.0 + diff --git a/dev-embedded/u-boot-pinephone-pro/files/0006-Added-dts-to-makefile.patch b/dev-embedded/u-boot-pinephone-pro/files/0006-Added-dts-to-makefile.patch new file mode 100644 index 0000000..f24e81e --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0006-Added-dts-to-makefile.patch @@ -0,0 +1,23 @@ +From 3e8d6e4d57dd15acf104a8f11ff18833f8d7adc7 Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sun, 13 Dec 2020 19:57:49 +0100 +Subject: [PATCH 6/8] Added dts to makefile + +--- + arch/arm/dts/Makefile | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile +index e2e8a5fb7a..ff07ae0270 100644 +--- a/arch/arm/dts/Makefile ++++ b/arch/arm/dts/Makefile +@@ -135,6 +135,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ + rk3399-nanopi-r4s.dtb \ + rk3399-orangepi.dtb \ + rk3399-pinebook-pro.dtb \ ++ rk3399-pinephone-pro.dtb \ + rk3399-puma-haikou.dtb \ + rk3399-roc-pc.dtb \ + rk3399-roc-pc-mezzanine.dtb \ +-- +2.33.0 diff --git a/dev-embedded/u-boot-pinephone-pro/files/0007-u-boot.dtsi-fixes.patch b/dev-embedded/u-boot-pinephone-pro/files/0007-u-boot.dtsi-fixes.patch new file mode 100644 index 0000000..9e09c0c --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0007-u-boot.dtsi-fixes.patch @@ -0,0 +1,24 @@ +From 19150d65b1bed6831ba92a4cf3e7262518f1049f Mon Sep 17 00:00:00 2001 +From: Martijn Braam +Date: Sun, 13 Dec 2020 20:02:56 +0100 +Subject: [PATCH 7/8] u-boot.dtsi fixes + +--- + arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi +index 7a058477db..e52263aafe 100644 +--- a/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi ++++ b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi +@@ -12,7 +12,7 @@ + }; + + chosen { +- u-boot,spl-boot-order = "same-as-spl", &sdhci, &spiflash, &sdmmc; ++ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; + }; + + config { +-- +2.33.0 diff --git a/dev-embedded/u-boot-pinephone-pro/files/0008-fix-boot-order.patch b/dev-embedded/u-boot-pinephone-pro/files/0008-fix-boot-order.patch new file mode 100644 index 0000000..a18a904 --- /dev/null +++ b/dev-embedded/u-boot-pinephone-pro/files/0008-fix-boot-order.patch @@ -0,0 +1,44 @@ +From b212ad24a604b00b240add35516b7381965deb31 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Thu, 17 Jun 2021 11:01:12 +0200 +Subject: [PATCH] rockchip: Fix MMC boot order + +Basically all, i.e. rk3036.dtsi, rk3128.dtsi, rk3xxx.dtsi, rk322x.dtsi, +rk3288.dtsi, rk3308-u-boot.dtsi, rk3328-u-boot.dtsi, rk3399-u-boot.dtsi +and px30-u-boot.dtsi Rockchip SoC devicetrees which have mmc indexes +are defining eMMC as mmc0 and sdmmc as mmc1. +This means that the rule to try to boot from the SD card first is ignored, +which as per comment is what we want and is important for distros, which +rely on that. + +Fix this by setting the correct mmc index, i.e. first from mmc1 (SD card), +second from mmc0 (eMMC). + +Signed-off-by: Alex Bee +Reviewed-by: Kever Yang +--- + include/configs/rockchip-common.h | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/include/configs/rockchip-common.h b/include/configs/rockchip-common.h +index 0b9e24d1db..ba7061a287 100644 +--- a/include/configs/rockchip-common.h ++++ b/include/configs/rockchip-common.h +@@ -14,11 +14,11 @@ + + #ifndef CONFIG_SPL_BUILD + +-/* First try to boot from SD (index 0), then eMMC (index 1) */ ++/* First try to boot from SD (index 1), then eMMC (index 0) */ + #if CONFIG_IS_ENABLED(CMD_MMC) + #define BOOT_TARGET_MMC(func) \ +- func(MMC, mmc, 0) \ +- func(MMC, mmc, 1) ++ func(MMC, mmc, 1) \ ++ func(MMC, mmc, 0) + #else + #define BOOT_TARGET_MMC(func) + #endif +-- +GitLab + diff --git a/dev-embedded/u-boot-pinephone-pro/files/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch b/dev-embedded/u-boot-pinephone-pro/files/0009-Correct-boot-order-to-be-USB-SD-eMMC.patch similarity index 100% rename from dev-embedded/u-boot-pinephone-pro/files/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch rename to dev-embedded/u-boot-pinephone-pro/files/0009-Correct-boot-order-to-be-USB-SD-eMMC.patch diff --git a/dev-embedded/u-boot-pinephone-pro/u-boot-pinephone-pro-2022.01.ebuild b/dev-embedded/u-boot-pinephone-pro/u-boot-pinephone-pro-2022.01.ebuild index 05039d4..7e0df66 100644 --- a/dev-embedded/u-boot-pinephone-pro/u-boot-pinephone-pro-2022.01.ebuild +++ b/dev-embedded/u-boot-pinephone-pro/u-boot-pinephone-pro-2022.01.ebuild @@ -41,9 +41,16 @@ src_prepare() { tools/Makefile || die #Apply PinePhone Pro patches - eapply "${FILESDIR}/0001-rockchip-Add-initial-support-for-the-PinePhone-Pro.patch" - eapply "${FILESDIR}/0002-Correct-boot-order-to-be-USB-SD-eMMC.patch" - eapply "${FILESDIR}/0003-Configure-USB-power-settings-for-PinePhone-Pro.patch" + eapply "${FILESDIR}"/0001-PPP.patch + eapply "${FILESDIR}"/0002-Add-ppp-dt.patch + eapply "${FILESDIR}"/0003-Config-changes.patch + eapply "${FILESDIR}"/0004-Add-kconfig-include.patch + eapply "${FILESDIR}"/0005-Add-pinephone-pro-rk3399.h.patch + eapply "${FILESDIR}"/0006-Added-dts-to-makefile.patch + eapply "${FILESDIR}"/0007-u-boot.dtsi-fixes.patch + eapply "${FILESDIR}"/0008-fix-boot-order.patch + eapply "${FILESDIR}"/0009-Correct-boot-order-to-be-USB-SD-eMMC.patch + }