Skip to content

Commit

Permalink
Merge tag 'tegra-for-4.2-clk' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/tegra/linux into clk-next

clk: tegra: Changes for v4.2-rc1

This contains the EMC clock driver that's been exhaustively reviewed and
tested. It also includes a change to the clock core that allows a clock
provider to perform low-level reparenting of clocks. This is required by
the EMC clock driver because the reparenting needs to be done at a very
specific point in time during the EMC frequency switch.
  • Loading branch information
Michael Turquette committed Jun 20, 2015
2 parents 85e88fa + 36b7be6 commit 2cd7b04
Show file tree
Hide file tree
Showing 13 changed files with 637 additions and 16 deletions.
44 changes: 43 additions & 1 deletion Documentation/devicetree/bindings/clock/nvidia,tegra124-car.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,38 @@ Required properties :
- #reset-cells : Should be 1.
In clock consumers, this cell represents the bit number in the CAR's
array of CLK_RST_CONTROLLER_RST_DEVICES_* registers.
- nvidia,external-memory-controller : phandle of the EMC driver.

The node should contain a "emc-timings" subnode for each supported RAM type (see
field RAM_CODE in register PMC_STRAPPING_OPT_A).

Required properties for "emc-timings" nodes :
- nvidia,ram-code : Should contain the value of RAM_CODE this timing set
is used for.

Each "emc-timings" node should contain a "timing" subnode for every supported
EMC clock rate.

Required properties for "timing" nodes :
- clock-frequency : Should contain the memory clock rate to which this timing
relates.
- nvidia,parent-clock-frequency : Should contain the rate at which the current
parent of the EMC clock should be running at this timing.
- clocks : Must contain an entry for each entry in clock-names.
See ../clocks/clock-bindings.txt for details.
- clock-names : Must include the following entries:
- emc-parent : the clock that should be the parent of the EMC clock at this
timing.

Example SoC include file:

/ {
tegra_car: clock {
tegra_car: clock@60006000 {
compatible = "nvidia,tegra124-car";
reg = <0x60006000 0x1000>;
#clock-cells = <1>;
#reset-cells = <1>;
nvidia,external-memory-controller = <&emc>;
};

usb@c5004000 {
Expand Down Expand Up @@ -62,4 +85,23 @@ Example board file:
&tegra_car {
clocks = <&clk_32k> <&osc>;
};

clock@60006000 {
emc-timings-3 {
nvidia,ram-code = <3>;

timing-12750000 {
clock-frequency = <12750000>;
nvidia,parent-clock-frequency = <408000000>;
clocks = <&tegra_car TEGRA124_CLK_PLL_P>;
clock-names = "emc-parent";
};
timing-20400000 {
clock-frequency = <20400000>;
nvidia,parent-clock-frequency = <408000000>;
clocks = <&tegra_car TEGRA124_CLK_PLL_P>;
clock-names = "emc-parent";
};
};
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ Required properties:
The second entry gives the physical address and length of the
registers indicating the strapping options.

Optional properties:
- nvidia,long-ram-code: If present, the RAM code is long (4 bit). If not, short (2 bit).
1 change: 1 addition & 0 deletions drivers/clk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,4 @@ endmenu
source "drivers/clk/mvebu/Kconfig"

source "drivers/clk/samsung/Kconfig"
source "drivers/clk/tegra/Kconfig"
8 changes: 8 additions & 0 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,14 @@ static void clk_core_reparent(struct clk_core *core,
__clk_recalc_rates(core, POST_RATE_CHANGE);
}

void clk_hw_reparent(struct clk_hw *hw, struct clk_hw *new_parent)
{
if (!hw)
return;

clk_core_reparent(hw->core, !new_parent ? NULL : new_parent->core);
}

/**
* clk_has_parent - check if a clock is a possible parent for another
* @clk: clock source
Expand Down
3 changes: 3 additions & 0 deletions drivers/clk/tegra/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
config TEGRA_CLK_EMC
def_bool y
depends on TEGRA124_EMC
1 change: 1 addition & 0 deletions drivers/clk/tegra/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ obj-y += clk-tegra-periph.o
obj-y += clk-tegra-pmc.o
obj-y += clk-tegra-fixed.o
obj-y += clk-tegra-super-gen4.o
obj-$(CONFIG_TEGRA_CLK_EMC) += clk-emc.o
obj-$(CONFIG_ARCH_TEGRA_2x_SOC) += clk-tegra20.o
obj-$(CONFIG_ARCH_TEGRA_3x_SOC) += clk-tegra30.o
obj-$(CONFIG_ARCH_TEGRA_114_SOC) += clk-tegra114.o
Expand Down
Loading

0 comments on commit 2cd7b04

Please sign in to comment.