path: root/arch/arm/include/asm/arch-tegra/clock.h
Commit message (Collapse)AuthorAgeFilesLines
* ARM: tegra: Implement clk_mThierry Reding2015-09-161-2/+5
| | | | | | | | | | On currently supported SoCs, clk_m always runs at the same frequency as the oscillator input. However newer SoC generations such as Tegra210 no longer have that restriction. Prepare for that by separating clk_m from the oscillator clock and allow SoC code to override the clk_m rate. Signed-off-by: Thierry Reding <> Signed-off-by: Tom Warren <>
* Tegra: PLL: use per-SoC pllinfo table instead of PLL_DIVM/N/P, etc.Tom Warren2015-08-051-0/+21
| | | | | | | | | | | | | Added PLL variables (dividers mask/shift, lock enable/detect, etc.) to new pllinfo struct for each Soc/PLL. PLLA/C/D/E/M/P/U/X. Used pllinfo struct in all clock functions, validated on T210. Should be equivalent to prior code on T124/114/30/20. Thanks to Marcel Ziswiler for corrections to the T20/T30 values. Signed-off-by: Marcel Ziswiler <> Tested-by: Marcel Ziswiler <> Signed-off-by: Tom Warren <>
* Tegra: clocks: Add 38.4MHz OSC support for T210 useTom Warren2015-08-051-0/+2
| | | | | | | | | | | | | | | Added 38.4MHz/48MHz entries to pll_x_table for CPU PLL. Needs to be measured - should be close to 700MHz (1.4G/2). Note that some freqs aren't in the PLLU table in T210 TRM (13, 26MHz), so I used the 12MHz table entry for them. They shouldn't be selected since they're not viable T210 OSC freqs. Since there are now 2 new OSC defines, all tables (pll_x_table, PLLU) had to increase by two entries, but since 38.4/48MHz are not viable osc freqs on T20/30/114, etc, they're just set to 0. Signed-off-by: Tom Warren <>
* tegra: clock: Support enabling external clocksSimon Glass2015-06-091-0/+8
| | | | | | | Add a simple function to enable external clocks. Signed-off-by: Simon Glass <> Signed-off-by: Tom Warren <>
* tegra: clock: Split the clock source code into a separate functionSimon Glass2015-05-131-0/+11
| | | | | | | | | Create a function which sets the source clock for a peripheral, given the number of mux bits to adjust. This can then be used more generally. For now, don't export it. Signed-off-by: Simon Glass <> Signed-off-by: Tom Warren <>
* tegra: clock: Add checking for invalid clock IDsSimon Glass2015-05-131-0/+3
| | | | | | | | | The get_pll() function can do the wrong thing if passed values that are out of range. Add checks for this and add a function which can return a 'simple' PLL. This can be defined by SoCs with their own clocks. Signed-off-by: Simon Glass <> Signed-off-by: Tom Warren <>
* ARM: tegra: don't exceed AVP limits when configuring PLLPJimmy Zhang2014-02-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Based on the Tegra TRM, the system clock (which is the AVP clock) can run up to 275MHz. On power on, the default sytem clock source is set to PLLP_OUT0. In function clock_early_init(), PLLP_OUT0 will be set to 408MHz which is beyond system clock's upper limit. The fix is to set the system clock to CLK_M before initializing PLLP, and then switch back to PLLP_OUT4, which has an appropriate divider configured, after PLLP has been configured Implement this logic in new function tegra30_set_up_pllp(), which sets up PLLP and all PLLP_OUT* dividers, and handles the AVP clock switching. Remove the duplicate PLLP setup from pllx_set_rate() and adjust_pllp_out_freqs(). Signed-off-by: Jimmy Zhang <> [swarren, significantly refactored the change] Signed-off-by: Stephen Warren <> Reviewed-by: Thierry Reding <> Tested-by: Thierry Reding <> Acked-by: Thierry Reding <> Signed-off-by: Tom Warren <>
* ARM: tegra: MASK_BITS_ no longer needs specific valuesStephen Warren2014-02-031-1/+1
| | | | | | | | | | | | | | | | | | Since all code that sets or interprets MASK_BITS_* now uses the enums to define/compare the values, there is no need for MASK_BITS_* to have a specific integer value. In fact, having a specific integer value may encourage people to hard-code those values, or interpret the values in incorrect ways. As such, remove the logic that assigns a specific value to the enum values in order to make it completely clear that it's just an enum, not something that directly represents some integer value. Signed-off-by: Stephen Warren <> Reviewed-by: Thierry Reding <> Tested-by: Thierry Reding <> Acked-by: Thierry Reding <> Signed-off-by: Tom Warren <>
* ARM: tegra: rename MASK_BITS_29_28 to MASK_BITS_31_28Stephen Warren2014-02-031-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | The only place where the MASK_BITS_* values are used is in adjust_periph_pll(), which interprets the value 4 (old MASK_BITS_29_28, new MASK_BITS_31_28) as being associated with mask OUT_CLK_SOURCE4_MASK, i.e. bits 31:28. Rename the MASK_BITS_ macro to reflect how it's actually implemented. Note that no Tegra clock register actually uses all of bits 31:28 as the mux field. Rather, bits 30:28, 29:28, or 28 are used. However, in those cases, nothing is stored in the bits above the mux field, so it's safe to pretend that the mux field extends all the way to the end of the register. As such, the U-Boot clock driver is currently a bit lazy, and doesn't distinguish between 31:28, 30:28, 29:28 and 28; it just lumps them all together and pretends they're all 31:28. This patch doesn't cause this issue; it was pre-existing. Hopefully, future patches will clean this up. Signed-off-by: Stephen Warren <> Reviewed-by: Thierry Reding <> Tested-by: Thierry Reding <> Acked-by: Thierry Reding <> Signed-off-by: Tom Warren <>
* ARM: tegra: deduplicate MASK_BITS_xxx clock mux enumTom Warren2014-02-031-0/+6
| | | | | | | | | | | | | | | The enum used to define the set of register bits used to represent a clock's input mux, MUX_BITS_*, is defined separately for each SoC at present. Move this definition to a common location to ease fixing up some issues with the definition, and the code that uses it. Signed-off-by: Tom Warren <> [swarren, extracted from a larger patch by Tom] Signed-off-by: Stephen Warren <> Reviewed-by: Thierry Reding <> Tested-by: Thierry Reding <> Acked-by: Thierry Reding <> Signed-off-by: Tom Warren <>
* arm: tegra: Fix the CPU complex reset masksAlban Bedel2013-12-181-3/+3
| | | | | | | | | | | | | The CPU complex reset masks are not matching with the datasheet for the CLK_RST_CONTROLLER_RST_CPU_CMPLX_SET/CLR_0 registers. For both T20 and T30 the register consist of groups of 4 bits, with one bit for each CPU core. On T20 the 2 high bits of each group are always stubbed as there is only 2 cores. Signed-off-by: Alban Bedel <> Acked-by: Stephen Warren <> Tested-by: Stephen Warren <> Signed-off-by: Tom Warren <>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-16/+1
| | | | | | Signed-off-by: Wolfgang Denk <> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <>
* Tegra114: Initialize System Counter (TSC) with osc frequencyTom Warren2013-04-151-0/+3
| | | | | | | | | T114 needs the SYSCTR0 counter initialized so the TSC can be read by the kernel. Do it in the bootloader since it's a write-once deal (secure/non-secure mode dependent). Signed-off-by: Tom Warren <> Reviewed-by: Stephen Warren <>
* Tegra: Move common clock code to arch/arm/cpu/tegra-common/clock.cTom Warren2013-02-111-2/+57
| | | | | | | | | This 'commonizes' much of the clock/pll code. SoC-dependent code and tables are left in arch/cpu/tegraXXX-common/clock.c Some T30 tables needed whitespace fixes due to checkpatch complaints. Signed-off-by: Tom Warren <>
* Tegra30: Add arch-tegra30 include filesTom Warren2013-01-161-4/+4
| | | | | | | | | | | | Common Tegra files are in arch-tegra, shared between T20 and T30. Tegra30-specific headers are in arch-tegra30. Note that some of these will be filled in as more T30 support is added (drivers, WB/LP0 support, etc.). A couple of Tegra20 files were changed to support common headers in arch-tegra, also. Signed-off-by: Tom Warren <> Reviewed-by: Stephen Warren <> Acked-by: Simon Glass <>
* tegra20: add clock_set_pllout functionLucas Stach2012-10-151-0/+12
| | | | | | | | | | | Common practice on Tegra 2 boards is to use the pllp_out4 FO to generate the ULPI reference clock. For this to work we have to override the default hardware generated output divider. This function adds a clean way to do so. Signed-off-by: Lucas Stach <> Signed-off-by: Tom Warren <>
* Tegra20: Move some include files to arch-tegra for sharing with Tegra30Tom Warren2012-10-151-0/+253
The move is pretty straight-forward. ap20.h and tegra20.h were renamed to ap.h and tegra.h. Some files remain in arch-tegra20 but 'include' a file in 'arch-tegra' with #defines & structs that will be common between T20 and T30 HW. HW-specific #defines, etc. stay in the 'arch-tegra20' 'root' file. All boards build OK w/MAKEALL -s tegra20. runs clean. Seaboard works OK. Signed-off-by: Tom Warren <>
OpenPOWER on IntegriCloud