uboot-tools/rockchip-Add-initial-support-for-the-PinePhone-Pro.patch

921 lines
24 KiB
Diff
Raw Normal View History

2022-12-31 11:06:47 +00:00
From 004af623388022d258cbc29c0b71d8e22cd96c52 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sat, 31 Dec 2022 09:20:34 +0000
Subject: [PATCH v2 0/2] Initial support for Pinephone Pro
2022-02-19 10:11:28 +00:00
2022-12-31 11:06:47 +00:00
This adds initial support for the PINE64 Pinephone Pro. It's a rebase
to upstream core rk3399 DT pieces, and the addition of the upstream
PPP DT from 6.2-rc1 and the U-Boot pieces are based on my work on
the Pinebook Pro.
2022-02-19 10:11:28 +00:00
2022-12-31 11:06:47 +00:00
Changes v2:
- Drop the rk3399.dtsi sync for time being, causing issues around
clock/dram
- Sync the Pinephone DT to 6.2-rc1
- Update for the CONFIG_SYS_TEXT_BASE -> CONFIG_TEXT_BASE change
- usb: ohci: Use a flexible array member for portstatus
- Rename CONFIG_DM_VIDEO to CONFIG_VIDEO
- Enable DM_REGULATOR_FAN53555
- Don't initialize i2c before relocation
2022-02-19 10:11:28 +00:00
2022-12-31 11:06:47 +00:00
Peter Robinson (2):
arm64: dts: rk3399: Add upstream Pinephone Pro dts
rockchip: Add initial support for the PINE64 Pinephone Pro
2022-02-19 10:11:28 +00:00
arch/arm/dts/Makefile | 1 +
2022-12-31 11:06:47 +00:00
arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 31 ++
arch/arm/dts/rk3399-pinephone-pro.dts | 474 ++++++++++++++++++
2022-02-19 10:11:28 +00:00
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 +
2022-12-31 11:06:47 +00:00
.../pinephone-pro-rk3399.c | 76 +++
configs/pinephone-pro-rk3399_defconfig | 104 ++++
include/configs/pinephone-pro-rk3399.h | 19 +
10 files changed, 737 insertions(+)
2022-02-19 10:11:28 +00:00
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
2022-12-31 11:06:47 +00:00
--
2.39.0
From 9976caacb35316cbe047ded58855d2ca1a54243b Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Sat, 31 Dec 2022 09:18:44 +0000
Subject: [PATCH v2 1/2] arm64: dts: rk3399: Add upstream Pinephone Pro dts
Initial support for the PinePhone Pro has now landed upstream in
Linux 6.1 RC1 so sync the dts from 6.2-rc1 for initial support.
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/Makefile | 1 +
arch/arm/dts/rk3399-pinephone-pro.dts | 474 ++++++++++++++++++++++++++
2 files changed, 475 insertions(+)
create mode 100644 arch/arm/dts/rk3399-pinephone-pro.dts
2022-02-19 10:11:28 +00:00
diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
2022-12-31 11:06:47 +00:00
index 43951a7731e..8c1eec1025f 100644
2022-02-19 10:11:28 +00:00
--- a/arch/arm/dts/Makefile
+++ b/arch/arm/dts/Makefile
2022-12-31 11:06:47 +00:00
@@ -153,6 +153,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \
2022-02-19 10:11:28 +00:00
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.dts b/arch/arm/dts/rk3399-pinephone-pro.dts
new file mode 100644
2022-12-31 11:06:47 +00:00
index 00000000000..04403a76238
2022-02-19 10:11:28 +00:00
--- /dev/null
+++ b/arch/arm/dts/rk3399-pinephone-pro.dts
2022-12-31 11:06:47 +00:00
@@ -0,0 +1,474 @@
2022-02-19 10:11:28 +00:00
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
2022-12-31 11:06:47 +00:00
+ * Copyright (c) 2020 Martijn Braam <martijn@brixit.nl>
+ * Copyright (c) 2021 Kamil Trzciński <ayufan@ayufan.eu>
+ */
+
+/*
+ * PinePhone Pro datasheet:
+ * https://files.pine64.org/doc/PinePhonePro/PinephonePro-Schematic-V1.0-20211127.pdf
2022-02-19 10:11:28 +00:00
+ */
+
+/dts-v1/;
2022-12-31 11:06:47 +00:00
+#include <dt-bindings/input/linux-event-codes.h>
2022-02-19 10:11:28 +00:00
+#include "rk3399.dtsi"
+#include "rk3399-opp.dtsi"
+
+/ {
2022-12-31 11:06:47 +00:00
+ model = "Pine64 PinePhonePro";
2022-02-19 10:11:28 +00:00
+ compatible = "pine64,pinephone-pro", "rockchip,rk3399";
2022-12-31 11:06:47 +00:00
+ chassis-type = "handset";
+
+ aliases {
+ mmc0 = &sdio0;
+ mmc1 = &sdmmc;
+ mmc2 = &sdhci;
+ };
2022-02-19 10:11:28 +00:00
+
+ chosen {
2022-12-31 11:06:47 +00:00
+ stdout-path = "serial2:115200n8";
2022-02-19 10:11:28 +00:00
+ };
+
2022-12-31 11:06:47 +00:00
+ gpio-keys {
+ compatible = "gpio-keys";
2022-02-19 10:11:28 +00:00
+ pinctrl-names = "default";
2022-12-31 11:06:47 +00:00
+ pinctrl-0 = <&pwrbtn_pin>;
+
+ key-power {
+ debounce-interval = <20>;
+ gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
+ label = "Power";
+ linux,code = <KEY_POWER>;
+ wakeup-source;
+ };
2022-02-19 10:11:28 +00:00
+ };
+
2022-12-31 11:06:47 +00:00
+ vcc_sys: vcc-sys-regulator {
2022-02-19 10:11:28 +00:00
+ compatible = "regulator-fixed";
2022-12-31 11:06:47 +00:00
+ regulator-name = "vcc_sys";
2022-02-19 10:11:28 +00:00
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
2022-12-31 11:06:47 +00:00
+ vcc3v3_sys: vcc3v3-sys-regulator {
2022-02-19 10:11:28 +00:00
+ compatible = "regulator-fixed";
+ regulator-name = "vcc3v3_sys";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
2022-12-31 11:06:47 +00:00
+ vin-supply = <&vcc_sys>;
+ };
2022-02-19 10:11:28 +00:00
+
2022-12-31 11:06:47 +00:00
+ vcca1v8_s3: vcc1v8-s3-regulator {
+ compatible = "regulator-fixed";
+ regulator-name = "vcca1v8_s3";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc3v3_sys>;
+ regulator-always-on;
+ regulator-boot-on;
+ };
+
+ vcc1v8_codec: vcc1v8-codec-regulator {
+ compatible = "regulator-fixed";
+ enable-active-high;
+ gpio = <&gpio3 RK_PA4 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vcc1v8_codec_en>;
+ regulator-name = "vcc1v8_codec";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ vin-supply = <&vcc3v3_sys>;
+ };
+
+ wifi_pwrseq: sdio-wifi-pwrseq {
+ compatible = "mmc-pwrseq-simple";
+ clocks = <&rk818 1>;
+ clock-names = "ext_clock";
+ pinctrl-names = "default";
+ pinctrl-0 = <&wifi_enable_h_pin>;
+ /*
+ * Wait between power-on and SDIO access for CYP43455
+ * POR circuit.
+ */
+ post-power-on-delay-ms = <110>;
+ /*
+ * Wait between consecutive toggles for CYP43455 CBUCK
+ * regulator discharge.
+ */
+ power-off-delay-us = <10000>;
+
+ /* WL_REG_ON on module */
+ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
2022-02-19 10:11:28 +00:00
+ };
+};
+
+&cpu_l0 {
+ cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l1 {
+ cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l2 {
+ cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_l3 {
+ cpu-supply = <&vdd_cpu_l>;
+};
+
+&cpu_b0 {
+ cpu-supply = <&vdd_cpu_b>;
+};
+
+&cpu_b1 {
+ cpu-supply = <&vdd_cpu_b>;
+};
+
+&emmc_phy {
+ status = "okay";
+};
+
+&i2c0 {
+ clock-frequency = <400000>;
+ i2c-scl-rising-time-ns = <168>;
+ i2c-scl-falling-time-ns = <4>;
+ status = "okay";
+
+ rk818: pmic@1c {
+ compatible = "rockchip,rk818";
+ reg = <0x1c>;
+ interrupt-parent = <&gpio1>;
+ interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>;
+ #clock-cells = <1>;
+ clock-output-names = "xin32k", "rk808-clkout2";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pmic_int_l>;
+ rockchip,system-power-controller;
+ wakeup-source;
+
2022-12-31 11:06:47 +00:00
+ vcc1-supply = <&vcc_sys>;
+ vcc2-supply = <&vcc_sys>;
+ vcc3-supply = <&vcc_sys>;
+ vcc4-supply = <&vcc_sys>;
+ vcc6-supply = <&vcc_sys>;
2022-02-19 10:11:28 +00:00
+ vcc7-supply = <&vcc3v3_sys>;
2022-12-31 11:06:47 +00:00
+ vcc8-supply = <&vcc_sys>;
2022-02-19 10:11:28 +00:00
+ vcc9-supply = <&vcc3v3_sys>;
+
+ regulators {
+ vdd_cpu_l: DCDC_REG1 {
2022-12-31 11:06:47 +00:00
+ regulator-name = "vdd_cpu_l";
2022-02-19 10:11:28 +00:00
+ regulator-always-on;
+ regulator-boot-on;
2022-12-31 11:06:47 +00:00
+ regulator-min-microvolt = <875000>;
+ regulator-max-microvolt = <975000>;
2022-02-19 10:11:28 +00:00
+ regulator-ramp-delay = <6001>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_center: DCDC_REG2 {
+ regulator-name = "vdd_center";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <800000>;
2022-12-31 11:06:47 +00:00
+ regulator-max-microvolt = <1000000>;
2022-02-19 10:11:28 +00:00
+ regulator-ramp-delay = <6001>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vcc_ddr: DCDC_REG3 {
+ regulator-name = "vcc_ddr";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vcc_1v8: DCDC_REG4 {
+ regulator-name = "vcc_1v8";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vcca3v0_codec: LDO_REG1 {
+ regulator-name = "vcca3v0_codec";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ };
+
+ vcc3v0_touch: LDO_REG2 {
+ regulator-name = "vcc3v0_touch";
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ };
+
+ vcca1v8_codec: LDO_REG3 {
+ regulator-name = "vcca1v8_codec";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
2022-12-31 11:06:47 +00:00
+ rk818_pwr_on: LDO_REG4 {
+ regulator-name = "rk818_pwr_on";
2022-02-19 10:11:28 +00:00
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vcc_3v0: LDO_REG5 {
+ regulator-name = "vcc_3v0";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3000000>;
+ regulator-max-microvolt = <3000000>;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vcc_1v5: LDO_REG6 {
+ regulator-name = "vcc_1v5";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <1500000>;
+ regulator-max-microvolt = <1500000>;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+
+ vcc1v8_dvp: LDO_REG7 {
+ regulator-name = "vcc1v8_dvp";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ };
+
+ vcc3v3_s3: LDO_REG8 {
+ regulator-name = "vcc3v3_s3";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
2022-12-31 11:06:47 +00:00
+ vccio_sd: LDO_REG9 {
+ regulator-name = "vccio_sd";
2022-02-19 10:11:28 +00:00
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <3300000>;
+ };
+
+ vcc3v3_s0: SWITCH_REG {
+ regulator-name = "vcc3v3_s0";
+ regulator-always-on;
+ regulator-boot-on;
+ regulator-state-mem {
+ regulator-on-in-suspend;
+ };
+ };
+ };
+ };
+
+ vdd_cpu_b: regulator@40 {
+ compatible = "silergy,syr827";
+ reg = <0x40>;
+ fcs,suspend-voltage-selector = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vsel1_pin>;
+ regulator-name = "vdd_cpu_b";
2022-12-31 11:06:47 +00:00
+ regulator-min-microvolt = <875000>;
+ regulator-max-microvolt = <1150000>;
2022-02-19 10:11:28 +00:00
+ regulator-ramp-delay = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+
+ vdd_gpu: regulator@41 {
+ compatible = "silergy,syr828";
+ reg = <0x41>;
+ fcs,suspend-voltage-selector = <1>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&vsel2_pin>;
+ regulator-name = "vdd_gpu";
2022-12-31 11:06:47 +00:00
+ regulator-min-microvolt = <875000>;
+ regulator-max-microvolt = <975000>;
2022-02-19 10:11:28 +00:00
+ regulator-ramp-delay = <1000>;
+ regulator-always-on;
+ regulator-boot-on;
+
+ regulator-state-mem {
+ regulator-off-in-suspend;
+ };
+ };
+};
+
2022-12-31 11:06:47 +00:00
+&cluster0_opp {
+ opp04 {
+ status = "disabled";
+ };
2022-02-19 10:11:28 +00:00
+
2022-12-31 11:06:47 +00:00
+ opp05 {
+ status = "disabled";
+ };
2022-02-19 10:11:28 +00:00
+};
+
2022-12-31 11:06:47 +00:00
+&cluster1_opp {
+ opp06 {
+ opp-hz = /bits/ 64 <1500000000>;
+ opp-microvolt = <1100000 1100000 1150000>;
+ };
2022-02-19 10:11:28 +00:00
+
2022-12-31 11:06:47 +00:00
+ opp07 {
+ status = "disabled";
2022-02-19 10:11:28 +00:00
+ };
+};
+
+&io_domains {
+ bt656-supply = <&vcc1v8_dvp>;
+ audio-supply = <&vcca1v8_codec>;
2022-12-31 11:06:47 +00:00
+ sdmmc-supply = <&vccio_sd>;
2022-02-19 10:11:28 +00:00
+ gpio1830-supply = <&vcc_3v0>;
2022-12-31 11:06:47 +00:00
+ status = "okay";
2022-02-19 10:11:28 +00:00
+};
+
+&pmu_io_domains {
2022-12-31 11:06:47 +00:00
+ pmu1830-supply = <&vcc_1v8>;
2022-02-19 10:11:28 +00:00
+ status = "okay";
+};
+
+&pinctrl {
+ buttons {
2022-12-31 11:06:47 +00:00
+ pwrbtn_pin: pwrbtn-pin {
2022-02-19 10:11:28 +00:00
+ rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+ };
+
+ pmic {
+ pmic_int_l: pmic-int-l {
+ rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
+ };
+
+ vsel1_pin: vsel1-pin {
+ rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+
+ vsel2_pin: vsel2-pin {
+ rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
+ };
+ };
+
+ sdio-pwrseq {
2022-12-31 11:06:47 +00:00
+ wifi_enable_h_pin: wifi-enable-h-pin {
2022-02-19 10:11:28 +00:00
+ rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+
2022-12-31 11:06:47 +00:00
+ sound {
+ vcc1v8_codec_en: vcc1v8-codec-en {
+ rockchip,pins = <3 RK_PA4 RK_FUNC_GPIO &pcfg_pull_down>;
2022-02-19 10:11:28 +00:00
+ };
+ };
+
2022-12-31 11:06:47 +00:00
+ wireless-bluetooth {
+ bt_wake_pin: bt-wake-pin {
+ rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
2022-02-19 10:11:28 +00:00
+ };
+
2022-12-31 11:06:47 +00:00
+ bt_host_wake_pin: bt-host-wake-pin {
+ rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
2022-02-19 10:11:28 +00:00
+
2022-12-31 11:06:47 +00:00
+ bt_reset_pin: bt-reset-pin {
+ rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
2022-02-19 10:11:28 +00:00
+};
+
+&sdio0 {
+ bus-width = <4>;
+ cap-sd-highspeed;
+ cap-sdio-irq;
+ disable-wp;
+ keep-power-in-suspend;
2022-12-31 11:06:47 +00:00
+ mmc-pwrseq = <&wifi_pwrseq>;
2022-02-19 10:11:28 +00:00
+ non-removable;
+ pinctrl-names = "default";
+ pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
+ sd-uhs-sdr104;
+ status = "okay";
+};
+
+&sdmmc {
+ bus-width = <4>;
+ cap-sd-highspeed;
2022-12-31 11:06:47 +00:00
+ cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
2022-02-19 10:11:28 +00:00
+ disable-wp;
+ max-frequency = <150000000>;
+ pinctrl-names = "default";
2022-12-31 11:06:47 +00:00
+ pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
+ vmmc-supply = <&vcc3v3_sys>;
+ vqmmc-supply = <&vccio_sd>;
2022-02-19 10:11:28 +00:00
+ status = "okay";
+};
+
+&sdhci {
+ bus-width = <8>;
+ mmc-hs200-1_8v;
+ non-removable;
+ status = "okay";
+};
+
+&tsadc {
+ rockchip,hw-tshut-mode = <1>;
+ rockchip,hw-tshut-polarity = <1>;
+ status = "okay";
+};
+
2022-12-31 11:06:47 +00:00
+&uart0 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
+ uart-has-rtscts;
2022-02-19 10:11:28 +00:00
+ status = "okay";
2022-12-31 11:06:47 +00:00
+
+ bluetooth {
+ compatible = "brcm,bcm4345c5";
+ clocks = <&rk818 1>;
+ clock-names = "lpo";
+ device-wakeup-gpios = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
+ host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
+ max-speed = <1500000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&bt_host_wake_pin &bt_wake_pin &bt_reset_pin>;
+ shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+ vbat-supply = <&vcc3v3_sys>;
+ vddio-supply = <&vcc_1v8>;
+ };
2022-02-19 10:11:28 +00:00
+};
+
2022-12-31 11:06:47 +00:00
+&uart2 {
2022-02-19 10:11:28 +00:00
+ status = "okay";
+};
2022-12-31 11:06:47 +00:00
--
2.39.0
From 004af623388022d258cbc29c0b71d8e22cd96c52 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 28 Dec 2022 03:52:27 +0000
Subject: [PATCH v2 2/2] rockchip: Add initial support for the PINE64 Pinephone
Pro
The Pinephone Pro is another device by PINE64. It's closely related
to the Pinebook Pro of which this initial support is derived from.
Specification:
- A variant of the Rockchip RK3399
- A 6 inch 720*1440 DSI display
- Front and rear cameras
- Type-C interface with alt mode display (DP 1.2) and PD charging
- 4GB LPDDR4 RAM
- 128GB eMMC
- mSD card slot
- An AP6255 module for 802.11ac WiFi and Bluetooth 5
- Quectel EG25-G 4G/LTE modem
Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi | 31 ++++++
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 | 76 +++++++++++++
configs/pinephone-pro-rk3399_defconfig | 104 ++++++++++++++++++
include/configs/pinephone-pro-rk3399.h | 19 ++++
8 files changed, 262 insertions(+)
create mode 100644 arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi
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/rk3399-pinephone-pro-u-boot.dtsi b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi
new file mode 100644
index 00000000000..1dad283ad05
--- /dev/null
+++ b/arch/arm/dts/rk3399-pinephone-pro-u-boot.dtsi
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2022 Peter Robinson <pbrobinson at gmail.com>
+ */
2022-02-19 10:11:28 +00:00
+
2022-12-31 11:06:47 +00:00
+#include "rk3399-u-boot.dtsi"
+#include "rk3399-sdram-lpddr4-100.dtsi"
+
+/ {
+ chosen {
+ u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc;
+ };
+
+ config {
+ u-boot,spl-payload-offset = <0x60000>; /* @ 384KB */
+ };
2022-02-19 10:11:28 +00:00
+};
+
2022-12-31 11:06:47 +00:00
+&rng {
2022-02-19 10:11:28 +00:00
+ status = "okay";
+};
+
2022-12-31 11:06:47 +00:00
+&sdhci {
+ max-frequency = <25000000>;
+ u-boot,dm-pre-reloc;
+};
+
+&sdmmc {
+ max-frequency = <20000000>;
+ u-boot,dm-pre-reloc;
2022-02-19 10:11:28 +00:00
+};
diff --git a/arch/arm/mach-rockchip/rk3399/Kconfig b/arch/arm/mach-rockchip/rk3399/Kconfig
2022-12-31 11:06:47 +00:00
index b48feeb3466..d01063ac98b 100644
2022-02-19 10:11:28 +00:00
--- a/arch/arm/mach-rockchip/rk3399/Kconfig
+++ b/arch/arm/mach-rockchip/rk3399/Kconfig
2022-12-31 11:06:47 +00:00
@@ -39,6 +39,13 @@ config TARGET_PINEBOOK_PRO_RK3399
2022-02-19 10:11:28 +00:00
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
2022-12-31 11:06:47 +00:00
+ PinePhone Pro is a phone based on a variant of the Rockchip
+ rk3399 SoC with 4Gb RAM, onboard eMMC, USB-C, headphone jack,
+ 720x1440 screen and a Quectel 4G/LTE modem.
2022-02-19 10:11:28 +00:00
+
config TARGET_PUMA_RK3399
bool "Theobroma Systems RK3399-Q7 (Puma)"
help
2022-12-31 11:06:47 +00:00
@@ -165,6 +172,7 @@ endif # BOOTCOUNT_LIMIT
2022-02-19 10:11:28 +00:00
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
2022-12-31 11:06:47 +00:00
index 00000000000..13d6465ae6e
2022-02-19 10:11:28 +00:00
--- /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
2022-12-31 11:06:47 +00:00
index 00000000000..c923ff1be32
2022-02-19 10:11:28 +00:00
--- /dev/null
+++ b/board/pine64/pinephone-pro-rk3399/MAINTAINERS
@@ -0,0 +1,8 @@
+PINEPHONE_PRO
2022-12-31 11:06:47 +00:00
+M: Peter Robinson <pbrobinson@gmail.com>
2022-02-19 10:11:28 +00:00
+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
2022-12-31 11:06:47 +00:00
index 00000000000..8d9203053e5
2022-02-19 10:11:28 +00:00
--- /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
2022-12-31 11:06:47 +00:00
index 00000000000..eb639cd0d07
2022-02-19 10:11:28 +00:00
--- /dev/null
+++ b/board/pine64/pinephone-pro-rk3399/pinephone-pro-rk3399.c
2022-12-31 11:06:47 +00:00
@@ -0,0 +1,76 @@
2022-02-19 10:11:28 +00:00
+// SPDX-License-Identifier: GPL-2.0+
+/*
2022-12-31 11:06:47 +00:00
+ * (C) Copyright 2016 Rockchip Electronics Co., Ltd
+ * (C) Copyright 2022 Peter Robinson <pbrobinson at gmail.com>
2022-02-19 10:11:28 +00:00
+ */
+
+#include <common.h>
+#include <dm.h>
+#include <init.h>
+#include <syscon.h>
+#include <asm/io.h>
+#include <asm/arch-rockchip/clock.h>
+#include <asm/arch-rockchip/grf_rk3399.h>
+#include <asm/arch-rockchip/hardware.h>
+#include <asm/arch-rockchip/misc.h>
2022-12-31 11:06:47 +00:00
+#include <power/regulator.h>
2022-02-19 10:11:28 +00:00
+
+#define GRF_IO_VSEL_BT565_SHIFT 0
+#define PMUGRF_CON0_VSEL_SHIFT 8
+
2022-12-31 11:06:47 +00:00
+#ifndef CONFIG_SPL_BUILD
+int board_early_init_f(void)
+{
+ struct udevice *regulator;
+ int ret;
+
+ ret = regulator_get_by_platname("vcc5v0_usb", &regulator);
+ if (ret) {
+ pr_debug("%s vcc5v0_usb init fail! ret %d\n", __func__, ret);
+ goto out;
+ }
+
+ ret = regulator_set_enable(regulator, true);
+ if (ret)
+ pr_debug("%s vcc5v0-host-en-gpio set fail! ret %d\n", __func__, ret);
+
+out:
+ return 0;
+}
+#endif
+
2022-02-19 10:11:28 +00:00
+#ifdef CONFIG_MISC_INIT_R
+static void setup_iodomain(void)
+{
+ struct rk3399_grf_regs *grf =
2022-12-31 11:06:47 +00:00
+ syscon_get_first_range(ROCKCHIP_SYSCON_GRF);
2022-02-19 10:11:28 +00:00
+ struct rk3399_pmugrf_regs *pmugrf =
2022-12-31 11:06:47 +00:00
+ syscon_get_first_range(ROCKCHIP_SYSCON_PMUGRF);
2022-02-19 10:11:28 +00:00
+
+ /* 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;
+
+ return ret;
+}
+#endif
diff --git a/configs/pinephone-pro-rk3399_defconfig b/configs/pinephone-pro-rk3399_defconfig
new file mode 100644
2022-12-31 11:06:47 +00:00
index 00000000000..eb979f6c051
2022-02-19 10:11:28 +00:00
--- /dev/null
+++ b/configs/pinephone-pro-rk3399_defconfig
2022-12-31 11:06:47 +00:00
@@ -0,0 +1,104 @@
2022-02-19 10:11:28 +00:00
+CONFIG_ARM=y
+CONFIG_SKIP_LOWLEVEL_INIT=y
2022-12-31 11:06:47 +00:00
+CONFIG_COUNTER_FREQUENCY=24000000
2022-02-19 10:11:28 +00:00
+CONFIG_ARCH_ROCKCHIP=y
2022-12-31 11:06:47 +00:00
+CONFIG_TEXT_BASE=0x00200000
2022-02-19 10:11:28 +00:00
+CONFIG_NR_DRAM_BANKS=1
+CONFIG_ENV_SIZE=0x8000
2022-12-31 11:06:47 +00:00
+CONFIG_ENV_OFFSET=0x3F8000
+CONFIG_DEFAULT_DEVICE_TREE="rk3399-pinephone-pro"
2022-02-19 10:11:28 +00:00
+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
2022-12-31 11:06:47 +00:00
+CONFIG_SPL_SPI=y
2022-02-19 10:11:28 +00:00
+CONFIG_SYS_LOAD_ADDR=0x800800
2022-12-31 11:06:47 +00:00
+CONFIG_DEBUG_UART=y
+CONFIG_HAS_CUSTOM_SYS_INIT_SP_ADDR=y
+CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x300000
2022-02-19 10:11:28 +00:00
+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
2022-12-31 11:06:47 +00:00
+CONFIG_SPL_MAX_SIZE=0x2e000
+CONFIG_SPL_PAD_TO=0x7f8000
+CONFIG_SPL_HAS_BSS_LINKER_SECTION=y
+CONFIG_SPL_BSS_START_ADDR=0x400000
+CONFIG_SPL_BSS_MAX_SIZE=0x2000
2022-02-19 10:11:28 +00:00
+# CONFIG_SPL_RAW_IMAGE_SUPPORT is not set
2022-12-31 11:06:47 +00:00
+# CONFIG_SPL_SHARES_INIT_SP_ADDR is not set
+CONFIG_SPL_STACK=0x400000
2022-02-19 10:11:28 +00:00
+CONFIG_SPL_STACK_R=y
+CONFIG_SPL_STACK_R_MALLOC_SIMPLE_LEN=0x10000
+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
2022-12-31 11:06:47 +00:00
+CONFIG_SPL_DM_SEQ_ALIAS=y
2022-02-19 10:11:28 +00:00
+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
2022-12-31 11:06:47 +00:00
+CONFIG_SF_DEFAULT_BUS=1
2022-02-19 10:11:28 +00:00
+CONFIG_SF_DEFAULT_SPEED=20000000
+CONFIG_SPI_FLASH_GIGADEVICE=y
+CONFIG_SPI_FLASH_WINBOND=y
+CONFIG_PHY_ROCKCHIP_INNO_USB2=y
+CONFIG_PHY_ROCKCHIP_TYPEC=y
+CONFIG_DM_PMIC_FAN53555=y
2022-12-31 11:06:47 +00:00
+CONFIG_DM_REGULATOR_FAN53555=y
2022-02-19 10:11:28 +00:00
+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_DISPLAY=y
2022-12-31 11:06:47 +00:00
+CONFIG_VIDEO=y
2022-02-19 10:11:28 +00:00
+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
2022-12-31 11:06:47 +00:00
index 00000000000..78017d6bcc3
2022-02-19 10:11:28 +00:00
--- /dev/null
+++ b/include/configs/pinephone-pro-rk3399.h
2022-12-31 11:06:47 +00:00
@@ -0,0 +1,19 @@
2022-02-19 10:11:28 +00:00
+/* SPDX-License-Identifier: GPL-2.0+ */
+/*
+ * Copyright (C) 2016 Rockchip Electronics Co., Ltd
2022-12-31 11:06:47 +00:00
+ * Copyright (C) 2022 Peter Robinson <pbrobinson at gmail.com>
2022-02-19 10:11:28 +00:00
+ */
+
+#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 <configs/rk3399_common.h>
+
+#define SDRAM_BANK_SIZE (2UL << 30)
+
+#endif
2022-12-31 11:06:47 +00:00
--
2.39.0