From patchwork Sun Jan 5 22:26: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: 13926827 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 2A1ABE77197 for ; Sun, 5 Jan 2025 22:31:42 +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=0KHSj75J3h8PUL4hNy5XOijFLpB7a2/UDj/WQMsw+Cw=; b=sisHeseXRCzi/r PHdH1RJChYNH1q0J5oGfaxrkhWfnlqi3VXFSFCYzSCFqTKXvlVR7mlru97kZFyvV6uZgnGXY1UVTx 01XPMFwf6JAv8eH5SBA+issk+PUAdkrfvs8e6pzFd/v2vEUz+fZKdsf3DSw3tD6V7KqXVWvuxsPBC 4dGq3YKFHsmdX+kj7E7tWe5owOuUvmcY30QLI4srWTzkWW5MKfN+/MRjITEinkEA4yEhshyZ2oha1 x2k4CjAds2kgnOGhpV83sY+u16ZXiRAbdYfOizVeRCyMeazDdJna4W+SnCkRtMVrUwPY2CWLPqcow 8WeCBXdEUxuBBzR2rsEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tUZ9n-0000000HTNO-1j1t; Sun, 05 Jan 2025 22:31:39 +0000 Received: from mail-ot1-x334.google.com ([2607:f8b0:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tUZ5B-0000000HSxq-3gaH; Sun, 05 Jan 2025 22:26:55 +0000 Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-71e163493efso8863137a34.3; Sun, 05 Jan 2025 14:26:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1736116013; x=1736720813; 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=FfSbHyT1R6raOhTJ7V8XARiXNUedGBDtTDTJSvxiO2Y=; b=iuOpliOlwKkxgj/IhPGzO5eTE9NbGnWm9UeiEamrm5oVWHLcussbkQaNFNpWiJEFpf +qTmIETv6dseIbU2nvMB2XbLwnfNm1cCLwHDMlhr3zz82T2zR0LK0sB2dHkHI0RSUo2W awlAZTXS0X2r6snMcVny5vs+ME6x9/Iwma9PRqV4O7Y3ZDvQkge09sDrcTyfuR3GqxY2 TmonLHRUqaqCv/ojr+qVt1sgRZ3BEZMjr3URAhnPLlcnW+pCybn/97AJj+339ScGkUK3 3Mtj1vGsnCXJWvFjsagA6hsitjclvqwdCHGE6N+DnHte+QzqPGcrFa9WlM6HoFuejt3R VNYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736116013; x=1736720813; 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=FfSbHyT1R6raOhTJ7V8XARiXNUedGBDtTDTJSvxiO2Y=; b=ItXtufyUjEcDa5fZX/hpHKS7ae4KtNSWjGYb7Of61ME5/9w/YebYP5o8gr+5CkKkCa bKOZDKC5Akae2IzMrWnI8Ks+obGcgs6XkLwgeJxjPBhfUdYGPfx5W+NR+MlDoxcSWgGn sXTFbndPs2yWhAy0cHnzeVwn1exqX+TENjEf3GoK3l+EWVmRter3QGv9f37rc+1rhj2M /X/Q5wLXdCMgu3x0Kg68KaQGlyZCMjGdwuKQNkXr0Q8ygtNXRIilNXxYcuzjd4NrZ9DG bGVAEv5aSaFb/FSEiHwDFwSRXvLhNib7upMS7ELIvvQ97YPNmlNP4luC+9b9/eHBhKUO QGdg== X-Forwarded-Encrypted: i=1; AJvYcCUX4tzusENtRY7gbVWTJJ/Kpq04u6t+atsljfZtNdNtkweOEtutTmKJTq74SIK8CVdnnGCnPIOIcZy0gobPOIEa@lists.infradead.org, AJvYcCV5KNXgwGOpsuDg1hDXrMC2llt3j1StIDc6aa7GaWh5Ifl/qsuGQvhuCgtkmZzbTSsKxSgwhZewsQJMuXIiXno=@lists.infradead.org X-Gm-Message-State: AOJu0YwyH167qQ1mBcUahPafYhMgFmMcKBzU3YNtKg9/8ggn75iiqdwv PgePgn6eYu7TRy8sr7mXZA9apNUzNBvahTDHFA4jDPQrorpEf1w7 X-Gm-Gg: ASbGncs2pZe43Y+GsEAJauW5EgUyfc6aB1wca5YK2wZNckbuZKNgc0es/E2YSon2Qaq LFmLMxsAKKUbiLlJD2uSFIWzPF61snXznX9zr1UVByUhcjgfskWR3KjJ9C2KJwD99Xr4jAh8GsB Y9L4UY8ja6hx1yAcS0DP7+795bpCY/dTT8GDiz/XPfmQqslZLS2XRN/q2e8pa3j75DIZ1Qpe/TR +elT+Su2AvuGUQL+vDb+DKkzJ+mET2EinTno4s2SZrS3HLCkiQEQ5Lwci/u4UnrFg== X-Google-Smtp-Source: AGHT+IGrZqK6CfF7TIMzjZudseuCis7T+qaireIqn0thes0b4qTk7dBNKWCCI/z1rtPJniDJGJ2o3w== X-Received: by 2002:a05:6830:3883:b0:71d:eee3:fd22 with SMTP id 46e09a7af769-720ff692341mr34767400a34.5.1736116012783; Sun, 05 Jan 2025 14:26:52 -0800 (PST) Received: from tower.cjhon.com ([2603:8081:ad00:4a:b377:72ce:54b5:bddf]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71fc980a9e8sm9555227a34.43.2025.01.05.14.26.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jan 2025 14:26:52 -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 v7 3/4] arm64: dts: rockchip: Add Orange Pi 5 Max board Date: Sun, 5 Jan 2025 16:26:12 -0600 Message-ID: <20250105222614.2359-4-honyuenkwun@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250105222614.2359-1-honyuenkwun@gmail.com> References: <20250105222614.2359-1-honyuenkwun@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250105_142653_932493_5A23CD94 X-CRM114-Status: GOOD ( 16.11 ) 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 - HDMI1 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, so these boards will share a common dtsi. 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..87090cb98020 --- /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 083d7f78b19a..a98e804a0949 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;