mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 12:11:40 +00:00
b1bc04a2ac
The Clock-and-Reset controller resides in a core power domain on NVIDIA Tegra SoCs. In order to support voltage scaling of the core power domain, we hook up DVFS-capable clocks to the core GENPD for managing of the GENPD's performance state based on the clock changes. Some clocks don't have any specific physical hardware unit that backs them, like root PLLs and system clock and they have theirs own voltage requirements. This patch adds new clk-device driver that backs the clocks and provides runtime PM functionality for them. A virtual clk-device is created for each such DVFS-capable clock at the clock's registration time by the new tegra_clk_register() helper. Driver changes clock's device GENPD performance state based on clk-rate notifications. In result we have this sequence of events: 1. Clock driver creates virtual device for selective clocks, enables runtime PM for the created device and registers the clock. 2. Clk-device driver starts to listen to clock rate changes. 3. Something changes clk rate or enables/disables clk. 4. CCF core propagates the change through the clk tree. 5. Clk-device driver gets clock rate-change notification or GENPD core handles prepare/unprepare of the clock. 6. Clk-device driver changes GENPD performance state on clock rate change. 7. GENPD driver changes voltage regulator state change. 8. The regulator state is committed to hardware via I2C. We rely on fact that DVFS is not needed for Tegra I2C and that Tegra I2C driver already keeps clock always-prepared. Hence I2C subsystem stays independent from the clk power management and there are no deadlock spots in the sequence. Currently all clocks are registered very early during kernel boot when the device driver core isn't available yet. The clk-device can't be created at that time. This patch splits the registration of the clocks in two phases: 1. Register all essential clocks which don't use RPM and are needed during early boot. 2. Register at a later boot time the rest of clocks. This patch adds power management support for Tegra20 and Tegra30 clocks. Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Tested-by: Peter Geis <pgwipeout@gmail.com> # Ouya T30 Tested-by: Paul Fertser <fercerpav@gmail.com> # PAZ00 T20 Tested-by: Nicolas Chauvet <kwizart@gmail.com> # PAZ00 T20 and TK1 T124 Tested-by: Matt Merhar <mattmerhar@protonmail.com> # Ouya T30 Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
33 lines
1.2 KiB
Makefile
33 lines
1.2 KiB
Makefile
# SPDX-License-Identifier: GPL-2.0
|
|
obj-y += clk.o
|
|
obj-y += clk-audio-sync.o
|
|
obj-y += clk-device.o
|
|
obj-y += clk-dfll.o
|
|
obj-y += clk-divider.o
|
|
obj-y += clk-periph.o
|
|
obj-y += clk-periph-fixed.o
|
|
obj-y += clk-periph-gate.o
|
|
obj-y += clk-pll.o
|
|
obj-y += clk-pll-out.o
|
|
obj-y += clk-sdmmc-mux.o
|
|
obj-y += clk-super.o
|
|
obj-y += clk-tegra-audio.o
|
|
obj-y += clk-tegra-periph.o
|
|
obj-y += clk-tegra-fixed.o
|
|
obj-y += clk-tegra-super-cclk.o
|
|
obj-y += clk-tegra-super-gen4.o
|
|
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
|
|
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20-emc.o
|
|
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
|
|
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra20-emc.o
|
|
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
|
|
obj-$(CONFIG_ARCH_TEGRA_124_SOC) += clk-tegra124.o
|
|
obj-$(CONFIG_TEGRA_CLK_DFLL) += clk-tegra124-dfll-fcpu.o
|
|
obj-$(CONFIG_TEGRA124_CLK_EMC) += clk-tegra124-emc.o
|
|
obj-$(CONFIG_ARCH_TEGRA_132_SOC) += clk-tegra124.o
|
|
obj-y += cvb.o
|
|
obj-$(CONFIG_ARCH_TEGRA_210_SOC) += clk-tegra210.o
|
|
obj-$(CONFIG_ARCH_TEGRA_210_SOC) += clk-tegra210-emc.o
|
|
obj-$(CONFIG_CLK_TEGRA_BPMP) += clk-bpmp.o
|
|
obj-y += clk-utils.o
|