Message ID | 20230717210356.2794736-2-samuel.holland@sifive.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c923:0:b0:3e4:2afc:c1 with SMTP id j3csp1349304vqt; Mon, 17 Jul 2023 14:17:08 -0700 (PDT) X-Google-Smtp-Source: APBJJlFem5y07Cs4YykwT4v8LI/gderfwKda09NsYsMVR85cW/dJOaMGBaExcppfI4CML5+0m/FH X-Received: by 2002:a17:902:b614:b0:1b8:6e2e:78cd with SMTP id b20-20020a170902b61400b001b86e2e78cdmr691993pls.40.1689628628514; Mon, 17 Jul 2023 14:17:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689628628; cv=none; d=google.com; s=arc-20160816; b=RYNdDOcmoSLoyWDOTCBfaKy5KJqXLPHcxJc4JI4YK9PNtz4GqvVrcfJbdeD3B31wOf 2JOSVw1QA5vWbK2m/p2ixmoS9encJ1UcFsjufZvC2iwT6Ksn7sElRI5xhFc9O/pglcMG uZVPVhBQsVVgb188I5rFFQEiqckzBNOwLSsaeFOVybHZnXfNLiP4wfUdup52AhrsTbpv 7h1teM0+oES4X2tP9W6vTMF/GeSzSo4ZER4zcz8deqsZhUv9XVbWCsUPd/dqCBkak0tf x+2txd2fCNd9JA/aEb1gM2SRanzQHtuMr4YiF/YQm5o6Vpj/KuFoqgbbPt5qgWRhfy++ p6jA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IIZEzHVxC1Fx70Cdkz+V0OVQ6Dog78uDmiwE1vZt2q4=; fh=kYv4WPNSsXOZTtkZEpQPATBObyILQwCk/MlFXRc99HE=; b=0jphbZzP2X8fT+vGBH9L+EQlCSw8LZdmObAJI3Ja3nJdLPlMd6TGDegrE1ZylSBgQ6 oeVm834J41QnkHtuK0WrgX8IzdonGXCHc3NDQD68y4/ur2biQyf1w07DNFljumJmAHE6 B2oCu9ty1b6F+ZWPO1DVWUT28S6Jb8WFR/9YYLYgGyBpsmT0zb2ARa1M0Xi1dW8/p1ri XAC4BkB0tnUm+XClQ665QyCjBVf8Uo4hH60ooMBLH4AvzqZ94qIOkYtj0BSjQRALfgNS KvztTj+y1+7x6QegwzQaHo+JPNqJrvYlBlx11LDQEw1ST8V8zkYmvGFfDDCER04OzY/a sYAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=BPsBDwWr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a170902dad100b001b85a47d2b7si468114plx.422.2023.07.17.14.16.55; Mon, 17 Jul 2023 14:17:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=BPsBDwWr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231218AbjGQVED (ORCPT <rfc822;hadasmailinglist@gmail.com> + 99 others); Mon, 17 Jul 2023 17:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47814 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230463AbjGQVEA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 17 Jul 2023 17:04:00 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2D54121 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 14:03:59 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6686a05bc66so3613712b3a.1 for <linux-kernel@vger.kernel.org>; Mon, 17 Jul 2023 14:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1689627839; x=1692219839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=IIZEzHVxC1Fx70Cdkz+V0OVQ6Dog78uDmiwE1vZt2q4=; b=BPsBDwWrNKB91DqaWrNhpO/v4ykSqWSBCirIAnuxFvOs77l0rqsU8+TqkOv28d6dXr WmYVAVFOM9vjv+UHSWcME4r1ezRlHwg5UqohAqTvLNhkEnaX5Hcz/xICNS3d7dBZx2Iv GvTFOn4TF4Fw47/Bm6YeEH648hSZrlKW22TNiQ9ZRZR+GIbPaytAhRE0ZhEGwAnWSUOu yZ2+3zkaTUHT/MggTaWj1HOAknAkIdJCOfkXNZXkxX6lAcMXp3eJYHfdKdUaRY4p8sqg 3GBwAf99mw6qFjNqVtSdyTeC8uhdwG9Wb9KnEINmXUoKYaNFsm+NslcdAJtzegeo08S9 tp2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689627839; x=1692219839; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IIZEzHVxC1Fx70Cdkz+V0OVQ6Dog78uDmiwE1vZt2q4=; b=cqwy+enLSqsG3G7HbOgWZvhSFh9rPE2Jv0tl8DIribxdMxOEAX+6+EVD+qvem9R//L MlMVAEEPpa5MZ+WHRA2gN0ATs6hhtSY4bmOVHhID6VX5RSdaWtGNIY23E+CYXO3p/BYk XBMm/rfxo2hdBhPrVlO9Qu5a7YoThk1x6awl2/qpwsKV0ojTExVhtPrZEG/ULOZo/wOA dIuNf8TdMkOc39Y0lvovPmQKjAv5JPiXie9aP7UlQ6pPdqvC8BL1noYmiwZNwoer9Oa6 AGvUFW4Ltum1zAGN1i4HLeMR1OI1/r/4cGqTglHsmLoQm6Ow4GPJmiOkxqLXBx/DO/Ds MMYw== X-Gm-Message-State: ABy/qLbFxV5x1r8APOuDjKOYRAQQRihZxU4l2yLToXa1yFU6iXW/IDAR BOC8QmKLSFVAJJRylO1rkuXQ+g== X-Received: by 2002:a05:6a00:ad1:b0:67d:22a6:2f54 with SMTP id c17-20020a056a000ad100b0067d22a62f54mr790132pfl.31.1689627839264; Mon, 17 Jul 2023 14:03:59 -0700 (PDT) Received: from sw06.internal.sifive.com ([64.62.193.194]) by smtp.gmail.com with ESMTPSA id j24-20020aa78d18000000b006732786b5f1sm191915pfe.213.2023.07.17.14.03.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 14:03:58 -0700 (PDT) From: Samuel Holland <samuel.holland@sifive.com> To: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@kernel.org> Cc: Samuel Holland <samuel.holland@sifive.com>, Conor Dooley <conor.dooley@microchip.com>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Yang Li <yang.lee@linux.alibaba.com>, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org Subject: [PATCH 2/2] clk: sifive: Allow building the driver as a module Date: Mon, 17 Jul 2023 14:03:56 -0700 Message-Id: <20230717210356.2794736-2-samuel.holland@sifive.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230717210356.2794736-1-samuel.holland@sifive.com> References: <20230717210356.2794736-1-samuel.holland@sifive.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1771704029062341806 X-GMAIL-MSGID: 1771704029062341806 |
Series |
[1/2] of/irq: Export of_irq_count()
|
|
Commit Message
Samuel Holland
July 17, 2023, 9:03 p.m. UTC
This can reduce the kernel image size in multiplatform configurations.
Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
---
drivers/clk/sifive/Kconfig | 2 +-
drivers/clk/sifive/sifive-prci.c | 8 +++-----
2 files changed, 4 insertions(+), 6 deletions(-)
Comments
On Wed, 19 Jul 2023 at 10:07, Samuel Holland <samuel.holland@sifive.com> wrote: > > This can reduce the kernel image size in multiplatform configurations. I don't mind this, but booting without this driver also means there is no uart for debug output or any other peripheral until the kernel gets to the initrd to load the driver. Does the earlycon console work all the way until we reach the initrd? Otherwise I can't imagine many scenarios where configuring this as a module is desirable. > Signed-off-by: Samuel Holland <samuel.holland@sifive.com> > --- > > drivers/clk/sifive/Kconfig | 2 +- > drivers/clk/sifive/sifive-prci.c | 8 +++----- > 2 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig > index 2322f634a910..49597d95602e 100644 > --- a/drivers/clk/sifive/Kconfig > +++ b/drivers/clk/sifive/Kconfig > @@ -10,7 +10,7 @@ menuconfig CLK_SIFIVE > if CLK_SIFIVE > > config CLK_SIFIVE_PRCI > - bool "PRCI driver for SiFive SoCs" > + tristate "PRCI driver for SiFive SoCs" > default ARCH_SIFIVE > select RESET_CONTROLLER > select RESET_SIMPLE > diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c > index e317f3454e93..8c67d1a7c8df 100644 > --- a/drivers/clk/sifive/sifive-prci.c > +++ b/drivers/clk/sifive/sifive-prci.c > @@ -7,6 +7,7 @@ > #include <linux/clkdev.h> > #include <linux/delay.h> > #include <linux/io.h> > +#include <linux/module.h> > #include <linux/of_device.h> > #include "sifive-prci.h" > #include "fu540-prci.h" > @@ -618,9 +619,6 @@ static struct platform_driver sifive_prci_driver = { > }, > .probe = sifive_prci_probe, > }; > +module_platform_driver(sifive_prci_driver); > > -static int __init sifive_prci_init(void) > -{ > - return platform_driver_register(&sifive_prci_driver); > -} > -core_initcall(sifive_prci_init); Maybe also add the MODULE_AUTHOR() and MODULE_DESCRIPTION() macros while you're at it. > +MODULE_LICENSE("GPL"); > -- > 2.40.1 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv
On 2023-07-19 9:18 AM, Emil Renner Berthing wrote: > On Wed, 19 Jul 2023 at 10:07, Samuel Holland <samuel.holland@sifive.com> wrote: >> >> This can reduce the kernel image size in multiplatform configurations. > > I don't mind this, but booting without this driver also means there is > no uart for debug output or any other peripheral until the kernel gets > to the initrd to load the driver. Does the earlycon console work all > the way until we reach the initrd? Otherwise I can't imagine many > scenarios where configuring this as a module is desirable. Thanks for the review. Yes, an "earlycon" command-line argument still works after this change, since the stdout-path UART already has its clock set up by a previous boot stage. >> Signed-off-by: Samuel Holland <samuel.holland@sifive.com> >> --- >> >> drivers/clk/sifive/Kconfig | 2 +- >> drivers/clk/sifive/sifive-prci.c | 8 +++----- >> 2 files changed, 4 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig >> index 2322f634a910..49597d95602e 100644 >> --- a/drivers/clk/sifive/Kconfig >> +++ b/drivers/clk/sifive/Kconfig >> @@ -10,7 +10,7 @@ menuconfig CLK_SIFIVE >> if CLK_SIFIVE >> >> config CLK_SIFIVE_PRCI >> - bool "PRCI driver for SiFive SoCs" >> + tristate "PRCI driver for SiFive SoCs" >> default ARCH_SIFIVE >> select RESET_CONTROLLER >> select RESET_SIMPLE >> diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c >> index e317f3454e93..8c67d1a7c8df 100644 >> --- a/drivers/clk/sifive/sifive-prci.c >> +++ b/drivers/clk/sifive/sifive-prci.c >> @@ -7,6 +7,7 @@ >> #include <linux/clkdev.h> >> #include <linux/delay.h> >> #include <linux/io.h> >> +#include <linux/module.h> >> #include <linux/of_device.h> >> #include "sifive-prci.h" >> #include "fu540-prci.h" >> @@ -618,9 +619,6 @@ static struct platform_driver sifive_prci_driver = { >> }, >> .probe = sifive_prci_probe, >> }; >> +module_platform_driver(sifive_prci_driver); >> >> -static int __init sifive_prci_init(void) >> -{ >> - return platform_driver_register(&sifive_prci_driver); >> -} >> -core_initcall(sifive_prci_init); > > Maybe also add the MODULE_AUTHOR() and MODULE_DESCRIPTION() macros > while you're at it. Will do. >> +MODULE_LICENSE("GPL"); >> -- >> 2.40.1 >> >> >> _______________________________________________ >> linux-riscv mailing list >> linux-riscv@lists.infradead.org >> http://lists.infradead.org/mailman/listinfo/linux-riscv
diff --git a/drivers/clk/sifive/Kconfig b/drivers/clk/sifive/Kconfig index 2322f634a910..49597d95602e 100644 --- a/drivers/clk/sifive/Kconfig +++ b/drivers/clk/sifive/Kconfig @@ -10,7 +10,7 @@ menuconfig CLK_SIFIVE if CLK_SIFIVE config CLK_SIFIVE_PRCI - bool "PRCI driver for SiFive SoCs" + tristate "PRCI driver for SiFive SoCs" default ARCH_SIFIVE select RESET_CONTROLLER select RESET_SIMPLE diff --git a/drivers/clk/sifive/sifive-prci.c b/drivers/clk/sifive/sifive-prci.c index e317f3454e93..8c67d1a7c8df 100644 --- a/drivers/clk/sifive/sifive-prci.c +++ b/drivers/clk/sifive/sifive-prci.c @@ -7,6 +7,7 @@ #include <linux/clkdev.h> #include <linux/delay.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/of_device.h> #include "sifive-prci.h" #include "fu540-prci.h" @@ -618,9 +619,6 @@ static struct platform_driver sifive_prci_driver = { }, .probe = sifive_prci_probe, }; +module_platform_driver(sifive_prci_driver); -static int __init sifive_prci_init(void) -{ - return platform_driver_register(&sifive_prci_driver); -} -core_initcall(sifive_prci_init); +MODULE_LICENSE("GPL");