diff options
29 files changed, 902 insertions, 2807 deletions
diff --git a/mk/image.mk b/mk/image.mk index 77046a191..614551ee2 100644 --- a/mk/image.mk +++ b/mk/image.mk @@ -357,7 +357,7 @@ endif PATH='${HOST_PATH}' $(FAKEROOT) mkfs.ext2 \ -d "$(TARGET_DIR)" \ -r 1 -N 0 -m 5 -L "rootfs" \ - $(FW_DIR)/rootfs.ext "32M" $(MAKE_TRACE) + $(FW_DIR)/rootfs.ext "48M" $(MAKE_TRACE) PATH='${HOST_PATH}' genimage \ --config "$(GENCFG)" \ --tmppath "${FW_DIR}/temp" \ diff --git a/mk/linux-ver.mk b/mk/linux-ver.mk index 39ce3e13a..03b4594f6 100644 --- a/mk/linux-ver.mk +++ b/mk/linux-ver.mk @@ -15,17 +15,17 @@ KERNEL_FILE_VER:= $(ADK_TARGET_LINUX_KERNEL_GIT) KERNEL_RELEASE:= 1 KERNEL_VERSION:= $(ADK_TARGET_LINUX_KERNEL_GIT_VER)-$(KERNEL_RELEASE) endif -ifeq ($(ADK_TARGET_LINUX_KERNEL_VERSION_5_19),y) -KERNEL_FILE_VER:= 5.19.12 +ifeq ($(ADK_TARGET_LINUX_KERNEL_VERSION_6_0),y) +KERNEL_FILE_VER:= 6.0.11 KERNEL_RELEASE:= 1 KERNEL_VERSION:= $(KERNEL_FILE_VER)-$(KERNEL_RELEASE) -KERNEL_HASH:= c436a548c7312ce6fc5a3472cbead895eef8f52841fbe7c71fd8e48bdfe2b0ba +KERNEL_HASH:= 2bae6131e64971e1e34ff395fa542971134c857bdb0b29069ab847c7c9a9c762 endif ifeq ($(ADK_TARGET_LINUX_KERNEL_VERSION_5_15),y) -KERNEL_FILE_VER:= 5.15.71 +KERNEL_FILE_VER:= 5.15.81 KERNEL_RELEASE:= 1 KERNEL_VERSION:= $(KERNEL_FILE_VER)-$(KERNEL_RELEASE) -KERNEL_HASH:= 5f5408138e016c0e029e015d98ceab86f4e6366c65cd611259dac808ab1d1e53 +KERNEL_HASH:= 8f885cdebd754d6e63b920cf6c3e5713e91bbf5f52e9d99eb0054ef7e8f096ab endif ifeq ($(ADK_TARGET_LINUX_KERNEL_VERSION_5_10),y) KERNEL_FILE_VER:= 5.10.146 diff --git a/mk/linux.mk b/mk/linux.mk index 37f7b8684..920c1749b 100644 --- a/mk/linux.mk +++ b/mk/linux.mk @@ -9,7 +9,8 @@ PKG_GIT:= $(ADK_TARGET_LINUX_KERNEL_GIT_TYPE) PKG_SITES:= $(ADK_TARGET_LINUX_KERNEL_GIT_REPO) else PKG_VERSION:= $(KERNEL_FILE_VER) -PKG_SITES:= ${MASTER_SITE_KERNEL:=kernel/v5.x/} \ +PKG_SITES:= ${MASTER_SITE_KERNEL:=kernel/v6.x/} \ + ${MASTER_SITE_KERNEL:=kernel/v5.x/} \ ${MASTER_SITE_KERNEL:=kernel/v4.x/} \ ${MASTER_SITE_KERNEL:=kernel/v3.x/} \ ${MASTER_SITE_KERNEL:=kernel/v3.0/testing/} \ diff --git a/package/genimage/Makefile b/package/genimage/Makefile index 4791a76e1..94f888e45 100644 --- a/package/genimage/Makefile +++ b/package/genimage/Makefile @@ -4,9 +4,9 @@ include $(ADK_TOPDIR)/rules.mk PKG_NAME:= genimage -PKG_VERSION:= 9 +PKG_VERSION:= 16 PKG_RELEASE:= 1 -PKG_HASH:= 69f35af7edf6f4dbdac7a18ddc69dcf38c501e43d8b50c524555754c51479078 +PKG_HASH:= 869f9662d3b778c69b1d1fe70df658e1c9e90aeda26abb753f6fe55e8b0c6e73 PKG_DESCR:= image creation utility PKG_SECTION:= dev/tools HOST_BUILDDEP:= confuse-host diff --git a/package/u-boot/Makefile b/package/u-boot/Makefile index 943cfb3eb..b89f0fdef 100644 --- a/package/u-boot/Makefile +++ b/package/u-boot/Makefile @@ -16,7 +16,7 @@ PKG_SITES:= ftp://ftp.denx.de/pub/u-boot/ DISTFILES:= $(PKG_NAME)-$(PKG_VERSION).tar.bz2 -PKG_SYSTEM_DEPENDS:= beaglebone-black orange-pi0 raspberry-pi raspberry-pi2 raspberry-pi3 banana-pro solidrun-imx6 solidrun-clearfog raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64 phytec-imx6 pcduino-3b imgtec-ci20 st-stm32f746g +PKG_SYSTEM_DEPENDS:= beaglebone-black orange-pi0 raspberry-pi raspberry-pi2 raspberry-pi3 banana-pro solidrun-imx6 solidrun-clearfog raspberry-pi3-64 raspberry-pi3p raspberry-pi3p-64 rockpi4-plus phytec-imx6 pcduino-3b imgtec-ci20 st-stm32f746g include $(ADK_TOPDIR)/mk/host.mk include $(ADK_TOPDIR)/mk/package.mk @@ -58,6 +58,10 @@ endif ifeq ($(ADK_TARGET_SYSTEM_RASPBERRY_PI3P_64),y) CONFIG:= rpi_3_defconfig endif +ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y) +CONFIG:= rock-pi-4c-rk3399_defconfig +UBOOT:= u-boot.itb +endif ifeq ($(ADK_TARGET_SYSTEM_BANANA_PRO),y) CONFIG:= Bananapro_defconfig UBOOT:= u-boot-sunxi-with-spl.bin @@ -104,7 +108,6 @@ do-build: V=1 \ PATH='$(HOST_PATH)' \ CROSS_COMPILE='$(TARGET_CROSS)' \ - KCFLAGS='-mno-fdpic' \ $(MAKE)) ifneq ($(OS_FOR_BUILD),Darwin) (cd $(WRKBUILD) && env \ @@ -115,6 +118,9 @@ endif u-boot-install: $(CP) $(WRKBUILD)/$(UBOOT) $(FW_DIR) +ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y) + $(CP) $(WRKBUILD)/idbloader.img $(FW_DIR) +endif ifeq ($(ADK_TARGET_SYSTEM_IMGTEC_CI20),y) $(CP) $(WRKBUILD)/spl/u-boot-spl.bin $(FW_DIR) endif diff --git a/package/u-boot/patches/patch-configs_rock-pi-4c-rk3399_defconfig b/package/u-boot/patches/patch-configs_rock-pi-4c-rk3399_defconfig new file mode 100644 index 000000000..6aa6a9358 --- /dev/null +++ b/package/u-boot/patches/patch-configs_rock-pi-4c-rk3399_defconfig @@ -0,0 +1,11 @@ +--- u-boot-2022.10.orig/configs/rock-pi-4c-rk3399_defconfig 2022-10-03 21:25:32.000000000 +0200 ++++ u-boot-2022.10/configs/rock-pi-4c-rk3399_defconfig 2022-12-06 13:45:16.410352759 +0100 +@@ -60,7 +60,7 @@ CONFIG_REGULATOR_RK8XX=y + CONFIG_PWM_ROCKCHIP=y + CONFIG_RAM_RK3399_LPDDR4=y + CONFIG_DM_RESET=y +-CONFIG_BAUDRATE=1500000 ++CONFIG_BAUDRATE=115200 + CONFIG_DEBUG_UART_SHIFT=2 + CONFIG_SYSRESET=y + CONFIG_USB=y diff --git a/scripts/install.sh b/scripts/install.sh index 0305ef8e4..1f721f050 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -155,7 +155,7 @@ tgt=$2 src=$3 case $target { -(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|solidrun-imx6|solidrun-clearfog|imgtec-ci20|default) ;; +(banana-pro|orange-pi0|pcengines-apu|phytec-imx6|phytec-wega|raspberry-pi|raspberry-pi0|raspberry-pi2|raspberry-pi3|raspberry-pi3-64|raspberry-pi4|raspberry-pi4-64|rockpi4-plus|solidrun-imx6|solidrun-clearfog|imgtec-ci20|default) ;; (*) print -u2 "Unknown target '$target', exiting" exit 1 ;; @@ -351,7 +351,7 @@ fi #(( partofs = ((coreendsec / secs) + 1) * secs )) # we just use 2048 all the time, since some loaders are longer partofs=2048 -if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega ]]; then +if [[ $target = raspberry-pi || $target = raspberry-pi0 || $target = raspberry-pi2 || $target = raspberry-pi3 || $target = raspberry-pi3-64 || $target = raspberry-pi4 || $target = raspberry-pi4-64 || $target = phytec-wega || $target = rockpi4-plus ]]; then (( spartofs = partofs + (100 * 2048) )) else spartofs=$partofs @@ -545,6 +545,10 @@ fi fwdir=$(dirname "$src") case $target { +(rockpi4-plus) + dd if="$fwdir/idbloader.img" of="$tgt" bs=512 seek=64 > /dev/null 2>&1 + dd if="$fwdir/u-boot.itb" of="$tgt" bs=512 seek=16384 > /dev/null 2>&1 + ;; (imgtec-ci20) dd if="$fwdir/u-boot-spl.bin" of="$tgt" obs=512 seek=1 > /dev/null 2>&1 dd if="$fwdir/u-boot-dtb.img" of="$tgt" obs=1k seek=14 > /dev/null 2>&1 @@ -631,6 +635,12 @@ case $target { done umount_fs "$B" ;; +(rockpi4-plus) + for x in "$fwdir"/*.dtb; do + [[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/" + break + done + ;; (solidrun-clearfog) for x in "$fwdir"/*.dtb; do [[ -e "$x" ]] && cp "$fwdir"/*.dtb "$R/boot/" diff --git a/target/aarch64/Makefile b/target/aarch64/Makefile index b470e2975..0106bd609 100644 --- a/target/aarch64/Makefile +++ b/target/aarch64/Makefile @@ -24,6 +24,10 @@ ifeq ($(ADK_TARGET_BOARD_BCM28XX),y) @echo "Use following command to install it on SD card:" @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)" endif +ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y) + @echo "Use following command to install it on SD card:" + @echo "sudo ./scripts/install.sh $(ADK_TARGET_SYSTEM) /dev/sdX $(FW_DIR)/$(ROOTFSTARBALL)" +endif ifeq ($(ADK_TARGET_QEMU),y) @echo 'The kernel file is: $(FW_DIR)/${TARGET_KERNEL}' @echo "Use following command to create a QEMU Image:" @@ -54,6 +58,12 @@ ifeq ($(ADK_TARGET_QEMU),y) @echo 'qemu-system-${ADK_TARGET_CPU_ARCH} ${QEMU_ARGS} -kernel $(FW_DIR)/$(TARGET_KERNEL)' endif endif +ifeq ($(ADK_TARGET_FS),genimage) +targethelp: + @echo "The disk image is: $(FW_DIR)/sdcard.img" + @echo "Use following command to install it on SD card:" + @echo 'sudo dd if=$(FW_DIR)/sdcard.img of=/dev/sdX bs=2048k' +endif kernel-strip: @cp $(KERNEL) $(BUILD_DIR)/$(TARGET_KERNEL) @@ -74,6 +84,13 @@ ifeq ($(ADK_TARGET_BOARD_BCM28XX),y) break; \ done endif +ifeq ($(ADK_TARGET_SYSTEM_ROCKPI4_PLUS),y) + ${KERNEL_MAKE} rockchip/rk3399-rock-pi-4c-plus.dtb $(MAKE_TRACE) +endif + for x in $(LINUX_DIR)/arch/arm64/boot/dts/*/*.dtb; do \ + [[ -e "$$x" ]] && cp $(LINUX_DIR)/arch/arm64/boot/dts/*/*.dtb $(FW_DIR); \ + break; \ + done # filesystem specific targets ifeq ($(ADK_TARGET_FS),archive) @@ -88,3 +105,6 @@ endif ifeq ($(ADK_TARGET_FS),initramfspiggyback) imageinstall: createinitramfs targethelp endif +ifeq ($(ADK_TARGET_FS),genimage) +imageinstall: dtb-install $(FW_DIR)/$(GENIMAGE) targethelp +endif diff --git a/target/aarch64/kernel/rockpi4-plus b/target/aarch64/kernel/rockpi4-plus new file mode 100644 index 000000000..5faf024de --- /dev/null +++ b/target/aarch64/kernel/rockpi4-plus @@ -0,0 +1,5 @@ +CONFIG_ARM64=y +CONFIG_ARCH_ROCKCHIP=y +CONFIG_SERIAL_8250=y +CONFIG_SERIAL_8250_CONSOLE=y +CONFIG_SERIAL_OF_PLATFORM=y diff --git a/target/aarch64/rockpi4-plus/extlinux.conf b/target/aarch64/rockpi4-plus/extlinux.conf new file mode 100644 index 000000000..162cf49d7 --- /dev/null +++ b/target/aarch64/rockpi4-plus/extlinux.conf @@ -0,0 +1,4 @@ +label rockpi4-plus-openadk + kernel /kernel + devicetree /rk3399-rock-pi-4c-plus.dtb + append console=ttyS2,115200n8 rw rootwait diff --git a/target/aarch64/rockpi4-plus/genimage.cfg b/target/aarch64/rockpi4-plus/genimage.cfg new file mode 100644 index 000000000..6c93aa58c --- /dev/null +++ b/target/aarch64/rockpi4-plus/genimage.cfg @@ -0,0 +1,39 @@ +image boot.vfat { + vfat { + files = { + "kernel", + "rk3399-rock-pi-4c-plus.dtb", + "extlinux" + } + } + + size = 112M +} + +image sdcard.img { + hdimage { + partition-table-type = "gpt" + } + + partition loader1 { + image = "idbloader.img" + offset = 32K + } + + partition loader2 { + image = "u-boot.itb" + offset = 8M + } + + partition boot { + partition-type-uuid = F + bootable = "true" + image = "boot.vfat" + offset = 16M + } + + partition rootfs { + partition-type-uuid = b921b045-1df0-41c3-af44-4c6f280d3fae + image = "rootfs.ext" + } +} diff --git a/target/aarch64/systems/rockpi4-plus b/target/aarch64/systems/rockpi4-plus new file mode 100644 index 000000000..650f98bf1 --- /dev/null +++ b/target/aarch64/systems/rockpi4-plus @@ -0,0 +1,22 @@ +config ADK_TARGET_SYSTEM_ROCKPI4_PLUS + bool "Rock PI 4 Plus" + depends on ADK_TARGET_OS_LINUX + select ADK_TARGET_LITTLE_ENDIAN + select ADK_TARGET_CPU_AARCH64_CORTEX_A53 + select ADK_TARGET_WITH_VGA + select ADK_TARGET_WITH_SERIAL + select ADK_TARGET_WITH_CPU_FREQ + select ADK_TARGET_WITH_USB + select ADK_TARGET_WITH_INPUT + select ADK_TARGET_WITH_SD + select ADK_TARGET_WITH_I2C + select ADK_TARGET_WITH_SPI + select ADK_TARGET_WITH_SMP + select ADK_TARGET_WITH_NET + select ADK_TARGET_WITH_NETDEVICE + select ADK_TARGET_WITH_BLOCK + select ADK_TARGET_WITH_SOUND + select ADK_TARGET_KERNEL_IMAGE + help + Rock PI 4 Plus + diff --git a/target/linux/Config.in.kernelcfg b/target/linux/Config.in.kernelcfg index 5e09b182e..3f70025a3 100644 --- a/target/linux/Config.in.kernelcfg +++ b/target/linux/Config.in.kernelcfg @@ -51,6 +51,8 @@ config ADK_TARGET_LINUX_KERNEL_DEFCONFIG default "stm32_defconfig" if ADK_TARGET_SYSTEM_ST_STM32F746G default "nommu_k210_defconfig" if ADK_TARGET_SYSTEM_SIPEED_MAIX_BIT default "loongson3_defconfig" if ADK_TARGET_SYSTEM_QEMU_LOONGARCH + default "defconfig" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS + default "rockpi4_defconfig" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS && ADK_TARGET_LINUX_KERNEL_VERSION_GIT default "" config ADK_TARGET_LINUX_KERNEL_CUSTOMCONFIG_PATH diff --git a/target/linux/Config.in.kernelversion b/target/linux/Config.in.kernelversion index 2a62542c2..b5b1614f0 100644 --- a/target/linux/Config.in.kernelversion +++ b/target/linux/Config.in.kernelversion @@ -34,8 +34,8 @@ config ADK_TARGET_LINUX_KERNEL_VERSION_GIT select ADK_TARGET_LINUX_KERNEL_IMAGE if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 select ADK_TARGET_LINUX_KERNEL_IMAGE if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK -config ADK_TARGET_LINUX_KERNEL_VERSION_5_19 - bool "5.19.12" +config ADK_TARGET_LINUX_KERNEL_VERSION_6_0 + bool "6.0.11" depends on !ADK_TARGET_ARCH_AVR32 depends on !ADK_TARGET_ARCH_BFIN depends on !ADK_TARGET_ARCH_CRIS @@ -43,7 +43,7 @@ config ADK_TARGET_LINUX_KERNEL_VERSION_5_19 depends on !ADK_TARGET_ARCH_METAG config ADK_TARGET_LINUX_KERNEL_VERSION_5_15 - bool "5.15.71" + bool "5.15.81" depends on !ADK_TARGET_ARCH_AVR32 depends on !ADK_TARGET_ARCH_BFIN depends on !ADK_TARGET_ARCH_CRIS @@ -177,6 +177,7 @@ config ADK_TARGET_LINUX_KERNEL_GIT_REPO default "https://git.phytec.de/git/linux-ti.git" if ADK_TARGET_SYSTEM_PHYTEC_WEGA default "https://github.com/kalray/linux_coolidge.git" if ADK_TARGET_ARCH_KVX default "https://github.com/shenki/linux-lm32.git" if ADK_TARGET_ARCH_LM32 + default "https://github.com/radxa/kernel.git" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS default "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" help GIT repository to use. @@ -194,6 +195,7 @@ config ADK_TARGET_LINUX_KERNEL_GIT_REPO_NAME default "phytec" if ADK_TARGET_SYSTEM_PHYTEC_WEGA default "clearfog" if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG default "fslc" if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 + default "radxa" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS default "linus" config ADK_TARGET_LINUX_KERNEL_GIT @@ -207,6 +209,7 @@ config ADK_TARGET_LINUX_KERNEL_GIT default "902739f3353150ac9eb69ad995098f3079d862a3" if ADK_TARGET_SYSTEM_SOLIDRUN_CLEARFOG default "c85fbc86c61a8c8fd45ab1fe3d1bdd2df12f7962" if ADK_TARGET_SYSTEM_SOLIDRUN_IMX6 default "8624998967676862843aed1f8ee2141e98987f81" if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK + default "stable-4.4-rockpi4" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS default "v4.4.52-phy" if ADK_TARGET_SYSTEM_PHYTEC_WEGA default "loongarch-next" if ADK_TARGET_LINUX_ARCH_LOONGARCH @@ -215,6 +218,7 @@ config ADK_TARGET_LINUX_KERNEL_GIT_VER depends on ADK_TARGET_LINUX_KERNEL_VERSION_GIT default "5.19" if ADK_TARGET_LINUX_ARCH_LOONGARCH default "5.10.110" if ADK_TARGET_BOARD_BCM28XX + default "5.10.110" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS default "4.4.37" if ADK_TARGET_SYSTEM_BEAGLEBONE_BLACK default "4.4.52" if ADK_TARGET_SYSTEM_PHYTEC_WEGA default "2.6.33" if ADK_TARGET_SYSTEM_KINETIS_K70 @@ -227,6 +231,7 @@ config ADK_TARGET_LINUX_KERNEL_GIT_TYPE depends on ADK_TARGET_LINUX_KERNEL_VERSION_GIT default "branch" if ADK_TARGET_LINUX_ARCH_LOONGARCH default "branch" if ADK_TARGET_SYSTEM_PHYTEC_WEGA + default "branch" if ADK_TARGET_SYSTEM_ROCKPI4_PLUS default "hash" config ADK_TARGET_LINUX_KERNEL_NO_MIRROR diff --git a/target/linux/patches/5.15.81/add-board-rock-pi-4c-plus.patch b/target/linux/patches/5.15.81/add-board-rock-pi-4c-plus.patch new file mode 100644 index 000000000..8dea9f52d --- /dev/null +++ b/target/linux/patches/5.15.81/add-board-rock-pi-4c-plus.patch @@ -0,0 +1,738 @@ +diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile +index 7eb135a5143f..1574279e61e8 100644 +--- a/arch/arm64/boot/dts/rockchip/Makefile ++++ b/arch/arm64/boot/dts/rockchip/Makefile +@@ -39,6 +39,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-roc-pc-mezzanine.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4a.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4b.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c.dtb ++dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock-pi-4c-plus.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rock960.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64-v2.dtb + dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-rockpro64.dtb +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c-plus.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c-plus.dts +new file mode 100644 +index 000000000000..9fc8d5baba54 +--- /dev/null ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c-plus.dts +@@ -0,0 +1,720 @@ ++// SPDX-License-Identifier: (GPL-2.0+ OR MIT) ++/* ++ * Copyright (c) 2022 Fuzhou Rockchip Electronics Co., Ltd ++ * Copyright (c) 2022 Radxa Limited ++ */ ++ ++/dts-v1/; ++#include <dt-bindings/input/linux-event-codes.h> ++#include <dt-bindings/pwm/pwm.h> ++#include "rk3399.dtsi" ++#include "rk3399-opp.dtsi" ++ ++/ { ++ model = "Radxa ROCK Pi 4C+"; ++ compatible = "radxa,rockpi4c-plus", "radxa,rockpi4", "rockchip,rk3399"; ++ ++ aliases { ++ mmc0 = &sdmmc; ++ mmc1 = &sdhci; ++ mmc2 = &sdio0; ++ }; ++ ++ chosen { ++ stdout-path = "serial2:115200n8"; ++ }; ++ ++ clkin_gmac: external-gmac-clock { ++ compatible = "fixed-clock"; ++ clock-frequency = <125000000>; ++ clock-output-names = "clkin_gmac"; ++ #clock-cells = <0>; ++ }; ++ ++ vcc_lan: vcc3v3-phy-regulator { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_lan"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc5v0_sys: vcc-sys { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc5v0_sys"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ }; ++ ++ vbus_host: vbus-host { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&usb1_en_oc>; ++ regulator-name = "vbus_host"; /* HOST-5V */ ++ regulator-always-on; ++ regulator-boot-on; ++ vin-supply = <&vcc5v0_usb2>; ++ }; ++ ++ vcc5v0_typec: vcc5v0-typec-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&vcc5v0_typec_en>; ++ regulator-name = "vcc5v0_typec"; ++ regulator-always-on; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ virtual_pd: virtual-pd { ++ status = "disabled"; ++ compatible = "linux,extcon-pd-virtual"; ++ /* 0: positive, 1: negative*/ ++ vpd,init-flip = <0>; ++ /* 0: u2, 1: u3*/ ++ vpd,init-ss = <1>; ++ /* 0: dfp, 1: ufp, 2: dp 3: dp/ufp */ ++ vpd,init-mode = <2>; ++ hpd-gpios = <&gpio4 25 GPIO_ACTIVE_LOW>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&hpd_en>; ++ dp-pwr-supply = <&vcc3v3_sys>; ++ }; ++ ++ vcc_0v9: vcc-0v9 { ++ compatible = "regulator-fixed"; ++ regulator-name = "vcc_0v9"; ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ vin-supply = <&vcc3v3_sys>; ++ }; ++ ++ vcc3v3_pcie: vcc3v3-pcie-regulator { ++ compatible = "regulator-fixed"; ++ enable-active-high; ++ gpio = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pcie_drv>; ++ regulator-boot-on; ++ regulator-always-on; ++ regulator-name = "vcc3v3_pcie"; ++ vin-supply = <&vcc5v0_sys>; ++ }; ++ ++ sdio_pwrseq: sdio-pwrseq { ++ compatible = "mmc-pwrseq-simple"; ++ clocks = <&rk809 1>; ++ clock-names = "ext_clock"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&wifi_enable_h>; ++ ++ /* ++ * On the module itself this is one of these (depending ++ * on the actual card populated): ++ * - SDIO_RESET_L_WL_REG_ON ++ * - PDN (power down when low) ++ */ ++ reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; ++ }; ++ ++ wireless_wlan: wireless-wlan { ++ compatible = "wlan-platdata"; ++ rockchip,grf = <&grf>; ++ wifi_chip_type = "ap6256"; ++ sdio_vref = <1800>; ++ WIFI,host_wake_irq = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>; ++ status = "okay"; ++ }; ++ ++ gpio-leds { ++ compatible = "gpio-leds"; ++ status = "okay"; ++ ++ user-led1 { ++ gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_LOW>; ++ linux,default-trigger = "default-on"; ++ default-state = "on"; ++ }; ++ ++ user-led2 { ++ gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; ++ linux,default-trigger = "heartbeat"; ++ default-state = "on"; ++ }; ++ }; ++}; ++ ++&cdn_dp { ++ extcon = <&virtual_pd>; ++ status = "disabled"; ++}; ++ ++&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>; ++}; ++ ++&gmac { ++ assigned-clocks = <&cru SCLK_RMII_SRC>; ++ assigned-clock-parents = <&clkin_gmac>; ++ clock_in_out = "input"; ++ phy-supply = <&vcc_lan>; ++ phy-mode = "rgmii"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&rgmii_pins>; ++ snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>; ++ snps,reset-active-low; ++ snps,reset-delays-us = <0 10000 50000>; ++ tx_delay = <0x28>; ++ rx_delay = <0x11>; ++ status = "okay"; ++}; ++ ++&i2c0 { ++ status = "okay"; ++ i2c-scl-falling-time-ns = <30>; ++ i2c-scl-rising-time-ns = <180>; ++ clock-frequency = <400000>; ++ ++ rk809: pmic@20 { ++ compatible = "rockchip,rk809"; ++ reg = <0x20>; ++ interrupt-parent = <&gpio1>; ++ interrupts = <RK_PC5 IRQ_TYPE_LEVEL_LOW>; ++ #clock-cells = <1>; ++ clock-output-names = "rk808-clkout1", "rk808-clkout2"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&pmic_int_l>; ++ rockchip,system-power-controller; ++ wakeup-source; ++ ++ vcc1-supply = <&vcc5v0_sys>; ++ vcc2-supply = <&vcc5v0_sys>; ++ vcc3-supply = <&vcc5v0_sys>; ++ vcc4-supply = <&vcc5v0_sys>; ++ vcc5-supply = <&vcc_buck5>; ++ vcc6-supply = <&vcc_buck5>; ++ vcc7-supply = <&vcc5v0_sys>; ++ vcc8-supply = <&vcc3v3_sys>; ++ vcc9-supply = <&vcc5v0_sys>; ++ ++ regulators { ++ vdd_log: DCDC_REG1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vdd_log"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vdd_cpu_l: DCDC_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <750000>; ++ regulator-max-microvolt = <1350000>; ++ regulator-ramp-delay = <6001>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vdd_cpu_l"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_ddr: DCDC_REG3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-name = "vcc_ddr"; ++ regulator-initial-mode = <0x2>; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ }; ++ }; ++ ++ vcc3v3_sys: DCDC_REG4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-initial-mode = <0x2>; ++ regulator-name = "vcc3v3_sys"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcc_buck5: DCDC_REG5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ regulator-name = "vcc_buck5"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <3300000>; ++ }; ++ }; ++ ++ vcca_0v9: LDO_REG1 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ regulator-name = "vcca_0v9"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v8: LDO_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <1800000>; ++ ++ regulator-name = "vcc_1v8"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <1800000>; ++ }; ++ }; ++ ++ vcc0v9_soc: LDO_REG3 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <900000>; ++ regulator-max-microvolt = <900000>; ++ ++ regulator-name = "vcc0v9_soc"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <900000>; ++ }; ++ }; ++ ++ vcca_1v8: LDO_REG4 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1850000>; ++ regulator-max-microvolt = <1850000>; ++ ++ regulator-name = "vcca_1v8"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_mipi: LDO_REG5 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ ++ regulator-name = "vcc_mipi"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_1v5: LDO_REG6 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1500000>; ++ regulator-max-microvolt = <1500000>; ++ ++ regulator-name = "vcc_1v5"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_3v0: LDO_REG7 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3000000>; ++ regulator-max-microvolt = <3000000>; ++ ++ regulator-name = "vcc_3v0"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vccio_sd: LDO_REG8 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <1800000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-name = "vccio_sd"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc_cam: LDO_REG9 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-name = "vcc_cam"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ ++ vcc5v0_usb2: SWITCH_REG1 { ++ regulator-min-microvolt = <5000000>; ++ regulator-max-microvolt = <5000000>; ++ ++ regulator-name = "vcc5v0_usb2.0"; ++ regulator-state-mem { ++ regulator-on-in-suspend; ++ regulator-suspend-microvolt = <5000000>; ++ }; ++ }; ++ ++ lcd_3v3: SWITCH_REG2 { ++ regulator-always-on; ++ regulator-boot-on; ++ regulator-min-microvolt = <3300000>; ++ regulator-max-microvolt = <3300000>; ++ ++ regulator-name = "lcd_3v3"; ++ regulator-state-mem { ++ regulator-off-in-suspend; ++ }; ++ }; ++ }; ++ }; ++ |