30 Jun, 2016

1 commit

  • Move the UTMI PLL initialization code form clk-tegra.c files into
    clk-pll.c. UTMI PLL was being configured and set in HW control right
    after registration. However, when the clock init_table is processed and
    child clks of PLLU are enabled, it will call in and enable PLLU as
    well, and initiate SW enabling sequence even though PLLU is already in
    HW control. This leads to getting UTMIPLL stuck with a SEQ_BUSY status.

    Doing the initialization once during pllu_enable means we configure it
    properly into HW control.

    A side effect of the commonization/localization of the UTMI PLL init
    code, is that it corrects some errors that were present for earlier
    generations. For instance, in clk-tegra124.c, it used to have:

    #define UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 6)

    when the correct shift to use is present in the new version:

    #define UTMIP_PLL_CFG1_ENABLE_DLY_COUNT(x) (((x) & 0x1f) << 27)

    which matches the Tegra124 TRM register definition.

    Signed-off-by: Andrew Bresticker
    [rklein: Merged in some later fixes for potential deadlocks]
    Signed-off-by: Rhyland Klein
    [treding: coding style bike-shedding, remove unused variable]
    Signed-off-by: Thierry Reding

    Andrew Bresticker
     

28 Apr, 2016

1 commit


21 Nov, 2015

3 commits

  • This removes the conversion from pdiv to hw, which is already taken
    care of by _get_table_rate before this code is run. This avoids
    incorrectly converting pdiv to hw twice and getting the wrong hw value.

    Also set the input_rate in the freq cfg in _calc_dynamic_ramp_rate while
    setting all the other fields.

    In order to prevent regressions on earlier SoC generations, all of the
    frequency tables need to be updated so that they contain the actual
    divider values. If they contain hardware values these would be converted
    to hardware values again, yielding the wrong value.

    Signed-off-by: Rhyland Klein
    [treding@nvidia.com: fix regressions on earlier SoC generations]
    Signed-off-by: Thierry Reding

    Rhyland Klein
     
  • SoC specific drivers should define the appropriate flags for each
    PLL rather than relying on the registration functions to automatically
    set flags on their behalf. This will properly allow for changes between
    SoC generations where flags might be different and allow sharing the
    same logic functions.

    Reviewed-by: Benson Leung
    Signed-off-by: Rhyland Klein
    Signed-off-by: Thierry Reding

    Rhyland Klein
     
  • This is static data that is never modified, so make it const.

    Signed-off-by: Thierry Reding

    Thierry Reding
     

18 Nov, 2015

3 commits


20 Oct, 2015

1 commit

  • tegra_audio_clk_init was written expecting a single PLL to be
    passed in directly. Change this to accept an array which will
    allow for supporting multiple plls and specifying specific data
    about them, like their parent, which may change over time.

    Reviewed-by: Benson Leung
    Signed-off-by: Rhyland Klein
    Signed-off-by: Thierry Reding

    Rhyland Klein
     

26 Aug, 2015

2 commits

  • The latest Tegra clk pull had some problems. Fix them.

    drivers/clk/tegra/clk-tegra124.c:1450:6: warning: symbol 'tegra124_clock_assert_dfll_dvco_reset' was not declared. Should it be static?
    drivers/clk/tegra/clk-tegra124.c:1466:6: warning: symbol 'tegra124_clock_deassert_dfll_dvco_reset' was not declared. Should it be static?
    drivers/clk/tegra/clk-tegra124.c:1476:5: warning: symbol 'tegra124_reset_assert' was not declared. Should it be static?
    drivers/clk/tegra/clk-tegra124.c:1486:5: warning: symbol 'tegra124_reset_deassert' was not declared. Should it be static?
    drivers/clk/tegra/clk-dfll.c:590 dfll_load_i2c_lut() warn: inconsistent indenting
    drivers/clk/tegra/clk-dfll.c:1448 dfll_build_i2c_lut() warn: unsigned 'td->i2c_lut[0]' is never less than zero.

    Signed-off-by: Stephen Boyd

    Stephen Boyd
     
  • …egra/linux into clk-next

    clk: tegra: Changes for v4.3-rc1

    This contains the DFLL driver needed to implement CPU frequency scaling
    on Tegra.

    Stephen Boyd
     

21 Jul, 2015

1 commit

  • Clock provider drivers generally shouldn't include clk.h because
    it's the consumer API. Only include clk.h in files that are using
    it. Also add in a clkdev.h include that was missing in a file
    using clkdev APIs.

    Cc: Peter De Schrijver
    Cc: Thierry Reding
    Signed-off-by: Stephen Boyd

    Stephen Boyd
     

16 Jul, 2015

2 commits

  • Save and restore this register since the LP1 restore assembly routines
    fiddle with it. Otherwise the CPU would keep running on PLLX after
    resume from suspend even when DFLL was the original clocksource.

    Signed-off-by: Tuomas Tynkkynen
    Signed-off-by: Mikko Perttunen
    Acked-by: Peter De Schrijver
    Acked-by: Michael Turquette
    Signed-off-by: Thierry Reding

    Tuomas Tynkkynen
     
  • The DVCO present in the DFLL IP block has a separate reset line,
    exposed via the CAR IP block. This reset line is asserted upon SoC
    reset. Unless something (such as the DFLL driver) deasserts this
    line, the DVCO will not oscillate, although reads and writes to the
    DFLL IP block will complete.

    Thanks to Aleksandr Frid for identifying this and
    saving hours of debugging time.

    Signed-off-by: Paul Walmsley
    [ttynkkynen: ported to tegra124 from tegra114]
    Signed-off-by: Tuomas Tynkkynen
    [mikko.perttunen: ported to special reset callback]
    Signed-off-by: Mikko Perttunen
    Acked-by: Michael Turquette
    Signed-off-by: Thierry Reding

    Paul Walmsley
     

13 May, 2015

3 commits


10 Apr, 2015

3 commits

  • The current parent, plld_out0, does not exist. The proper name is
    pll_d_out0. While at it, rename the plld_dsi clock to pll_d_dsi_out to
    be more consistent with other clock names.

    Fixes: b270491eb9a0 ("clk: tegra: Define PLLD_DSI and remove dsia(b)_mux")
    Signed-off-by: Thierry Reding

    Thierry Reding
     
  • Currently the Tegra clock driver simplifies the clock tree somewhat by
    taking advantage of the fact that clk_m runs at the same frequency as
    the oscillator. While that's true on all currently supported SoCs, it
    does not apply to Tegra210 anymore. On Tegra210 clk_m is typically
    divided down from the oscillator frequency. To support that setup, add
    a separate clock for the oscillator that both clk_m and pll_ref derive
    from.

    Modify the tegra_osc_clk_init() function to take an additional divider
    parameter for clk_m. Existing SoCs always pass in 1, whereas Tegra210
    will read the divider from a register in the clock & reset controller.

    Signed-off-by: Thierry Reding

    Thierry Reding
     
  • Add the clocks used for HDMI audio played through the HDA controller.
    Initialize the codec clock to 48Mhz and the HDA clock to 102MHz per
    the TRM.

    Signed-off-by: Dylan Reid
    Acked-by: Stephen Warren
    Signed-off-by: Thierry Reding

    Dylan Reid
     

02 Feb, 2015

3 commits

  • PLLD is the only parent for DSIA & DSIB on Tegra124 and
    Tegra132. Besides, BIT 30 in PLLD_MISC register controls
    the output of DSI clock.

    So this patch removes "dsia_mux" & "dsib_mux", and create
    a new clock "plld_dsi" to represent the DSI clock enable
    control.

    Signed-off-by: Peter De Schrijver
    Signed-off-by: Mark Zhang

    Mark Zhang
     
  • Tegra132 CAR supports almost the same clocks as Tegra124 CAR. This
    patch mostly deals with the small differences.

    Since Tegra132 contains many of the same PLL clock sources used on
    Tegra114 and Tegra124, enable them in drivers/clk/tegra/clk-pll.c when
    the kernel is configured to include Tegra132 support.

    This patch is based on several patches from others:

    1. a patch from Peter De Schrijver:

    http://lkml.iu.edu/hypermail/linux/kernel/1407.1/06094.html

    2. a patch from Bill Huang ("clk: tegra: enable cclk_g at boot on
    Tegra132"), and

    3. a patch from Allen Martin ("clk: Enable tegra clock driver for
    tegra132").

    Signed-off-by: Paul Walmsley
    Signed-off-by: Paul Walmsley
    Cc: Peter De Schrijver
    Cc: Allen Martin
    Cc: Prashant Gaikwad
    Cc: Stephen Warren
    Cc: Thierry Reding
    Cc: Alexandre Courbot
    Cc: Bill Huang
    Cc: Mike Turquette
    Cc: Stephen Boyd

    Paul Walmsley
     
  • Set the parent of the dsi lp clocks to pll_p and the rate
    to 68MHz. The default parent is clk_m and rate is 12MHz, this
    is too slow to receive data from the peripheral.

    Per NVidia HW engineers, the optimal rate is 70MHz, but 68MHz
    will suffice.

    Signed-off-by: Sean Paul
    Signed-off-by: Peter De Schrijver

    Sean Paul
     

26 Nov, 2014

1 commit


18 Sep, 2014

1 commit


27 Jun, 2014

1 commit


26 Jun, 2014

1 commit


25 Jun, 2014

1 commit


23 May, 2014

2 commits

  • Initialize the XUSB-related clocks with appropriate parents and rates
    for both Tegra114 and Tegra124.

    Signed-off-by: Jim Lin
    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mike Turquette

    Andrew Bresticker
     
  • Currently the Tegra1x4 clock init code hard-codes the mux setting
    for xusb_hs_src and treats it as a fixed-factor clock. It is,
    however, a mux which can be parented by either xusb_ss_src/2 or
    pll_u_60M. Add the fixed-factor clock xusb_ss_div2 and put an
    entry in periph_clks[] for the xusb_hs_src mux.

    Signed-off-by: Andrew Bresticker
    Signed-off-by: Mike Turquette

    Andrew Bresticker
     

24 Apr, 2014

1 commit


21 Feb, 2014

1 commit


17 Feb, 2014

5 commits


12 Dec, 2013

1 commit

  • The Tegra CAR module implements both a clock and reset controller. So
    far, the driver exposes the clock feature via the common clock API and
    the reset feature using a custom API. This patch adds an implementation
    of the common reset framework API (include/linux/reset*.h). The legacy
    reset implementation will be removed once all drivers have been
    converted.

    Signed-off-by: Stephen Warren
    Reviewed-by: Thierry Reding
    Acked-By: Peter De Schrijver

    Stephen Warren
     

27 Nov, 2013

2 commits