From patchwork Tue Sep 7 00:39:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525082 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=tMAlYV1D; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHR3M4Cz9shn; Tue, 7 Sep 2021 10:39:47 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9L-0002uI-Gy; Tue, 07 Sep 2021 00:39:43 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9I-0002rM-FK for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:40 +0000 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 49E924015D for ; Tue, 7 Sep 2021 00:39:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975180; bh=NHY7cKlOmtsiMBmaZRg5BtcZcsTxLes8flPTqBLtUJc=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=tMAlYV1DZv/g0JiRpdTza+6KZaxjZOQlmkhJtNspNpqpXVQTqB0TxLhyGTwH6F+Vc t4qDvFwvKGeEShZdR9G8o8fHK1s8ukd0DSY/7o9cRwHxyJysL90pYKIQdmN67yktcc G7fvmAcN1MFRTgjWyVyaJu5B3QNdj7yEgv+qTPXL26dLZ9LLbAgNddopSsf3I2jo9F n/B8fH3V4XZ3ioI64otGuPxcmiQoZMvy7IhTzrD0lc2dLPEQYr5qKPJGkWN/fam2ma YT9/W0XJFv5c0sqrNeu040eQvCJO4i/ls3QoC3PSA4EjeBZqJlufRBsxUd6hpRiELG FPA1wIOsvSVVw== Received: by mail-wm1-f69.google.com with SMTP id h1-20020a05600c350100b002e751bf6733so485583wmq.8 for ; Mon, 06 Sep 2021 17:39:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NHY7cKlOmtsiMBmaZRg5BtcZcsTxLes8flPTqBLtUJc=; b=c2dP9aHJq3dVh0mu2Qy0DrxlNq1EDUN/nRyAqSDjleZX7H0An4wMdOTbenkUEHI+8k MxsLDSEuq0x7SNh/jjAQYdkwLHucBdvUlnOTZltzNbSeb1eqeYMQkjzrl+B6RzAiP/JG sL4TvujRIZ1fzeuiQ1xCYIdPBIFcU3muuEYc9RXaT6Hg/n7Ji4UPsspszV5/uon7MJsM v47hL3dhaVy/VcTLaJzpl/ZqpcdqZhbKZQkh4SrC72jDsJ4fgg6O019OgMk8N8Bd2fAs 53LPNJ0Rr+XjKf0RT7ffu8MA7yUA1sEGvvDV5oX6XE5iacnCPnH0BO/E5/vl79zyqMzJ ZUCQ== X-Gm-Message-State: AOAM530NKyUai2yyWob8FhfYne7KBZxns0k1ISBjSIHLO9wh7O97/Mpb rTPAFd+1IOb+LXUunSWu3n0SalVTSkrP44NqSEYhpcJjZtWX6Uid5RMRCkVgyABQ4+9E7eNuW35 yVPKODm4W8K2BXoiIHOF2nEZ4Uq9T8lK2M1t60/ItZA== X-Received: by 2002:adf:e747:: with SMTP id c7mr13570927wrn.241.1630975179678; Mon, 06 Sep 2021 17:39:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxf+aCwItvEEK9opTa/vo/r8dkG7DXFu16Z/H/AOzK/MgBqj+3ylymtXe/Nhvdszxm/p8yEKQ== X-Received: by 2002:adf:e747:: with SMTP id c7mr13570923wrn.241.1630975179511; Mon, 06 Sep 2021 17:39:39 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id t14sm845270wmi.12.2021.09.06.17.39.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:39 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 1/6] riscv: sifive: unmatched: add D12 PWM LED Date: Tue, 7 Sep 2021 01:39:27 +0100 Message-Id: <20210907003932.112495-2-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Abdurachmanov Signed-off-by: David Abdurachmanov BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index e026f60af0..8461b33d1f 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -3,6 +3,7 @@ #include "fu740-c000.dtsi" #include +#include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ #define RTCCLK_FREQ 1000000 @@ -30,6 +31,17 @@ memory@80000000 { soc { }; + pwmleds { + compatible = "pwm-leds"; + d12 { + label = "green:d12"; + pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + }; + hfclk: hfclk { #clock-cells = <0>; compatible = "fixed-clock"; From patchwork Tue Sep 7 00:39:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525083 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=LCAPVP+g; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHT67xSz9shn; Tue, 7 Sep 2021 10:39:49 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9M-0002vj-V4; Tue, 07 Sep 2021 00:39:44 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9K-0002sO-59 for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:42 +0000 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 67FF34019C for ; Tue, 7 Sep 2021 00:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975181; bh=B7ylXwQJg538KKlVV0rWDgFMwUzUcIRNN2UlLOFqwZg=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=LCAPVP+g/X1IY49fGNTIHWCF76uAY/YQkcom7PKQLrdzL92iN5PpxAzjZn/OJpQOh FSPqxfHyfKGN5pAAMlIzy1aviRlBJlDCcwrkbEV82aTsCCDRqeBUcm7Ds63V5MwLzJ 594Jq1aqWx+DDC/Np/yD89VWdWjBFL4E8UQyJddjssgAtgamlVxIDIrWEJCg85QYxH 88UTK4lLJMFT2fJ5jI1wqSlvD4uJHaYN/7+78SkL4yE26X2vOBTniYr5biUy8v6HaS jc0gK/KMFtaq13Ijt1XxEPo3t2aRQY1Y7Ve4l3hSQUGwov65ZMmgq8ogXEEUGnj8CZ Js57zDGX8BvVA== Received: by mail-wm1-f71.google.com with SMTP id r125-20020a1c2b830000b0290197a4be97b7so486032wmr.9 for ; Mon, 06 Sep 2021 17:39:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=B7ylXwQJg538KKlVV0rWDgFMwUzUcIRNN2UlLOFqwZg=; b=LTP5Nohr+TtBeH3tcRQIOO87AF8KSw0wWLdioIKe1mxFwVGiTOjMX0KjgWjmEpHjfB RJSQmNdgVRBa0ZepNDHmmqBCxup7Cjeea2UEQ0nzISvnEq9i4LiSJQvEbtceeQQv33eH 2X+VrwdRu75kyQnuFQaLUeXEG22TUk4GjeaiXeMIiiR3lhNpsYtqexCxjXWxd57s2GGh hkysRRCNdo/NPArARdifu46U5x8KYzSoSotrOmUFqtmjU8EXN2B1l3PTF1nX9axVrKJF ZYigOe1wh7chBcn80gJKmADvVyJh8NDZzvF6VUJWTgIzBfPd2pPzZLZf8rOwUisk2ikR YNIQ== X-Gm-Message-State: AOAM532a8Fkd2FHUiNWwBZoLLWRj1x6tMxZ+hiQSmQRUUsWvmg0fmT1q YW9xiZhEMu9NwX6hiPqLRgbhBgz9vXCUWX5qdwln3pQKBnd+64t8yirHTMBFiZ9XOYWv6guMCf3 YBfMeuRgvimgN5Q+aP87ROTQDqHvJbv1AAeP9i6wWtg== X-Received: by 2002:a7b:c92b:: with SMTP id h11mr1343679wml.62.1630975180852; Mon, 06 Sep 2021 17:39:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8hOXih5ZXHJ47j7RNiBGJ+8oKSWs1HDtW38Dk9f8xTp3esxCTQtiRDN3q8pCIeopcB8M8Aw== X-Received: by 2002:a7b:c92b:: with SMTP id h11mr1343667wml.62.1630975180584; Mon, 06 Sep 2021 17:39:40 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id c4sm1095132wme.14.2021.09.06.17.39.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:40 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 2/6] riscv: sifive: unmatched: add D2 RGB LED Date: Tue, 7 Sep 2021 01:39:28 +0100 Message-Id: <20210907003932.112495-3-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Abdurachmanov Signed-off-by: David Abdurachmanov BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- .../boot/dts/sifive/hifive-unmatched-a00.dts | 26 ++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index 8461b33d1f..56e6d8e8fe 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -33,13 +33,37 @@ soc { pwmleds { compatible = "pwm-leds"; - d12 { + green-d12 { label = "green:d12"; pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; active-low = <1>; max-brightness = <255>; linux,default-trigger = "none"; }; + + green-d2 { + label = "green:d2"; + pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + + red-d2 { + label = "red:d2"; + pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; + + blue-d2 { + label = "blue:d2"; + pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; + active-low = <1>; + max-brightness = <255>; + linux,default-trigger = "none"; + }; }; hfclk: hfclk { From patchwork Tue Sep 7 00:39:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525086 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=psrViK8f; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHc3w2Fz9sjJ; Tue, 7 Sep 2021 10:39:56 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9T-00030e-7C; Tue, 07 Sep 2021 00:39:51 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9K-0002tQ-Ev for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:42 +0000 Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 3B5293F046 for ; Tue, 7 Sep 2021 00:39:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975182; bh=swyGoF+YUCHYMuKouB0KQeWOn5zPel1aPL9jwTo8R68=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=psrViK8fHd4t8lWfWRTad3Ki4ZMG3McxDlpAzWoBgLE2HmrfIJ6ulcYfPBl2IUYUP 1kHJke4NOvHm8RYJdimsJGbqzGoBs+TAZfDWOY9qFHJHECzs2rOjwiPEe/WlC5raV3 PtaCi7Uo7kOwSTN+g2zJJIZdYV+O0xBsCEe2loUVok0AU12eSwqWMxiJMw0vWc6CP7 MH/YA0uIJHA88IgXVS2KvRRUFRoXqFizACguaRlH8TXfB4FSVNhNhhSe7gbijLehJe ahJesMDJZ+FY6TaP/MmB0joXLJqEy6TSYQEuzshjAXQ0pmZ/+DOE1i01dnt0z0w727 kR/B7jzGjctnQ== Received: by mail-wm1-f70.google.com with SMTP id r4-20020a1c4404000000b002e728beb9fbso396556wma.9 for ; Mon, 06 Sep 2021 17:39:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=swyGoF+YUCHYMuKouB0KQeWOn5zPel1aPL9jwTo8R68=; b=cVY929Rt+CJ/AC5MZ66mzgc62U6oVESgYM31GCWPue2L18g4U9fwM62ewTy8WuYaX0 moMXFWQbRZe18YTFCGnjPYP8WEsOVyrUf35bWSqScmR95VMd4FMhEC+AsjJjcNUJ/x+Y nZfEs7CVvOclNGVzgYK1atgm6KA15SJGJkC1FkRN3CuWGoPU1JAGJB4GUh8iCvo++v4a MwnS4u/StcxdiauS2LWELuuABmiN/Dl199b6LzU9hTY5OhK7iJ0L3vttaVq9HDKFceIE VFi/alSqQ1s77rpVvizBFQ4bEUUXrpuvTZZyfdXsadq/i5v1i/nNPgRO5pOwH0+gaAxL M55Q== X-Gm-Message-State: AOAM53216PvCYdDj65E9ZmnO88WXRcfxnL26+8QGThCPRcZJMJm23RXQ MNIIC22Js3ovuVDw3bNCWUs8vjPFCqNeB8YwBsc9I4rpfJt4O2mySHhsXob1KRZnbYvVEhEuBk2 //hlXQ91G5xIvxNy4vKVpEu2ZdoR4YmlOViTQLNdwrQ== X-Received: by 2002:a5d:4410:: with SMTP id z16mr15984148wrq.110.1630975181732; Mon, 06 Sep 2021 17:39:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzNSLxhjB1xyvqTdqrlt9tBxHrVdctKfil5N9wlUgD/08T7aEBfBZb3Y2G+lRot1kIA6ewoVg== X-Received: by 2002:a5d:4410:: with SMTP id z16mr15984139wrq.110.1630975181534; Mon, 06 Sep 2021 17:39:41 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id t14sm845309wmi.12.2021.09.06.17.39.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:41 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 3/6] riscv: sifive: unmatched: define LEDs color Date: Tue, 7 Sep 2021 01:39:29 +0100 Message-Id: <20210907003932.112495-4-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Abdurachmanov Signed-off-by: David Abdurachmanov BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index 56e6d8e8fe..200d022c75 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -3,6 +3,7 @@ #include "fu740-c000.dtsi" #include +#include #include /* Clock frequency (in Hz) of the PCB crystal for rtcclk */ @@ -35,6 +36,7 @@ pwmleds { compatible = "pwm-leds"; green-d12 { label = "green:d12"; + color = ; pwms = <&pwm0 0 7812500 PWM_POLARITY_INVERTED>; active-low = <1>; max-brightness = <255>; @@ -43,6 +45,7 @@ green-d12 { green-d2 { label = "green:d2"; + color = ; pwms = <&pwm0 1 7812500 PWM_POLARITY_INVERTED>; active-low = <1>; max-brightness = <255>; @@ -51,6 +54,7 @@ green-d2 { red-d2 { label = "red:d2"; + color = ; pwms = <&pwm0 2 7812500 PWM_POLARITY_INVERTED>; active-low = <1>; max-brightness = <255>; @@ -59,6 +63,7 @@ red-d2 { blue-d2 { label = "blue:d2"; + color = ; pwms = <&pwm0 3 7812500 PWM_POLARITY_INVERTED>; active-low = <1>; max-brightness = <255>; From patchwork Tue Sep 7 00:39:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525084 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=RiTE2xsH; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHW6r32z9s5R; Tue, 7 Sep 2021 10:39:51 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9O-0002wp-Hd; Tue, 07 Sep 2021 00:39:46 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9L-0002uJ-PC for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:43 +0000 Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 5D7F94015D for ; Tue, 7 Sep 2021 00:39:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975183; bh=RVKkiiH6usjXdX4iN6SEmgdBLmC8PgydvWSyoWG99KQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RiTE2xsHaZ1azA50hPBf8VyRpn6CGMgTlnS3j12O6Iuhw65tMu9XyxwuDeo5KQb0o Fwp0NNWctWwobCtrm6o/XgZPKvHOZA4wCiAGZWF4uilB/1w7QPXCwjeEQvJk9Ywy/o d7Ca3GOqvBsFE1GrLXl72yEHaUvETdKKMjE/GXTEvobBlrjrgXoQ4Z495P2ztf4RUZ aMZvaq+xR3Jd17tU+OoGC1DFJhOkWNH5Zjc/mALGdKWpWyjtN7cMkDTPhkHl/X5o1R Q2nsETB1VxdO6ZqFpkRzLVVvGvjUO/92XmEGt6E0o2J+keuedM++tZLOIFlpeDX2Yo J74rWnNOEwbuw== Received: by mail-wr1-f70.google.com with SMTP id v6-20020adfe4c6000000b001574f9d8336so1512892wrm.15 for ; Mon, 06 Sep 2021 17:39:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=RVKkiiH6usjXdX4iN6SEmgdBLmC8PgydvWSyoWG99KQ=; b=tNK9M71BDOAe7jYWOW4f3L8xP2womFK9NvtrqH0KCakBn1RXsGzEqF6Jk4NGls2d2g Udq9QFz3HSMWbu00ZRKOe5A+XEtDW7xLrAukE9pdMAqnCIUSCfPSA06bSorLn0pAQvaw W+ycYZisZDioEZv4VJQA3SVFfGhBP9sO8sWSrvp/WnGi1t4wcg2UOfgtLRdn3QRu8ezq ALF7WAMYW8PX0y46MScBmvzR75UjNQYHg5asdmXElaYmE59mETYMz8tCal4VVueq9FY3 qAZ06RCLIYSDLwFix1dqONB7m0GYhL6VdEKtdCAiqBD2LQh3JLVs53n8H4V4uMIeqMur reqA== X-Gm-Message-State: AOAM532onLK9cXLbbwI0yXqySbjIPtCtHgbr2ox9MUwaCgKnvxopMPan Q9SUcE8KuyjErNtfZfbXViTAvGHMjwU6YwFX+JJdljJejdwUUlQnXdZ9SDNgD96k+KiSKUXz2j7 QsEgvG7ZIGLVVwxgKjvm+kITimpMLpV14BwFKg4Oydw== X-Received: by 2002:adf:e6d0:: with SMTP id y16mr15781382wrm.284.1630975182757; Mon, 06 Sep 2021 17:39:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCRGMPyCTsZTFpDawYYo1+dYlHH0oKZHDcn70SYeSHB2xEMIf992RGHtjeG6MssEhs21WphQ== X-Received: by 2002:adf:e6d0:: with SMTP id y16mr15781374wrm.284.1630975182527; Mon, 06 Sep 2021 17:39:42 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id x9sm847675wmi.30.2021.09.06.17.39.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:42 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 4/6] riscv: enable generic PCI resource mapping Date: Tue, 7 Sep 2021 01:39:30 +0100 Message-Id: <20210907003932.112495-5-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Stanislaw Kardach Enable the PCI resource mapping on RISC-V using the generic framework. This allows userspace applications to mmap PCI resources using /sys/devices/pci*/*/resource* interface. The mmap has been tested with Intel x520-DA2 NIC card on a HiFive Unmatched board (SiFive FU740 SoC). Signed-off-by: Stanislaw Kardach BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- arch/riscv/include/asm/pci.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/pci.h b/arch/riscv/include/asm/pci.h index 658e112c3c..7fd52a30e6 100644 --- a/arch/riscv/include/asm/pci.h +++ b/arch/riscv/include/asm/pci.h @@ -18,6 +18,8 @@ /* RISC-V shim does not initialize PCI bus */ #define pcibios_assign_all_busses() 1 +#define ARCH_GENERIC_PCI_MMAP_RESOURCE 1 + extern int isa_dma_bridge_buggy; #ifdef CONFIG_PCI From patchwork Tue Sep 7 00:39:31 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525085 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=KUaXN1w8; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHZ3k7rz9s5R; Tue, 7 Sep 2021 10:39:54 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9P-0002y9-UV; Tue, 07 Sep 2021 00:39:48 +0000 Received: from smtp-relay-internal-1.internal ([10.131.114.114] helo=smtp-relay-internal-1.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9M-0002vP-RS for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:44 +0000 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 5BC1C4015D for ; Tue, 7 Sep 2021 00:39:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975184; bh=PWj1w3rS4C20mAVanBbCXJ/WX3tC68Rl9eCcI/fJItU=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=KUaXN1w8CNE3lg8uxZs6rojSPBYUl+FzxtkvMB7YtjmNBvrtqKmd1tN/MC4ZpFWYN OVO0ldkPRZEy3CsAnWUVTWTQVTN4m/RHirz5Q++id3m28YBBPxAVstxYDsqjvciYwB ezF2AQrbTpWD4lk96pSgve2dKsL4zSeLYdgVjymQ2tfVwllg4yXFWnYMYQoBf3OvZo KV89Mloyyq9SC/Woy5tO96JqLKaGZXY+Zq5vkHhgRdLoGL3MYTMAPOKyfITopKlfnt FWDVjFIZoUdYQTHCa6YDO7N2cR7s9/jpA6dpj2YZi9VI7L1ah4I+ItJO93MilvNuLf qHaQtOkTXG74w== Received: by mail-wr1-f72.google.com with SMTP id r11-20020a5d4e4b000000b001575c5ed4b4so1526220wrt.4 for ; Mon, 06 Sep 2021 17:39:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PWj1w3rS4C20mAVanBbCXJ/WX3tC68Rl9eCcI/fJItU=; b=ghB3llcNpJFh5cN0xy7ZvqLh+ElzTFh/T336pWR6oZRP1LWn3uC78Eb2L146A5JMZl /FN0W8xaFSAFstYcHnxIpP8tf5vuXwnUNv+JHRNHFXOWzFY7mrCdtO0pVhwJClJlA+G7 j9YTpsRuMR0V0JFGwTeIyZQ2n2ml/WsbQY4MHtKjJ4Yiq+apzBo+nFfmjiHfhhfsfO5y 7AsGek2QWneJKH0VFWsZKnkXKKt8QP/N9Ol2epBr8WbECCe5pPyGebIptowE6wPNqSC8 0aOxfLtRbHIcVHDC76tCwEoe2YyeBKM3uTA3QS6b3a3JhkoICWjw6Sbp3GngdFuh0RME 8L+g== X-Gm-Message-State: AOAM532RG7J0aqpLLg2Gs2ioP1xiu8SYfYonPENghKeKCkm4mCEvj+DN itQ65SXPRQV2/ANiHyPKff5E367sDwidOsAwKjZkhjMtfmKKIcnTZS7Gh0ywwYvJhpCXWCZ5yYP 4ZglrtTTGzSM81srTu7aEOQmozyQpiq4z2vhjn9oMrw== X-Received: by 2002:a1c:9d8a:: with SMTP id g132mr1319428wme.17.1630975183864; Mon, 06 Sep 2021 17:39:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlKdme/8rO169wjwWFhUoZ1/g7su9E/9IQc0tAwakG0qOGRUEjgjq1nCH/EpENxJ8yM/n/aQ== X-Received: by 2002:a1c:9d8a:: with SMTP id g132mr1319420wme.17.1630975183634; Mon, 06 Sep 2021 17:39:43 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id s10sm13818wrg.42.2021.09.06.17.39.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:43 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 5/6] riscv: sifive: unmatched: add gpio-poweroff node Date: Tue, 7 Sep 2021 01:39:31 +0100 Message-Id: <20210907003932.112495-6-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: David Abdurachmanov Signed-off-by: David Abdurachmanov BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts index 200d022c75..4584676d77 100644 --- a/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts +++ b/arch/riscv/boot/dts/sifive/hifive-unmatched-a00.dts @@ -2,6 +2,7 @@ /* Copyright (c) 2020 SiFive, Inc */ #include "fu740-c000.dtsi" +#include #include #include #include @@ -84,6 +85,11 @@ rtcclk: rtcclk { clock-frequency = ; clock-output-names = "rtcclk"; }; + + gpio-poweroff { + compatible = "gpio-poweroff"; + gpios = <&gpio 2 GPIO_ACTIVE_LOW>; + }; }; &uart0 { From patchwork Tue Sep 7 00:39:32 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dimitri John Ledkov X-Patchwork-Id: 1525087 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=cVhftBB/; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4H3RHd1Txcz9shn; Tue, 7 Sep 2021 10:39:57 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1mNP9U-00032q-Ul; Tue, 07 Sep 2021 00:39:52 +0000 Received: from smtp-relay-internal-0.internal ([10.131.114.225] helo=smtp-relay-internal-0.canonical.com) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1mNP9O-0002wH-Dn for kernel-team@lists.ubuntu.com; Tue, 07 Sep 2021 00:39:46 +0000 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-0.canonical.com (Postfix) with ESMTPS id 613673F046 for ; Tue, 7 Sep 2021 00:39:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1630975185; bh=vwY0GyREwDxUyu6PmgoJJAbASD5dqYVwYvhZbAA80bQ=; h=From:To:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=cVhftBB/2QpJqkdZkJYa6gY9Y2RPDAmEyFD8DkHV3m52E5Uq317i4f/aKwOc4hASP aVj7mX7awTuTkkoCAYBE5po8Gdf/x2EHEngef0J/oo51/XqxQLeXJCpkpHumQLvtlL a9EmzmShiWucy8VXzgwoRLoxobv6OYeJEfKL7weROY3MOg70Opyd8xqj9Q2cIeC9M5 CwtLvXxmIu+BA3nsthaEboMo0EkU9n7UH71ullAu5ThYAIksYGOdoHPz02wJryq508 qxrtMpfCkUAfOHhrqDxI4x72Atc06izQXP6ULb91Cq4p3HOmtKN9ymRFn0ul5RrqEb 2p7ZQqOmtt/cQ== Received: by mail-wr1-f69.google.com with SMTP id q14-20020a5d574e000000b00157b0978ddeso1520236wrw.5 for ; Mon, 06 Sep 2021 17:39:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vwY0GyREwDxUyu6PmgoJJAbASD5dqYVwYvhZbAA80bQ=; b=eqJYN9JlVs8I2GvLK5A1NJbuyygCVloJhobdebavAH7Ky/9WcyPmpJ/9Jt5axa/n1J G7RxL6JwNaUeByByztd2+iN+YznbnHI+Gawvb3KKl+CIHPPmYh3oCWIeUhvuygn8sknc FY1ebIdkWwYXd5bzVskEsyg5SioDZ8EBl2hqEowVnTedPGZg93vNURfaTSJPSWID04dB 2n2reWoUvjCiv3xg4rZbrr37rdkKTO426seYpWPn+qauvkG9J4gsk97o9DfhNfm1PKqT mAotnfb0q51Sti3rfMhoR+JMC+Vc5OeE7QITH0UJ8Dpmidf5acU5WOGCzKWcqCSf6GIA /nzQ== X-Gm-Message-State: AOAM530dqOHpmv+MaPODdnTJNjDsuv/7Endhaag98r3oc++2w+/mOGNh iy4tqgEsA3TBlC1OmNbpicNs+8LwP1c6plrxNu8RAf858cc0HIpYd+6/vAh+iCtDTNKMjG9sdF3 7tH00oET07yS/GMDHm6MtsdSZdh/LkITke0NnsIaJSA== X-Received: by 2002:a05:6000:36e:: with SMTP id f14mr15827804wrf.196.1630975184818; Mon, 06 Sep 2021 17:39:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycRFg6IABswjcfaCCVTMYLMqEQ9MNPQUqFjW9t14OQoYuD+cGAKbzSEFSFOjNVMrTxU2mMBw== X-Received: by 2002:a05:6000:36e:: with SMTP id f14mr15827790wrf.196.1630975184546; Mon, 06 Sep 2021 17:39:44 -0700 (PDT) Received: from localhost ([2a01:4b00:85fd:d700:3349:7876:92a0:e08a]) by smtp.gmail.com with ESMTPSA id u13sm9294031wrg.68.2021.09.06.17.39.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Sep 2021 17:39:44 -0700 (PDT) From: Dimitri John Ledkov To: kernel-team@lists.ubuntu.com Subject: [SRU][I/riscv][PATCH 6/6] UBUNTU: SAUCE: riscv: set default pm_power_off to NULL Date: Tue, 7 Sep 2021 01:39:32 +0100 Message-Id: <20210907003932.112495-7-dimitri.ledkov@canonical.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210907003932.112495-1-dimitri.ledkov@canonical.com> References: <20210907003932.112495-1-dimitri.ledkov@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" Set pm_power_off to NULL like on all other architectures, check if it is set in machine_halt() and machine_power_off() and fallback to default_power_off if no other power driver got registered. This brings riscv architecture inline with all other architectures, and allows to reuse exiting power drivers unmodified. Kernels without legacy SBI v0.1 extensions (CONFIG_RISCV_SBI_V01 is not set), do not set pm_power_off to sbi_shutdown(). There is no support for SBI v0.3 system reset extension either. This prevents using gpio_poweroff on SiFive HiFive Unmatched. Tested on SiFive HiFive unmatched, with a dtb specifying gpio-poweroff node and kernel complied without CONFIG_RISCV_SBI_V01. BugLink: https://bugs.launchpad.net/bugs/1942806 Signed-off-by: Dimitri John Ledkov --- arch/riscv/kernel/reset.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/riscv/kernel/reset.c b/arch/riscv/kernel/reset.c index ee5878d968..9c842c4168 100644 --- a/arch/riscv/kernel/reset.c +++ b/arch/riscv/kernel/reset.c @@ -12,7 +12,7 @@ static void default_power_off(void) wait_for_interrupt(); } -void (*pm_power_off)(void) = default_power_off; +void (*pm_power_off)(void) = NULL; EXPORT_SYMBOL(pm_power_off); void machine_restart(char *cmd) @@ -23,10 +23,16 @@ void machine_restart(char *cmd) void machine_halt(void) { - pm_power_off(); + if (pm_power_off != NULL) + pm_power_off(); + else + default_power_off(); } void machine_power_off(void) { - pm_power_off(); + if (pm_power_off != NULL) + pm_power_off(); + else + default_power_off(); }