Commit Graph

45 Commits

Author SHA1 Message Date
Joel Slebodnick ccc0ad2f2b clk: imx8mp: fix sai4 clock
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit c30f600f1f41dcf5ef0fb02e9a201f9b2e8f31bd
Author: Marco Felsch <m.felsch@pengutronix.de>
Date:   Mon Jul 31 16:21:49 2023 +0200

    clk: imx8mp: fix sai4 clock

    The reference manual don't mention a SAI4 hardware block. This would be
    clock slice 78 which is skipped (TRM, page 237). Remove any reference to
    this clock to align the driver with the reality.

    Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
    Acked-by: Stephen Boyd <sboyd@kernel.org>
    Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
    Link: https://lore.kernel.org/r/20230731142150.3186650-1-m.felsch@pengutronix.de
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-04-04 08:57:47 -04:00
Joel Slebodnick 826e5ec2ba clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 878b02d5f3b56cb090dbe2c70c89273be144087f
Author: Yuxing Liu <lyx2022@hust.edu.cn>
Date:   Wed May 3 07:06:07 2023 +0000

    clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()

    Replace of_iomap() and kzalloc() with devm_of_iomap() and devm_kzalloc()
    which can automatically release the related memory when the device
    or driver is removed or unloaded to avoid potential memory leak.

    In this case, iounmap(anatop_base) in line 427,433 are removed
    as manual release is not required.

    Besides, referring to clk-imx8mq.c, check the return code of
    of_clk_add_hw_provider, if it returns negtive, print error info
    and unregister hws, which makes the program more robust.

    Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
    Signed-off-by: Yuxing Liu <lyx2022@hust.edu.cn>
    Reviewed-by: Dongliang Mu <dzm91@hust.edu.cn>
    Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/20230503070607.2462-1-lyx2022@hust.edu.cn
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-04-04 08:57:46 -04:00
Joel Slebodnick b487ad2681 clk: imx: imx8mp: change the 'nand_usdhc_bus' clock to non-critical
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 7875ee29f877dc76dae2d04648b95811f6a05b41
Author: Haibo Chen <haibo.chen@nxp.com>
Date:   Mon Apr 3 17:46:33 2023 +0800

    clk: imx: imx8mp: change the 'nand_usdhc_bus' clock to non-critical

    The 'nand_usdhc_bus' clock is only need to be enabled when usdhc
    or nand module is active, so change it to non-critical clock type.

    Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Link: https://lore.kernel.org/r/20230403094633.3366446-4-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-04-04 08:57:44 -04:00
Joel Slebodnick b52dc4f299 clk: imx: imx8mp: Add LDB root clock
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 82afc344d795cb467a646a2873573298162f01b9
Author: Liu Ying <victor.liu@nxp.com>
Date:   Mon Apr 3 17:46:32 2023 +0800

    clk: imx: imx8mp: Add LDB root clock

    This patch adds "media_ldb_root_clk" clock for
    the LDB in the MEDIAMIX subsystem.

    Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
    Signed-off-by: Liu Ying <victor.liu@nxp.com>
    Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Link: https://lore.kernel.org/r/20230403094633.3366446-3-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-04-04 08:57:44 -04:00
Joel Slebodnick d5505cfc05 clk: imx: imx8mp: correct DISP2 pixel clock type
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 3ea7c4c907119eb369d6b4cdec22af0434eb5304
Author: Peng Fan <peng.fan@nxp.com>
Date:   Mon Apr 3 17:46:30 2023 +0800

    clk: imx: imx8mp: correct DISP2 pixel clock type

    The MEDIA_DISP2_CLK_ROOT use ccm_ahb_channel, it is bus type.

    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/20230403094633.3366446-1-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-04-04 08:57:44 -04:00
Joel Slebodnick 7e821765b2 clk: imx8mp: Add audio shared gate
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit b1f12a685d459c3fc898b12d0b052acfab2e3018
Author: Abel Vesa <abel.vesa@nxp.com>
Date:   Mon Nov 7 16:50:07 2022 +0800

    clk: imx8mp: Add audio shared gate

    According to the RM, the CCGR101 is shared for the following root clocks:
    - AUDIO_AHB_CLK_ROOT
    - AUDIO_AXI_CLK_ROOT
    - SAI1_CLK_ROOT
    - SAI2_CLK_ROOT
    - SAI3_CLK_ROOT
    - SAI5_CLK_ROOT
    - SAI6_CLK_ROOT
    - SAI7_CLK_ROOT
    - PDM_CLK_ROOT

    IMX8MP_CLK_AUDIO_ROOT is same as AUDIO_AHB_CLK_ROOT
    which can avoid break any users.

    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
    Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
    Reviewed-by: Peng Fan <peng.fan@nxp.com>
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/1667811007-19222-3-git-send-email-shengjiu.wang@nxp.com

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 19:04:19 -04:00
Joel Slebodnick 8ff0d84822 clk: imx: imx8mp: add shared clk gate for usb suspend clk
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit ed1f4ccfe947a3e1018a3bd7325134574c7ff9b3
Author: Li Jun <jun.li@nxp.com>
Date:   Fri Sep 30 22:54:22 2022 +0800

    clk: imx: imx8mp: add shared clk gate for usb suspend clk

    32K usb suspend clock gate is shared with usb_root_clk, this
    shared clock gate was initially defined only for usb suspend
    clock, usb suspend clk is kept on while system is active or
    system sleep with usb wakeup enabled, so usb root clock is
    fine with this situation; with the commit cf7f3f4fa9e5
    ("clk: imx8mp: fix usb_root_clk parent"), this clock gate is
    changed to be for usb root clock, but usb root clock will
    be off while usb is suspended, so usb suspend clock will be
    gated too, this cause some usb functionalities will not work,
    so define this clock to be a shared clock gate to conform with
    the real HW status.

    Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
    Cc: stable@vger.kernel.org # v5.19+
    Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
    Signed-off-by: Li Jun <jun.li@nxp.com>
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/1664549663-20364-2-git-send-email-jun.li@nxp.com

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 19:04:19 -04:00
Joel Slebodnick e637b300b6 clk: imx8mp: tune the order of enet_qos_root_clk
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit c68cd258a67730c24566b9688d7c134e67459ac6
Author: Peng Fan <peng.fan@nxp.com>
Date:   Mon Aug 15 09:34:28 2022 +0800

    clk: imx8mp: tune the order of enet_qos_root_clk

    The enet_qos_root_clk takes sim_enet_root_clk as parent. When
    registering enet_qos_root_clk, it will be put into clk orphan list,
    because sim_enet_root_clk is not ready.

    When sim_enet_root_clk is ready, clk_core_reparent_orphans_nolock will
    set enet_qos_root_clk parent to sim_enet_root_clk.

    Because CLK_OPS_PARENT_ENABLE is set, sim_enet_root_clk will be
    enabled and disabled during the enet_qos_root_clk reparent phase.

    All the above are correct. But with M7 booted early and using
    enet, M7 enet feature will be broken, because clk driver probe phase
    disable the needed clks, in case M7 firmware not configure
    sim_enet_root_clk.

    And tune the order would also save cpu cycles.

    Reviewed-by: Ye Li <ye.li@nxp.com>
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/20220815013428.476015-1-peng.fan@oss.nxp.com

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 19:04:17 -04:00
Joel Slebodnick 64a7242c80 clk: imx8mp: fix usb_root_clk parent
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit cf7f3f4fa9e57b8e9f594823e77e6cbb0ce2b254
Author: Peng Fan <peng.fan@nxp.com>
Date:   Sat May 7 20:54:30 2022 +0800

    clk: imx8mp: fix usb_root_clk parent

    According to reference mannual CCGR77(usb) sources from hsio_axi, fix
    it.

    Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220507125430.793287-1-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 19:04:16 -04:00
Joel Slebodnick 3d8d81fd80 clk: imx8mp: remove SYS PLL 1/2 clock gates
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit d097cc045b64948ca3048ced4a43cc74eaf641a5
Author: Peng Fan <peng.fan@nxp.com>
Date:   Fri Feb 25 16:17:33 2022 +0800

    clk: imx8mp: remove SYS PLL 1/2 clock gates

    Remove the PLL 1/2 gates as it make AMP clock management harder without
    obvious benifit.

    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220225081733.2294166-4-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 15:45:02 -04:00
Joel Slebodnick fe19292268 clk: imx8mp: Add missing IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT clock
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 39d1e443173a58a6a3452bb931907ce0fb4061e3
Author: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Date:   Fri Feb 11 11:13:11 2022 +0200

    clk: imx8mp: Add missing IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT clock

    The IMX8MP_CLK_MEDIA_MIPI_PHY1_REF_ROOT clock derives from the
    media_mipi_phy1_ref clock and is gated by the shared media clock gate.
    Its identifier is defined in dt-bindings/clock/imx8mp-clock.h but its
    definition is missing from the driver. Add it.

    Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
    Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
    Link: https://lore.kernel.org/r/20220211091311.28146-1-laurent.pinchart@ideasonboard.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 15:45:02 -04:00
Joel Slebodnick d173eb2598 clk: imx8mp: Fix the parent clk of the audio_root_clk
JIRA: https://issues.redhat.com/browse/RHEL-5705

commit 9dd81021084ff22cf88a180d720f4f4b47392059
Author: Hui Wang <hui.wang@canonical.com>
Date:   Tue Nov 9 20:56:57 2021 +0800

    clk: imx8mp: Fix the parent clk of the audio_root_clk

    Having the parent of the audio_root_clk set to ipg_root
    in the clk-imx8mp.c, there is a hang happening when the
    audiomix IP regs are accessed. Switch parent to audio_ahb.

    And we could also refer to the section "5.1.4 System Clocks" of the
    IMX8MPRM.pdf, the parent clk of CCGR101 (Audiomix) is the
    AUDIO_AHB_CLK_ROOT.

    Signed-off-by: Hui Wang <hui.wang@canonical.com>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20211109125657.63485-2-hui.wang@canonical.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Joel Slebodnick <jslebodn@redhat.com>
2024-03-26 15:45:01 -04:00
Jan Stancek 5c6ae09a2e Merge: clk: imx8m: driver updates
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2523

Description:
Updates for NXP i.MX8MQ CCM Clock Driver

Bugzilla: http://bugzilla.redhat.com/2184094

Build Info: https://brewweb.engineering.redhat.com/brew/taskinfo?taskID=52606149

Tested: Did sanity boot testing on (nxp-imx8mquad-01.edge1) system.

Signed-off-by: Steve Best <sbest@redhat.com>

Approved-by: Tony Camuso <tcamuso@redhat.com>
Approved-by: David Arcari <darcari@redhat.com>

Signed-off-by: Jan Stancek <jstancek@redhat.com>
2023-07-25 16:23:15 +02:00
Steve Best b52ac6e202 clk: imx: remove clk_count of imx_register_uart_clocks
Bugzilla: https://bugzilla.redhat.com/2212497

Conflicts: skip clk-imx8ulp.c hunk we haven't included this clock in RHEL 9.x yet

commit 2d5513bf7563b425b74867c254a7352373613b74
Author: Peng Fan <peng.fan@nxp.com>
Date:   Wed Jan 4 19:00:31 2023 +0800

    clk: imx: remove clk_count of imx_register_uart_clocks

    The clk count has been get with of_clk_get_parent_count, there is
    no need to pass clk_count from users.

    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/20230104110032.1220721-4-peng.fan@oss.nxp.com

Signed-off-by: Steve Best <sbest@redhat.com>
2023-06-13 13:20:43 -04:00
Steve Best 2fa9528c70 clk: imx: Remove the snvs clock
Bugzilla: https://bugzilla.redhat.com/2184094

commit 56fddc6996c95d846d90abf212718628056669d5
Author: Jacky Bai <ping.bai@nxp.com>
Date:   Thu Mar 10 17:34:04 2022 +0800

    clk: imx: Remove the snvs clock

    The SNVS moudule is not used only by the linux, it may also used
    by other SW component is secure world. No sense to populate it
    in linux, so remove it.

    Signed-off-by: Jacky Bai <ping.bai@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220310093404.236966-1-ping.bai@nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-05-15 05:23:49 -04:00
Steve Best b610ddc8b6 clk: imx: add mcore_booted module paratemter
Bugzilla: https://bugzilla.redhat.com/2184094

commit 19565ea12d61c69ef2be97a97b426ba5c55572ff
Author: Peng Fan <peng.fan@nxp.com>
Date:   Mon Feb 28 20:41:11 2022 +0800

    clk: imx: add mcore_booted module paratemter

    Add mcore_booted boot parameter which could simplify AMP clock
    management. To i.MX8M, there is CCM(clock control Module) to generate
    clock root clock, anatop(analog PLL module) to generate PLL, and CCGR
    (clock gating) to gate clocks to peripherals. As below:
      anatop->ccm->ccgr->peripheral

    Linux handles the clock management and the auxiliary core is under
    control of Linux. Although there is per hardware domain control for CCGR
    and CCM, auxiliary core normally only use CCGR hardware domain control
    to avoid linux gate off the clk to peripherals and leave CCM ana anatop
    to Linux.

    Per NXP hardware design, because CCGR already support gate to
    peripherals, and clk root gate power leakage is negligible. So
    when in AMP case, we could not register the clk root gate.

    Signed-off-by: Peng Fan <peng.fan@nxp.com>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220228124112.3974242-1-peng.fan@oss.nxp.com
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>

Signed-off-by: Steve Best <sbest@redhat.com>
2023-05-15 05:23:44 -04:00
Steve Best 24134a7fb2 clk: imx: rename imx_obtain_fixed_clk_hw() to imx_get_clk_hw_by_name()
Bugzilla: http://bugzilla.redhat.com/2178965

Conflicts: skip change drivers/clk/imx/clk-imxrt1050.c it has been included in RHEL

commit 8178e245fa953f793670147368642717fcdb302e
Author: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Date:   Sun Nov 13 19:08:39 2022 +0100

    clk: imx: rename imx_obtain_fixed_clk_hw() to imx_get_clk_hw_by_name()

    The imx_obtain_fixed_clk_hw name was wrong and misleading. Renaming it
    to imx_get_clk_hw_by_name clarifies the purpose of the function, and
    will allow it to be used not only for fixed rate clocks but also in
    wider contexts.

    No functional changes intended.

    The replacements were made with the following command:

    grep -rl 'imx_obtain_fixed_clk_hw' ./ | \
         xargs sed -i 's/imx_obtain_fixed_clk_hw/imx_get_clk_hw_by_name/g'

    Tested on a BSH SystemMaster (SMM) S2 board.

    Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
    Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
    Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
    Link: https://lore.kernel.org/r/20221113180839.1625832-1-dario.binacchi@amarulasolutions.com

Signed-off-by: Steve Best <sbest@redhat.com>
2023-04-02 07:45:27 -04:00
Al Stone 60368a26ae clk: imx8mp: add clkout1/2 support
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2121508
Tested: This is one of a series of patch sets to enable Arm SystemReady IR
 support in the kernel for NXP i.MX8 platforms.  This set updates the
 DTS sources and dt-bindings directories.  While the DTS sources are
 primarily documentation, the dt-bindings are used in compiling the
 kernel.  This set has been tested via simple boot tests and the CI
 loop.

commit 43896f56b59eeaf08687fa976257ae7083d01b41
Author: Lucas Stach <l.stach@pengutronix.de>
Date:   Wed Apr 27 18:21:31 2022 +0200

    clk: imx8mp: add clkout1/2 support

    clkout1 and clkout2 allow to supply clocks from the SoC to the board,
    which is used by some board designs to provide reference clocks.

    Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220427162131.3127303-1-l.stach@pengutronix.de
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
    (cherry picked from commit 43896f56b59eeaf08687fa976257ae7083d01b41)

Signed-off-by: Al Stone <ahs3@redhat.com>
2022-10-07 10:30:32 -06:00
Al Stone 83f751f13c clk: imx8mp: Add DISP2 pixel clock
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2121508
Tested: This is one of a series of patch sets to enable Arm SystemReady IR
 support in the kernel for NXP i.MX8 platforms.  This set updates the
 DTS sources and dt-bindings directories.  While the DTS sources are
 primarily documentation, the dt-bindings are used in compiling the
 kernel.  This set has been tested via simple boot tests and the CI
 loop.

commit 39772efd98adecbd5b8c6096d465d2fcbafbde6a
Author: Marek Vasut <marex@denx.de>
Date:   Sun Mar 13 13:39:49 2022 +0100

    clk: imx8mp: Add DISP2 pixel clock

    Add pixel clock for second LCDIFv3 interface. Both LCDIFv3 interfaces use
    the same set of parent clock, so deduplicate imx8mp_media_disp1_pix_sels
    into common imx8mp_media_disp_pix_sels and use it for both.

    Signed-off-by: Marek Vasut <marex@denx.de>
    Cc: Abel Vesa <abel.vesa@nxp.com>
    Cc: Fabio Estevam <festevam@gmail.com>
    Cc: NXP Linux Team <linux-imx@nxp.com>
    Cc: Peng Fan <peng.fan@nxp.com>
    Cc: Shawn Guo <shawnguo@kernel.org>
    Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
    Link: https://lore.kernel.org/r/20220313123949.207284-1-marex@denx.de
    Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
    (cherry picked from commit 39772efd98adecbd5b8c6096d465d2fcbafbde6a)

Signed-off-by: Al Stone <ahs3@redhat.com>
2022-10-07 10:30:31 -06:00
Jacky Bai b24e288d50 clk: imx: Remove the audio ipg clock from imx8mp
There is no audio ipg clock on i.MX8MP, so remove this from
the clock driver.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
2021-06-14 12:33:04 +03:00
Richard Zhu 1840518ae7 clk: imx8mp: Remove the none exist pcie clocks
In the i.MX8MP PCIe design, the PCIe PHY REF clock comes from external
OSC or internal system PLL. It is configured in the IOMUX_GPR14 register
directly, and can't be contolled by CCM at all.
Remove the PCIE PHY clock from clock driver to clean up codes.
There is only one PCIe in i.MX8MP, remove the none exist second PCIe
related clocks.
Remove the none exsits clocks IDs together.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
2021-04-04 22:39:04 +03:00
Adam Ford 379c9a24cc clk: imx: Fix reparenting of UARTs not associated with stdout
Most if not all i.MX SoC's call a function which enables all UARTS.
This is a problem for users who need to re-parent the clock source,
because any attempt to change the parent results in an busy error
due to the fact that the clocks have been enabled already.

  clk: failed to reparent uart1 to sys_pll1_80m: -16

Instead of pre-initializing all UARTS, scan the device tree to see
which UART clocks are associated to stdout, and only enable those
UART clocks if it's needed early.  This will move initialization of
the remaining clocks until after the parenting of the clocks.

When the clocks are shutdown, this mechanism will also disable any
clocks that were pre-initialized.

Fixes: 9461f7b33d ("clk: fix CLK_SET_RATE_GATE with clock rate protection")
Suggested-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Adam Ford <aford173@gmail.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Tested-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Signed-off-by: Abel Vesa <abel.vesa@nxp.com>
2021-04-04 22:39:04 +03:00
Linus Torvalds 8653b778e4 The core framework got some nice improvements this time around. We gained the
ability to get struct clk pointers from a struct clk_hw so that clk providers
 can consume the clks they provide, if they need to do something like that. This
 has been a long missing part of the clk provider API that will help us move
 away from exposing a struct clk pointer in the struct clk_hw. Tracepoints are
 added for the clk_set_rate() "range" functions, similar to the tracepoints we
 already have for clk_set_rate() and we added a column to debugfs to help
 developers understand the hardware enable state of clks in case firmware or
 bootloader state is different than what is expected. Overall the core changes
 are mostly improving the clk driver writing experience.
 
 At the driver level, we have the usual collection of driver updates and new
 drivers for new SoCs. This time around the Qualcomm folks introduced a good
 handful of clk drivers for various parts of three or four SoCs. The SiFive
 folks added a new clk driver for their FU740 SoCs, coming in second on the
 diffstat and then Atmel AT91 and Amlogic SoCs had lots of work done after that
 for various new features. One last thing to note in the driver area is that the
 i.MX driver has gained a new binding to support SCU clks after being on the
 list for many months. It uses a two cell binding which is sort of rare in clk
 DT bindings. Beyond that we have the usual set of driver fixes and tweaks that
 come from more testing and finding out that some configuration was wrong or
 that a driver could support being built as a module.
 
 Core:
  - Add some trace points for clk_set_rate() "range" functions
  - Add hardware enable information to clk_summary debugfs
  - Replace clk-provider.h with of_clk.h when possible
  - Add devm variant of clk_notifier_register()
  - Add clk_hw_get_clk() to generate a struct clk from a struct clk_hw
 
 New Drivers:
  - Bindings for Canaan K210 SoC clks
  - Support for SiFive FU740 PRCI
  - Camera clks on Qualcomm SC7180 SoCs
  - GCC and RPMh clks on Qualcomm SDX55 SoCs
  - RPMh clks on Qualcomm SM8350 SoCs
  - LPASS clks on Qualcomm SM8250 SoCs
 
 Updates:
  - DVFS support for AT91 clk driver
  - Update git repo branch for Renesas clock drivers
  - Add camera (CSI) and video-in (VIN) clocks on Renesas R-Car V3U
  - Add RPC (QSPI/HyperFLASH) clocks on Renesas RZ/G2M, RZ/G2N, and RZ/G2E
  - Stop using __raw_*() I/O accessors in Renesas clk drivers
  - One more conversion of DT bindings to json-schema
  - Make i.MX clk-gate2 driver more flexible
  - New two cell binding for i.MX SCU clks
  - Drop of_match_ptr() in i.MX8 clk drivers
  - Add arch dependencies for Rockchip clk drivers
  - Fix i2s on Rockchip rk3066
  - Add MIPI DSI clks on Amlogic axg and g12 SoCs
  - Support modular builds of Amlogic clk drivers
  - Fix an Amlogic Video PLL clock dependency
  - Samsung Kconfig dependencies updates for better compile test coverage
  - Refactoring of the Samsung PLL clocks driver
  - Small Tegra driver cleanups
  - Minor fixes to Ingenic and VC5 clk drivers
  - Cleanup patches to remove unused variables and plug memory leaks
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAl/f/ycRHHNib3lkQGtl
 cm5lbC5vcmcACgkQrQKIl8bklSXjxg/7BJMFphpZmQb3iy/lZMYfgPh2yxZvrrBj
 zJ2i1mMru/C3BkXTx29HCJvj6/VC2HgGLL6fzfwe7oY3XVRT1Vxlsvka9vNZSNc2
 UYNa8GUwR0mSXDzp5KnzoAQfLwvSqWUIeT8WB+Z+CJ7WIAGWnXgBlqsf/d/mr9hg
 JoAh+ROpbksL6hs61WJSm+7/Yu6efS0Yj0zzLZOINFWvDIOJ+Rp4g1u+qGH9tZyO
 I2Bik75Sc8hqvLUP5SVzI/1H4yLB0On+ADgVRwjvrKPVX56alYquOUMsU+sy4SeY
 ONQBki3vV5gtJHG1qvkwTC5/Yw20eUsrmrc7PNECvb1zo5Tp4QuOAR5nHCb4fg8u
 n7RRd1MktTAUAQxTzBaNYtix3Q19fjSR44C/1B6lKk6xkN+w4uYLi2GHrADy9rXa
 SwQVTKTGc8LjGywDaAOXdAyx2FMAtt1OvkTxZ238+aoHw5nQDHWKxu5TwYK6b5jG
 aEFzTCIEYlzRLqcZyGONSD0WXmQWyoNiPwJ3B7RDRfpg7dPESyKIB4MzGWiX9eDy
 lri/SoVH08c1sRf8AzIoi+CUNi8geTNAHHlJfiGznrv81ttVf3FioWyWLjr+SmBV
 rNxn35WxeDWoCZqtrLJlg5skVgmD8BRXLZTI9udPG8u6D7OdWdJBuMZ6EelO+OZg
 /n4w8tdo3cE=
 =Wt9O
 -----END PGP SIGNATURE-----

Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk updates from Stephen Boyd:
 "The core framework got some nice improvements this time around. We
  gained the ability to get struct clk pointers from a struct clk_hw so
  that clk providers can consume the clks they provide, if they need to
  do something like that. This has been a long missing part of the clk
  provider API that will help us move away from exposing a struct clk
  pointer in the struct clk_hw. Tracepoints are added for the
  clk_set_rate() "range" functions, similar to the tracepoints we
  already have for clk_set_rate() and we added a column to debugfs to
  help developers understand the hardware enable state of clks in case
  firmware or bootloader state is different than what is expected.
  Overall the core changes are mostly improving the clk driver writing
  experience.

  At the driver level, we have the usual collection of driver updates
  and new drivers for new SoCs. This time around the Qualcomm folks
  introduced a good handful of clk drivers for various parts of three or
  four SoCs. The SiFive folks added a new clk driver for their FU740
  SoCs, coming in second on the diffstat and then Atmel AT91 and Amlogic
  SoCs had lots of work done after that for various new features. One
  last thing to note in the driver area is that the i.MX driver has
  gained a new binding to support SCU clks after being on the list for
  many months. It uses a two cell binding which is sort of rare in clk
  DT bindings. Beyond that we have the usual set of driver fixes and
  tweaks that come from more testing and finding out that some
  configuration was wrong or that a driver could support being built as
  a module.

  Summary:

  Core:
   - Add some trace points for clk_set_rate() "range" functions
   - Add hardware enable information to clk_summary debugfs
   - Replace clk-provider.h with of_clk.h when possible
   - Add devm variant of clk_notifier_register()
   - Add clk_hw_get_clk() to generate a struct clk from a struct clk_hw

  New Drivers:
   - Bindings for Canaan K210 SoC clks
   - Support for SiFive FU740 PRCI
   - Camera clks on Qualcomm SC7180 SoCs
   - GCC and RPMh clks on Qualcomm SDX55 SoCs
   - RPMh clks on Qualcomm SM8350 SoCs
   - LPASS clks on Qualcomm SM8250 SoCs

  Updates:
   - DVFS support for AT91 clk driver
   - Update git repo branch for Renesas clock drivers
   - Add camera (CSI) and video-in (VIN) clocks on Renesas R-Car V3U
   - Add RPC (QSPI/HyperFLASH) clocks on Renesas RZ/G2M, RZ/G2N, and RZ/G2E
   - Stop using __raw_*() I/O accessors in Renesas clk drivers
   - One more conversion of DT bindings to json-schema
   - Make i.MX clk-gate2 driver more flexible
   - New two cell binding for i.MX SCU clks
   - Drop of_match_ptr() in i.MX8 clk drivers
   - Add arch dependencies for Rockchip clk drivers
   - Fix i2s on Rockchip rk3066
   - Add MIPI DSI clks on Amlogic axg and g12 SoCs
   - Support modular builds of Amlogic clk drivers
   - Fix an Amlogic Video PLL clock dependency
   - Samsung Kconfig dependencies updates for better compile test coverage
   - Refactoring of the Samsung PLL clocks driver
   - Small Tegra driver cleanups
   - Minor fixes to Ingenic and VC5 clk drivers
   - Cleanup patches to remove unused variables and plug memory leaks"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (134 commits)
  dt-binding: clock: Document canaan,k210-clk bindings
  dt-bindings: Add Canaan vendor prefix
  clk: vc5: Use "idt,voltage-microvolt" instead of "idt,voltage-microvolts"
  clk: ingenic: Fix divider calculation with div tables
  clk: sunxi-ng: Make sure divider tables have sentinel
  clk: s2mps11: Fix a resource leak in error handling paths in the probe function
  clk: mvebu: a3700: fix the XTAL MODE pin to MPP1_9
  clk: si5351: Wait for bit clear after PLL reset
  clk: at91: sam9x60: remove atmel,osc-bypass support
  clk: at91: sama7g5: register cpu clock
  clk: at91: clk-master: re-factor master clock
  clk: at91: sama7g5: do not allow cpu pll to go higher than 1GHz
  clk: at91: sama7g5: decrease lower limit for MCK0 rate
  clk: at91: sama7g5: remove mck0 from parent list of other clocks
  clk: at91: clk-sam9x60-pll: allow runtime changes for pll
  clk: at91: sama7g5: add 5th divisor for mck0 layout and characteristics
  clk: at91: clk-master: add 5th divisor for mck master
  clk: at91: sama7g5: allow SYS and CPU PLLs to be exported and referenced in DT
  dt-bindings: clock: at91: add sama7g5 pll defines
  clk: at91: sama7g5: fix compilation error
  ...
2020-12-21 10:39:37 -08:00
Krzysztof Kozlowski f32e42f092 clk: imx8mp: drop of_match_ptr from of_device_id table
The driver can match only via the DT table so the table should be always
used and the of_match_ptr does not have any sense (this also allows ACPI
matching via PRP0001, even though it might be not relevant here).  This
fixes compile warning (!CONFIG_OF && !CONFIG_MODULES):

    drivers/clk/imx/clk-imx8mp.c:751:34: warning:
        ‘imx8mp_clk_of_match’ defined but not used [-Wunused-const-variable=]

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-11-10 09:53:25 +08:00
Peng Fan c277ca155d clk: imx8m: fix bus critical clk registration
noc/axi/ahb are bus clk, not peripheral clk.
Since peripheral clk has a limitation that for peripheral clock slice,
IP clock slices must be stopped to change the clock source.

However if the bus clk is marked as critical clk peripheral, the
assigned clock parent operation will fail.

So we added CLK_SET_PARENT_GATE flag to avoid glitch.

And add imx8m_clk_hw_composite_bus_critical for bus critical clock usage

Fixes: 936c383673 ("clk: imx: fix composite peripheral flags")
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Reported-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://lore.kernel.org/r/1604229834-25594-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2020-11-04 17:13:12 -08:00
Colin Ian King f2644bd741 clk: imx: remove redundant assignment to pointer np
Pointer np is being initialized with a value that is never read
and it is being updated with a value later on. The initialization
is redundant and can be removed.

Addresses-Coverity: ("Unused value")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-11-01 17:26:43 +08:00
Jacky Bai f185919850 clk: imx: Correct the memrepair clock on imx8mp
The root clock slice at offset 0xbf80 should be memrepair
clock, so correct it. And this clock should be always on
to make sure the memory repair function can works well.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-08-31 10:27:06 +08:00
Jacky Bai afff77ce88 clk: imx: Correct the root clk of media ldb on imx8mp
The root clock slice at 0xbf00 is media_ldb clock,
not csi_phy2_ref, so correct it.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-08-31 10:26:57 +08:00
Anson Huang 9a976cd278 clk: imx8m: Support module build
Change configuration to "tristate", add module author, description
and license to support building i.MX8M SoCs clock driver as module.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-08-22 12:38:26 +08:00
Peng Fan 94ae59ac5d clk: imx8mp: add mu root clk
Add mu root clk for mu mailbox usage.

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-06-23 15:10:05 +08:00
Peng Fan b1657ad708 clk: imx: use imx8m_clk_hw_composite_bus for i.MX8M bus clk slice
Switch the bus clk use imx8m_clk_hw_composite_bus, then
we could avoid possible issue when setting mux of the clk.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-05-21 22:37:48 +08:00
Peng Fan 8c83a8ff4d clk: imx8mp: use imx8m_clk_hw_composite_core to simplify code
Use imx8m_clk_hw_composite_core to simpliy clks that belong to
core clk slice.

Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-05-20 09:26:48 +08:00
Peng Fan 77f5d2d973 clk: imx8mp: Define gates for pll1/2 fixed dividers
Inspried from
commit e8688fe8df ("clk: imx8mn: Define gates for pll1/2 fixed dividers")

On imx8mp there are 9 fixed-factor dividers for SYS_PLL1 and SYS_PLL2
each with their own gate. Only one of these gates (the one "dividing" by
one) is currently defined and it's incorrectly set as the parent of all
the fixed-factor dividers.

Add the other 8 gates to the clock tree between sys_pll1/2_bypass and
the fixed dividers.

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-05-20 09:26:45 +08:00
Peng Fan dc6e21da34 clk: imx: imx8mp: fix pll mux bit
Same to i.MX8MN/i.MX8MM, 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.

Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-05-20 09:26:42 +08:00
Peng Fan cccc464742 clk: imx8m: drop clk_hw_set_parent for A53
The parent settings have been moved to dtsi, we no need to
set parent here. And clk_hw_set_parent will trigger lockdep warning,
because this api not have prepare_lock.

Reported-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Reviewed-by: Leonard Crestez <leonard.crestez@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-05-20 09:26:28 +08:00
Linus Torvalds 3476195651 There's not much to see in the core framework this time around. Instead the
majority of the diff is the normal collection of driver additions for new SoCs
 and non-critical clk data fixes and updates. The framework must be middle aged.
 
 The two biggest directories in the diffstat show that the Qualcomm and Unisoc
 support added a handful of big drivers for new SoCs but that's not really the
 whole story because those new drivers tend to add large numbers of lines of clk
 data. There's a handful of AT91 clk drivers added this time around too and a
 bunch of improvements to drivers like the i.MX driver. All around lots of
 updates and fixes in various clk drivers which is good to see.
 
 The core framework has only one real major change which has been baking in next
 for the past couple months. It fixes the framework so that it stops caching a
 clk's phase when the phase clk_op returns an error. Before this change we would
 consider some negative errno as a phase and that just doesn't make sense.
 
 Core:
  - Don't show clk phase when it is invalid
 
 New Drivers:
  - Add support for Unisoc SC9863A clks
  - Qualcomm SM8250 RPMh and MSM8976 RPM clks
  - Qualcomm SM8250 Global Clock Controller (GCC) support
  - Qualcomm SC7180 Modem Clock Controller (MSS CC) support
  - EHRPWM's TimeBase clock(TBCLK) for TI AM654 SoCs
  - Support PMC clks on at91sam9n12, at91rm9200, sama5d3, and at91sam9g45 SoCs
 
 Updates:
  - GPU GX GDSC support on Qualcomm sc7180
  - Fixes and improvements for the Marvell MMP2/MMP3 SoC clk drivers
  - A series from Anson to convert i.MX8 clock bindings to json-schema
  - Update i.MX pll14xx driver to include new frequency entries for pll1443x table,
    and return error for invalid PLL type
  - Add missing of_node_put() call for a number of i.MX clock drivers
  - Drop flag CLK_IS_CRITICAL from 'A53_CORE' mux clock, as we already
    have the flag on its child cpu clock
  - Fix a53 cpu clock for i.MX8 drivers to get it source from ARM PLL
    via CORE_SEL slice, and source from A53 CCM clk root when we need to
    change ARM PLL frequency. Thus, we can support core running above
    1GHz safely
  - Update i.MX pfdv2 driver to check zero rate and use determine_rate for
    getting the best rate
  - Add CLKO2 for imx8mm, SNVS clock for imx8mn, and PXP clock for imx7d
  - Remove PMC clks from Tegra clk driver
  - Improved clock/reset handling for the Renesas R-Car USB2 Clock Selector
  - Conversion to json-schema of the Renesas CPG/MSSR DT bindings
  - Add Crypto clocks on Renesas R-Car M3-W/W+, M3-N, E3, and D3
  - Add RPC (QSPI/HyperFLASH) clocks on Renesas R-Car H3, M3-W/W+, and M3-N
  - Update Amlogic audio clock gate hierarchy for meson8 and gxbb
  - Update Amlogic g12a spicc clock sources
  - Support for Ingenic X1000 TCU clks
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEE9L57QeeUxqYDyoaDrQKIl8bklSUFAl6JDxURHHNib3lkQGtl
 cm5lbC5vcmcACgkQrQKIl8bklSU51A/+OzAA4HyywcSwLWMhUbyWI0hWis8/Gdtv
 /tIOPY/+J/Wi+2vFXoZEQWr/GViEEC1ylQwtkc/cm1WklEka/+q+GJFawyyIfX2i
 ovofDWw5lJd4/ACaOqV4ryEppwHnPUvASvoIOUXX6IwauNQzI0dRZWTOLTg2YW7x
 uvI5OtQ8o71+bM+VL1tuhWvN/4Zx9tALNU9yhaRhHdafR+xQ0d4x5bBQo8MG/2E0
 3xIbRqGbhO6XfNiKAjgKcI3jtHn006LK1/1AjyXUETWzu5Zcg2SYb/YAah39RKLZ
 FTV+xY39C8JBLPt6ZLrBu9mPDcoQOWohmnDLki0qm65cfVs/tbDX3kwp3ixCly7y
 jSCqNpl7RuWcbjMe8YesakhJc1IFICQts08KsM6dPipL+7iAv++fNQrfrnXf0cDx
 cPCgDkepos/aRhNXmVFdxf2FRKkIQjYpdAPFdYSvLv6MK0Dk6G7/EhOOXA10Z2BU
 BojY8tUx/YaC8sRbnZlhitYfpqDVFzdihL2G6W31iUbt1sKYR6t6Szhct2EbRTOQ
 69bUy2lw7M8pk1Remp0LqdrVUDYLy0/X3dVaa/teIaZt2Ac1NnWzHw9LMmnlFFEG
 GxuZy5Q5fCKbAf0tSkD4Gzb9z8f0pzAyfdlpGsY7+eEEWloc4yNFCcFcNyzJTXWV
 4kdye0klUPs=
 =ZoI6
 -----END PGP SIGNATURE-----

Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux

Pull clk updates from Stephen Boyd:
 "There's not much to see in the core framework this time around.
  Instead the majority of the diff is the normal collection of driver
  additions for new SoCs and non-critical clk data fixes and updates.
  The framework must be middle aged.

  The two biggest directories in the diffstat show that the Qualcomm and
  Unisoc support added a handful of big drivers for new SoCs but that's
  not really the whole story because those new drivers tend to add large
  numbers of lines of clk data. There's a handful of AT91 clk drivers
  added this time around too and a bunch of improvements to drivers like
  the i.MX driver. All around lots of updates and fixes in various clk
  drivers which is good to see.

  The core framework has only one real major change which has been
  baking in next for the past couple months. It fixes the framework so
  that it stops caching a clk's phase when the phase clk_op returns an
  error. Before this change we would consider some negative errno as a
  phase and that just doesn't make sense.

  Core:
   - Don't show clk phase when it is invalid

  New Drivers:
   - Add support for Unisoc SC9863A clks
   - Qualcomm SM8250 RPMh and MSM8976 RPM clks
   - Qualcomm SM8250 Global Clock Controller (GCC) support
   - Qualcomm SC7180 Modem Clock Controller (MSS CC) support
   - EHRPWM's TimeBase clock(TBCLK) for TI AM654 SoCs
   - Support PMC clks on at91sam9n12, at91rm9200, sama5d3, and
     at91sam9g45 SoCs

  Updates:
   - GPU GX GDSC support on Qualcomm sc7180
   - Fixes and improvements for the Marvell MMP2/MMP3 SoC clk drivers
   - A series from Anson to convert i.MX8 clock bindings to json-schema
   - Update i.MX pll14xx driver to include new frequency entries for
     pll1443x table, and return error for invalid PLL type
   - Add missing of_node_put() call for a number of i.MX clock drivers
   - Drop flag CLK_IS_CRITICAL from 'A53_CORE' mux clock, as we already
     have the flag on its child cpu clock
   - Fix a53 cpu clock for i.MX8 drivers to get it source from ARM PLL
     via CORE_SEL slice, and source from A53 CCM clk root when we need
     to change ARM PLL frequency. Thus, we can support core running
     above 1GHz safely
   - Update i.MX pfdv2 driver to check zero rate and use determine_rate
     for getting the best rate
   - Add CLKO2 for imx8mm, SNVS clock for imx8mn, and PXP clock for
     imx7d
   - Remove PMC clks from Tegra clk driver
   - Improved clock/reset handling for the Renesas R-Car USB2 Clock
     Selector
   - Conversion to json-schema of the Renesas CPG/MSSR DT bindings
   - Add Crypto clocks on Renesas R-Car M3-W/W+, M3-N, E3, and D3
   - Add RPC (QSPI/HyperFLASH) clocks on Renesas R-Car H3, M3-W/W+, and
     M3-N
   - Update Amlogic audio clock gate hierarchy for meson8 and gxbb
   - Update Amlogic g12a spicc clock sources
   - Support for Ingenic X1000 TCU clks"

* tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux: (146 commits)
  clk: sprd: fix to get a correct ibias of pll
  dt-bindings: imx8mm-clock: Fix the file path
  dt-bindings: imx8mq-clock: Fix the file path
  clk: qcom: rpmh: Drop unnecessary semicolons
  clk: qcom: rpmh: Simplify clk_rpmh_bcm_send_cmd()
  clk: tegra: Use NULL for pointer initialization
  clk: sprd: add clocks support for SC9863A
  clk: sprd: support to get regmap from parent node
  clk: sprd: Add macros for referencing parents without strings
  clk: sprd: Add dt-bindings include file for SC9863A
  dt-bindings: clk: sprd: add bindings for sc9863a clock controller
  dt-bindings: clk: sprd: rename the common file name sprd.txt to SoC specific
  clk: sprd: add gate for pll clocks
  MAINTAINERS: dt: update reference for arm-integrator.txt
  clk: mmp2: Fix bit masks for LCDC I/O and pixel clocks
  clk: mmp2: Add clock for fifth SD HCI on MMP3
  dt-bindings: marvell,mmp2: Add clock id for the fifth SD HCI on MMP3
  clk: mmp2: Add clocks for the thermal sensors
  dt-bindings: marvell,mmp2: Add clock ids for the thermal sensors
  clk: mmp2: add the GPU clocks
  ...
2020-04-05 10:43:32 -07:00
Fugang Duan 857c9d31f5 clk: imx8mp: Correct the enet_qos parent clock
enet_qos is for eqos tsn AXI bus clock whose clock source is from
ccm_enet_axi_clk_root, and controlled by CCM_CCGR59(offset 0x43b0)
and CCM_CCGR64(offset 0x4400), so correct enet_qos root clock's
parent clock to sim_enet.

Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-03-16 08:18:20 +08:00
Anson Huang 78ef3c9ecf clk: imx8mp: Correct IMX8MP_CLK_HDMI_AXI clock parent
IMX8MP_CLK_HDMI_AXI should be from imx8mp_media_axi_sels instead
of imx8mp_media_apb_sels, fix it.

Fixes: 9c140d9926 ("clk: imx: Add support for i.MX8MP clock driver")
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-03-16 08:18:20 +08:00
Anson Huang 0d77abc4fc clk: imx8mp: A53 core clock no need to be critical
'A53_CORE' is just a mux and no need to be critical, being critical
will cause its parent clock always ON which does NOT make sense,
to make sure CPU's hardware clock source NOT being disabled during
clock tree setup, need to move the 'A53_SRC'/'A53_CORE' reparent
operations to after critical clock 'ARM_CLK' setup finished.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-03-11 15:11:59 +08:00
Peng Fan 7ab2272101 clk: imx: imx8mp: fix a53 cpu clock
The A53 CCM clk root only accepts input up to 1GHz, CCM A53 root
signoff timing is 1Ghz, however the A53 core which sources from CCM
root could run above 1GHz which voilates the CCM.

There is a CORE_SEL slice before A53 core, we need configure the
CORE_SEL slice source from ARM PLL, not A53 CCM clk root.

The A53 CCM clk root should only be used when need to change ARM PLL
frequency.

Add arm_a53_core clk that could source from arm_a53_div and arm_pll_out.
Configure a53 ccm root sources from 800MHz sys pll
Configure a53 core sources from arm_pll_out
Mark arm_a53_core as critical clk

Reviewed-by: Jacky Bai <ping.bai@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-02-24 15:39:56 +08:00
Anson Huang c267bd443f clk: imx8mp: Rename the IMX8MP_CLK_HDMI_27M clock
On i.MX8MP, internal HDMI 27M clock is actually 24MHz, so rename
the IMX8MP_CLK_HDMI_27M to IMX8MP_CLK_HDMI_24M.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-02-24 10:08:36 +08:00
Anson Huang 64bee9c6cd clk: imx8mp: Include slab.h instead of clkdev.h
slab.h is necessary and included indirectly by clkdev.h,
actually, there is nothing in use from clkdev.h, so just
include slab.h instead of clkdev.h.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-02-19 10:19:13 +08:00
Anson Huang 680fbce528 clk: imx8mp: Add missing of_node_put()
After finishing using device node got from of_find_compatible_node(),
of_node_put() needs to be called.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Stephen Boyd <sboyd@kernel.org>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-02-17 14:37:54 +08:00
Peng Fan 14875e57d8 clk: imx: imx8mp: add ocotp root clk
Add ocotp root clk, then when using nvmem to read fuse, clk
could be managed.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-02-14 09:50:16 +08:00
Anson Huang 9c140d9926 clk: imx: Add support for i.MX8MP clock driver
Add clock driver support for i.MX8MP which is a new SoC of i.MX8M
family.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Abel Vesa <abel.vesa@nxp.com>
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
2020-01-12 14:07:36 +08:00