From patchwork Mon Mar 15 08:42:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tianling Shen X-Patchwork-Id: 401996 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=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham 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 C5835C433E0 for ; Mon, 15 Mar 2021 08:44:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8539060238 for ; Mon, 15 Mar 2021 08:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229544AbhCOIo1 (ORCPT ); Mon, 15 Mar 2021 04:44:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbhCOIn4 (ORCPT ); Mon, 15 Mar 2021 04:43:56 -0400 Received: from mail-io1-xd2f.google.com (mail-io1-xd2f.google.com [IPv6:2607:f8b0:4864:20::d2f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CF79C061574; Mon, 15 Mar 2021 01:43:56 -0700 (PDT) Received: by mail-io1-xd2f.google.com with SMTP id o11so32544653iob.1; Mon, 15 Mar 2021 01:43:56 -0700 (PDT) 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=2V/uwR+/jc8ZqqGwCEmkn70oENnu/vxhA/I84HfDnXg=; b=rLxJy9jsSJBeC9OguC2viz0c0ck5QDiDMbNEhX1iCuTu03MIlmkJCuzFSIaTFzwla8 apU/4rHgMK86bObHR067V0tNqHFdcyazlf8uZYHsfMbouZlWpRZBy9SbVjVuC1LIIH45 PetjUlQ2fAGyEQrYsMQddWMELZg4fgclT311B/aqs8pRvA4n5BqtlpBkw8VHhBLS7MCU rozLte89KU4xdPetc4PqaI+D7b9U97njrtwrxvTdERUob3Ms5Iy9BjmClIrCApYFtbyg N7S5tW5g9KzYvb31K3zax8liMOqy713awaq7u+Xg2tBD9btnXHFgh02M+YhnS2Mn2MpX wAvg== 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=2V/uwR+/jc8ZqqGwCEmkn70oENnu/vxhA/I84HfDnXg=; b=Yz/OffNYV/QeL3Nx+kfWPJcuKxsDMqqjVQKPJZynHSWNQEVPekcbaqf91LW/gVPWYa HkpnF/j3kcX7BSTnqNT+MELXgK0/1Mn+DEueBPn5JWdAVJ5CBGmHQ85zIGo60lhnk3gR 5OGsOSFVIs4jn/X+fDbyzQSGyGdZ+u1wdCpySg6wJ1tML0uIofGAP0RNtuV4anDTvNJL fLDryMvJO+6vbfvxHdNBwVTtMwF4kHP3aHtldZaxfzgFVZY2G88haW86DEBig1Dag25q X/un516Vta8GUv1613mz+BJRJm8rEKKJVV/dXENmu3J9lA8EudHIQA7Q+seMUmBJCK2n 78Tg== X-Gm-Message-State: AOAM533qWbRMx+VHde53qxuxr9oKP8DJsokA0vISa67SQHhUiZ7MYgp0 R41xl0nyMqh3iEloEtBft1E= X-Google-Smtp-Source: ABdhPJwvfUvNG3jWG3WhghjwDIUxG/WmBvdNK5uUAyXub64jrZABn6gaoWAfdI6hiBUi4mIVtwpn5Q== X-Received: by 2002:a02:6a0b:: with SMTP id l11mr8467363jac.82.1615797835904; Mon, 15 Mar 2021 01:43:55 -0700 (PDT) Received: from localhost.localdomain (tunnel525895-pt.tunnel.tserv15.lax1.ipv6.he.net. [2001:470:c:1200::2]) by smtp.googlemail.com with ESMTPSA id w6sm7375110ilm.38.2021.03.15.01.43.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 01:43:55 -0700 (PDT) From: Tianling Shen To: Rob Herring , Heiko Stuebner , Jagan Teki , Chen-Yu Tsai , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , Tianling Shen , Johan Jonker , David Bauer , Jensen Huang , Marty Jones Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 2/2] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S Date: Mon, 15 Mar 2021 16:42:41 +0800 Message-Id: <20210315084241.22345-2-cnsztl@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210315084241.22345-1-cnsztl@gmail.com> References: <20210315084241.22345-1-cnsztl@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.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 [minor adjustments] Co-developed-by: Marty Jones Signed-off-by: Marty Jones [minor adjustments, fixed format issues] Signed-off-by: Tianling Shen --- arch/arm64/boot/dts/rockchip/Makefile | 1 + .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 139 ++++++++++++++++++ 2 files changed, 140 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 62d3abc17a24..c3e00c0e2db7 100644 --- a/arch/arm64/boot/dts/rockchip/Makefile +++ b/arch/arm64/boot/dts/rockchip/Makefile @@ -36,6 +36,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopc-t4.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4.dtb dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-nanopi-m4b.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..2da1a5acf66d --- /dev/null +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts @@ -0,0 +1,139 @@ +// 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/ display-subsystem; + + gpio-leds { + /delete-property/ pinctrl-0; + pinctrl-0 = <&lan_led_pin>, <&sys_led_pin>, <&wan_led_pin>; + + /delete-node/ led-0; + 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"; + default-state = "on"; + }; + + wan_led: led-2 { + gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; + label = "nanopi-r4s:green:wan"; + }; + }; + + gpio-keys { + /delete-property/ pinctrl-0; + pinctrl-0 = <&reset_button_pin>; + + /delete-node/ power; + 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; + }; +}; + +&emmc_phy { + status = "disabled"; +}; + +&i2c4 { + 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 { + gpio-leds { + /delete-node/ status-led-pin; + + 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>; + }; + }; + + rockchip-key { + /delete-node/ power-key; + + reset_button_pin: reset-button-pin { + rockchip,pins = <1 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>; + }; + }; +}; + +&sdhci { + status = "disabled"; +}; + +&sdio0 { + status = "disabled"; +}; + +&u2phy0_host { + phy-supply = <&vdd_5v>; +}; + +&u2phy1_host { + status = "disabled"; +}; + +&uart0 { + status = "disabled"; +}; + +&usbdrd_dwc3_0 { + dr_mode = "host"; +}; + +&vcc3v3_sys { + vin-supply = <&vcc5v0_sys>; +};