From mboxrd@z Thu Jan 1 00:00:00 1970 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.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 8F24BC433E0 for ; Sat, 13 Mar 2021 11:58:28 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 27D9464F17 for ; Sat, 13 Mar 2021 11:58:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 27D9464F17 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.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=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rX3WqorrXP0/grA7NErCK9fawVUkaOrSEXyLemPihnc=; b=p0wcgT4qSk1PXlkIMIYRCicVE 4Y3yN8yQDfRPkqNTN+detYjO9OaIhHRn+bxDzlaJl+kd8HJ33PhOxYkTOmoeQLWETvxD6BL1N5Eg4 Bq2wJ4syQhcWN6ULgKbUPj/wdXKpQdn53M3v52O3TDD6VUVoXw8osHyN/YK5cOM7aVJpQJjqhS5ib tVFK4aELdWYh0pNULYclg/cpPWDWGYtAflGKxYV+naMrrW9lZlM0QbcJ8k6wmhUKVbTJ/3y8Oxuf5 bMFgdn0jGceVufzXMPXboGVvdoD+2HyoiMsaZtBeelcKf3sP4gbi0GcQwFj006TWK9qX4jgRB3/5G BLnoc2BqQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lL2rY-00DAIz-QH; Sat, 13 Mar 2021 11:55:21 +0000 Received: from foss.arm.com ([217.140.110.172]) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lL2rL-00DAID-Cp; Sat, 13 Mar 2021 11:55:13 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EF4CBED1; Sat, 13 Mar 2021 03:55:00 -0800 (PST) Received: from [192.168.1.104] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 3E2503F70D; Sat, 13 Mar 2021 03:54:57 -0800 (PST) Subject: Re: [PATCH v3 2/2] rockchip: rk3399: Add support for FriendlyARM NanoPi R4S To: Tianling Shen , Rob Herring , Heiko Stuebner , Jagan Teki , Chen-Yu Tsai , Geert Uytterhoeven , David Bauer , =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Johan Jonker , Michael Trimarchi , Marty Jones , Jensen Huang Cc: devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, kernel test robot References: <20210313032515.12590-1-cnsztl@gmail.com> <20210313032515.12590-2-cnsztl@gmail.com> From: Robin Murphy Message-ID: <1f7f1a11-0b9b-b2e4-efbc-193f61d62832@arm.com> Date: Sat, 13 Mar 2021 11:54:49 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210313032515.12590-2-cnsztl@gmail.com> Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210313_115510_722732_8B9B8C78 X-CRM114-Status: GOOD ( 25.48 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-03-13 03:25, Tianling Shen wrote: > 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 > [fixed format issues] > Signed-off-by: Tianling Shen > > Reported-by: kernel test robot > --- > arch/arm64/boot/dts/rockchip/Makefile | 1 + > .../boot/dts/rockchip/rk3399-nanopi-r4s.dts | 179 ++++++++++++++++++ > 2 files changed, 180 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..41b3d5c5043c > --- /dev/null > +++ b/arch/arm64/boot/dts/rockchip/rk3399-nanopi-r4s.dts > @@ -0,0 +1,179 @@ > +// 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; Why? You could justify deleting &status_led, but redefining the whole node from scratch seems unnecessary. > + 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"; > + default-state = "on"; > + }; > + > + wan_led: led-2 { > + gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; > + label = "nanopi-r4s:green:wan"; > + }; > + }; > + > + /delete-node/ gpio-keys; Ditto - just removing the power key node itself should suffice. > + 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>; This is clearly not true - those numbers refer to a 12V fan on my NanoPC-T4's 12V PWM circuit, while the output circuit here is 5V. If you really want a placeholder here maybe just use <0 255>, or figure out some empirical values with a suitable 5V fan that are actually meaningful. > + #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"; This can never be enabled since it doesn't exist in the design at all, so it's one place where deletion *would* make good sense. AFAICS this means you also don't need i2c4 enabled either. > +}; It might be nice to disable HDMI and all the other display pieces given that the board is physically headless. > + > +&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>; > + }; What's this for? > +}; > + > +&pinctrl { > + /delete-node/ gpio-leds; Again, at most you'd only need to delete &status_led_pin. > + 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; Ditto for &power_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; Are those modes unique to this particular board? > +}; > + What about the Bluetooth stuff on uart0? Robin. > +&u2phy0_host { > + phy-supply = <&vdd_5v>; > +}; > + > +&u2phy1_host { > + status = "disabled"; > +}; > + > +&usbdrd_dwc3_0 { > + dr_mode = "host"; > +}; > + > +&vcc3v3_sys { > + vin-supply = <&vcc5v0_sys>; > +}; > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel