clk: sunxi-ng: Module support
Subsystems (3)
Samuel Holland
maintainerv3 cover clk: sunxi-ng: Module support
This series allows the CCU core and drivers to be loaded/unloaded as modules. As part of this, patch 3 converts most of the early OF clock providers to platform drivers.
Changes in v3:
- Also export helper functions.
Changes in v2:
- Export symbols to the SUNXI_CCU namespace.
Changes in v1:
- Patches 1-3 of 8 were merged.
- Name modules using Makefile logic, not by renaming the source files. (Drop patch 4 of 8.)
Samuel Holland (4):
clk: sunxi-ng: Export symbols used by CCU drivers
clk: sunxi-ng: Allow drivers to be built as modules
clk: sunxi-ng: Convert early providers to platform drivers
clk: sunxi-ng: Allow the CCU core to be built as a module
drivers/clk/Makefile | 2 +- drivers/clk/sunxi-ng/Kconfig | 39 +++++----- drivers/clk/sunxi-ng/Makefile | 97 +++++++++++++++--------- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 ++++++++------ drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c | 4 +- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 4 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 7 +- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 +++++++++----- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 7 +- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 +++++--- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++--- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 ++++++--- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++--- drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 7 +- drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 9 ++- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++----- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 +++++++++------- drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 6 +- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 ++++++++------ drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c | 7 +- drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c | 7 +- drivers/clk/sunxi-ng/ccu-sun9i-a80.c | 7 +- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 +++++++--- drivers/clk/sunxi-ng/ccu_common.c | 6 ++ drivers/clk/sunxi-ng/ccu_div.c | 1 + drivers/clk/sunxi-ng/ccu_frac.c | 6 ++ drivers/clk/sunxi-ng/ccu_gate.c | 4 + drivers/clk/sunxi-ng/ccu_mp.c | 2 + drivers/clk/sunxi-ng/ccu_mult.c | 1 + drivers/clk/sunxi-ng/ccu_mux.c | 6 ++ drivers/clk/sunxi-ng/ccu_nk.c | 1 + drivers/clk/sunxi-ng/ccu_nkm.c | 1 + drivers/clk/sunxi-ng/ccu_nkmp.c | 1 + drivers/clk/sunxi-ng/ccu_nm.c | 1 + drivers/clk/sunxi-ng/ccu_phase.c | 1 + drivers/clk/sunxi-ng/ccu_reset.c | 1 + drivers/clk/sunxi-ng/ccu_sdm.c | 6 ++ drivers/mmc/host/Kconfig | 1 + include/linux/clk/sunxi-ng.h | 15 ---- 39 files changed, 490 insertions(+), 251 deletions(-)
Signature · 1 line
2.32.0
Samuel Holland
maintainerPATCH v3 1/4 clk: sunxi-ng: Export symbols used by CCU drivers
For the individual CCU drivers to be built as modules, the ops structs, helper functions, and callback registration functions must be exported. These symbols are intended for use only by the adjacent CCU drivers, so export them into the SUNXI_CCU namespace.
of_sunxi_ccu_probe is not exported because it is only used by built-in OF clock providers.
---
Changes in v3:
- Also export helper functions.
Changes in v2:
- Export symbols to the SUNXI_CCU namespace.
drivers/clk/sunxi-ng/ccu_common.c | 3 +++ drivers/clk/sunxi-ng/ccu_div.c | 1 + drivers/clk/sunxi-ng/ccu_frac.c | 6 ++++++ drivers/clk/sunxi-ng/ccu_gate.c | 4 ++++ drivers/clk/sunxi-ng/ccu_mp.c | 2 ++ drivers/clk/sunxi-ng/ccu_mult.c | 1 + drivers/clk/sunxi-ng/ccu_mux.c | 6 ++++++ drivers/clk/sunxi-ng/ccu_nk.c | 1 + drivers/clk/sunxi-ng/ccu_nkm.c | 1 + drivers/clk/sunxi-ng/ccu_nkmp.c | 1 + drivers/clk/sunxi-ng/ccu_nm.c | 1 + drivers/clk/sunxi-ng/ccu_phase.c | 1 + drivers/clk/sunxi-ng/ccu_reset.c | 1 + drivers/clk/sunxi-ng/ccu_sdm.c | 6 ++++++ 14 files changed, 35 insertions(+)
drivers/clk/sunxi-ng/ccu_common.c +3 -0
@@ -36,6 +36,7 @@ void ccu_helper_wait_for_lock(struct ccu_common *common, u32 lock)WARN_ON (readl_relaxed_poll_timeout (addr, reg, reg & lock,100 ,70000 )); } +EXPORT_SYMBOL_NS_GPL (ccu_helper_wait_for_lock,SUNXI_CCU );/* * This clock notifier is called when the frequency of a PLL clock is
@@ -83,6 +84,7 @@ int ccu_pll_notifier_register(struct ccu_pll_nb *pll_nb)return clk_notifier_register (pll_nb->common->hw.clk, &pll_nb->clk_nb); } +EXPORT_SYMBOL_NS_GPL (ccu_pll_notifier_register,SUNXI_CCU ); static int sunxi_ccu_probe(struct sunxi_ccu *ccu, struct device *dev, struct device_node *node, void __iomem *reg,
@@ -194,6 +196,7 @@ int devm_sunxi_ccu_probe(struct device *dev, void __iomem *reg,return 0 ; } +EXPORT_SYMBOL_NS_GPL (devm_sunxi_ccu_probe,SUNXI_CCU );void of_sunxi_ccu_probe (struct device_node *node,void __iomem *reg,const struct sunxi_ccu_desc *desc)
drivers/clk/sunxi-ng/ccu_div.c +1 -0
@@ -141,3 +141,4 @@ const struct clk_ops ccu_div_ops = { .recalc_rate = ccu_div_recalc_rate, .set_rate = ccu_div_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_div_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_frac.c +6 -0
@@ -18,6 +18,7 @@ bool ccu_frac_helper_is_enabled(struct ccu_common *common,return !(readl (common->base + common->reg) & cf->enable); } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_is_enabled,SUNXI_CCU );void ccu_frac_helper_enable (struct ccu_common *common,struct ccu_frac_internal *cf)
@@ -33,6 +34,7 @@ void ccu_frac_helper_enable(struct ccu_common *common,writel (reg & ~cf->enable, common->base + common->reg);spin_unlock_irqrestore (common->lock, flags); } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_enable,SUNXI_CCU );void ccu_frac_helper_disable (struct ccu_common *common,struct ccu_frac_internal *cf)
@@ -48,6 +50,7 @@ void ccu_frac_helper_disable(struct ccu_common *common,writel (reg | cf->enable, common->base + common->reg);spin_unlock_irqrestore (common->lock, flags); } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_disable,SUNXI_CCU ); bool ccu_frac_helper_has_rate(struct ccu_common *common, struct ccu_frac_internal *cf,
@@ -58,6 +61,7 @@ bool ccu_frac_helper_has_rate(struct ccu_common *common,return (cf->rates[0 ] == rate) || (cf->rates[1 ] == rate); } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_has_rate,SUNXI_CCU );unsigned long ccu_frac_helper_read_rate (struct ccu_common *common,struct ccu_frac_internal *cf)
@@ -79,6 +83,7 @@ unsigned long ccu_frac_helper_read_rate(struct ccu_common *common,return (reg & cf->select) ? cf->rates[1 ] : cf->rates[0 ]; } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_read_rate,SUNXI_CCU ); int ccu_frac_helper_set_rate(struct ccu_common *common, struct ccu_frac_internal *cf,
@@ -107,3 +112,4 @@ int ccu_frac_helper_set_rate(struct ccu_common *common,return 0 ; } +EXPORT_SYMBOL_NS_GPL (ccu_frac_helper_set_rate,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_gate.c +4 -0
@@ -24,6 +24,7 @@ void ccu_gate_helper_disable(struct ccu_common *common, u32 gate)spin_unlock_irqrestore (common->lock, flags); } +EXPORT_SYMBOL_NS_GPL (ccu_gate_helper_disable,SUNXI_CCU );static void ccu_gate_disable (struct clk_hw *hw) {
@@ -49,6 +50,7 @@ int ccu_gate_helper_enable(struct ccu_common *common, u32 gate)return 0 ; } +EXPORT_SYMBOL_NS_GPL (ccu_gate_helper_enable,SUNXI_CCU );static int ccu_gate_enable (struct clk_hw *hw) {
@@ -64,6 +66,7 @@ int ccu_gate_helper_is_enabled(struct ccu_common *common, u32 gate)return readl (common->base + common->reg) & gate; } +EXPORT_SYMBOL_NS_GPL (ccu_gate_helper_is_enabled,SUNXI_CCU );static int ccu_gate_is_enabled (struct clk_hw *hw) {
@@ -124,3 +127,4 @@ const struct clk_ops ccu_gate_ops = { .set_rate = ccu_gate_set_rate, .recalc_rate = ccu_gate_recalc_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_gate_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_mp.c +2 -0
@@ -245,6 +245,7 @@ const struct clk_ops ccu_mp_ops = { .recalc_rate = ccu_mp_recalc_rate, .set_rate = ccu_mp_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_mp_ops,SUNXI_CCU );/* * Support for MMC timing mode switching
@@ -325,3 +326,4 @@ const struct clk_ops ccu_mp_mmc_ops = { .recalc_rate = ccu_mp_mmc_recalc_rate, .set_rate = ccu_mp_mmc_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_mp_mmc_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_mult.c +1 -0
@@ -170,3 +170,4 @@ const struct clk_ops ccu_mult_ops = { .recalc_rate = ccu_mult_recalc_rate, .set_rate = ccu_mult_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_mult_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_mux.c +6 -0
@@ -64,6 +64,7 @@ unsigned long ccu_mux_helper_apply_prediv(struct ccu_common *common, {return parent_rate /ccu_mux_get_prediv (common, cm, parent_index); } +EXPORT_SYMBOL_NS_GPL (ccu_mux_helper_apply_prediv,SUNXI_CCU ); static unsigned long ccu_mux_helper_unapply_prediv(struct ccu_common *common, struct ccu_mux_internal *cm,
@@ -152,6 +153,7 @@ int ccu_mux_helper_determine_rate(struct ccu_common *common, req->rate = best_rate;return 0 ; } +EXPORT_SYMBOL_NS_GPL (ccu_mux_helper_determine_rate,SUNXI_CCU );u8 ccu_mux_helper_get_parent (struct ccu_common *common,struct ccu_mux_internal *cm)
@@ -174,6 +176,7 @@ u8 ccu_mux_helper_get_parent(struct ccu_common *common,return parent; } +EXPORT_SYMBOL_NS_GPL (ccu_mux_helper_get_parent,SUNXI_CCU ); int ccu_mux_helper_set_parent(struct ccu_common *common, struct ccu_mux_internal *cm,
@@ -195,6 +198,7 @@ int ccu_mux_helper_set_parent(struct ccu_common *common,return 0 ; } +EXPORT_SYMBOL_NS_GPL (ccu_mux_helper_set_parent,SUNXI_CCU );static void ccu_mux_disable (struct clk_hw *hw) {
@@ -251,6 +255,7 @@ const struct clk_ops ccu_mux_ops = { .determine_rate = __clk_mux_determine_rate, .recalc_rate = ccu_mux_recalc_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_mux_ops,SUNXI_CCU );/* * This clock notifier is called when the frequency of the of the parent
@@ -285,3 +290,4 @@ int ccu_mux_notifier_register(struct clk *clk, struct ccu_mux_nb *mux_nb)return clk_notifier_register (clk, &mux_nb->clk_nb); } +EXPORT_SYMBOL_NS_GPL (ccu_mux_notifier_register,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_nk.c +1 -0
@@ -157,3 +157,4 @@ const struct clk_ops ccu_nk_ops = { .round_rate = ccu_nk_round_rate, .set_rate = ccu_nk_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_nk_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_nkm.c +1 -0
@@ -206,3 +206,4 @@ const struct clk_ops ccu_nkm_ops = { .recalc_rate = ccu_nkm_recalc_rate, .set_rate = ccu_nkm_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_nkm_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_nkmp.c +1 -0
@@ -230,3 +230,4 @@ const struct clk_ops ccu_nkmp_ops = { .round_rate = ccu_nkmp_round_rate, .set_rate = ccu_nkmp_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_nkmp_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_nm.c +1 -0
@@ -238,3 +238,4 @@ const struct clk_ops ccu_nm_ops = { .round_rate = ccu_nm_round_rate, .set_rate = ccu_nm_set_rate, }; +EXPORT_SYMBOL_NS_GPL (ccu_nm_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_phase.c +1 -0
@@ -121,3 +121,4 @@ const struct clk_ops ccu_phase_ops = { .get_phase = ccu_phase_get_phase, .set_phase = ccu_phase_set_phase, }; +EXPORT_SYMBOL_NS_GPL (ccu_phase_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_reset.c +1 -0
@@ -75,3 +75,4 @@ const struct reset_control_ops ccu_reset_ops = { .reset = ccu_reset_reset, .status = ccu_reset_status, }; +EXPORT_SYMBOL_NS_GPL (ccu_reset_ops,SUNXI_CCU );
drivers/clk/sunxi-ng/ccu_sdm.c +6 -0
@@ -20,6 +20,7 @@ bool ccu_sdm_helper_is_enabled(struct ccu_common *common,return !!(readl (common->base + sdm->tuning_reg) & sdm->tuning_enable); } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_is_enabled,SUNXI_CCU ); void ccu_sdm_helper_enable(struct ccu_common *common, struct ccu_sdm_internal *sdm,
@@ -49,6 +50,7 @@ void ccu_sdm_helper_enable(struct ccu_common *common,writel (reg | sdm->enable, common->base + common->reg);spin_unlock_irqrestore (common->lock, flags); } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_enable,SUNXI_CCU );void ccu_sdm_helper_disable (struct ccu_common *common,struct ccu_sdm_internal *sdm)
@@ -69,6 +71,7 @@ void ccu_sdm_helper_disable(struct ccu_common *common,writel (reg & ~sdm->tuning_enable, common->base + sdm->tuning_reg);spin_unlock_irqrestore (common->lock, flags); } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_disable,SUNXI_CCU );/* * Sigma delta modulation provides a way to do fractional-N frequency
@@ -102,6 +105,7 @@ bool ccu_sdm_helper_has_rate(struct ccu_common *common,return false; } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_has_rate,SUNXI_CCU ); unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common, struct ccu_sdm_internal *sdm,
@@ -132,6 +136,7 @@ unsigned long ccu_sdm_helper_read_rate(struct ccu_common *common,/* We can't calculate the effective clock rate, so just fail. */ return 0 ; } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_read_rate,SUNXI_CCU ); int ccu_sdm_helper_get_factors(struct ccu_common *common, struct ccu_sdm_internal *sdm,
@@ -153,3 +158,4 @@ int ccu_sdm_helper_get_factors(struct ccu_common *common,/* nothing found */ return -EINVAL ; } +EXPORT_SYMBOL_NS_GPL (ccu_sdm_helper_get_factors,SUNXI_CCU );
Signature · 1 line
2.32.0
Samuel Holland
maintainerPATCH v3 2/4 clk: sunxi-ng: Allow drivers to be built as modules
In reply to Samuel HollandWhile 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.
As a first step, convert the CCUs that are already platform drivers.
When the drivers are built as modules, normally the file name becomes the module name. However, the current file names are inconsistent with the <platform>-<peripheral> name used everywhere else: the devicetree bindings, the platform driver names, and the Kconfig symbols. Use Makfile logic to rename the modules so they follow the usual pattern.
---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 16 +++--- drivers/clk/sunxi-ng/Makefile | 64 ++++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c | 4 +- drivers/clk/sunxi-ng/ccu-sun50i-a100.c | 4 +- drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 7 ++- drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 7 ++- drivers/clk/sunxi-ng/ccu-sun8i-a83t.c | 7 ++- drivers/clk/sunxi-ng/ccu-sun8i-de2.c | 9 ++-- drivers/clk/sunxi-ng/ccu-sun8i-r40.c | 6 ++- drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c | 7 ++- drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c | 7 ++- drivers/clk/sunxi-ng/ccu-sun9i-a80.c | 7 ++- 12 files changed, 98 insertions(+), 47 deletions(-)
drivers/clk/sunxi-ng/Kconfig +8 -8
@@ -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 depends on MACH_SUN8I || COMPILE_TEST
@@ -84,16 +84,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
drivers/clk/sunxi-ng/Makefile +43 -21
67 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-sun50i-a100-r.c +3 -1
@@ -5,7 +5,6 @@#include <linux/clk-provider.h> #include <linux/module.h> -#include <linux/of_address.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -213,3 +212,6 @@ static struct platform_driver sun50i_a100_r_ccu_driver = { }, };module_platform_driver (sun50i_a100_r_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun50i-a100.c +3 -1
@@ -6,7 +6,6 @@#include <linux/clk-provider.h> #include <linux/io.h> #include <linux/module.h> -#include <linux/of_address.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -1275,3 +1274,6 @@ static struct platform_driver sun50i_a100_ccu_driver = { }, };module_platform_driver (sun50i_a100_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun50i-a64.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -980,4 +980,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun50i-h6.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -1254,4 +1254,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-a83t.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -920,4 +920,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-de2.c +6 -3
@@ -5,8 +5,8 @@#include <linux/clk.h> #include <linux/clk-provider.h> -#include <linux/of_address.h> -#include <linux/of_platform.h> +#include <linux/module.h> +#include <linux/of_device.h> #include <linux/platform_device.h> #include <linux/reset.h>
@@ -394,4 +394,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-r40.c +5 -1
@@ -5,6 +5,7 @@#include <linux/clk-provider.h> #include <linux/io.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/regmap.h>
@@ -1371,4 +1372,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun9i-a80-de.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk.h> #include <linux/clk-provider.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include <linux/reset.h>
@@ -270,4 +270,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun9i-a80-usb.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk.h> #include <linux/clk-provider.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -138,4 +138,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun9i-a80.c +5 -2
@@ -5,7 +5,7 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -1245,4 +1245,7 @@ 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_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
Signature · 1 line
2.32.0
Samuel Holland
maintainerPATCH v3 3/4 clk: sunxi-ng: Convert early providers to platform drivers
In reply to Samuel HollandThe PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then fw_devlink will ensure the drivers are bound in the optimal order.
The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)
drivers/clk/sunxi-ng/Kconfig +10 -10
@@ -8,7 +8,7 @@ config SUNXI_CCU if SUNXI_CCU config SUNIV_F1C100S_CCU - bool "Support for the Allwinner newer F1C100s CCU" + tristate "Support for the Allwinner newer F1C100s CCU" default MACH_SUNIV depends on MACH_SUNIV || COMPILE_TEST
@@ -33,17 +33,17 @@ config SUN50I_H6_CCU depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_H616_CCU - bool "Support for the Allwinner H616 CCU" + tristate "Support for the Allwinner H616 CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN50I_H6_R_CCU - bool "Support for the Allwinner H6 and H616 PRCM CCU" + tristate "Support for the Allwinner H6 and H616 PRCM CCU" default ARM64 && ARCH_SUNXI depends on (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN4I_A10_CCU - bool "Support for the Allwinner A10/A20 CCU" + tristate "Support for the Allwinner A10/A20 CCU" default MACH_SUN4I default MACH_SUN7I depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST
@@ -54,17 +54,17 @@ config SUN5I_CCU depends on MACH_SUN5I || COMPILE_TEST config SUN6I_A31_CCU - bool "Support for the Allwinner A31/A31s CCU" + tristate "Support for the Allwinner A31/A31s CCU" default MACH_SUN6I depends on MACH_SUN6I || COMPILE_TEST config SUN8I_A23_CCU - bool "Support for the Allwinner A23 CCU" + tristate "Support for the Allwinner A23 CCU" default MACH_SUN8I depends on MACH_SUN8I || COMPILE_TEST config SUN8I_A33_CCU - bool "Support for the Allwinner A33 CCU" + tristate "Support for the Allwinner A33 CCU" default MACH_SUN8I depends on MACH_SUN8I || COMPILE_TEST
@@ -74,12 +74,12 @@ config SUN8I_A83T_CCU depends on MACH_SUN8I || COMPILE_TEST config SUN8I_H3_CCU - bool "Support for the Allwinner H3 CCU" + tristate "Support for the Allwinner H3 CCU" default MACH_SUN8I || (ARM64 && ARCH_SUNXI) depends on MACH_SUN8I || (ARM64 && ARCH_SUNXI) || COMPILE_TEST config SUN8I_V3S_CCU - bool "Support for the Allwinner V3s CCU" + tristate "Support for the Allwinner V3s CCU" default MACH_SUN8I depends on MACH_SUN8I || COMPILE_TEST
@@ -98,7 +98,7 @@ config SUN9I_A80_CCU depends on MACH_SUN9I || COMPILE_TEST config SUN8I_R_CCU - bool "Support for Allwinner SoCs' PRCM CCUs" + tristate "Support for Allwinner SoCs' PRCM CCUs" default MACH_SUN8I || (ARCH_SUNXI && ARM64) endif
drivers/clk/sunxi-ng/ccu-sun4i-a10.c +36 -22
80 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c +35 -21
72 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-sun50i-h616.c +23 -10
@@ -7,7 +7,7 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> #include <linux/platform_device.h> #include "ccu_common.h"
@@ -1082,17 +1082,15 @@ static const u32 usb2_clk_regs[] = { SUN50I_H616_USB3_CLK_REG, }; -static void __init sun50i_h616_ccu_setup (struct device_node *node) +static int sun50i_h616_ccu_probe (struct platform_device *pdev) {void __iomem *reg;u32 val;int i; - reg =of_io_request_and_map (node,0 ,of_node_full_name (node)); -if (IS_ERR (reg)) { -pr_err ("%pOF: Could not map clock registers\n" , node); -return ; - } + reg =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (reg)) +return PTR_ERR (reg);/* Enable the lock bits and the output enable bits on all PLLs */ for (i =0 ; i <ARRAY_SIZE (pll_regs); i++) {
@@ -1141,8 +1139,23 @@ static void __init sun50i_h616_ccu_setup(struct device_node *node) val |=BIT (24 );writel (val, reg +SUN50I_H616_HDMI_CEC_CLK_REG ); -of_sunxi_ccu_probe (node, reg, &sun50i_h616_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun50i_h616_ccu_desc); } -CLK_OF_DECLARE (sun50i_h616_ccu,"allwinner,sun50i-h616-ccu" , - sun50i_h616_ccu_setup); +static const struct of_device_id sun50i_h616_ccu_ids[] = { + { .compatible ="allwinner,sun50i-h616-ccu" }, + { } +}; + +static struct platform_driver sun50i_h616_ccu_driver = { + .probe = sun50i_h616_ccu_probe, + .driver = { + .name ="sun50i-h616-ccu" , + .suppress_bind_attrs = true, + .of_match_table = sun50i_h616_ccu_ids, + }, +}; +module_platform_driver (sun50i_h616_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun6i-a31.c +30 -10
@@ -9,7 +9,8 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> +#include <linux/platform_device.h> #include "ccu_common.h" #include "ccu_reset.h"
@@ -1226,16 +1227,15 @@ static struct ccu_mux_nb sun6i_a31_cpu_nb = { .bypass_index = 1, /* index of 24 MHz oscillator */ }; -static void __init sun6i_a31_ccu_setup (struct device_node *node) +static int sun6i_a31_ccu_probe (struct platform_device *pdev) {void __iomem *reg; +int ret;u32 val; - reg =of_io_request_and_map (node,0 ,of_node_full_name (node)); -if (IS_ERR (reg)) { -pr_err ("%pOF: Could not map the clock registers\n" , node); -return ; - } + reg =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (reg)) +return PTR_ERR (reg);/* Force the PLL-Audio-1x divider to 1 */ val =readl (reg +SUN6I_A31_PLL_AUDIO_REG );
@@ -1257,10 +1257,30 @@ static void __init sun6i_a31_ccu_setup(struct device_node *node) val |=0x3 <<12 ;writel (val, reg +SUN6I_A31_AHB1_REG ); -of_sunxi_ccu_probe (node, reg, &sun6i_a31_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun6i_a31_ccu_desc); +if (ret) +return ret;ccu_mux_notifier_register (pll_cpu_clk.common.hw.clk, &sun6i_a31_cpu_nb); + +return 0 ; } -CLK_OF_DECLARE (sun6i_a31_ccu,"allwinner,sun6i-a31-ccu" , - sun6i_a31_ccu_setup); + +static const struct of_device_id sun6i_a31_ccu_ids[] = { + { .compatible ="allwinner,sun6i-a31-ccu" }, + { } +}; + +static struct platform_driver sun6i_a31_ccu_driver = { + .probe = sun6i_a31_ccu_probe, + .driver = { + .name ="sun6i-a31-ccu" , + .suppress_bind_attrs = true, + .of_match_table = sun6i_a31_ccu_ids, + }, +}; +module_platform_driver (sun6i_a31_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-a23.c +25 -10
@@ -5,7 +5,8 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> +#include <linux/platform_device.h> #include "ccu_common.h" #include "ccu_reset.h"
@@ -724,16 +725,14 @@ static const struct sunxi_ccu_desc sun8i_a23_ccu_desc = { .num_resets = ARRAY_SIZE(sun8i_a23_ccu_resets), }; -static void __init sun8i_a23_ccu_setup (struct device_node *node) +static int sun8i_a23_ccu_probe (struct platform_device *pdev) {void __iomem *reg;u32 val; - reg =of_io_request_and_map (node,0 ,of_node_full_name (node)); -if (IS_ERR (reg)) { -pr_err ("%pOF: Could not map the clock registers\n" , node); -return ; - } + reg =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (reg)) +return PTR_ERR (reg);/* Force the PLL-Audio-1x divider to 1 */ val =readl (reg +SUN8I_A23_PLL_AUDIO_REG );
@@ -745,7 +744,23 @@ static void __init sun8i_a23_ccu_setup(struct device_node *node) val &= ~BIT (16 );writel (val, reg +SUN8I_A23_PLL_MIPI_REG ); -of_sunxi_ccu_probe (node, reg, &sun8i_a23_ccu_desc); +return devm_sunxi_ccu_probe (&pdev->dev, reg, &sun8i_a23_ccu_desc); } -CLK_OF_DECLARE (sun8i_a23_ccu,"allwinner,sun8i-a23-ccu" , - sun8i_a23_ccu_setup); + +static const struct of_device_id sun8i_a23_ccu_ids[] = { + { .compatible ="allwinner,sun8i-a23-ccu" }, + { } +}; + +static struct platform_driver sun8i_a23_ccu_driver = { + .probe = sun8i_a23_ccu_probe, + .driver = { + .name ="sun8i-a23-ccu" , + .suppress_bind_attrs = true, + .of_match_table = sun8i_a23_ccu_ids, + }, +}; +module_platform_driver (sun8i_a23_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-a33.c +30 -10
@@ -5,7 +5,8 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> +#include <linux/platform_device.h> #include "ccu_common.h" #include "ccu_reset.h"
@@ -784,16 +785,15 @@ static struct ccu_mux_nb sun8i_a33_cpu_nb = { .bypass_index = 1, /* index of 24 MHz oscillator */ }; -static void __init sun8i_a33_ccu_setup (struct device_node *node) +static int sun8i_a33_ccu_probe (struct platform_device *pdev) {void __iomem *reg; +int ret;u32 val; - reg =of_io_request_and_map (node,0 ,of_node_full_name (node)); -if (IS_ERR (reg)) { -pr_err ("%pOF: Could not map the clock registers\n" , node); -return ; - } + reg =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (reg)) +return PTR_ERR (reg);/* Force the PLL-Audio-1x divider to 1 */ val =readl (reg +SUN8I_A33_PLL_AUDIO_REG );
@@ -805,7 +805,9 @@ static void __init sun8i_a33_ccu_setup(struct device_node *node) val &= ~BIT (16 );writel (val, reg +SUN8I_A33_PLL_MIPI_REG ); -of_sunxi_ccu_probe (node, reg, &sun8i_a33_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &sun8i_a33_ccu_desc); +if (ret) +return ret;/* Gate then ungate PLL CPU after any rate changes */ ccu_pll_notifier_register (&sun8i_a33_pll_cpu_nb);
@@ -813,6 +815,24 @@ static void __init sun8i_a33_ccu_setup(struct device_node *node)/* Reparent CPU during PLL CPU rate changes */ ccu_mux_notifier_register (pll_cpux_clk.common.hw.clk, &sun8i_a33_cpu_nb); + +return 0 ; } -CLK_OF_DECLARE (sun8i_a33_ccu,"allwinner,sun8i-a33-ccu" , - sun8i_a33_ccu_setup); + +static const struct of_device_id sun8i_a33_ccu_ids[] = { + { .compatible ="allwinner,sun8i-a33-ccu" }, + { } +}; + +static struct platform_driver sun8i_a33_ccu_driver = { + .probe = sun8i_a33_ccu_probe, + .driver = { + .name ="sun8i-a33-ccu" , + .suppress_bind_attrs = true, + .of_match_table = sun8i_a33_ccu_ids, + }, +}; +module_platform_driver (sun8i_a33_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
drivers/clk/sunxi-ng/ccu-sun8i-h3.c +41 -21
90 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-sun8i-r.c +38 -27
82 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-sun8i-v3s.c +35 -22
80 lines not on this page · raw message
drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c +29 -9
@@ -6,7 +6,8 @@#include <linux/clk-provider.h> #include <linux/io.h> -#include <linux/of_address.h> +#include <linux/module.h> +#include <linux/platform_device.h> #include "ccu_common.h" #include "ccu_reset.h"
@@ -525,20 +526,21 @@ static struct ccu_mux_nb suniv_cpu_nb = {static void __init suniv_f1c100s_ccu_setup (struct device_node *node) {void __iomem *reg; +int ret;u32 val; - reg =of_io_request_and_map (node,0 ,of_node_full_name (node)); -if (IS_ERR (reg)) { -pr_err ("%pOF: Could not map the clock registers\n" , node); -return ; - } + reg =devm_platform_ioremap_resource (pdev,0 ); +if (IS_ERR (reg)) +return PTR_ERR (reg);/* Force the PLL-Audio-1x divider to 4 */ val =readl (reg +SUNIV_PLL_AUDIO_REG ); val &= ~GENMASK (19 ,16 );writel (val | (3 <<16 ), reg +SUNIV_PLL_AUDIO_REG ); -of_sunxi_ccu_probe (node, reg, &suniv_ccu_desc); + ret =devm_sunxi_ccu_probe (&pdev->dev, reg, &suniv_ccu_desc); +if (ret) +return ret;/* Gate then ungate PLL CPU after any rate changes */ ccu_pll_notifier_register (&suniv_pll_cpu_nb);
@@ -546,6 +548,24 @@ static void __init suniv_f1c100s_ccu_setup(struct device_node *node)/* Reparent CPU during PLL CPU rate changes */ ccu_mux_notifier_register (pll_cpu_clk.common.hw.clk, &suniv_cpu_nb); + +return 0 ; } -CLK_OF_DECLARE (suniv_f1c100s_ccu,"allwinner,suniv-f1c100s-ccu" , - suniv_f1c100s_ccu_setup); + +static const struct of_device_id suniv_f1c100s_ccu_ids[] = { + { .compatible ="allwinner,suniv-f1c100s-ccu" }, + { } +}; + +static struct platform_driver suniv_f1c100s_ccu_driver = { + .probe = suniv_f1c100s_ccu_probe, + .driver = { + .name ="suniv-f1c100s-ccu" , + .suppress_bind_attrs = true, + .of_match_table = suniv_f1c100s_ccu_ids, + }, +}; +module_platform_driver (suniv_f1c100s_ccu_driver); + +MODULE_IMPORT_NS (SUNXI_CCU ); +MODULE_LICENSE ("GPL" );
Signature · 1 line
2.32.0
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 20 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
Quoted 12 lines
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
Signature · 6 lines
Måns Rullgård _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 35 lines · Måns Rullgård
Quoted 20 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
Quoted 12 lines
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
Maxime
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 36 lines · Maxime Ripard
Quoted 35 lines · Måns Rullgård
Quoted 32 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)
Quoted 7 lines
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
The A20 works as such since, as you say, it has other clocksources. However, the hstimer has become unusable. If anyone was using, for whatever reason, it won't be working for them now.
Before this change, the kernel log used include this line:
clocksource: hstimer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 6370868154 ns
Now there is only a cryptic "Can't get timer clock" in its place.
As it is now, the hstimer driver is nothing but a waste of space. I figure it ought to be fixed one way or another.
Signature · 1 line
Måns Rullgård
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 50 lines · Måns Rullgård
Quoted 36 lines · Maxime Ripard
Quoted 35 lines · Måns Rullgård
Quoted 32 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)Quoted 7 lines
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
The A20 works as such since, as you say, it has other clocksources. However, the hstimer has become unusable. If anyone was using, for whatever reason, it won't be working for them now.
Quoted 8 lines
Before this change, the kernel log used include this line:
clocksource: hstimer: mask:
0xffffffffmax_cycles:0xffffffff,max_idle_ns: 6370868154 nsNow there is only a cryptic "Can't get timer clock" in its place.
As it is now, the hstimer driver is nothing but a waste of space. I figure it ought to be fixed one way or another.
Yeah, definitely.
IIRC, the situation is:
- A10 has just the "regular", old, timer
- A10s/A13/GR8 has the A10 timer + hstimer
- A20 has the A13 timers + arch timers
We also default to the hstimer only for the A10s/A13 which aren't affected by this patch series afaics.
We also enable the HS timer for the A31, but just like the A20 it doesn't use it by default, so it's probably been broken there too.
I guess one way to fix it would be to switch the HS timer driver to a lower priority than the A10 timer, so we pick that up by default instead for the A10s/A13, and then convert the HS timer driver to a proper platform_device driver that will be able to get its clock.
The downside is that the A13 will lose some precision over its default timer, but I don't think it's a big deal.
Maxime
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 74 lines · Maxime Ripard
Quoted 50 lines · Måns Rullgård
Quoted 36 lines · Maxime Ripard
Quoted 35 lines · Måns Rullgård
Quoted 32 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)Quoted 7 lines
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
The A20 works as such since, as you say, it has other clocksources. However, the hstimer has become unusable. If anyone was using, for whatever reason, it won't be working for them now.
Quoted 8 lines
Before this change, the kernel log used include this line:
clocksource: hstimer: mask:
0xffffffffmax_cycles:0xffffffff,max_idle_ns: 6370868154 nsNow there is only a cryptic "Can't get timer clock" in its place.
As it is now, the hstimer driver is nothing but a waste of space. I figure it ought to be fixed one way or another.
Yeah, definitely.
IIRC, the situation is:
- A10 has just the "regular", old, timer
- A10s/A13/GR8 has the A10 timer + hstimer
- A20 has the A13 timers + arch timersWe also default to the hstimer only for the A10s/A13 which aren't affected by this patch series afaics.
We also enable the HS timer for the A31, but just like the A20 it doesn't use it by default, so it's probably been broken there too.
Quoted 7 lines
I guess one way to fix it would be to switch the HS timer driver to a lower priority than the A10 timer, so we pick that up by default instead for the A10s/A13, and then convert the HS timer driver to a proper
platform_devicedriver that will be able to get its clock.The downside is that the A13 will lose some precision over its default timer, but I don't think it's a big deal.
The options I see are converting the hstimer to a platform device or reverting the change to the sun4i ccu driver.
I don't personally have much of an opinion on this since my systems aren't affected. The only reason I looked at it was that I noticed a new error message in the kernel logs.
Signature · 1 line
Måns Rullgård
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 84 lines · Måns Rullgård
Quoted 74 lines · Maxime Ripard
Quoted 50 lines · Måns Rullgård
Quoted 36 lines · Maxime Ripard
Quoted 35 lines · Måns Rullgård
Quoted 32 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)Quoted 7 lines
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
The A20 works as such since, as you say, it has other clocksources. However, the hstimer has become unusable. If anyone was using, for whatever reason, it won't be working for them now.
Quoted 8 lines
Before this change, the kernel log used include this line:
clocksource: hstimer: mask:
0xffffffffmax_cycles:0xffffffff,max_idle_ns: 6370868154 nsNow there is only a cryptic "Can't get timer clock" in its place.
As it is now, the hstimer driver is nothing but a waste of space. I figure it ought to be fixed one way or another.
Yeah, definitely.
IIRC, the situation is:
- A10 has just the "regular", old, timer
- A10s/A13/GR8 has the A10 timer + hstimer
- A20 has the A13 timers + arch timersWe also default to the hstimer only for the A10s/A13 which aren't affected by this patch series afaics.
We also enable the HS timer for the A31, but just like the A20 it doesn't use it by default, so it's probably been broken there too.
Quoted 7 lines
I guess one way to fix it would be to switch the HS timer driver to a lower priority than the A10 timer, so we pick that up by default instead for the A10s/A13, and then convert the HS timer driver to a proper
platform_devicedriver that will be able to get its clock.The downside is that the A13 will lose some precision over its default timer, but I don't think it's a big deal.
Quoted 6 lines
The options I see are converting the hstimer to a platform device or reverting the change to the sun4i ccu driver.
I don't personally have much of an opinion on this since my systems aren't affected. The only reason I looked at it was that I noticed a new error message in the kernel logs.
Thanks for the report then. I'm not really working on that anymore, so I won't submit a fix for this either.
Maxime
Re: [PATCH v3 3/4] clk: sunxi-ng: Convert early providers to platform drivers
Quoted 88 lines · Maxime Ripard
Quoted 87 lines · Måns Rullgård
Quoted 74 lines · Maxime Ripard
Quoted 50 lines · Måns Rullgård
Quoted 36 lines · Maxime Ripard
Quoted 35 lines · Måns Rullgård
Quoted 32 lines · Samuel Holland
The PRCM CCU drivers depend on clocks provided by other CCU drivers. For example, the sun8i-r-ccu driver uses the "pll-periph" clock provided by the SoC's main CCU.
However, sun8i-r-ccu is an early OF clock provider, and many of the main CCUs (e.g. sun50i-a64-ccu) use platform drivers. This means that the consumer clocks will be orphaned until the supplier driver is bound. This can be avoided by converting the remaining CCUs to use platform drivers. Then
fw_devlinkwill ensure the drivers are bound in the optimal order.The sun5i CCU is the only one which actually needs to be an early clock provider, because it provides the clock for the system timer. That one is left alone.
Signed-off-by Samuel Holland <[email protected]>---
(no changes since v1)
drivers/clk/sunxi-ng/Kconfig | 20 ++++---- drivers/clk/sunxi-ng/ccu-sun4i-a10.c | 58 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h6-r.c | 56 ++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun50i-h616.c | 33 ++++++++---- drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 35 +++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 40 +++++++++++---- drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 62 ++++++++++++++-------- drivers/clk/sunxi-ng/ccu-sun8i-r.c | 65 ++++++++++++++---------- drivers/clk/sunxi-ng/ccu-sun8i-v3s.c | 57 +++++++++++++-------- drivers/clk/sunxi-ng/ccu-suniv-f1c100s.c | 38 ++++++++++---- 11 files changed, 332 insertions(+), 172 deletions(-)Quoted 7 lines
Quoted 2 lines
This broke the hstimer clocksource on A20 since it requires a clock provided by the sun4i ccu driver.
The A10 is probably broken by this, but the A20 should be able to use the arch timers just like all the other Cortex-A7-based SoCs.
Do you have a dmesg log that could help debug why it's not working?
The A20 works as such since, as you say, it has other clocksources. However, the hstimer has become unusable. If anyone was using, for whatever reason, it won't be working for them now.
Quoted 8 lines
Before this change, the kernel log used include this line:
clocksource: hstimer: mask:
0xffffffffmax_cycles:0xffffffff,max_idle_ns: 6370868154 nsNow there is only a cryptic "Can't get timer clock" in its place.
As it is now, the hstimer driver is nothing but a waste of space. I figure it ought to be fixed one way or another.
Yeah, definitely.
IIRC, the situation is:
- A10 has just the "regular", old, timer
- A10s/A13/GR8 has the A10 timer + hstimer
- A20 has the A13 timers + arch timersWe also default to the hstimer only for the A10s/A13 which aren't affected by this patch series afaics.
We also enable the HS timer for the A31, but just like the A20 it doesn't use it by default, so it's probably been broken there too.
Quoted 7 lines
I guess one way to fix it would be to switch the HS timer driver to a lower priority than the A10 timer, so we pick that up by default instead for the A10s/A13, and then convert the HS timer driver to a proper
platform_devicedriver that will be able to get its clock.The downside is that the A13 will lose some precision over its default timer, but I don't think it's a big deal.
The options I see are converting the hstimer to a platform device or reverting the change to the sun4i ccu driver.
Quoted 6 lines
Quoted 3 lines
I don't personally have much of an opinion on this since my systems aren't affected. The only reason I looked at it was that I noticed a new error message in the kernel logs.
Thanks for the report then. I'm not really working on that anymore, so I won't submit a fix for this either.
I can have a go at converting it to a platform device if you think that's the right approach. I don't have anything other than A20 to test it on, though.
Signature · 1 line
Måns Rullgård
Samuel Holland
maintainerPATCH v3 4/4 clk: sunxi-ng: Allow the CCU core to be built as a module
In reply to Samuel HollandLike the individual CCU drivers, it can be beneficial for memory consumption of cross-platform configurations to only load the CCU core on the relevant platform. For example, a generic arm64 kernel sees the following improvement when building the CCU core and drivers as modules:
before:
text data bss dec hex filename
13882360 5251670 360800 19494830 12977ae vmlinuxafter:
text data bss dec hex filename
13734787 5086442 360800 19182029 124b1cd vmlinuxSo the result is a 390KB total reduction in kernel image size.
The one early clock provider (sun5i) requires the core to be built in.
Now that loading the MMC driver will trigger loading the CCU core, the MMC timing mode functions do not need a compile-time fallback.
---
(no changes since v1)
drivers/clk/Makefile | 2 +- drivers/clk/sunxi-ng/Kconfig | 3 ++- drivers/clk/sunxi-ng/Makefile | 33 +++++++++++++++++-------------- drivers/clk/sunxi-ng/ccu_common.c | 3 +++ drivers/mmc/host/Kconfig | 1 + include/linux/clk/sunxi-ng.h | 15 -------------- 6 files changed, 25 insertions(+), 32 deletions(-)
drivers/clk/Makefile +1 -1
@@ -110,7 +110,7 @@ obj-$(CONFIG_PLAT_SPEAR) += spear/ obj-y += sprd/ obj-$(CONFIG_ARCH_STI) += st/ obj-$(CONFIG_ARCH_SUNXI) += sunxi/ -obj-$(CONFIG_SUNXI_CCU) += sunxi-ng/ +obj-y += sunxi-ng/ obj-$(CONFIG_ARCH_TEGRA) += tegra/ obj-y += ti/ obj-$(CONFIG_CLK_UNIPHIER) += uniphier/
drivers/clk/sunxi-ng/Kconfig +2 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only config SUNXI_CCU - bool "Clock support for Allwinner SoCs" + tristate "Clock support for Allwinner SoCs" depends on ARCH_SUNXI || COMPILE_TEST select RESET_CONTROLLER default ARCH_SUNXI
@@ -52,6 +52,7 @@ config SUN5I_CCU bool "Support for the Allwinner sun5i family CCM" default MACH_SUN5I depends on MACH_SUN5I || COMPILE_TEST + depends on SUNXI_CCU=y config SUN6I_A31_CCU tristate "Support for the Allwinner A31/A31s CCU"
drivers/clk/sunxi-ng/Makefile +18 -15
@@ -1,24 +1,27 @@ # SPDX-License-Identifier: GPL-2.0 + +obj-$(CONFIG_SUNXI_CCU) += sunxi-ccu.o + # Common objects -obj-y += ccu_common.o -obj-y += ccu_mmc_timing.o -obj-y += ccu_reset.o +sunxi-ccu-y += ccu_common.o +sunxi-ccu-y += ccu_mmc_timing.o +sunxi-ccu-y += ccu_reset.o # Base clock types -obj-y += ccu_div.o -obj-y += ccu_frac.o -obj-y += ccu_gate.o -obj-y += ccu_mux.o -obj-y += ccu_mult.o -obj-y += ccu_phase.o -obj-y += ccu_sdm.o +sunxi-ccu-y += ccu_div.o +sunxi-ccu-y += ccu_frac.o +sunxi-ccu-y += ccu_gate.o +sunxi-ccu-y += ccu_mux.o +sunxi-ccu-y += ccu_mult.o +sunxi-ccu-y += ccu_phase.o +sunxi-ccu-y += ccu_sdm.o # Multi-factor clocks -obj-y += ccu_nk.o -obj-y += ccu_nkm.o -obj-y += ccu_nkmp.o -obj-y += ccu_nm.o -obj-y += ccu_mp.o +sunxi-ccu-y += ccu_nk.o +sunxi-ccu-y += ccu_nkm.o +sunxi-ccu-y += ccu_nkmp.o +sunxi-ccu-y += ccu_nm.o +sunxi-ccu-y += ccu_mp.o # SoC support obj-$(CONFIG_SUNIV_F1C100S_CCU) += suniv-f1c100s-ccu.o
drivers/clk/sunxi-ng/ccu_common.c +3 -0
@@ -9,6 +9,7 @@#include <linux/clk-provider.h> #include <linux/device.h> #include <linux/iopoll.h> +#include <linux/module.h> #include <linux/slab.h> #include "ccu_common.h"
@@ -214,3 +215,5 @@ void of_sunxi_ccu_probe(struct device_node *node, void __iomem *reg,kfree (ccu); } } + +MODULE_LICENSE ("GPL" );
drivers/mmc/host/Kconfig +1 -0
@@ -966,6 +966,7 @@ config MMC_REALTEK_USB config MMC_SUNXI tristate "Allwinner sunxi SD/MMC Host Controller support" depends on ARCH_SUNXI || COMPILE_TEST + depends on SUNXI_CCU help This selects support for the SD/MMC Host Controller on Allwinner sunxi SoCs.
include/linux/clk/sunxi-ng.h +0 -15
@@ -6,22 +6,7 @@#ifndef _LINUX_CLK_SUNXI_NG_H_#define _LINUX_CLK_SUNXI_NG_H_ -#include <linux/errno.h> - -#ifdef CONFIG_SUNXI_CCU int sunxi_ccu_set_mmc_timing_mode (struct clk *clk,bool new_mode);int sunxi_ccu_get_mmc_timing_mode (struct clk *clk); -#else -static inline int sunxi_ccu_set_mmc_timing_mode (struct clk *clk, -bool new_mode) -{ -return -ENOTSUPP ; -} - -static inline int sunxi_ccu_get_mmc_timing_mode (struct clk *clk) -{ -return -ENOTSUPP ; -} -#endif #endif
Signature · 1 line
2.32.0
Maxime Ripard
AppliedQuoted 8 lines · Samuel Holland
This series allows the CCU core and drivers to be loaded/unloaded as modules. As part of this, patch 3 converts most of the early OF clock providers to platform drivers.
Changes in v3:
- Also export helper functions.[...]
Applied to sunxi/linux.git (sunxi/clk-for-5.17).
Thanks!
Maxime