From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 998BD2FB6 for ; Wed, 1 Sep 2021 05:05:36 +0000 (UTC) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EFB325C019C; Wed, 1 Sep 2021 01:05:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 01 Sep 2021 01:05:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=4e2oI5zdlCz+Q FIe2+F59HWSrI67X+JBq24r/vRVDKE=; b=D0ViyHtVNMkHBLJQjKwP4OKlR/Ge8 6NYtP1wT9FfZkmGHGVmYkmdeq/hAh4g2pwHMMYSCJzgsOrUVa1S0wohqEHsV0cfW 4xIhmhNU064DJbK3MWVIHIad0kIUdwgWsuZe/tjni3go3ptXofNS751EM6ItQW88 kc9JLkJOYQagW5ZUCtVTCeuP8JIrzrOXQl7LM518VLhQR4F3ra7Sq3Ck8lGxMblD Dm7NLKzABYoX/MRDtY79sp01Cim5LzxRYJh88NxjOrQdXehRVzoLzDqHNbJ2uG4i SD00me1a3D/RjuQ6Mleh3Wdglu/MD/zzNDuLS8b2025XO4f5tkaALgVSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=4e2oI5zdlCz+QFIe2+F59HWSrI67X+JBq24r/vRVDKE=; b=TIoAVugz CgRYpwBgL0OlnH7kL8PlRJRTAdyFUc0YZTp87/ZZh6N5ja/6OTAKQQeh5VHNYLOd VVfXXTnY1M7jaGBtJ4EmCQMnOHzgFs9KShaBGrwOCHQ/DUXIiBrUWXXCKF3MQgYC 43g7Z+x0oWN65RQeh5vlpwbpeZzAaqoiGnpE2zet0C7N415KedFJn2f+3hpFbLsE cUzgvd4314W3MRGeqBXy8LZ4mm4G31yEW8x0IN+V6r2nsQNFCRReIMxpYZc+k7kB PGCOEHspYuHVe1DUJ4xrm7rVZkApHWF8vDlEY7SrQu+p9UBqHG5YJPvRxMhw1RXR MtC/mu3IuyKBQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvvddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Sep 2021 01:05:35 -0400 (EDT) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH 6/8] clk: sunxi-ng: Allow drivers to be built as modules Date: Wed, 1 Sep 2021 00:05:24 -0500 Message-Id: <20210901050526.45673-7-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210901050526.45673-1-samuel@sholland.org> References: <20210901050526.45673-1-samuel@sholland.org> Precedence: bulk X-Mailing-List: linux-sunxi@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit While it is useful to build all of the CCU drivers at once, only 1-3 of them will be loaded at a time, or possibly none of them if the kernel is booted on a non-sunxi platform. These CCU drivers are relatively large; 32-bit drivers have 30-50k of data each, while the 64-bit ones are 50-75k due to the increased pointer overhead. About half of that data comes from relocations. Let's allow the user to build these drivers as modules so only the necessary data is loaded. Signed-off-by: Samuel Holland --- drivers/clk/sunxi-ng/Kconfig | 16 ++++++++-------- drivers/clk/sunxi-ng/sun50i-a100-ccu.c | 3 ++- drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c | 3 ++- drivers/clk/sunxi-ng/sun50i-a64-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun50i-h6-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun8i-a83t-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun8i-de2-ccu.c | 8 +++++--- drivers/clk/sunxi-ng/sun8i-r40-ccu.c | 5 ++++- drivers/clk/sunxi-ng/sun9i-a80-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c | 6 ++++-- 11 files changed, 45 insertions(+), 26 deletions(-) diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig index cd46d8853876..7cfdf21717f7 100644 --- a/drivers/clk/sunxi-ng/Kconfig +++ b/drivers/clk/sunxi-ng/Kconfig @@ -13,22 +13,22 @@ config SUNIV_F1C100S_CCU depends on MACH_SUNIV || COMPILE_TEST config SUN50I_A64_CCU - bool "Support for the Allwinner A64 CCU" + tristate "Support for the Allwinner A64 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_A100_CCU - bool "Support for the Allwinner A100 CCU" + tristate "Support for the Allwinner A100 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_A100_R_CCU - bool "Support for the Allwinner A100 PRCM CCU" + tristate "Support for the Allwinner A100 PRCM CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_H6_CCU - bool "Support for the Allwinner H6 CCU" + tristate "Support for the Allwinner H6 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST @@ -69,7 +69,7 @@ config SUN8I_A33_CCU depends on MACH_SUN8I || COMPILE_TEST config SUN8I_A83T_CCU - bool "Support for the Allwinner A83T CCU" + tristate "Support for the Allwinner A83T CCU" default MACH_SUN8I config SUN8I_H3_CCU @@ -83,16 +83,16 @@ config SUN8I_V3S_CCU depends on MACH_SUN8I || COMPILE_TEST config SUN8I_DE2_CCU - bool "Support for the Allwinner SoCs DE2 CCU" + tristate "Support for the Allwinner SoCs DE2 CCU" default MACH_SUN8I || (ARM64 && ARCH_SUNXI) config SUN8I_R40_CCU - bool "Support for the Allwinner R40 CCU" + tristate "Support for the Allwinner R40 CCU" default MACH_SUN8I depends on MACH_SUN8I || COMPILE_TEST config SUN9I_A80_CCU - bool "Support for the Allwinner A80 CCU" + tristate "Support for the Allwinner A80 CCU" default MACH_SUN9I depends on MACH_SUN9I || COMPILE_TEST diff --git a/drivers/clk/sunxi-ng/sun50i-a100-ccu.c b/drivers/clk/sunxi-ng/sun50i-a100-ccu.c index 5a813af9941c..5bb901c3b2f5 100644 --- a/drivers/clk/sunxi-ng/sun50i-a100-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a100-ccu.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include "ccu_common.h" @@ -1275,3 +1274,5 @@ static struct platform_driver sun50i_a100_ccu_driver = { }, }; module_platform_driver(sun50i_a100_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c b/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c index 078ebdf8b093..6842d69616a4 100644 --- a/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c @@ -5,7 +5,6 @@ #include #include -#include #include #include "ccu_common.h" @@ -213,3 +212,5 @@ static struct platform_driver sun50i_a100_r_ccu_driver = { }, }; module_platform_driver(sun50i_a100_r_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-a64-ccu.c b/drivers/clk/sunxi-ng/sun50i-a64-ccu.c index ffc5ef5fab3c..0e7ba14d58ca 100644 --- a/drivers/clk/sunxi-ng/sun50i-a64-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a64-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -982,4 +982,6 @@ static struct platform_driver sun50i_a64_ccu_driver = { .of_match_table = sun50i_a64_ccu_ids, }, }; -builtin_platform_driver(sun50i_a64_ccu_driver); +module_platform_driver(sun50i_a64_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-h6-ccu.c b/drivers/clk/sunxi-ng/sun50i-h6-ccu.c index 8876358710c5..c28a09e4938d 100644 --- a/drivers/clk/sunxi-ng/sun50i-h6-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-h6-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -1256,4 +1256,6 @@ static struct platform_driver sun50i_h6_ccu_driver = { .of_match_table = sun50i_h6_ccu_ids, }, }; -builtin_platform_driver(sun50i_h6_ccu_driver); +module_platform_driver(sun50i_h6_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c b/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c index 067eb9bb4b53..8ae7b0417a6b 100644 --- a/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -922,4 +922,6 @@ static struct platform_driver sun8i_a83t_ccu_driver = { .of_match_table = sun8i_a83t_ccu_ids, }, }; -builtin_platform_driver(sun8i_a83t_ccu_driver); +module_platform_driver(sun8i_a83t_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-de2-ccu.c b/drivers/clk/sunxi-ng/sun8i-de2-ccu.c index 15d15448ac21..61c185cbc04a 100644 --- a/drivers/clk/sunxi-ng/sun8i-de2-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-de2-ccu.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -396,4 +396,6 @@ static struct platform_driver sunxi_de2_clk_driver = { .of_match_table = sunxi_de2_clk_ids, }, }; -builtin_platform_driver(sunxi_de2_clk_driver); +module_platform_driver(sunxi_de2_clk_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-r40-ccu.c b/drivers/clk/sunxi-ng/sun8i-r40-ccu.c index 7347b65a5051..a090b21002b6 100644 --- a/drivers/clk/sunxi-ng/sun8i-r40-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-r40-ccu.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -1373,4 +1374,6 @@ static struct platform_driver sun8i_r40_ccu_driver = { .of_match_table = sun8i_r40_ccu_ids, }, }; -builtin_platform_driver(sun8i_r40_ccu_driver); +module_platform_driver(sun8i_r40_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-ccu.c index bc0b89e18652..ae654078eca5 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -1247,4 +1247,6 @@ static struct platform_driver sun9i_a80_ccu_driver = { .of_match_table = sun9i_a80_ccu_ids, }, }; -builtin_platform_driver(sun9i_a80_ccu_driver); +module_platform_driver(sun9i_a80_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c index 5be451411cb4..69303f5d7747 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -272,4 +272,6 @@ static struct platform_driver sun9i_a80_de_clk_driver = { .of_match_table = sun9i_a80_de_clk_ids, }, }; -builtin_platform_driver(sun9i_a80_de_clk_driver); +module_platform_driver(sun9i_a80_de_clk_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c index 62417b6e4f74..a9cab6d70953 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -140,4 +140,6 @@ static struct platform_driver sun9i_a80_usb_clk_driver = { .of_match_table = sun9i_a80_usb_clk_ids, }, }; -builtin_platform_driver(sun9i_a80_usb_clk_driver); +module_platform_driver(sun9i_a80_usb_clk_driver); + +MODULE_LICENSE("GPL"); -- 2.31.1 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=-17.1 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,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 D8918C432BE for ; Wed, 1 Sep 2021 05:10:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 98BEE61056 for ; Wed, 1 Sep 2021 05:10:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 98BEE61056 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LfmIiwR7HGUYHmb4Q9RCZoNmdS73184rhC9kw6ePe0w=; b=Fo7z4TLYaNagf2 fmcA0oOoyrbtdJ6ifJkRbefts2yTmV8uWCJtc6P29tAfjR0GbZ1zKV333j6jNEaiEhGzW9WOx9buW 7h64cWQ/SrV3AuZYLNKVe0XUb/JNujCx9BdOTt6OrqCr5h4TSHkYui/FXQ7Onpg5XSRu2VSKWG8uM KzFPSEpAffwr5WUrUTf8IuNvZoCgLLyjDoyLazR4QHQYnU11Qa64ftByH7Dmc2oOBY0sSK4WWGQfy GVKHFBU+zBH3Ow6xRy0uSMb2kqpeKYCpJ/5Snu+y4WkZvtGO/Ge/RZ4BWN11ayZScc74qlE6BCBYD hKKHv+o19zpB2ScPk05Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLISq-003p6t-9F; Wed, 01 Sep 2021 05:07:08 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLIRR-003ocU-PE for linux-arm-kernel@lists.infradead.org; Wed, 01 Sep 2021 05:05:46 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id EFB325C019C; Wed, 1 Sep 2021 01:05:35 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 01 Sep 2021 01:05:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=4e2oI5zdlCz+Q FIe2+F59HWSrI67X+JBq24r/vRVDKE=; b=D0ViyHtVNMkHBLJQjKwP4OKlR/Ge8 6NYtP1wT9FfZkmGHGVmYkmdeq/hAh4g2pwHMMYSCJzgsOrUVa1S0wohqEHsV0cfW 4xIhmhNU064DJbK3MWVIHIad0kIUdwgWsuZe/tjni3go3ptXofNS751EM6ItQW88 kc9JLkJOYQagW5ZUCtVTCeuP8JIrzrOXQl7LM518VLhQR4F3ra7Sq3Ck8lGxMblD Dm7NLKzABYoX/MRDtY79sp01Cim5LzxRYJh88NxjOrQdXehRVzoLzDqHNbJ2uG4i SD00me1a3D/RjuQ6Mleh3Wdglu/MD/zzNDuLS8b2025XO4f5tkaALgVSg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=4e2oI5zdlCz+QFIe2+F59HWSrI67X+JBq24r/vRVDKE=; b=TIoAVugz CgRYpwBgL0OlnH7kL8PlRJRTAdyFUc0YZTp87/ZZh6N5ja/6OTAKQQeh5VHNYLOd VVfXXTnY1M7jaGBtJ4EmCQMnOHzgFs9KShaBGrwOCHQ/DUXIiBrUWXXCKF3MQgYC 43g7Z+x0oWN65RQeh5vlpwbpeZzAaqoiGnpE2zet0C7N415KedFJn2f+3hpFbLsE cUzgvd4314W3MRGeqBXy8LZ4mm4G31yEW8x0IN+V6r2nsQNFCRReIMxpYZc+k7kB PGCOEHspYuHVe1DUJ4xrm7rVZkApHWF8vDlEY7SrQu+p9UBqHG5YJPvRxMhw1RXR MtC/mu3IuyKBQw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddvvddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgv lhcujfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtf frrghtthgvrhhnpeduhfejfedvhffgfeehtefghfeiiefgfeehgfdvvdevfeegjeehjedv gfejheeuieenucevlhhushhtvghrufhiiigvpedvnecurfgrrhgrmhepmhgrihhlfhhroh hmpehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 1 Sep 2021 01:05:35 -0400 (EDT) From: Samuel Holland To: Maxime Ripard , Chen-Yu Tsai , Jernej Skrabec , Michael Turquette , Stephen Boyd Cc: linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Samuel Holland Subject: [PATCH 6/8] clk: sunxi-ng: Allow drivers to be built as modules Date: Wed, 1 Sep 2021 00:05:24 -0500 Message-Id: <20210901050526.45673-7-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210901050526.45673-1-samuel@sholland.org> References: <20210901050526.45673-1-samuel@sholland.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210831_220541_960398_05B1A02F X-CRM114-Status: GOOD ( 16.00 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org While it is useful to build all of the CCU drivers at once, only 1-3 of them will be loaded at a time, or possibly none of them if the kernel is booted on a non-sunxi platform. These CCU drivers are relatively large; 32-bit drivers have 30-50k of data each, while the 64-bit ones are 50-75k due to the increased pointer overhead. About half of that data comes from relocations. Let's allow the user to build these drivers as modules so only the necessary data is loaded. Signed-off-by: Samuel Holland --- drivers/clk/sunxi-ng/Kconfig | 16 ++++++++-------- drivers/clk/sunxi-ng/sun50i-a100-ccu.c | 3 ++- drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c | 3 ++- drivers/clk/sunxi-ng/sun50i-a64-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun50i-h6-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun8i-a83t-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun8i-de2-ccu.c | 8 +++++--- drivers/clk/sunxi-ng/sun8i-r40-ccu.c | 5 ++++- drivers/clk/sunxi-ng/sun9i-a80-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c | 6 ++++-- drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c | 6 ++++-- 11 files changed, 45 insertions(+), 26 deletions(-) diff --git a/drivers/clk/sunxi-ng/Kconfig b/drivers/clk/sunxi-ng/Kconfig index cd46d8853876..7cfdf21717f7 100644 --- a/drivers/clk/sunxi-ng/Kconfig +++ b/drivers/clk/sunxi-ng/Kconfig @@ -13,22 +13,22 @@ config SUNIV_F1C100S_CCU depends on MACH_SUNIV || COMPILE_TEST config SUN50I_A64_CCU - bool "Support for the Allwinner A64 CCU" + tristate "Support for the Allwinner A64 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_A100_CCU - bool "Support for the Allwinner A100 CCU" + tristate "Support for the Allwinner A100 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_A100_R_CCU - bool "Support for the Allwinner A100 PRCM CCU" + tristate "Support for the Allwinner A100 PRCM CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_H6_CCU - bool "Support for the Allwinner H6 CCU" + tristate "Support for the Allwinner H6 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST @@ -69,7 +69,7 @@ config SUN8I_A33_CCU depends on MACH_SUN8I || COMPILE_TEST config SUN8I_A83T_CCU - bool "Support for the Allwinner A83T CCU" + tristate "Support for the Allwinner A83T CCU" default MACH_SUN8I config SUN8I_H3_CCU @@ -83,16 +83,16 @@ config SUN8I_V3S_CCU depends on MACH_SUN8I || COMPILE_TEST config SUN8I_DE2_CCU - bool "Support for the Allwinner SoCs DE2 CCU" + tristate "Support for the Allwinner SoCs DE2 CCU" default MACH_SUN8I || (ARM64 && ARCH_SUNXI) config SUN8I_R40_CCU - bool "Support for the Allwinner R40 CCU" + tristate "Support for the Allwinner R40 CCU" default MACH_SUN8I depends on MACH_SUN8I || COMPILE_TEST config SUN9I_A80_CCU - bool "Support for the Allwinner A80 CCU" + tristate "Support for the Allwinner A80 CCU" default MACH_SUN9I depends on MACH_SUN9I || COMPILE_TEST diff --git a/drivers/clk/sunxi-ng/sun50i-a100-ccu.c b/drivers/clk/sunxi-ng/sun50i-a100-ccu.c index 5a813af9941c..5bb901c3b2f5 100644 --- a/drivers/clk/sunxi-ng/sun50i-a100-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a100-ccu.c @@ -6,7 +6,6 @@ #include #include #include -#include #include #include "ccu_common.h" @@ -1275,3 +1274,5 @@ static struct platform_driver sun50i_a100_ccu_driver = { }, }; module_platform_driver(sun50i_a100_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c b/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c index 078ebdf8b093..6842d69616a4 100644 --- a/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a100-r-ccu.c @@ -5,7 +5,6 @@ #include #include -#include #include #include "ccu_common.h" @@ -213,3 +212,5 @@ static struct platform_driver sun50i_a100_r_ccu_driver = { }, }; module_platform_driver(sun50i_a100_r_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-a64-ccu.c b/drivers/clk/sunxi-ng/sun50i-a64-ccu.c index ffc5ef5fab3c..0e7ba14d58ca 100644 --- a/drivers/clk/sunxi-ng/sun50i-a64-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-a64-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -982,4 +982,6 @@ static struct platform_driver sun50i_a64_ccu_driver = { .of_match_table = sun50i_a64_ccu_ids, }, }; -builtin_platform_driver(sun50i_a64_ccu_driver); +module_platform_driver(sun50i_a64_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun50i-h6-ccu.c b/drivers/clk/sunxi-ng/sun50i-h6-ccu.c index 8876358710c5..c28a09e4938d 100644 --- a/drivers/clk/sunxi-ng/sun50i-h6-ccu.c +++ b/drivers/clk/sunxi-ng/sun50i-h6-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -1256,4 +1256,6 @@ static struct platform_driver sun50i_h6_ccu_driver = { .of_match_table = sun50i_h6_ccu_ids, }, }; -builtin_platform_driver(sun50i_h6_ccu_driver); +module_platform_driver(sun50i_h6_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c b/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c index 067eb9bb4b53..8ae7b0417a6b 100644 --- a/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-a83t-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -922,4 +922,6 @@ static struct platform_driver sun8i_a83t_ccu_driver = { .of_match_table = sun8i_a83t_ccu_ids, }, }; -builtin_platform_driver(sun8i_a83t_ccu_driver); +module_platform_driver(sun8i_a83t_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-de2-ccu.c b/drivers/clk/sunxi-ng/sun8i-de2-ccu.c index 15d15448ac21..61c185cbc04a 100644 --- a/drivers/clk/sunxi-ng/sun8i-de2-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-de2-ccu.c @@ -5,8 +5,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -396,4 +396,6 @@ static struct platform_driver sunxi_de2_clk_driver = { .of_match_table = sunxi_de2_clk_ids, }, }; -builtin_platform_driver(sunxi_de2_clk_driver); +module_platform_driver(sunxi_de2_clk_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun8i-r40-ccu.c b/drivers/clk/sunxi-ng/sun8i-r40-ccu.c index 7347b65a5051..a090b21002b6 100644 --- a/drivers/clk/sunxi-ng/sun8i-r40-ccu.c +++ b/drivers/clk/sunxi-ng/sun8i-r40-ccu.c @@ -5,6 +5,7 @@ #include #include +#include #include #include @@ -1373,4 +1374,6 @@ static struct platform_driver sun8i_r40_ccu_driver = { .of_match_table = sun8i_r40_ccu_ids, }, }; -builtin_platform_driver(sun8i_r40_ccu_driver); +module_platform_driver(sun8i_r40_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-ccu.c index bc0b89e18652..ae654078eca5 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -1247,4 +1247,6 @@ static struct platform_driver sun9i_a80_ccu_driver = { .of_match_table = sun9i_a80_ccu_ids, }, }; -builtin_platform_driver(sun9i_a80_ccu_driver); +module_platform_driver(sun9i_a80_ccu_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c index 5be451411cb4..69303f5d7747 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-de-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include @@ -272,4 +272,6 @@ static struct platform_driver sun9i_a80_de_clk_driver = { .of_match_table = sun9i_a80_de_clk_ids, }, }; -builtin_platform_driver(sun9i_a80_de_clk_driver); +module_platform_driver(sun9i_a80_de_clk_driver); + +MODULE_LICENSE("GPL"); diff --git a/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c b/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c index 62417b6e4f74..a9cab6d70953 100644 --- a/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c +++ b/drivers/clk/sunxi-ng/sun9i-a80-usb-ccu.c @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include "ccu_common.h" @@ -140,4 +140,6 @@ static struct platform_driver sun9i_a80_usb_clk_driver = { .of_match_table = sun9i_a80_usb_clk_ids, }, }; -builtin_platform_driver(sun9i_a80_usb_clk_driver); +module_platform_driver(sun9i_a80_usb_clk_driver); + +MODULE_LICENSE("GPL"); -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel