From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Piotr Szczepanik Date: Fri, 24 Jan 2020 14:21:27 +0100 Subject: [ARCHEOLOGY] OrangePi 4 preliminary support (kernel dt from NanoPi M4) > X-Git-Archeology: - Revision a22b07948a898485db733189edea0f1e4b753071: https://github.com/armbian/build/commit/a22b07948a898485db733189edea0f1e4b753071 > X-Git-Archeology: Date: Fri, 24 Jan 2020 14:21:27 +0100 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: OrangePi 4 preliminary support (kernel dt from NanoPi M4) > X-Git-Archeology: > X-Git-Archeology: - Revision e4be7bcfd8dcc556ea38b0b286e4d8ba0c8c5881: https://github.com/armbian/build/commit/e4be7bcfd8dcc556ea38b0b286e4d8ba0c8c5881 > X-Git-Archeology: Date: Fri, 24 Jan 2020 19:17:26 +0100 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: OrangePi 4 preliminary support (fixed default FDT file name) > X-Git-Archeology: > X-Git-Archeology: - Revision 75d0f64e3d75e7c34466871b9723ef1a238609d8: https://github.com/armbian/build/commit/75d0f64e3d75e7c34466871b9723ef1a238609d8 > X-Git-Archeology: Date: Fri, 17 Apr 2020 21:30:37 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Switch rk3399 to u-boot v2020.04 (#1873) > X-Git-Archeology: > X-Git-Archeology: - Revision 5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d: https://github.com/armbian/build/commit/5a2b2c360b9c26ca4bd0d309af7cd3994fd08b7d > X-Git-Archeology: Date: Sun, 03 May 2020 19:15:46 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Prepare rockchip64 for switch to mainline u-boot and switched ROCK Pi 4 (#1934) > X-Git-Archeology: > X-Git-Archeology: - Revision 88a585a3fe56bf9eb8c1df8993fe34830597ca77: https://github.com/armbian/build/commit/88a585a3fe56bf9eb8c1df8993fe34830597ca77 > X-Git-Archeology: Date: Sat, 18 Jul 2020 00:06:01 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Update mainline u-boot for rockchip64 / rk3399 to v2020.07 (#2086) > X-Git-Archeology: > X-Git-Archeology: - Revision 6e4078974bcf69c5e49bb78b920d52d62dc29f6b: https://github.com/armbian/build/commit/6e4078974bcf69c5e49bb78b920d52d62dc29f6b > X-Git-Archeology: Date: Sun, 19 Jul 2020 00:07:03 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Adjusted patches for rockchip64 mainline u-boot (fuzzines, upstreamed file) > X-Git-Archeology: > X-Git-Archeology: - Revision 3ce107f35826cc51a42d24d0140f8f27325b46c9: https://github.com/armbian/build/commit/3ce107f35826cc51a42d24d0140f8f27325b46c9 > X-Git-Archeology: Date: Sun, 24 Jan 2021 21:24:06 +0100 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Disable excessive logging for OrangePi 4 in u-boot > X-Git-Archeology: > X-Git-Archeology: - Revision 86abac1fd4e169712a44d245cf7adef4ee17c420: https://github.com/armbian/build/commit/86abac1fd4e169712a44d245cf7adef4ee17c420 > X-Git-Archeology: Date: Tue, 26 Oct 2021 22:14:41 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Cleanup u-boot configurations for rockchip64 derivatives (#3150) > X-Git-Archeology: > X-Git-Archeology: - Revision 26437e36c18bb09484f4150e396a1784cc6471b7: https://github.com/armbian/build/commit/26437e36c18bb09484f4150e396a1784cc6471b7 > X-Git-Archeology: Date: Thu, 16 Jun 2022 12:27:05 +0200 > X-Git-Archeology: From: Piotr Szczepanik > X-Git-Archeology: Subject: Switched rockchip64 u-boot to v2022.04 (#3871) > X-Git-Archeology: > X-Git-Archeology: - Revision 2813365dd25e3ad110936cbf014b95b38d7090ec: https://github.com/armbian/build/commit/2813365dd25e3ad110936cbf014b95b38d7090ec > X-Git-Archeology: Date: Mon, 07 Nov 2022 21:29:00 +0100 > X-Git-Archeology: From: Igor Pecovnik > X-Git-Archeology: Subject: Move known non working rockhip64 boards to previous boot loader (#4392) > X-Git-Archeology: --- arch/arm/dts/Makefile | 1 + arch/arm/dts/rk3399-orangepi-4-u-boot.dtsi | 13 + arch/arm/dts/rk3399-orangepi-4.dts | 206 ++++++++++ configs/orangepi-4-rk3399_defconfig | 79 ++++ 4 files changed, 299 insertions(+) diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile index 42fe9f7411..8d6b9b462b 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile @@ -152,6 +152,7 @@ dtb-$(CONFIG_ROCKCHIP_RK3399) += \ rk3399-nanopi-neo4.dtb \ rk3399-nanopi-r4s.dtb \ rk3399-orangepi.dtb \ + rk3399-orangepi-4.dtb \ rk3399-pinebook-pro.dtb \ rk3399-puma-haikou.dtb \ rk3399-roc-pc.dtb \ diff --git a/arch/arm/dts/rk3399-orangepi-4-u-boot.dtsi b/arch/arm/dts/rk3399-orangepi-4-u-boot.dtsi new file mode 100644 index 0000000000..5bd8696666 --- /dev/null +++ b/arch/arm/dts/rk3399-orangepi-4-u-boot.dtsi @@ -0,0 +1,13 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2019 Jagan Teki + */ + +#include "rk3399-u-boot.dtsi" +#include "rk3399-sdram-lpddr4-100.dtsi" + +/ { + chosen { + u-boot,spl-boot-order = "same-as-spl", &sdhci, &sdmmc; + }; +}; diff --git a/arch/arm/dts/rk3399-orangepi-4.dts b/arch/arm/dts/rk3399-orangepi-4.dts new file mode 100644 index 0000000000..65e9c44b7c --- /dev/null +++ b/arch/arm/dts/rk3399-orangepi-4.dts @@ -0,0 +1,206 @@ +/* + * (C) Copyright 2016 Rockchip Electronics Co., Ltd + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +/dts-v1/; +#include +#include +#include "rk3399.dtsi" +#include "rk3399-opp.dtsi" + +/ { + model = "OrangePi 4 AI board"; + compatible = "rockchip,rk3399"; + + chosen { + stdout-path = "serial2:1500000n8"; + }; + + vdd_center: vdd-center { + compatible = "pwm-regulator"; + pwms = <&pwm3 0 25000 1>; + regulator-name = "vdd_center"; + regulator-min-microvolt = <800000>; + regulator-max-microvolt = <1400000>; + regulator-init-microvolt = <950000>; + regulator-always-on; + regulator-boot-on; + status = "okay"; + }; + + vccsys: vccsys { + compatible = "regulator-fixed"; + regulator-name = "vccsys"; + regulator-boot-on; + regulator-always-on; + }; + + vcc3v3_sys: vcc3v3-sys { + compatible = "regulator-fixed"; + regulator-name = "vcc3v3_sys"; + regulator-always-on; + regulator-boot-on; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; + }; + + vcc_phy: vcc-phy-regulator { + compatible = "regulator-fixed"; + regulator-name = "vcc_phy"; + regulator-always-on; + regulator-boot-on; + }; + + vcc5v0_host: vcc5v0-host-en { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_host"; + gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>; + }; + + vcc5v0_typec0: vcc5v0-typec0-en { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_typec0"; + gpio = <&gpio1 3 GPIO_ACTIVE_HIGH>; + }; + + vcc5v0_typec1: vcc5v0-typec1-en { + compatible = "regulator-fixed"; + regulator-name = "vcc5v0_typec1"; + gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>; + }; + + clkin_gmac: external-gmac-clock { + compatible = "fixed-clock"; + clock-frequency = <125000000>; + clock-output-names = "clkin_gmac"; + #clock-cells = <0>; + }; + +}; + +&emmc_phy { + status = "okay"; +}; + +&pwm0 { + status = "okay"; +}; + +&pwm2 { + status = "okay"; +}; + +&pwm3 { + status = "okay"; +}; + +&saradc { + status = "okay"; +}; + +&sdmmc { + bus-width = <4>; + status = "okay"; +}; + +&sdhci { + bus-width = <8>; + mmc-hs400-1_8v; + mmc-hs400-enhanced-strobe; + non-removable; + status = "okay"; +}; + +&uart2 { + status = "okay"; +}; + +&usb_host0_ehci { + status = "okay"; +}; + +&usb_host0_ohci { + status = "okay"; +}; + +&usbdrd3_0 { + vbus-supply = <&vcc5v0_typec0>; + status = "okay"; +}; + +&usb_host1_ehci { + status = "okay"; +}; + +&usb_host1_ohci { + status = "okay"; +}; + +&usbdrd3_1 { + vbus-supply = <&vcc5v0_typec1>; + status = "okay"; +}; + +&i2c0 { + status = "okay"; + clock-frequency = <400000>; + i2c-scl-falling-time-ns = <50>; + i2c-scl-rising-time-ns = <100>; + u-boot,dm-pre-reloc; + + rk808: pmic@1b { + compatible = "rockchip,rk808"; + clock-output-names = "xin32k", "wifibt_32kin"; + interrupt-parent = <&gpio0>; + interrupts = <4 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&pmic_int_l>; + reg = <0x1b>; + rockchip,system-power-controller; + #clock-cells = <1>; + u-boot,dm-pre-reloc; + status = "okay"; + + vcc12-supply = <&vcc3v3_sys>; + + regulators { + vcc33_lcd: SWITCH_REG2 { + regulator-always-on; + regulator-boot-on; + regulator-name = "vcc33_lcd"; + }; + }; + }; +}; + +&pinctrl { + pmic { + pmic_int_l: pmic-int-l { + rockchip,pins = + <1 21 RK_FUNC_GPIO &pcfg_pull_up>; + }; + + pmic_dvs2: pmic-dvs2 { + rockchip,pins = + <1 18 RK_FUNC_GPIO &pcfg_pull_down>; + }; + }; +}; + +&gmac { + phy-supply = <&vcc_phy>; + phy-mode = "rgmii"; + clock_in_out = "input"; + snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; + snps,reset-active-low; + snps,reset-delays-us = <0 10000 50000>; + assigned-clocks = <&cru SCLK_RMII_SRC>; + assigned-clock-parents = <&clkin_gmac>; + pinctrl-names = "default"; + pinctrl-0 = <&rgmii_pins>; + tx_delay = <0x28>; + rx_delay = <0x11>; + status = "okay"; +}; diff --git a/configs/orangepi-4-rk3399_defconfig b/configs/orangepi-4-rk3399_defconfig new file mode 100644 index 0000000000..57a07a2a9f --- /dev/null +++ b/configs/orangepi-4-rk3399_defconfig @@ -0,0 +1,79 @@ +CONFIG_ARM=y +CONFIG_SKIP_LOWLEVEL_INIT=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_SYS_TEXT_BASE=0x00200000 +CONFIG_NR_DRAM_BANKS=1 +CONFIG_ENV_OFFSET=0x3F8000 +CONFIG_DEFAULT_DEVICE_TREE="rk3399-orangepi-4" +CONFIG_ROCKCHIP_RK3399=y +CONFIG_TARGET_EVB_RK3399=y +CONFIG_DEBUG_UART_BASE=0xFF1A0000 +CONFIG_DEBUG_UART_CLOCK=24000000 +CONFIG_DEBUG_UART=y +CONFIG_SYS_LOAD_ADDR=0x800800 +# CONFIG_ANDROID_BOOT_IMAGE is not set +CONFIG_DEFAULT_FDT_FILE="rockchip/rk3399-orangepi-4.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_TPL=y +CONFIG_CMD_BOOTZ=y +CONFIG_CMD_GPT=y +CONFIG_CMD_MMC=y +CONFIG_CMD_REGULATOR=y +CONFIG_CMD_PCI=y +CONFIG_CMD_USB=y +# CONFIG_CMD_SETEXPR is not set +CONFIG_CMD_TIME=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_MMC=y +CONFIG_SYS_RELOC_GD_ENV_ADDR=y +CONFIG_SPL_DM_SEQ_ALIAS=y +CONFIG_ROCKCHIP_GPIO=y +CONFIG_SYS_I2C_ROCKCHIP=y +CONFIG_MISC=y +CONFIG_ROCKCHIP_EFUSE=y +CONFIG_MMC_DW=y +CONFIG_MMC_DW_ROCKCHIP=y +CONFIG_MMC_SDHCI=y +CONFIG_MMC_SDHCI_ROCKCHIP=y +CONFIG_DM_ETH=y +CONFIG_ETH_DESIGNWARE=y +CONFIG_GMAC_ROCKCHIP=y +CONFIG_NVME_PCI=y +CONFIG_PCI=y +CONFIG_PHY_ROCKCHIP_INNO_USB2=y +CONFIG_PHY_ROCKCHIP_TYPEC=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_BAUDRATE=1500000 +CONFIG_DEBUG_UART_SHIFT=2 +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_DWC3=y +CONFIG_USB_DWC3_GENERIC=y +CONFIG_USB_KEYBOARD=y +CONFIG_USB_HOST_ETHER=y +CONFIG_USB_ETHER_ASIX=y +CONFIG_USB_ETHER_ASIX88179=y +CONFIG_USB_ETHER_MCS7830=y +CONFIG_USB_ETHER_RTL8152=y +CONFIG_USB_ETHER_SMSC95XX=y +CONFIG_USB_GADGET=y +CONFIG_DM_VIDEO=y +CONFIG_DISPLAY=y +CONFIG_VIDEO_ROCKCHIP=y +CONFIG_DISPLAY_ROCKCHIP_HDMI=y +CONFIG_SPL_TINY_MEMSET=y +CONFIG_ERRNO_STR=y -- Armbian