From patchwork Fri Jan 3 00:41:12 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jimmy Hon X-Patchwork-Id: 13925068 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0F426E77188 for ; Fri, 3 Jan 2025 00:46:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T+DO0rQv0NDeHKVuFdPdy118B8Pxyt6fMzJ07CP3KVw=; b=kIQgNKBJqIyeBi BosMbXdG7PpYJPzmQZlTA+2am9cGuxDZH0XbZbijdF0ZLkUYSDh46wk6QPbhDOAs3nkehsQAulqc6 WLqIbMiPAigILbWYnbCBfxjalA/NMnRkYQc4isQfMpbzKA+DNYLeUUETbiRKKMYnsi0qylYAQ7tMC l09NtqVFPNDtbSOZUOs+AflK+c+9xprk2mKSOHekmzFFrIUUOXfZ82ALXK4ECoAEe2fNyF6OSSl6+ Pan2KHVw7u0LPLJ/nBi+9cDzfzjFcv5qkmjJNbB550PqpNABLvlZPw5uO5qzTRVXj/mMZJwkncNb8 PoTpZ1QyO2zWE2QIcezQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tTVpv-0000000BmuS-0dX8; Fri, 03 Jan 2025 00:46:47 +0000 Received: from mail-oi1-x22c.google.com ([2607:f8b0:4864:20::22c]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tTVlA-0000000BmAy-1lEf; Fri, 03 Jan 2025 00:41:53 +0000 Received: by mail-oi1-x22c.google.com with SMTP id 5614622812f47-3eb8bdcac2eso2057915b6e.0; Thu, 02 Jan 2025 16:41:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735864911; x=1736469711; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=92hBy0nqIHlsesNY+D3j5cB8nw7jFdV9PWQHMw34g9s=; b=A7VDOh3zvEoJZKMyVyYWw/2FwgCAKyvhofv7GaTLntRFtbPqTgR76LVqCj3ESCCZgW xM92lJY0/jS2WkMCYpYcMvXf1mNYaagy7oKYzQgxKiIbkdy10xNZoEnscrwbLWlsQVK9 mNx5erIdb/NxInxO2Tzef4R1ABp9c+NnOiYZmaJTYV/5S7+QG1HTTD+/Mkkr7WrQi9gf aVvcQ6syStXgh43f3GS3dEKDnBWa49BtMh251szXaKjMfb2e/fuIsMRf8SoykhDOX6hQ zJNNwSsXWk8Xjz7Nyl0hw7+1jRjaFE5vDg/0JDzftQ8SLflb3bElvwFk+qXvXYoe+WyB LkPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735864911; x=1736469711; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=92hBy0nqIHlsesNY+D3j5cB8nw7jFdV9PWQHMw34g9s=; b=H+TZw6BCbvT7OUVUpHrD3FbddbnkDx6mWjt1EPupQXomS93E8U6XYma85otqNnvtlR 5Trwdof9gYCrUSc1E5rZ9Ai48UoTpOqe5FHmtJJ6pIrok2tik2dNHlfdUtzwBQmA2z7B 8cOVE/aOWdnZKBYWNsvE3MPTSVb4YwfWTNagAPyyWmkj5bn4aX1B/xLOSZXnSi+PE0E+ EgJ+f+TXcEjKEeiu7MMTqUqh8j8O4eELdxnQfUg39tffGPUAhrZIB4gGJEAOSQak+nxH LqSyLLljVSBDqOPJdioUY7IS+6XZkd0VPDzQznaiFiQxzW1njEV2Q083IBnvyddK/kcH +i2Q== X-Forwarded-Encrypted: i=1; AJvYcCWjPnFOQkTSSg+6dwuGUDMIv9iRRD4/HvcELXq6vBwOgVwnoFoc19nknKaNcs/PnVOZCa7ESLZcI8lPA1MWqAOK@lists.infradead.org, AJvYcCX+brLJ9bo3OPwnAs0FJNUb8DGb8G5lVHDB1ugHjlhVN3332UqJcOKVwM52qPSdtvOI9xhF9qgFp/isaDRDjBg=@lists.infradead.org X-Gm-Message-State: AOJu0YxXaBbFL1qP5fqskC+ScGf4EAKMdHUQAaF5m2ruUvVkYI626Bt8 lbNgPj6Hx1yHrMivujpqYYwrYF03Tm+EcUnkeC8Z6/3tO6Xp0Ry+ X-Gm-Gg: ASbGncu2X9wUjSE9Y9twzzDlpyyGzp+x2FwY/LnmgtfDsNVfc+90c3xCV+N/kNVKzVr Gt5Q1XJnYBg5hQ7gLx+D+UC4zsj1K8z7tSeBlFKIYvkhbcHPJ4CYZDZ+Cfh2BacgRterYPpFl+Q zOctg6XYFHQawthKpK1JCHEwYGx/JDXsHZWHjS42MNin/nwMD4HhLNlQSXRvmjccLcSR9XplW4f pByXtHCOt0QpNgzqs5UbR8kXGqhuIXcFC1GIwRAa+BnNwzIX6CC1sXIm38czTVb6A== X-Google-Smtp-Source: AGHT+IGnqTMnfxeBnsiyG8GdBSFG9T80P2B+GJvy1FhoOZjk98AwtKo7e+sVwEI3hH4bMVpQTP3vsA== X-Received: by 2002:a05:6808:38c5:b0:3eb:3f93:7aaa with SMTP id 5614622812f47-3ed88e9f85dmr32670673b6e.4.1735864911254; Thu, 02 Jan 2025 16:41:51 -0800 (PST) Received: from tower.cjhon.com ([2603:8081:ad00:4a:19f2:4f54:d97c:af6e]) by smtp.gmail.com with ESMTPSA id 5614622812f47-3ece2549542sm8087778b6e.32.2025.01.02.16.41.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jan 2025 16:41:50 -0800 (PST) From: Jimmy Hon To: Heiko Stuebner Cc: Ondrej Jirman , Rob Herring , Krzysztof Kozlowski , Conor Dooley , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, Jimmy Hon Subject: [PATCH v5 3/4] arm64: dts: rockchip: Add Orange Pi 5 Max board Date: Thu, 2 Jan 2025 18:41:12 -0600 Message-ID: <20250103004114.1902-4-honyuenkwun@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250103004114.1902-1-honyuenkwun@gmail.com> References: <20250103004114.1902-1-honyuenkwun@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250102_164152_463844_0F6ADFF5 X-CRM114-Status: GOOD ( 16.50 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+linux-rockchip=archiver.kernel.org@lists.infradead.org The RK3588 Single Board Computer includes - eMMC - microSD - UART - 2 PWM LEDs - RTC - RTL8125 network controller on PCIe 2.0x1. - M.2 M-key connector routed to PCIe 3.0x4 - PWM controlled heat sink fan. - 2 USB2 ports - lower USB3 port - upper USB3 port with OTG capability - Mali GPU - SPI NOR flash - Mask Rom button - Analog audio using es8388 codec via the headset jack and onboard mic - HDMI0 the vcc5v0_usb30 regulator shares the same enable gpio pin as the vcc5v0_usb20 regulator. The Orange Pi 5 Max and Orange Pi 5 Ultra are both credit-card sized boards with similar layout. The 5 Max has an extra HDMI0 while the 5 Ultra has a HDMI IN instead. Signed-off-by: Jimmy Hon --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../rockchip/rk3588-orangepi-5-compact.dtsi | 151 ++++++++++++++++++ .../dts/rockchip/rk3588-orangepi-5-max.dts | 60 +++++++ .../boot/dts/rockchip/rk3588-orangepi-5.dtsi | 8 + 4 files changed, 220 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-compact.dtsi create mode 100644 arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index 86cc418a2255..83ad11650f0b 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -142,6 +142,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-jaguar.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-nanopc-t6-lts.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-ok3588-c.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-max.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-orangepi-5-plus.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-quartzpro64.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3588-rock-5-itx.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-compact.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-compact.dtsi new file mode 100644 index 000000000000..b5bf5e5bc5fb --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-compact.dtsi @@ -0,0 +1,151 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include "rk3588-orangepi-5.dtsi" + +/ { + model = "Xunlong Orange Pi 5 Max"; + compatible = "xunlong,orangepi-5-max", "rockchip,rk3588"; + + vcc5v0_usb30_otg: vcc5v0-usb30-otg-regulator { + compatible = "regulator-fixed"; + enable-active-high; + /* USB_OTG_PWREN */ + gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_otg_pwren>; + regulator-name = "vcc5v0_usb30_otg"; + regulator-min-microvolt = <5000000>; + regulator-max-microvolt = <5000000>; + vin-supply = <&vcc5v0_sys>; + }; +}; + +&headphone_amp { + /* PHONE_CTL */ + enable-gpios = <&gpio4 RK_PB0 GPIO_ACTIVE_HIGH>; +}; + +&analog_sound { + pinctrl-names = "default"; + pinctrl-0 = <&hp_detect>; + simple-audio-card,aux-devs = <&headphone_amp>; + simple-audio-card,hp-det-gpios = <&gpio3 RK_PD2 GPIO_ACTIVE_HIGH>; + + simple-audio-card,routing = + "Headphones", "LOUT1", + "Headphones", "ROUT1", + "LINPUT1", "Microphone Jack", + "RINPUT1", "Microphone Jack", + "LINPUT2", "Onboard Microphone", + "RINPUT2", "Onboard Microphone"; + simple-audio-card,widgets = + "Microphone", "Microphone Jack", + "Microphone", "Onboard Microphone", + "Headphone", "Headphones"; +}; + +&fan { + /* FAN_CTL_H */ + pwms = <&pwm9 0 50000 0>; +}; + +&hym8563 { + interrupt-parent = <&gpio0>; + interrupts = ; + pinctrl-names = "default"; + pinctrl-0 = <&rtc_int_l>; +}; + +&led_blue_pwm { + /* PWM_LED1 */ + pwms = <&pwm4 0 25000 0>; + status = "okay"; +}; + +&led_green_pwm { + /* PWM_LED2 */ + pwms = <&pwm5 0 25000 0>; +}; + +/* phy2 */ +&pcie2x1l1 { + reset-gpios = <&gpio4 RK_PD4 GPIO_ACTIVE_HIGH>; + vpcie3v3-supply = <&vcc3v3_pcie_eth>; + status = "okay"; +}; + +&pinctrl { + hym8563 { + rtc_int_l: hym8563-int { + rockchip,pins = <0 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + sound { + hp_detect: hp-detect { + rockchip,pins = <3 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + usb { + usb_host_pwren: usb-host-pwren { + rockchip,pins = <3 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&pwm4 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm4m0_pins>; + status = "okay"; +}; + +&pwm5 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm5m1_pins>; + status = "okay"; +}; + +&pwm9 { + pinctrl-names = "default"; + pinctrl-0 = <&pwm9m2_pins>; + status = "okay"; +}; + +&sfc { + pinctrl-names = "default"; + pinctrl-0 = <&fspim2_pins>; +}; + +&u2phy0_otg { + phy-supply = <&vcc5v0_usb30_otg>; +}; + +&u2phy1_otg { + phy-supply = <&vcc5v0_usb20>; +}; + +&usb_host0_xhci { + dr_mode = "host"; +}; + +/* pcie eth. not a real regulator. 33VAUX */ +&vcc3v3_pcie_eth { + /* Ethernet_power_en */ + gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_LOW>; +}; + +/* + * Represents the vcc5v0_usb20 and vcc5v0_usb30 in the schematic, + * both regulators share the same enable gpio + */ +&vcc5v0_usb20 { + /* USB_HOST_PWREN */ + gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&usb_host_pwren>; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts new file mode 100644 index 000000000000..ce44549babf4 --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-max.dts @@ -0,0 +1,60 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) + +/dts-v1/; + +#include +#include +#include +#include "rk3588-orangepi-5-compact.dtsi" + +/ { + model = "Xunlong Orange Pi 5 Max"; + compatible = "xunlong,orangepi-5-max", "rockchip,rk3588"; + + hdmi0-con { + compatible = "hdmi-connector"; + type = "a"; + + port { + hdmi0_con_in: endpoint { + remote-endpoint = <&hdmi0_out_con>; + }; + }; + }; +}; + +&hdmi0 { + status = "okay"; +}; + +&hdmi0_in { + hdmi0_in_vp0: endpoint { + remote-endpoint = <&vp0_out_hdmi0>; + }; +}; + +&hdmi0_out { + hdmi0_out_con: endpoint { + remote-endpoint = <&hdmi0_con_in>; + }; +}; + +&hdptxphy_hdmi0 { + status = "okay"; +}; + +&pinctrl { + + usb { + usb_otg_pwren: usb-otg-pwren { + rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; +}; + +&vp0 { + vp0_out_hdmi0: endpoint@ROCKCHIP_VOP2_EP_HDMI0 { + reg = ; + remote-endpoint = <&hdmi0_in_vp0>; + }; +}; diff --git a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5.dtsi b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5.dtsi index 944f21410860..325044fd8be5 100644 --- a/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5.dtsi @@ -83,6 +83,14 @@ fan: pwm-fan { pwm-leds { compatible = "pwm-leds"; + led_blue_pwm: led-1 { + color = ; + function = LED_FUNCTION_STATUS; + linux,default-trigger = "heartbeat"; + max-brightness = <255>; + status = "disabled"; + }; + led_green_pwm: led-2 { color = ; function = LED_FUNCTION_INDICATOR;