The patch enables CPU multiplexer clock on MT8173 SoC which fixes up
cpufreq driver fails at acquiring intermediate clock source when driver
probe is called.
Signed-off-by: Pi-Cheng Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The patch enables CPU multiplexer clock on MT2701/MT7623 SoC which fixes
up cpufreq driver fails at acquiring intermediate clock source when driver
probe is called.
Signed-off-by: Pi-Cheng Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
This patch adds CPU multiplexer clocks which are essential for Mediatek
cpufreq driver. It would use the CPU clock multiplexer to switch to the
intermediate clock source temporarily and then wait for the primary clock
changing getting stable.
Signed-off-by: Pi-Cheng Chen <[email protected]>
Signed-off-by: Sean Wang <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The ethernet clock core has a reset register that is currently not exposed
to the user. Fix this by adding the missing registration code.
Signed-off-by: John Crispin <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
If I say "no" to "Clock driver for Mediatek MT2701", I don't want to
be asked individually about each sub-driver. No means no.
Additionally, this driver shouldn't be proposed at all on non-mediatek
builds, unless build-testing.
Signed-off-by: Jean Delvare <[email protected]>
Fixes: e986211827 ("clk: mediatek: Add MT2701 clock support")
Reviewed-by: Andreas Färber <[email protected]>
Reviewed-by: James Liao <[email protected]>
Cc: Shunli Wang <[email protected]>
Cc: Erin Lo <[email protected]>
Cc: Michael Turquette <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
In infrasys and perifsys, there are many reset
control bits for kinds of modules. These bits are
used as actual reset controllers to be registered
into kernel's generic reset controller framework.
Signed-off-by: Shunli Wang <[email protected]>
Signed-off-by: James Liao <[email protected]>
Signed-off-by: Erin Lo <[email protected]>
Tested-by: John Crispin <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Remove __init from functions that will be used by init functions
that support probe deferral.
Signed-off-by: James Liao <[email protected]>
Signed-off-by: Erin Lo <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The hdmitx_dig_cts clock signal is not a child of tvdpll_445p5m,
but is routed out of the HDMI PHY module.
Signed-off-by: Philipp Zabel <[email protected]>
Acked-by: Stephen Boyd <[email protected]>
The configurable hdmi_ref output of the PLL block is derived from
the tvdpll_594m clock signal via a configurable PLL post-divider.
It is used as the PLL reference input to the HDMI PHY module.
Signed-off-by: Philipp Zabel <[email protected]>
Acked-by: James Liao <[email protected]>
Acked-by: Stephen Boyd <[email protected]>
This mux is supposed to select a fitting divider after the PLL
is already set to the correct rate.
Signed-off-by: Philipp Zabel <[email protected]>
Acked-by: James Liao <[email protected]>
Acked-by: Stephen Boyd <[email protected]>
The mtk_reset_ops structure is never modified. Make it const.
Signed-off-by: Philipp Zabel <[email protected]>
Reviewed-by: Matthias Brugger <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
mtk_clk_register_composite() may leak memory due to some error
handling path don't free all allocated memory. This patch
free all pointers that may allocate memory before error return.
And it's safe because kfree() can handle NULL pointers.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
to_clk_*(_hw) macros have been repeatedly defined in many places.
This patch moves all the to_clk_*(_hw) definitions in the common
clock framework to public header clk-provider.h, and drop the local
definitions.
Signed-off-by: Geliang Tang <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Add REF2USB_TX clock support into MT8173 APMIXEDSYS. This clock
is needed by USB 3.0.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Most multimedia subsystem clocks will be accessed by multiple
drivers, so it's a better way to manage these clocks in CCF.
This patch adds clock support for MM, IMG, VDEC, VENC and VENC_LT
subsystems.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Remove the dependency from clk_null, and give all root clocks a
typical rate, include clkph_mck_o, usb_syspll_125m and hdmitx_dig_cts.
dpi_ck was removed due to no clock reference to it.
Replace parent clock of infra_cpum with cpum_ck, which is an external
clock and can be defined in the device tree.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
This patch adds fixed clocks support by using CCF fixed-rate
clock implementation.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Add __init for clock registration functions, and add __initdata for
mtk_gate_regs initial structures.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Remove unused header files from MT8173, and remove unused
keywords from function declaration.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
The dpi_ck clock can be removed because it not actually used
in topckgen and subsystems.
Signed-off-by: James Liao <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
* cleanup-clk-h-includes: (62 commits)
clk: Remove clk.h from clk-provider.h
clk: h8300: Remove clk.h and clkdev.h includes
clk: at91: Include clk.h and slab.h
clk: ti: Switch clk-provider.h include to clk.h
clk: pistachio: Include clk.h
clk: ingenic: Include clk.h
clk: si570: Include clk.h
clk: moxart: Include clk.h
clk: cdce925: Include clk.h
clk: Include clk.h in clk.c
clk: zynq: Include clk.h
clk: ti: Include clk.h
clk: sunxi: Include clk.h and remove unused clkdev.h includes
clk: st: Include clk.h
clk: qcom: Include clk.h
clk: highbank: Include clk.h
clk: bcm: Include clk.h
clk: versatile: Remove clk.h and clkdev.h includes
clk: ux500: Remove clk.h and clkdev.h includes
clk: tegra: Properly include clk.h
...
MT8173 MMPLL frequency settings are different from common PLLs.
It needs different post divider settings for some ranges of frequency.
This patch add support for MT8173 MMPLL frequency setting by adding
div-rate table to lookup suitable post divider setting under a
specified frequency.
Signed-off-by: James Liao <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Avoid u32 overflow when calculate post divider setting, and
increase the max post divider setting from 3 (/8) to 4 (/16).
Signed-off-by: James Liao <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Write postdiv and pcw settings at the same time for PLLs if postdiv
and pcw settings are on the same register.
This is need by PLLs such as MT8173 MMPLL and ARM*PLL.
Signed-off-by: James Liao <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
We don't need to include clk.h in header files, just forward
declare struct clk here. This leads us to a few places where the
include of clk.h was missing in C files. Add them.
Cc: James Liao <[email protected]>
Cc: Henry Chen <[email protected]>
Cc: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
On the MT8173 the clocks are provided by different units. To enable
the critical clocks we must be sure that all parent clocks are already
registered, otherwise the parents of the critical clocks end up being
unused and get disabled later. To find a place where all parents are
registered we try each time after we've registered some clocks if
all known providers are present now and only then we enable the critical
clocks
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: James Liao <[email protected]>
[[email protected]: Marked function and data __init]
Signed-off-by: Stephen Boyd <[email protected]>
The size of clk_data should be the same as CLK_APMIXED_NR_CLK
instead of ARRAY_SIZE(plls). CLK_APMIXED_* is numbered from 1, so
CLK_APMIXED_NR_CLK will be greater than ARRAY_SIZE(plls).
Signed-off-by: James Liao <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The variable init (struct clk_init_data) is allocated on the stack.
We weren't initializing the .flags field, so it contains random junk,
which can cause all kinds of interesting issues when the flags are
parsed by clk_register.
Signed-off-by: Ricky Liang <[email protected]>
Acked-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
This patch adds basic clocks for MT8173, including TOPCKGEN, PLLs,
INFRA and PERI clocks.
Signed-off-by: James Liao <[email protected]>
Signed-off-by: Henry Chen <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
This patch adds basic clocks for MT8135, including TOPCKGEN, PLLs,
INFRA and PERI clocks.
Signed-off-by: James Liao <[email protected]>
Signed-off-by: Henry Chen <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
The pericfg and infracfg units also provide reset lines to several
other SoC internal units. This adds a function which can be called
from the pericfg and infracfg initialization functions which will
register the reset controller using reset_controller_register. The
reset controller will provide support for resetting the units
connected to the pericfg and infracfg controller. The units resetted
by this controller can use the standard reset device tree binding
to gain access to the reset lines.
Signed-off-by: Sascha Hauer <[email protected]>
Acked-by: Philipp Zabel <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
This patch adds common clock support for Mediatek SoCs, including plls,
muxes and clock gates.
Signed-off-by: James Liao <[email protected]>
Signed-off-by: Henry Chen <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
[[email protected]: Squelch checkpatch warning in clk-mtk.h]
Signed-off-by: Stephen Boyd <[email protected]>