1. 24 8月, 2017 5 次提交
  2. 04 4月, 2017 2 次提交
  3. 20 3月, 2017 14 次提交
  4. 30 6月, 2016 1 次提交
    • A
      clk: tegra: Initialize UTMI PLL when enabling PLLU · 15d68e8c
      Andrew Bresticker 提交于
      Move the UTMI PLL initialization code form clk-tegra<chip>.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: NAndrew Bresticker <abrestic@chromium.org>
      [rklein: Merged in some later fixes for potential deadlocks]
      Signed-off-by: NRhyland Klein <rklein@nvidia.com>
      [treding: coding style bike-shedding, remove unused variable]
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      15d68e8c
  5. 23 6月, 2016 2 次提交
  6. 17 6月, 2016 2 次提交
  7. 10 6月, 2016 1 次提交
    • T
      clk: tegra: Fixup post dividers on Tegra210 · eddb65e7
      Thierry Reding 提交于
      Commit 86c679a5 ("clk: tegra: pll: Fix _pll_ramp_calc_pll logic and
      _calc_dynamic_ramp_rate") changed the PLL divider computation logic to
      consistently use P-divider values from tables as real dividers rather
      than the hardware values. Unfortunately for some reason many of the
      Tegra210 clocks didn't have their tables updated (most likely an over-
      sight by me when applying the patches). This commit fixes them all up.
      
      Cc: Jon Hunter <jonathanh@nvidia.com>
      Cc: Rhyland Klein <rklein@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      eddb65e7
  8. 28 5月, 2016 1 次提交
    • A
      remove lots of IS_ERR_VALUE abuses · 287980e4
      Arnd Bergmann 提交于
      Most users of IS_ERR_VALUE() in the kernel are wrong, as they
      pass an 'int' into a function that takes an 'unsigned long'
      argument. This happens to work because the type is sign-extended
      on 64-bit architectures before it gets converted into an
      unsigned type.
      
      However, anything that passes an 'unsigned short' or 'unsigned int'
      argument into IS_ERR_VALUE() is guaranteed to be broken, as are
      8-bit integers and types that are wider than 'unsigned long'.
      
      Andrzej Hajda has already fixed a lot of the worst abusers that
      were causing actual bugs, but it would be nice to prevent any
      users that are not passing 'unsigned long' arguments.
      
      This patch changes all users of IS_ERR_VALUE() that I could find
      on 32-bit ARM randconfig builds and x86 allmodconfig. For the
      moment, this doesn't change the definition of IS_ERR_VALUE()
      because there are probably still architecture specific users
      elsewhere.
      
      Almost all the warnings I got are for files that are better off
      using 'if (err)' or 'if (err < 0)'.
      The only legitimate user I could find that we get a warning for
      is the (32-bit only) freescale fman driver, so I did not remove
      the IS_ERR_VALUE() there but changed the type to 'unsigned long'.
      For 9pfs, I just worked around one user whose calling conventions
      are so obscure that I did not dare change the behavior.
      
      I was using this definition for testing:
      
       #define IS_ERR_VALUE(x) ((unsigned long*)NULL == (typeof (x)*)NULL && \
             unlikely((unsigned long long)(x) >= (unsigned long long)(typeof(x))-MAX_ERRNO))
      
      which ends up making all 16-bit or wider types work correctly with
      the most plausible interpretation of what IS_ERR_VALUE() was supposed
      to return according to its users, but also causes a compile-time
      warning for any users that do not pass an 'unsigned long' argument.
      
      I suggested this approach earlier this year, but back then we ended
      up deciding to just fix the users that are obviously broken. After
      the initial warning that caused me to get involved in the discussion
      (fs/gfs2/dir.c) showed up again in the mainline kernel, Linus
      asked me to send the whole thing again.
      
      [ Updated the 9p parts as per Al Viro  - Linus ]
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Cc: Andrzej Hajda <a.hajda@samsung.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Link: https://lkml.org/lkml/2016/1/7/363
      Link: https://lkml.org/lkml/2016/5/27/486
      Acked-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> # For nvmem part
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      287980e4
  9. 28 4月, 2016 5 次提交
  10. 02 2月, 2016 7 次提交
    • J
      clk: tegra: Fix sparse warnings for functions not declared as static · fd360e20
      Jon Hunter 提交于
      Sparse reports the following warnings for functions in clk-tegra210.c
      that should be declared as static:
      
      drivers/clk/tegra/clk-tegra210.c:460:6: warning: symbol
       'tegra210_pllcx_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:485:6: warning: symbol
       '_pllc_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:490:6: warning: symbol
       '_pllc2_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:495:6: warning: symbol
       '_pllc3_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:500:6: warning: symbol
       '_plla1_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:510:6: warning: symbol
       'tegra210_plla_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:562:6: warning: symbol
       'tegra210_plld_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:701:6: warning: symbol
       'tegra210_plld2_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:709:6: warning: symbol
       'tegra210_plldp_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:722:6: warning: symbol
       'tegra210_pllc4_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:731:6: warning: symbol
       'tegra210_pllre_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:844:6: warning: symbol
       'tegra210_pllx_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:904:6: warning: symbol
       'tegra210_pllmb_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:963:6: warning: symbol
       'tegra210_pllp_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:1025:6: warning: symbol
       'tegra210_pllu_set_defaults' was not declared. Should it be static?
      drivers/clk/tegra/clk-tegra210.c:1215:15: warning: symbol
       'tegra210_clk_adjust_vco_min' was not declared. Should it be static?
      
      Fix this by declaring the above as static.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      fd360e20
    • J
      clk: tegra: Fix sparse warning for pll_m · d9e65791
      Jon Hunter 提交于
      Sparse generates the following warning for the pll_m params structure:
      
      drivers/clk/tegra/clk-tegra210.c:1569:10: warning: Initializer entry
       defined twice
      drivers/clk/tegra/clk-tegra210.c:1570:10:   also defined here
      
      Fix this by correcting the index for the MISC1 register.
      
      Fixes: b31eba5ff3f7 ("clk: tegra: Add support for Tegra210 clocks")
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      d9e65791
    • J
      clk: tegra: Use definition for pll_u override bit · 2d5b6cf8
      Jon Hunter 提交于
      The definition, PLLU_BASE_OVERRIDE, for the pll_u OVERRIDE bit is defined
      but not used and when the OVERRIDE bit is cleared in tegra210_pll_init()
      the code directly uses the bit number. Therefore, use the definition,
      PLLU_BASE_OVERRIDE when clearing the OVERRIDE bit.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      2d5b6cf8
    • J
      clk: tegra: Fix warning caused by pll_u failing to lock · 0649c323
      Jon Hunter 提交于
      If the pll_u is not configured by the bootloader, then on kernel boot the
      following warning is seen:
      
       clk_pll_wait_for_lock: Timed out waiting for pll pll_u_vco lock
       tegra_init_from_table: Failed to enable pll_u_out1
       ------------[ cut here ]------------
       WARNING: at drivers/clk/tegra/clk.c:269
       Modules linked in:
      
       CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.4.0-rc4-next-20151214+ #1
       Hardware name: NVIDIA Tegra210 P2371 reference board (E.1) (DT)
       task: ffffffc0bc0a0000 ti: ffffffc0bc0a8000 task.ti: ffffffc0bc0a8000
       PC is at tegra_init_from_table+0x140/0x164
       LR is at tegra_init_from_table+0x140/0x164
       pc : [<ffffffc0008fee78>] lr : [<ffffffc0008fee78>] pstate: 80000045
       sp : ffffffc0bc0abd50
       x29: ffffffc0bc0abd50 x28: ffffffc00090b8a8
       x27: ffffffc000a06000 x26: ffffffc0bc019780
       x25: ffffffc00086a708 x24: ffffffc00086a790
       x23: ffffffc0006d7188 x22: ffffffc0bc010000
       x21: 000000000000016e x20: ffffffc0bc00d100
       x19: ffffffc000944178 x18: 0000000000000007
       x17: 000000000000000e x16: 0000000000000001
       x15: 0000000000000007 x14: 000000000000000e
       x13: 0000000000000013 x12: 000000000000001a
       x11: 000000000000004d x10: 0000000000000750
       x9 : ffffffc0bc0a8000 x8 : ffffffc0bc0a07b0
       x7 : 0000000000000001 x6 : 0000000002d5f0f8
       x5 : 0000000000000000 x4 : 0000000000000000
       x3 : 0000000000000002 x2 : ffffffc000996724
       x1 : 0000000000000000 x0 : 0000000000000032
      
       ---[ end trace cbd20ae519e92ced ]---
       Call trace:
       [<ffffffc0008fee78>] tegra_init_from_table+0x140/0x164
       [<ffffffc000900ac8>] tegra210_clock_apply_init_table+0x20/0x28
       [<ffffffc0008fec40>] tegra_clocks_apply_init_table+0x18/0x24
       [<ffffffc00008291c>] do_one_initcall+0x90/0x194
       [<ffffffc0008cfab0>] kernel_init_freeable+0x148/0x1e8
       [<ffffffc000636bb0>] kernel_init+0x10/0xdc
       [<ffffffc000085cd0>] ret_from_fork+0x10/0x40
       clk_pll_wait_for_lock: Timed out waiting for pll pll_u_vco lock
       tegra_init_from_table: Failed to enable pll_u_out2
       ------------[ cut here ]------------
      
      pll_u can be either controlled by software or hardware and this is
      selected via the OVERRIDE bit in the pll_u base register. In the function
      tegra210_pll_init(), the OVERRIDE bit for pll_u is cleared, which selects
      hardware control of the pll. However, at the same time the pll_u clocks
      are populated in the init_table for tegra210 and so software will try to
      configure the pll_u if it is not already configured and hence, the above
      warning is seen when the pll fails to lock. Remove the pll_u clocks from
      the init_table so that software does not try to configure this pll on
      boot.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      0649c323
    • J
      clk: tegra: Fix clock sources for Tegra210 EMC · 4f8d4440
      Jon Hunter 提交于
      The EMC clock sources for Tegra210 currently incorrectly include pll_c2
      and pll_c3. However, both of these should have been pll_mb as shown in
      the TRM. If Tegra210 happens to be configured such that the pll_mb is the
      default clock for the EMC, as configured by the bootloader, then this will
      cause a system hang on boot. This is because the kernel will disable the
      pll_mb when disabling unused clock as it appears to be unused when it is
      not.
      
      Also add the additional pll_p clock source for the EMC.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Acked-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      4f8d4440
    • J
      clk: tegra: Add the APB2APE audio clock on Tegra210 · 29569941
      Jon Hunter 提交于
      The APB2APE clock for the audio subsystem is required for powering up the
      audio power domain and accessing the various modules in this subsystem on
      Tegra210 devices. Add this clock for Tegra210.
      Signed-off-by: NJon Hunter <jonathanh@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      29569941
    • R
      clk: tegra: Fix pllx dyn step calculation · 3dad5c5f
      Rhyland Klein 提交于
      The logic for calculating the input rate used when figuring out the
      proper dynamic steps for pllx was incorrect. It is supposed to be
      calculated using parent_rate / m but it was just using the parent rate
      directly, therefore using the wrong step values.
      Signed-off-by: NRhyland Klein <rklein@nvidia.com>
      Signed-off-by: NThierry Reding <treding@nvidia.com>
      3dad5c5f