From patchwork Mon Feb 8 19:16:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tianling Shen X-Patchwork-Id: 12076321 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 483ADC433E0 for ; Mon, 8 Feb 2021 19:18:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F192264E74 for ; Mon, 8 Feb 2021 19:18:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F192264E74 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=pHGw2+8n749IhMl8KcbqkiM9VYHLfjHucCMPTTa/aG0=; b=QVzkCl93WzjXbyCGxi+5EC/Oh CnYZ76CsacmtirRUgxMlm4NhNKT3EM+k3RT8ZgkylhVsrat/oU5p3TiKLbQkKbWS9W8AXXwYCnjoC Hi9DG/by3RYRElmINxtjhgz58NxiqYsBvD/Y7oIBxzA9M+vF6+4dfaQKxyjG2mwB4oj69+562w201 +5NvII+BLNfO98SpOs8I50CpfRBZMHRAacCUUccxHy/K9qShpFMUkyjMhPCrhoj2yPBmxCfvgeGA7 i7qJcS3nUf7Huq76FobEzNkMHXWQKoTO0X33OHkPJFgFtSGRRBdeGm6RUkv4aVvfHdwvU85si7nw0 rlv1msNLA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9C2H-0004xS-Co; Mon, 08 Feb 2021 19:17:25 +0000 Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l9C29-0004uo-Fl; Mon, 08 Feb 2021 19:17:19 +0000 Received: by mail-io1-xd31.google.com with SMTP id f20so2662019ioo.10; Mon, 08 Feb 2021 11:17:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vIfE0BvfZVoAYmQCo3XOHdikwlOFZuMhWiFKWJRteT8=; b=Dhkabv8gRujAjQQwbnPhYXUUwDTw49eRqi+idVaJiHtPJzXgwYkZGR5Cvp3/wpkXqD ASH9c3pArDrz71VR6dtqLdiIk1t9U4wiM7oEO3w//22NfFCZMvT1k3UEW1/dfdtw5Nr/ DnQBWwqzqtC7OCyMCp10Ll4AvMmPIisUC/fFU37vMRn7s+0ApgQzq+xc2cHJ9vhMSbWP 0YX7dqEe7NI6E/gXsIaLfkEjaXzpXIKIFhEAl2+OUwltMwxXxQk7ZUl2YBp+7b3800CF 6pQQRdLhhMgrTO2kLpMQrtoNujbtocLQMxwXT2PMB9tdwylWe6Puku66rQ3EFFgqUBiv 3Dzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vIfE0BvfZVoAYmQCo3XOHdikwlOFZuMhWiFKWJRteT8=; b=jvzWUIAIDy2XWziRuX6kj2TgIJr22pnaEQYIiIr+0UQbiZKmXpYfjJgd/PsqYf5Yfc b6+ccKQ+Q36RFaIbo43iKNRk6d3CtCeIDGWCHGVdP4sDm9btnm7gif+BXxuxqZ9ctxDE PdEPort8Gfk3+mSi4nJDhGf5vJsny75AU4Bm4bfX5JHOJ3x4wB0U0uAhzkEzbZ1pY4dO BMDvvytHjhdAlkannD53D+dEacS2qLfi6S4B0aFW55Rg3tlLOibtd9xAw2z5u2w2pFLz kdBN7bNkKnZTbl7W6S4aydovZMx7QHp/bSCW8BmNzEbEevI0DTN+jqrOBqmhSnwoKrb7 lBDw== X-Gm-Message-State: AOAM530VV7fCPVp1Yt5KgNFK7kSNUmFjQnCIw8u/ox/9J+7o09IxMJfU 2//w8Owcu5q6DfK5z8iTSAo= X-Google-Smtp-Source: ABdhPJzcv3bu3rRvywoNUS3tEyeCyDw4dCK3m0+rTpK/hwjjR7jMnq9bQXs9ZGRei0DRr0ImEgiDSg== X-Received: by 2002:a6b:b70f:: with SMTP id h15mr3269388iof.172.1612811835481; Mon, 08 Feb 2021 11:17:15 -0800 (PST) Received: from localhost.localdomain (tunnel525895-pt.tunnel.tserv15.lax1.ipv6.he.net. [2001:470:c:1200::2]) by smtp.googlemail.com with ESMTPSA id j25sm9429645iog.27.2021.02.08.11.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Feb 2021 11:17:14 -0800 (PST) From: Tianling Shen To: Rob Herring , Heiko Stuebner , Jagan Teki , Johan Jonker , Tianling Shen , Emmanuel Vadot , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , David Bauer , Tobias Schramm , Marty Jones , Jensen Huang Subject: [PATCH 2/2] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S Date: Tue, 9 Feb 2021 03:16:46 +0800 Message-Id: <20210208191646.6511-2-cnsztl@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210208191646.6511-1-cnsztl@gmail.com> References: <20210208191646.6511-1-cnsztl@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210208_141717_588038_36D19BD5 X-CRM114-Status: GOOD ( 18.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds support for the NanoPi R4S from FriendlyArm. Rockchip RK3399 SoC 1GB DDR3 or 4GB LPDDR4 RAM Gigabit Ethernet (WAN) Gigabit Ethernet (PCIe) (LAN) USB 3.0 Port x 2 MicroSD slot Reset button WAN - LAN - SYS LED [initial DTS file] Co-developed-by: Jensen Huang Signed-off-by: Jensen Huang Co-developed-by: Marty Jones Signed-off-by: Marty Jones Signed-off-by: Tianling Shen --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 178 ++++++++++++++++++ 2 files changed, 179 insertions(+) create mode 100644 arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts diff --git a/arch/arm64/boot/dts/rockchip/Makefile b/arch/arm64/boot/dts/rockchip/Makefile index 1ab55a124a87..eb2e13532012 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -34,6 +34,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-leez-p710.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-neo4.dtb +dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-r4s.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-orangepi.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-pinebook-pro.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-puma-haikou.dtb diff --git a/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts new file mode 100644 index 000000000000..b8e8d03eee0a --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts @@ -0,0 +1,178 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * FriendlyElec NanoPC-T4 board device tree source + * + * Copyright (c) 2020 FriendlyElec Computer Tech. Co., Ltd. + * (http://www.friendlyarm.com) + * + * Copyright (c) 2018 Collabora Ltd. + * + * Copyright (c) 2020 Jensen Huang + * Copyright (c) 2020 Marty Jones + * Copyright (c) 2021 Tianling Shen + */ + +/dts-v1/; +#include "rk3399-nanopi4.dtsi" + +/ { + model = "FriendlyElec NanoPi R4S"; + compatible = "friendlyarm,nanopi-r4s", "rockchip,rk3399"; + + /delete-node/ gpio-leds; + gpio-leds { + compatible = "gpio-leds"; + pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; + pinctrl-names = "default"; + + lan_led: led-0 { + gpios = <&gpio1 RK_PA1 GPIO_ACTIVE_HIGH>; + label = "nanopi-r4s:green:lan"; + }; + + sys_led: led-1 { + gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>; + label = "nanopi-r4s:red:sys"; + }; + + wan_led: led-2 { + gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; + label = "nanopi-r4s:green:wan"; + }; + }; + + /delete-node/ gpio-keys; + gpio-keys { + compatible = "gpio-keys"; + pinctrl-names = "default"; + pinctrl-0 = <&reset_button_pin>; + + reset { + debounce-interval = <50>; + gpios = <&gpio1 RK_PC6 GPIO_ACTIVE_LOW>; + label = "reset"; + linux,code = ; + }; + }; + + vdd_5v: vdd-5v { + compatible = "regulator-fixed"; + regulator-name = "vdd_5v"; + regulator-always-on; + regulator-boot-on; + }; + + fan: pwm-fan { + compatible = "pwm-fan"; + /* + * With 20KHz PWM and an EVERCOOL EC4007H12SA fan, these levels + * work out to 0, ~1200, ~3000, and 5000RPM respectively. + */ + cooling-levels = <0 12 18 255>; + #cooling-cells = <2>; + fan-supply = <&vdd_5v>; + pwms = <&pwm1 0 50000 0>; + }; +}; + +&cpu_thermal { + trips { + cpu_warm: cpu_warm { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu_hot { + temperature = <65000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map2 { + trip = <&cpu_warm>; + cooling-device = <&fan THERMAL_NO_LIMIT 1>; + }; + + map3 { + trip = <&cpu_hot>; + cooling-device = <&fan 2 THERMAL_NO_LIMIT>; + }; + }; +}; + +&emmc_phy { + status = "disabled"; +}; + +&fusb0 { + status = "disabled"; +}; + +&pcie0 { + max-link-speed = <1>; + num-lanes = <1>; + vpcie3v3-supply = <&vcc3v3_sys>; + + pcie@0 { + reg = <0x00000000 0 0 0 0>; + #address-cells = <3>; + #size-cells = <2>; + }; +}; + +&pinctrl { + /delete-node/ gpio-leds; + gpio-leds { + lan_led_pin: lan-led-pin { + rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + sys_led_pin: sys-led-pin { + rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>; + }; + + wan_led_pin: wan-led-pin { + rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + + /delete-node/ rockchip-key; + rockchip-key { + reset_button_pin: reset-button-pin { + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&sdhci { + status = "disabled"; +}; + +&sdio0 { + status = "disabled"; +}; + +&sdmmc { + sd-uhs-sdr12; + sd-uhs-sdr25; + sd-uhs-sdr50; +}; + +&u2phy0_host { + phy-supply = <&vdd_5v>; +}; + +&u2phy1_host { + status = "disabled"; +}; + +&usbdrd_dwc3_0 { + dr_mode = "host"; +}; + +&vcc3v3_sys { + vin-supply = <&vcc5v0_sys>; +};