02 Apr, 2020

2 commits

  • commit 8400ab8896324641243b57fc49b448023c07409a upstream.

    The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have odd sizeofs.

    This produces many oopses with CONFIG_KASAN=y.

    Fix by marking with __aligned(4).

    Fixes: 666aed2d13ee ("clk: imx: scu: add set parent support")
    Signed-off-by: Leonard Crestez
    Link: https://lkml.kernel.org/r/aad021e432b3062c142973d09b766656eec18fde.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Leonard Crestez
     
  • commit a0ae04a25650fd51b7106e742d27333e502173c6 upstream.

    The imx SC api strongly assumes that messages are composed out of
    4-bytes words but some of our message structs have odd sizeofs.

    This produces many oopses with CONFIG_KASAN=y.

    Fix by marking with __aligned(4).

    Fixes: fe37b4820417 ("clk: imx: add scu clock common part")
    Signed-off-by: Leonard Crestez
    Link: https://lkml.kernel.org/r/10e97a04980d933b2cfecb6b124bf9046b6e4f16.1582216144.git.leonard.crestez@nxp.com
    Signed-off-by: Stephen Boyd
    Signed-off-by: Greg Kroah-Hartman

    Leonard Crestez
     

24 Feb, 2020

1 commit

  • [ Upstream commit f60f1c62c3188fcca945581e35e3440ee3fdcc95 ]

    If the clk_hw based API returns an error, trying to return the clk from
    hw will end up in a NULL pointer dereference. So adding the to_clk
    checker and using it inside every clk based macro helper we handle that
    case correctly.

    This to_clk is also temporary and will go away along with the clk based
    macro helpers once there is no user that need them anymore.

    Signed-off-by: Abel Vesa
    Signed-off-by: Shawn Guo
    Signed-off-by: Sasha Levin

    Abel Vesa
     

23 Jan, 2020

2 commits

  • commit 2e2b928a04bd74ea410da72bd60e1c5b06398276 upstream.

    In the latest reference manual Rev.0,06/2019, the DDR clock mux
    is extended to 2 bits, and the clock options are also changed,
    correct them accordingly.

    Fixes: b1260067ac3d ("clk: imx: add imx7ulp clk driver")
    Signed-off-by: Anson Huang
    Reviewed-by: Fabio Estevam
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Anson Huang
     
  • commit 96ac93a7c4bea4eb4186425795c00937d2dd6085 upstream.

    In the latest reference manual Rev.0,06/2019, the SCS's option #7
    is no longer from upll, it is reserved, update clock driver accordingly.

    Fixes: b1260067ac3d ("clk: imx: add imx7ulp clk driver")
    Signed-off-by: Anson Huang
    Reviewed-by: Fabio Estevam
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Anson Huang
     

18 Jan, 2020

1 commit

  • commit 094234fcf46146339caaac8282aa15d225a5911a upstream.

    The PLL14xx on imx8m can change the S and K parameter without requiring
    a reset and relock of the whole PLL.

    Fix clk_pll144xx_mp_change register reading and use it for pll1443 as
    well since no reset+relock is required on K changes either.

    Signed-off-by: Leonard Crestez
    Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Leonard Crestez
     

31 Dec, 2019

3 commits

  • commit c3a5fd15ed0c1494435e4e35fbee734ae46b5073 upstream.

    The usage of readl_poll_timeout is wrong, the 3rd parameter(cond)
    should be "val & LOCK_STATUS" not "val & LOCK_TIMEOUT_US",
    It is not check whether the pll locked, LOCK_STATUS reflects the mask,
    not LOCK_TIMEOUT_US.

    Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
    Cc:
    Reviewed-by: Abel Vesa
    Signed-off-by: Peng Fan
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     
  • commit 073a01e8d7c23b3efb59a3d4c20aa546f9ec29a9 upstream.

    There is a lock to divider in the composite driver, but that's not
    enough. lock to gate/mux are also needed to provide exclusive access
    to the register.

    Fixes: d3ff9728134e ("clk: imx: Add imx composite clock")
    Signed-off-by: Peng Fan
    Cc:
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     
  • commit ed11e31709d7ddb19d4dc451d5bbfb15129f4cad upstream.

    There should be a sentinel of ulp_div_table, otherwise _get_table_div
    may access data out of the array.

    Fixes: b1260067ac3d ("clk: imx: add imx7ulp clk driver")
    Signed-off-by: Peng Fan
    Cc:
    Signed-off-by: Shawn Guo
    Signed-off-by: Greg Kroah-Hartman

    Peng Fan
     

28 Oct, 2019

1 commit

  • During cpu frequency switching the main "CLK_ARM" is reparented to an
    intermediate "step" clock. On imx8mm and imx8mn the 24M oscillator is
    used for this purpose but it is extremely slow, increasing wakeup
    latencies to the point that i2c transactions can timeout and system
    becomes unresponsive.

    Fix by switching the "step" clk to SYS_PLL1_800M, matching the behavior
    of imx8m cpufreq drivers in imx vendor tree.

    This bug was not immediately apparent because upstream arm64 defconfig
    uses the "performance" governor by default so no cpufreq transitions
    happen.

    Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
    Fixes: 96d6392b54db ("clk: imx: Add support for i.MX8MN clock driver")

    Cc: stable@vger.kernel.org
    Signed-off-by: Leonard Crestez
    Link: https://lkml.kernel.org/r/f5d2b9c53f1ed5ccb1dd3c6624f56759d92e1689.1571771777.git.leonard.crestez@nxp.com
    Acked-by: Shawn Guo
    Signed-off-by: Stephen Boyd

    Leonard Crestez
     

18 Sep, 2019

4 commits

  • pll BYPASS bit should be kept inside pll driver for glitchless freq
    setting following spec. If exposing the bit, that means pll driver and
    clk driver has two paths to touch this bit, which is wrong.

    So use EXT_BYPASS bit here.

    And drop uneeded set parent, because EXT_BYPASS default is 0.

    Suggested-by: Jacky Bai
    Reviewed-by: Leonard Crestez
    Signed-off-by: Peng Fan
    Link: https://lkml.kernel.org/r/1568043491-20680-5-git-send-email-peng.fan@nxp.com
    Signed-off-by: Stephen Boyd

    Peng Fan
     
  • pll BYPASS bit should be kept inside pll driver for glitchless freq
    setting following spec. If exposing the bit, that means pll driver and
    clk driver has two paths to touch this bit, which is wrong.

    So use EXT_BYPASS bit here.

    And drop uneeded set parent, because EXT_BYPASS default is 0.

    Fixes: ba5625c3e272 ("clk: imx: Add clock driver support for imx8mm")
    Suggested-by: Jacky Bai
    Reviewed-by: Leonard Crestez
    Signed-off-by: Peng Fan
    Link: https://lkml.kernel.org/r/1568043491-20680-4-git-send-email-peng.fan@nxp.com
    Signed-off-by: Stephen Boyd

    Peng Fan
     
  • When registering the PLL, unbypass the PLL.
    The PLL has two bypass control bit, BYPASS and EXT_BYPASS.
    we will expose EXT_BYPASS to clk driver for mux usage, and keep
    BYPASS inside pll14xx usage. The PLL has a restriction that
    when M/P change, need to RESET/BYPASS pll to avoid glitch, so
    we could not expose BYPASS.

    To make it easy for clk driver usage, unbypass PLL which does
    not hurt current function.

    Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
    Reviewed-by: Leonard Crestez
    Signed-off-by: Peng Fan
    Link: https://lkml.kernel.org/r/1568043491-20680-3-git-send-email-peng.fan@nxp.com
    Signed-off-by: Stephen Boyd

    Peng Fan
     
  • According to PLL1443XA and PLL1416X spec,
    "When BYPASS is 0 and RESETB is changed from 0 to 1, FOUT starts to
    output unstable clock until lock time passes. PLL1416X/PLL1443XA may
    generate a glitch at FOUT."

    So set BYPASS when RESETB is changed from 0 to 1 to avoid glitch.
    In the end of set rate, BYPASS will be cleared.

    When prepare clock, also need to take care to avoid glitch. So
    we also follow Spec to set BYPASS before RESETB changed from 0 to 1.
    And add a check if the RESETB is already 0, directly return 0;

    Fixes: 8646d4dcc7fb ("clk: imx: Add PLLs driver for imx8mm soc")
    Reviewed-by: Leonard Crestez
    Signed-off-by: Peng Fan
    Link: https://lkml.kernel.org/r/1568043491-20680-2-git-send-email-peng.fan@nxp.com
    Signed-off-by: Stephen Boyd

    Peng Fan
     

25 Aug, 2019

1 commit

  • The AUDIO PLL max support 650M, so the original clk settings violate
    spec. This patch makes the output 786432000 -> 393216000,
    and 722534400 -> 361267200 to aligned with NXP vendor kernel without any
    impact on audio functionality and go within 650MHz PLL limit.

    Signed-off-by: Peng Fan
    Reviewed-by: Shengjiu Wang
    Signed-off-by: Shawn Guo

    Peng Fan
     

19 Aug, 2019

7 commits


12 Aug, 2019

2 commits


03 Aug, 2019

16 commits