From patchwork Mon Feb 28 17:48:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 546773 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3B88C433F5 for ; Mon, 28 Feb 2022 18:20:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237556AbiB1SVY (ORCPT ); Mon, 28 Feb 2022 13:21:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240137AbiB1SVL (ORCPT ); Mon, 28 Feb 2022 13:21:11 -0500 X-Greylist: delayed 457 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 28 Feb 2022 09:58:24 PST Received: from relay-us1.mymailcheap.com (relay-us1.mymailcheap.com [51.81.35.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB82220D3; Mon, 28 Feb 2022 09:58:24 -0800 (PST) Received: from relay5.mymailcheap.com (relay5.mymailcheap.com [159.100.241.64]) by relay-us1.mymailcheap.com (Postfix) with ESMTPS id EF130201F2; Mon, 28 Feb 2022 17:50:22 +0000 (UTC) Received: from relay1.mymailcheap.com (relay1.mymailcheap.com [144.217.248.102]) by relay5.mymailcheap.com (Postfix) with ESMTPS id CCA29206D3; Mon, 28 Feb 2022 17:49:29 +0000 (UTC) Received: from filter2.mymailcheap.com (filter2.mymailcheap.com [91.134.140.82]) by relay1.mymailcheap.com (Postfix) with ESMTPS id C304A3F201; Mon, 28 Feb 2022 17:48:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by filter2.mymailcheap.com (Postfix) with ESMTP id 2C94C2A6DF; Mon, 28 Feb 2022 17:48:58 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at filter2.mymailcheap.com Received: from filter2.mymailcheap.com ([127.0.0.1]) by localhost (filter2.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ajWsz5Lt1Fza; Mon, 28 Feb 2022 17:48:57 +0000 (UTC) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter2.mymailcheap.com (Postfix) with ESMTPS; Mon, 28 Feb 2022 17:48:57 +0000 (UTC) Received: from edelgard.icenowy.info (unknown [59.41.161.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id 209A5405A4; Mon, 28 Feb 2022 17:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1646070536; bh=EUzRPh29lTz0HC2sOaanLBcm5/67RZ1K8csq/rZ5tF0=; h=From:To:Cc:Subject:Date:From; b=lm4d08q9QW/jYV2uymu/ojKgPwtij1OU7udNcw7HWUfexmbojWX0184HRSkqwvtFc 12PZmrrV3b++TueVDtpz+16uZ3fOUNbHdfueF1wIPUJmx1DDwUfcLCY9L+hsEyLglW niRTQDnKGS5mgt+J2woUn5mnCkMGwpYPU9yNl5Hw= From: Icenowy Zheng To: Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Icenowy Zheng Subject: [PATCH 1/2] riscv: dts: sifive: sort Unleashed DT nodes under / Date: Tue, 1 Mar 2022 01:48:36 +0800 Message-Id: <20220228174837.602758-1-icenowy@aosc.io> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The device tree nodes at root in HiFive Unleashed DT is currently not sorted. Sort them alphabetically. Signed-off-by: Icenowy Zheng --- .../boot/dts/sifive/hifive-unleashed-a00.dts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts index ced0d4e479385..44824d7e50ac7 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts @@ -20,9 +20,9 @@ cpus { timebase-frequency = ; }; - memory@80000000 { - device_type = "memory"; - reg = <0x0 0x80000000 0x2 0x00000000>; + gpio-restart { + compatible = "gpio-restart"; + gpios = <&gpio 10 GPIO_ACTIVE_LOW>; }; hfclk: hfclk { @@ -32,16 +32,17 @@ hfclk: hfclk { clock-output-names = "hfclk"; }; + memory@80000000 { + device_type = "memory"; + reg = <0x0 0x80000000 0x2 0x00000000>; + }; + rtcclk: rtcclk { #clock-cells = <0>; compatible = "fixed-clock"; clock-frequency = ; clock-output-names = "rtcclk"; }; - gpio-restart { - compatible = "gpio-restart"; - gpios = <&gpio 10 GPIO_ACTIVE_LOW>; - }; }; &uart0 { From patchwork Mon Feb 28 17:48:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 547399 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9AE71C433EF for ; Mon, 28 Feb 2022 18:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240143AbiB1SVZ (ORCPT ); Mon, 28 Feb 2022 13:21:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240149AbiB1SVM (ORCPT ); Mon, 28 Feb 2022 13:21:12 -0500 Received: from relay-us1.mymailcheap.com (relay-us1.mymailcheap.com [51.81.35.219]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FFED220D4; Mon, 28 Feb 2022 09:58:24 -0800 (PST) Received: from relay5.mymailcheap.com (relay5.mymailcheap.com [159.100.248.207]) by relay-us1.mymailcheap.com (Postfix) with ESMTPS id 4A326201F1; Mon, 28 Feb 2022 17:50:06 +0000 (UTC) Received: from relay4.mymailcheap.com (relay4.mymailcheap.com [137.74.80.156]) by relay5.mymailcheap.com (Postfix) with ESMTPS id 5886F267CE; Mon, 28 Feb 2022 17:49:35 +0000 (UTC) Received: from filter1.mymailcheap.com (filter1.mymailcheap.com [149.56.130.247]) by relay4.mymailcheap.com (Postfix) with ESMTPS id D602E2000E; Mon, 28 Feb 2022 17:49:04 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by filter1.mymailcheap.com (Postfix) with ESMTP id 3E3B62A378; Mon, 28 Feb 2022 17:49:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at filter1.mymailcheap.com Received: from filter1.mymailcheap.com ([127.0.0.1]) by localhost (filter1.mymailcheap.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id c7fNPPvqKdGq; Mon, 28 Feb 2022 17:49:03 +0000 (UTC) Received: from mail20.mymailcheap.com (mail20.mymailcheap.com [51.83.111.147]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by filter1.mymailcheap.com (Postfix) with ESMTPS; Mon, 28 Feb 2022 17:49:02 +0000 (UTC) Received: from edelgard.icenowy.info (unknown [59.41.161.107]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail20.mymailcheap.com (Postfix) with ESMTPSA id 3A4FC405A4; Mon, 28 Feb 2022 17:48:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=aosc.io; s=default; t=1646070542; bh=LULP0zQ1ZvfvYvSVqa6XKbmkljj5l8VtkKiZl1WBvIw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=j5krynj2l3oFWH2XX0+o56R6rdO4tC9K6Fet3VAyOm/KrYj/an3u2NQphq0BQyAqg sJ+ACBugGcVBH/bRnFGq7uVbWOihxOty/50/A3U89qZSxYciouA2GhjTK6aT0tlhH4 kPhxodzy3jG6Q1IVetSpFjZR+rGyfCMyH0iI2WgA= From: Icenowy Zheng To: Rob Herring , Paul Walmsley , Palmer Dabbelt , Albert Ou Cc: devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Icenowy Zheng Subject: [PATCH 2/2] riscv: dts: sifive: add pwm leds for HiFive Unleashed Date: Tue, 1 Mar 2022 01:48:37 +0800 Message-Id: <20220228174837.602758-2-icenowy@aosc.io> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220228174837.602758-1-icenowy@aosc.io> References: <20220228174837.602758-1-icenowy@aosc.io> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The PWM0 controller of HiFive Unleashed's FU540-C000 chip is connected to 4 LEDs. Add them to the device tree, with function and default trigger set from the triggers used in old kernels done by SiFive. Signed-off-by: Icenowy Zheng --- .../boot/dts/sifive/hifive-unleashed-a00.dts | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts index 44824d7e50ac7..2935719ca169e 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unleashed-a00.dts @@ -3,6 +3,8 @@ #include "fu540-c000.dtsi" #include +#include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -32,6 +34,46 @@ hfclk: hfclk { clock-output-names = "hfclk"; }; + led-controller { + compatible = "pwm-leds"; + + led-0 { + color = ; + pwms = <&pwm0 0 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_HEARTBEAT; + linux,default-trigger = "heartbeat"; + }; + + led-1 { + color = ; + pwms = <&pwm0 1 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_MTD; + linux,default-trigger = "mtd"; + }; + + led-2 { + color = ; + pwms = <&pwm0 2 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_LAN; + linux,default-trigger = "netdev"; + }; + + led-3 { + color = ; + pwms = <&pwm0 3 10000000 PWM_POLARITY_INVERTED>; + active-low; + max-brightness = <255>; + function = LED_FUNCTION_PANIC; + linux,default-trigger = "panic"; + }; + }; + memory@80000000 { device_type = "memory"; reg = <0x0 0x80000000 0x2 0x00000000>;