1
0
Fork 0
Commit Graph

4564 Commits (redonkable)

Author SHA1 Message Date
Peng Fan 4fa37208c0 MLK-18205-5 clk: imx: add i.MX8MM clock driver support
Add i.MX8MM clock driver support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Cosmin-Gabriel Samoila <cosmin.samoila@nxp.com>
Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Ranjani Vaidyanathan c7b110368d MLK-18220-3 XRDC: Fix the power domains for Audio clocks.
Ensure the audio clocks are associated with the correct power domain.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang e06889b73b MLK-18208-2 clk: imx: imx8qxp: remove unused clocks
Latest SCFW has requirement that whenever trying
access a resource, its power MUST be turned ON,
otherwise, XRDC will block such access and cause
kernel dump like below, this patch removes those
unused clocks to avoid such dump during kernel clock
framework trying to disable unused clocks, as these
clocks' power domains are NOT enabled because no device
use them now.

[    7.236611] Unhandled fault: synchronous external abort (0x96000210) at 0xffff000009fb0000
[    7.244875] Internal error: : 96000210 [#1] PREEMPT SMP
[    7.250102] Modules linked in:
[    7.253165] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.88-04869-ga28143b-dirty #129
[    7.261082] Hardware name: Freescale i.MX8QXP MEK (DT)
[    7.266218] task: ffff80083a088000 task.stack: ffff80083a034000
[    7.272144] PC is at clk_gate2_scu_is_enabled+0x30/0x74
[    7.277365] LR is at clk_gate2_scu_is_enabled+0x5c/0x74
[    7.282585] pc : [<ffff0000084f462c>] lr : [<ffff0000084f4658>] pstate: 800000c5
[    7.289977] sp : ffff80083a037d40
[    7.293287] x29: ffff80083a037d40 x28: ffff0000091e3508
[    7.298612] x27: ffff0000093ea000 x26: ffff00000918045c
[    7.303937] x25: ffff0000091e3560 x24: ffff0000093ea000
[    7.309263] x23: ffff0000091743d0 x22: ffff0000094152f8
[    7.314588] x21: ffff000009415000 x20: ffff80083a48c500
[    7.319914] x19: ffff80083a48d800 x18: ffff000008e102f8
[    7.325239] x17: 0000000000000000 x16: 0000000000000000
[    7.330564] x15: 0000000000000000 x14: 0000000000000000
[    7.335890] x13: 0000000000000007 x12: 00000000000001ee
[    7.341215] x11: 0000000000000006 x10: 00000000000001ef
[    7.346541] x9 : 0000000000000006 x8 : 2c6e69616d6f645f
[    7.351866] x7 : 0000000000000020 x6 : ffff000008cb1400
[    7.357192] x5 : 0000000000000008 x4 : 0000000000000000
[    7.362517] x3 : 0000000000000000 x2 : 0000000000000001
[    7.367843] x1 : ffff000009fb0000 x0 : 0000000000000000
[    7.373167]
[    7.374655] Process swapper/0 (pid: 1, stack limit = 0xffff80083a034020)
[    7.381354] Stack: (0xffff80083a037d40 to 0xffff80083a038000)
[    7.387099] 7d40: ffff80083a037d60 ffff0000084e1994 0000000000000040 ffff80083a45c300
[    7.394934] 7d60: ffff80083a037d80 ffff0000084e1930 ffff80083a48c500 ffff80083a45c200
[    7.402770] 7d80: ffff80083a037da0 ffff0000084e1a0c ffff80083a4003a8 ffff80083a45c200
[    7.410606] 7da0: ffff80083a037dd0 ffff000008084144 ffff80083a034000 ffff0000084e19c8
[    7.418442] 7dc0: 0000000000000000 ffff0000091e34d0 ffff80083a037e40 ffff000009180d00
[    7.426278] 7de0: ffff000009251028 0000000000000007 0000000000000198 ffff0000091e34d0
[    7.434115] 7e00: ffff80083a037e00 ffff000008fd0198 ffff80083a037e20 ffff000008fcf9e8
[    7.441950] 7e20: 0000000700000007 0000000000000000 0000000000000000 ffff0000091743d0
[    7.449787] 7e40: ffff80083a037ea0 ffff000008c4b554 ffff000008c4b544 0000000000000000
[    7.457622] 7e60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.465459] 7e80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.473295] 7ea0: 0000000000000000 ffff000008083820 ffff000008c4b544 0000000000000000
[    7.481131] 7ec0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.488967] 7ee0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.496803] 7f00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.504639] 7f20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.512475] 7f40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.520311] 7f60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.528148] 7f80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.535984] 7fa0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.543820] 7fc0: 0000000000000000 0000000000000005 0000000000000000 0000000000000000
[    7.551656] 7fe0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.559489] Call trace:
[    7.561933] Exception stack(0xffff80083a037b70 to 0xffff80083a037ca0)
[    7.568370] 7b60:                                   ffff80083a48d800 0000ffffffffffff
[    7.576199] 7b80: ffff80083a037d40 ffff0000084f462c 0000000000000007 ffff000000000000
[    7.584034] 7ba0: ffff000009fb0000 0000000000000000 ffff0000093f41c8 00000000000000c0
[    7.591871] 7bc0: ffff80083a037cc0 ffff80083a037cc0 ffff80083a037c80 00000000ffffffc8
[    7.599707] 7be0: ffff80083a037c10 ffff00000816f824 ffff80083a037cc0 ffff80083a037cc0
[    7.607543] 7c00: ffff80083a037c80 00000000ffffffc8 0000000000000000 ffff000009fb0000
[    7.615379] 7c20: 0000000000000001 0000000000000000 0000000000000000 0000000000000008
[    7.623215] 7c40: ffff000008cb1400 0000000000000020 2c6e69616d6f645f 0000000000000006
[    7.631051] 7c60: 00000000000001ef 0000000000000006 00000000000001ee 0000000000000007
[    7.638887] 7c80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.646725] [<ffff0000084f462c>] clk_gate2_scu_is_enabled+0x30/0x74
[    7.652998] [<ffff0000084e1994>] clk_disable_unused_subtree+0x8c/0xc0
[    7.659442] [<ffff0000084e1930>] clk_disable_unused_subtree+0x28/0xc0
[    7.665888] [<ffff0000084e1a0c>] clk_disable_unused+0x44/0x130
[    7.671728] [<ffff000008084144>] do_one_initcall+0x38/0x128
[    7.677307] [<ffff000009180d00>] kernel_init_freeable+0x1ac/0x248
[    7.683403] [<ffff000008c4b554>] kernel_init+0x10/0xf8
[    7.688545] [<ffff000008083820>] ret_from_fork+0x10/0x30
[    7.693854] Code: b9418420 35000200 f9400e61 b40001c1 (b9400021)
[    7.699969] ---[ end trace 510c6d25aa9fc50a ]---
[    7.704600] note: swapper/0[1] exited with preempt_count 1
[    7.710119] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    7.710119]
[    7.719253] SMP: stopping secondary CPUs
[    7.723175] Kernel Offset: disabled
[    7.726662] Memory Limit: none
[    7.729715] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    7.729715]

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 4874b797d7 MLK-18208-1 clk: imx: imx8qm: remove unused clocks
Latest SCFW has requirement that whenever trying
access a resource, its power MUST be turned ON,
otherwise, XRDC will block such access and cause
kernel dump like below, this patch removes those
unused clocks to avoid such dump during kernel clock
framework trying to disable unused clocks, as these
clocks' power domains are NOT enabled because no device
use them now.

[    7.300474] Unhandled fault: synchronous external abort (0x96000210) at 0xffff00000ab40000
[    7.308736] Internal error: : 96000210 [#1] PREEMPT SMP
[    7.313955] Modules linked in:
[    7.317018] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.9.88-04869-ga28143b-dirty #127
[    7.324936] Hardware name: Freescale i.MX8QM MEK (DT)
[    7.329984] task: ffff8008f60a8000 task.stack: ffff8008f6034000
[    7.335910] PC is at clk_gate2_scu_is_enabled+0x30/0x74
[    7.341131] LR is at clk_gate2_scu_is_enabled+0x5c/0x74
[    7.346352] pc : [<ffff0000084f4664>] lr : [<ffff0000084f4690>] pstate: 800001c5
[    7.353743] sp : ffff8008f6037d40
[    7.357053] x29: ffff8008f6037d40 x28: ffff0000091e3508
[    7.362379] x27: ffff0000093ea000 x26: ffff00000918045c
[    7.367704] x25: ffff0000091e3560 x24: ffff0000093ea000
[    7.373030] x23: ffff0000091743f0 x22: ffff0000094152f8
[    7.378355] x21: ffff000009415000 x20: ffff8008f6575d00
[    7.383680] x19: ffff8008f65b9900 x18: ffff000008e102f8
[    7.389006] x17: 0000000000000000 x16: 0000000000000000
[    7.394331] x15: 0000000000000000 x14: 0000000000000000
[    7.399657] x13: 0000000000000007 x12: 00000000000002ce
[    7.404982] x11: 0000000000000006 x10: 00000000000002cf
[    7.410307] x9 : 0000000000000006 x8 : 2c6e69616d6f645f
[    7.415633] x7 : 0000000000000020 x6 : ffff000008cb1400
[    7.420958] x5 : 0000000000000008 x4 : 0000000000000000
[    7.426284] x3 : 0000000000000000 x2 : 0000000000000001
[    7.431609] x1 : ffff00000ab40000 x0 : 0000000000000000
[    7.436935]
[    7.438421] Process swapper/0 (pid: 1, stack limit = 0xffff8008f6034020)
[    7.445120] Stack: (0xffff8008f6037d40 to 0xffff8008f6038000)
[    7.450864] 7d40: ffff8008f6037d60 ffff0000084e1994 0000000000000140 ffff8008f663be00
[    7.458691] 7d60: ffff8008f6037d80 ffff0000084e1930 ffff8008f6575d00 ffff8008f663bd00
[    7.466518] 7d80: ffff8008f6037da0 ffff0000084e1a0c ffff8008f66455a8 ffff8008f663bd00
[    7.474346] 7da0: ffff8008f6037dd0 ffff000008084144 ffff8008f6034000 ffff0000084e19c8
[    7.482173] 7dc0: 0000000000000000 ffff0000091e34d0 ffff8008f6037e40 ffff000009180d00
[    7.490000] 7de0: ffff000009251028 0000000000000007 0000000000000198 ffff0000091e34d0
[    7.497828] 7e00: ffff8008f6037e00 ffff000008fd0198 ffff8008f6037e20 ffff000008fcf9e8
[    7.505655] 7e20: 0000000700000007 0000000000000000 0000000000000000 ffff0000091743f0
[    7.513483] 7e40: ffff8008f6037ea0 ffff000008c4b62c ffff000008c4b61c 0000000000000000
[    7.521310] 7e60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.529137] 7e80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.536965] 7ea0: 0000000000000000 ffff000008083820 ffff000008c4b61c 0000000000000000
[    7.544792] 7ec0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.552619] 7ee0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.560447] 7f00: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.568274] 7f20: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.576102] 7f40: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.583929] 7f60: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.591757] 7f80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.599584] 7fa0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.607411] 7fc0: 0000000000000000 0000000000000005 0000000000000000 0000000000000000
[    7.615239] 7fe0: 0000000000000000 0000000000000000 ffffffffffffffff 7fff7f7fffffffff
[    7.623065] Call trace:
[    7.625508] Exception stack(0xffff8008f6037b70 to 0xffff8008f6037ca0)
[    7.631945] 7b60:                                   ffff8008f65b9900 0000ffffffffffff
[    7.639773] 7b80: ffff8008f6037d40 ffff0000084f4664 0000000000000007 ffff000000000000
[    7.647600] 7ba0: ffff00000ab40000 0000000000000000 ffff0000093f41c8 00000000000001c0
[    7.655428] 7bc0: ffff8008f6037cc0 ffff8008f6037cc0 ffff8008f6037c80 00000000ffffffc8
[    7.663255] 7be0: ffff8008f6037c10 ffff00000816f824 ffff8008f6037cc0 ffff8008f6037cc0
[    7.671083] 7c00: ffff8008f6037c80 00000000ffffffc8 0000000000000000 ffff00000ab40000
[    7.678910] 7c20: 0000000000000001 0000000000000000 0000000000000000 0000000000000008
[    7.686737] 7c40: ffff000008cb1400 0000000000000020 2c6e69616d6f645f 0000000000000006
[    7.694565] 7c60: 00000000000002cf 0000000000000006 00000000000002ce 0000000000000007
[    7.702392] 7c80: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[    7.710221] [<ffff0000084f4664>] clk_gate2_scu_is_enabled+0x30/0x74
[    7.716486] [<ffff0000084e1994>] clk_disable_unused_subtree+0x8c/0xc0
[    7.722930] [<ffff0000084e1930>] clk_disable_unused_subtree+0x28/0xc0
[    7.729367] [<ffff0000084e1a0c>] clk_disable_unused+0x44/0x130
[    7.735199] [<ffff000008084144>] do_one_initcall+0x38/0x128
[    7.740778] [<ffff000009180d00>] kernel_init_freeable+0x1ac/0x248
[    7.746875] [<ffff000008c4b62c>] kernel_init+0x10/0xf8
[    7.752015] [<ffff000008083820>] ret_from_fork+0x10/0x30
[    7.757325] Code: b9418420 35000200 f9400e61 b40001c1 (b9400021)
[    7.763429] ---[ end trace bfe5d53d2c12087e ]---
[    7.768052] note: swapper/0[1] exited with preempt_count 1
[    7.773559] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
[    7.773559]
[    7.782689] SMP: stopping secondary CPUs
[    7.786616] Kernel Offset: disabled
[    7.790099] Memory Limit: none
[    7.793151] ---[ end Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Ye Li <ye.li@nxp.com>
2018-10-29 11:10:38 +08:00
Weiguang Kong a8393121b0 MLK-17747: dsp: use the name of dsp instead of hifi
In order to avoid the name problem going forward with
integration with Qcom, Qcom has their own dsp and hifi
is competitor, so the hifi name should not be used in
our code.

So use the name of dsp instead of hifi to fix this
problem.

Signed-off-by: Weiguang Kong <weiguang.kong@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping 1f475a0873 MLK-17971 clk: imx: fix pll set rate failure issue on imx7ulp
The logic of 'if' check for the mult is wrong, this will lead
to set rate to PLL type failed. Additionally, remove the
unnecessary 'CLK_IS_CRITICAL' flags.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou 1fa70abe5e MLK-17929: CI_PI: Correct clock register for CI_PI ss
Correct pixel and ipg clock register for CI_PI ss

Reviewed-by: ranjani.vaidyanathan <ranjani.vaidyanathan@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
2018-10-29 11:10:38 +08:00
Yuchou Gan 33df3945cd MGS-3786 [#ccc] Cncrease the clock rate of GPU3D/GPU2D for 7ulp B0 board
The gpu3d/2d clock rate for 7ulp B0 board is 400M, increase it

Signed-off-by: yuchou gan <yuchou.gan@nxp.com>
2018-10-29 11:10:38 +08:00
Haibo Chen f4690793d4 MLK-17586-4 ARM: dts: improve usdhc root clock rate
Confirm with IC, HS400 MAX clock Freq for Instance 0 is 198Mhz
and for Instance 1 is 192MHz, so set the usdhc parent clock at
396MHz, due to current APLL is config to 529.2MHz, use the formula
APLL_PFD clock = APLL * 18 / i, the nearest clock is 381.024MHz when
the i is 25, so the usdhc root clock is 190.512MHz.

But eMMC HS400 can't pass stress test at 190.512MHz, will meet CRC
error sometimes, only when down to 176.4MHz can pass the stress test.

This patch make the usdhc0 and usdhc1 root clock both source from
IMX7ULP_CLK_APLL_PFD1, and set this APLL_PFD1 clcok rate at 352.8MHz,
and set the USDHC0 root clock at 352.8MHz, and set the USDHC1 root
clock at 176.4MHz.

Also remove the clk_prepare_enable() and clk_disable_unprepare() for
APLL_PFD2, bacause U-Boot already gate off APLL_PFD1, not need to do
this again.

Acked-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Guoniu.Zhou f511fb1c39 MLK-17230-1: CI_PI: register clocks for CI_PI ss
Register clocks for CI_PI subsystem.

Reviewed-by: Sandor.Yu <sandor.yu@nxp.com>
Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
(cherry picked from commit d29308ec4fa29addd049c114520d7628e9e921d7)
2018-10-29 11:10:38 +08:00
Richard Zhu ed8f3d102b MLK-17815-2 ata: imx: imx8qm: configure phy impedance ratio
- To save power consumption, PHY related CLKs can be
gated off after the configurations are done.
- The impedance ratio should be configured refer to
differnet REXT values.
0x6c <--> REXT valuse is 85Ohms
Default values 0x80 <--> REXT value is 100Ohms.
- IMX8QM_HSIO_PHY_X1_APB_CLK is mandatory required when
access SATA PHY registers. Change the power domain to SATA.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Peng Fan 5e447a71d5 MLK-17787 clk: imx: gate-scu: fix return code
The sc api error code is not compatible with Linux error code,
directly returning the sc api error code to caller is wrong.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Laurentiu Palcu c1a1a0fafd MLK-17634-10: clk: imx8m: add support for 27MHz phy clock and fix pll2 round/set rate functions
The SSCG PLL2 is identical to PLL1, hence make the rounding/setting
functions reflect that.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2018-10-29 11:10:38 +08:00
Laurentiu Palcu 6ac1f994cc MLK-17634-9: clk: imx8m: add VIDEO2_PLL2 clock tree
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 0ff8d2564c MLK-17626 Use DEFINE_SPINLOCK for imx_ccm_lock
If spinlock debug is enabled there are BUG_ON asserts in
place for default values on the spinlock_t members.
DEFINE_SPINLOCK declares and initializes the spinlock and
avoids triggering those.

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Tested-by: Marius Vlad <marius-cristian.vlad@nxp.com>
Acked-By: Marius Vlad <marius-cristian.vlad@nxp.com>
2018-10-29 11:10:38 +08:00
Ranjani Vaidyanathan 650a7291bd MLK-17561-3 clk:imx8: Update to the latest SCFW API based on commit 97b8a6ee
commit 97b8a6eed4eee19ec8a60dedfffc2f5f3d8933c5
Author: Chuck Cannon <chuck.cannon@freescale.com>
Date:   Tue Feb 6 08:54:16 2018 -0600

Add unique ID API call. Required to get info needed for SECO fuse
programming. Added info command to DM.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping d636de6fb2 MLK-17590-01 driver: clk: imx: update the clk flag of pll
Add CLK_GET_RATE_NOCACHE and CLK_SET_RATE_GATE for sscg pll.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 1a633aacc0 MLK-17491-50 clk: imx7ulp: remove the duplicated clk-gate-exclusive.o in Makefile
remove the duplicated clk-gate-exclusive.o in Makefile

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng f73ede44ed MLK-17491-49 clk: imx7ulp: fix watchdog 2 clock name typo
Fix watchdog 2 clock name typo

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 047328f236 MLK-17491-48 clk: imx7ulp: fix the wrong periph_bus_sels clocks
According to the clk digram in section 24.6 Core, Platform and System Bus
clocks in reference manual, the correct available periph_bus_sels should be
{ "dummy", "sosc_bus_clk", "mpll", "firc_bus_clk", "rosc", "nic1_bus",
"nic1_div", "spll_bus_clk", }.

And the real tpm/pwm/lpuart parent clock should be IMX7ULP_CLK_SOSC_BUS_CLK
while some others should be IMX7ULP_CLK_FIRC_BUS_CLK, So update dts as well.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 9030981e76 MLK-17491-47 dts: imx7ulp: correct the periph_slow_sels clock name
According to the clk digram in section 24.6 Core, Platform and System Bus
clocks in reference manual, periph_slow_sels should be better renamed to
periph_bus_sels to avoid confusing.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 4ffaf007dc MLK-17491-46 clk: imx7ulp: add missing sosc_bus_clk/firc_bus_clk/spll_bus_clk clocks
Add missing sosc_bus_clk/firc_bus_clk/spll_bus_clk clocks which will be used
by other devices later.

All these clocks use the same divider as ddr_div, so ulp_div_table is used.
Besides that, all these clocks need to be controlled by M4, so
CLK_DIVIDER_READ_ONLY is also specified.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 644103a4c5 MLK-17491-45 clk: imx7ulp: fix nic0_div/nic1_div/nic1_bus clock types
According to reference manual, none of them should specify CLK_SET_RATE_GATE,
So switch them to imx_clk_divider_flags with only CLK_SET_RATE_PARENT kept.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng d94b75f6d5 MLK-17491-44 clk: imx7ulp: fix sys_sel/hsrun_sys_sel/ddr_sel/nic_sel clock types
According to reference manual, all these mux clocks requires operation
with their parent clocks were enabled previously.
So switch them to imx_clk_mux2 type which has CLK_OPS_PARENT_ENABLE
flag. Also remark some critical clocks in case they're disabled.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng cd22472145 MLK-17491-43 clk: imx7ulp: fix ddr_div clock definitions
According RM, ddr_div clock actually is not CLK_DIVIDER_ONE_BASED type,
we need use a clk_div_table to handle its special divider value.

Besides that, due to 0 DDRDIV means output is disabled, so we also need
specify CLK_DIVIDER_ZERO_GATE for it.

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 7ad039e745 MLK-17491-42 clk: imx7ulp: fix the wrong gpio clocks definition
Current imx_clk_composite used for GPIO clock definition is wrong
as GPIO has no mux support according to reference manual.
Instead, we can only use imx_clk_gate for it.

This patch also fixes some code indent issue.

Fixes: ("1a86f07ce6a2 MLK-13485-4 clk: imx7ulp: add gpio port control clocks")
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng ed7e58f9ac MLK-17491-41 clk: imx7ulp: do not keep GPIO clocks always on in clks_init_on
Since patch ("gpio-vf610: add getting necessary clocks support"),
GPIO clocks will be handled by its driver.
No need put them in clks_init_on which should be only for system
critical clocks.

Fixes: ("1a86f07ce6a2 MLK-13485-4 clk: imx7ulp: add gpio port control clocks")
Acked-by: Peter Chen <peter.chen@nxp.com>
Reviewed-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng cf5c618add MLK-17491-39 clk: imx: remove private clk-frac-divider
Kernel already supports fractional divider and we switched to it.
See: drivers/clk/clk-fractional-divider.c
So no need keep our private clk-frac-divider copy now which functions
the same, delete it.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng fef6b41b03 MLK-17491-38 clk: imx: clk-composite: code cleanup and improvement
1) reorder headfile
2) remove unused headfile
3) remove unused macro
4) replace magic number by macro
5) fix code indent issue
6) reorder local variables
7) remove unnessary error message

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng e926ed86ac MLK-17491-37 clk: imx: clk-composite: using kernel fractional divider instead of our own
Kernel already supports fractional divider.
See: drivers/clk/clk-fractional-divider.c

After patch: ("clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED
flag support"), it can supports ZERO based dividers now which be used by
IMX ULP.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 7d5983455b MLK-17491-36 clk: reparent orphans after critical clocks enabled
The orphan clocks reparent operation should be moved after the critical
clocks enabled, otherwise it may get a chance to disable a newly
registered critical clock which triggers the following warning.

Assuming we have two clocks: A and B, B is the parent of A.
Clock A has flag: CLK_OPS_PARENT_ENABLE
Clock B has flag: CLK_IS_CRITICAL

Step 1:
Clock A is registered, then it becomes orphan.

Step 2:
Clock B is registered. Before clock B reach the critical clock enable
operation, orphan A will find the newly registered parent B and do
reparent operation, then parent B will be finally disabled in
__clk_set_parent_after() due to CLK_OPS_PARENT_ENABLE flag as there's
still no users of B which will then trigger the following warning.

[    0.000000] WARNING: CPU: 0 PID: 0 at drivers/clk/clk.c:597 clk_core_disable+0xb4/0xe0
[    0.000000] Modules linked in:
[    0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc1-00056-gdff1f66-dirty #1373
[    0.000000] Hardware name: Generic DT based system
[    0.000000] Backtrace:
[    0.000000] [<c010c4bc>] (dump_backtrace) from [<c010c764>] (show_stack+0x18/0x1c)
[    0.000000]  r6:600000d3 r5:00000000 r4:c0e26358 r3:00000000
[    0.000000] [<c010c74c>] (show_stack) from [<c040599c>] (dump_stack+0xb4/0xe8)
[    0.000000] [<c04058e8>] (dump_stack) from [<c0125c94>] (__warn+0xd8/0x104)
[    0.000000]  r10:c0c21cd0 r9:c048aa78 r8:00000255 r7:00000009 r6:c0c1cd90 r5:00000000
[    0.000000]  r4:00000000 r3:c0e01d34
[    0.000000] [<c0125bbc>] (__warn) from [<c0125d74>] (warn_slowpath_null+0x28/0x30)
[    0.000000]  r9:00000000 r8:ef00bf80 r7:c165ac4c r6:ef00bf80 r5:ef00bf80 r4:ef00bf80
[    0.000000] [<c0125d4c>] (warn_slowpath_null) from [<c048aa78>] (clk_core_disable+0xb4/0xe0)
[    0.000000] [<c048a9c4>] (clk_core_disable) from [<c048be88>] (clk_core_disable_lock+0x20/0x2c)
[    0.000000]  r4:000000d3 r3:c0e0af00
[    0.000000] [<c048be68>] (clk_core_disable_lock) from [<c048c224>] (clk_core_disable_unprepare+0x14/0x28)
[    0.000000]  r5:00000000 r4:ef00bf80
[    0.000000] [<c048c210>] (clk_core_disable_unprepare) from [<c048c270>] (__clk_set_parent_after+0x38/0x54)
[    0.000000]  r4:ef00bd80 r3:000010a0
[    0.000000] [<c048c238>] (__clk_set_parent_after) from [<c048daa8>] (clk_register+0x4d0/0x648)
[    0.000000]  r6:ef00d500 r5:ef00bf80 r4:ef00bd80 r3:ef00bfd4
[    0.000000] [<c048d5d8>] (clk_register) from [<c048dc30>] (clk_hw_register+0x10/0x1c)
[    0.000000]  r9:00000000 r8:00000003 r7:00000000 r6:00000824 r5:00000001 r4:ef00d500
[    0.000000] [<c048dc20>] (clk_hw_register) from [<c048e698>] (_register_divider+0xcc/0x120)
[    0.000000] [<c048e5cc>] (_register_divider) from [<c048e730>] (clk_register_divider+0x44/0x54)
[    0.000000]  r10:00000004 r9:00000003 r8:00000001 r7:00000000 r6:00000003 r5:00000001
[    0.000000]  r4:f0810030
[    0.000000] [<c048e6ec>] (clk_register_divider) from [<c0d3ff58>] (imx7ulp_clocks_init+0x558/0xe98)
[    0.000000]  r7:c0e296f8 r6:c165c808 r5:00000000 r4:c165c808
[    0.000000] [<c0d3fa00>] (imx7ulp_clocks_init) from [<c0d24db0>] (of_clk_init+0x118/0x1e0)
[    0.000000]  r10:00000001 r9:c0e01f68 r8:00000000 r7:c0e01f60 r6:ef7f8974 r5:ef0035c0
[    0.000000]  r4:00000006
[    0.000000] [<c0d24c98>] (of_clk_init) from [<c0d04a50>] (time_init+0x2c/0x38)
[    0.000000]  r10:efffed40 r9:c0d61a48 r8:c0e78000 r7:c0e07900 r6:ffffffff r5:c0e78000
[    0.000000]  r4:00000000
[    0.000000] [<c0d04a24>] (time_init) from [<c0d00b8c>] (start_kernel+0x218/0x394)
[    0.000000] [<c0d00974>] (start_kernel) from [<6000807c>] (0x6000807c)
[    0.000000]  r10:00000000 r9:410fc075 r8:6000406a r7:c0e0c930 r6:c0d61a44 r5:c0e07918
[    0.000000]  r4:c0e78294
[    0.000000] ---[ end trace 0000000000000000 ]---

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 8348172898 MLK-17491-35 clk: fractional-divider: add CLK_FRAC_DIVIDER_ZERO_BASED flag support
Adding CLK_FRAC_DIVIDER_ZERO_BASED flag to indicate the numerator and
denominator value in register are start from 0.

This can be used to support frac dividers like below:
Divider output clock = Divider input clock x [(frac +1) / (div +1)]
where frac/div in register is:
000b - Divide by 1.
001b - Divide by 2.
010b - Divide by 3.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 3213cec014 MLK-17491-34 clk: clk-divider: add CLK_DIVIDER_ZERO_GATE clk support
For dividers with zero indicating clock is disabled, instead of giving a
warning each time like "clkx: Zero divisor and CLK_DIVIDER_ALLOW_ZERO not
set" in exist code, we'd like to introduce enable/disable function for it.
e.g.
000b - Clock disabled
001b - Divide by 1
010b - Divide by 2
...

Set rate when the clk is disabled will cache the rate request and only
when the clk is enabled will the driver actually program the hardware to
have the requested divider value. Similarly, when the clk is disabled we'll
write a 0 there, but when the clk is enabled we'll restore whatever rate
(divider) was chosen last.

It does mean that recalc rate will be sort of odd, because when the clk is
off it will return 0, and when the clk is on it will return the right rate.
So to make things work, we'll need to return the cached rate in recalc rate
when the clk is off and read the hardware when the clk is on.

NOTE for the default off divider, the recalc rate will still return 0 as
there's still no proper preset rate. Enable such divider will give user
a reminder error message.

Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 33cdd4a3a5 MLK-17491-33 clk: imx: clk-pfdv2: need wait lock stable for PFD
Add the required wait lock stable for PLL.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 0a8ed3b0fc MLK-17491-32 clk: imx: clk-pfdv2: fix the possible sychronization issue
Clk core using different locks for clk_enable/disable and clk_set_rate.
Driver should protect them if accessing the same resource.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 4cbf394ecd MLK-17491-31 clk: imx: clk-pfdv2: add error checking for invalid pfd index
Give a warning when get an invalid pfd index.

Cc: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 2d2b2ac6e1 MLK-17491-30 clk: imx: clk-pfdv2: improve the code readability
Remove the complicated and unreadable arithmetic calculation code.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 19cc30653e MLK-17491-29 clk: imx: clk-pfdv2: fix the wrong pfd rate exported
There's no meaning to fake a wrong rate to recalc.
Instread, simply return 0 for this case.

Before:
    spll_pre_sel                          1            1    24000000          0 0
       spll_pre_div                       1            1    24000000          0 0
          spll                            2            2   531648000          0 0
             spll_pfd3                    0            0   979729408          0 0
             spll_pfd2                    0            0   979729408          0 0
             spll_pfd1                    0            0   979729408          0 0
             spll_pfd0                    1            1   416072347          0 0

After:
    spll_pre_sel                          1            1    24000000          0 0
       spll_pre_div                       1            1    24000000          0 0
          spll                            2            2   531648000          0 0
             spll_pfd3                    0            0           0          0 0
             spll_pfd2                    0            0           0          0 0
             spll_pfd1                    0            0           0          0 0
             spll_pfd0                    1            1   416072347          0 0

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng baab3994f5 MLK-17491-28 clk: imx: clk-pfdv2: add missing CLK_SET_RATE_GATE flag
According to reference manual, pfdv2 can't set rate without gating clock.
So we should add CLK_SET_RATE_GATE flag accordingly.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 6990bebd16 MLK-17491-27 clk: imx: clk-pllv4: need wait lock stable for PLL
Add the required wait lock stable for PLL.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 47e2cfbcf8 MLK-17491-26 clk: imx: clk-pllv4: fix the multiplier name
Currently using 'div' name for the PLL multiplier defined in RM which is a
bit confusing. So fix it.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng a03c1a416c MLK-17491-25 clk: imx: clk-pllv4: remove meaningless register members
There's no meaning to add members for fixed register offset and mask.
This using seems to be derived from MX6 PLL code but not suitable for
ULP up till now.

Cc: Anson Huang <Anson.Huang@nxp.com>
Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 6e6869b7de MLK-17491-24 clk: imx: clk-pllv4: fix the wrong mult values used
According to reference manual, the Valid MULT values are 33, 27, 22,
20, 17, 16. Not the ranges from 16 to 30 currently used.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 442a0842c9 MLK-17491-23 clk: imx: clk-pllv4: fix wrong return of clk_pllv4_is_enabled
PLL_EN bit set means pll enabled, not disabled.

Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 53a904c2b4 MLK-17491-22 clk: imx: clk-pllv4: add the missing CLK_SET_RATE_GATE
According to reference manual, this pll can't set rate without gating
clock. So we should add CLK_SET_RATE_GATE flag accordingly.

Cc: Anson Huang <Anson.Huang@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Fixes: 78ef764871d6 ("MLK-13441-5 ARM: imx: add new clk types")
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng fc24da6cdb MLK-17491-21 clk: imx7ulp: fix RTC OSC clock name
'CKIL' clock name is derived from MX6 SoC series which is invalid for
MX7ULP (can't find it from RM). Changing it to the correct 'ROSC'
which is defined in RM.

The exist 'OSC' name is also changed accordingly which should be SOSC
(System OSC).

Fixes: aacf0b70af26 ("MLK-13441-6 ARM: imx: add i.mx7ulp clock driver")
Cc: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu 444cae4e3d MLK-17461-2: clk: create imx8qm hdmi_pixel_select clocks
Add hdmi_pxl_sel clocks.
Add av_pll_bypass clock.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 0f1c0f8270 MLK-17452 clk: imx: imx7ulp: update nic1_divbus clock for B0
On i.MX7ULP B0 chip, nic1_divbus's parent is changed to
from nic0_div directly, update it accordingly.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Ranjani Vaidyanathan 0e739be173 MLK-17363-1 imx8: pm-domain: fix clock parent restore issue after suspend/resume
Currently the clock parent actually is failed to be restored in power
domain driver due to the set_parent will bail out early as the clk core
already cached the same old parent.

Implement a CLK_SET_PARENT_NOCACHE flag in clk core and register all
SC mux clocks with this flag to make sure the clk core won't bypass
the SC clock parent setting.

[ Aisheng: "Add commit message" ]

Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu fcef7dccae MLK-17341-4: clk: Rename mipi csi i2c power domain name
rename mipi csi i2c power domain name

Acked-by: Fugang Duan <fugang.duan@nxp.com>
Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 7e6ae1ea27 MLK-17293-5 clk: imx7ulp: adjust clk tree for B0 chip
On i.MX7ULP B0 chip, snvs is located in M4 domain, remove
snvs clock from linux clock tree;

Use SMC PMCTRL RUNM field for ARM clock mux instead
of reserved register in SCG, as when CPU frequency changes,
RUNM field will switch between RUN and HSRUN, ARM clock
source will be changed accordingly, so RUNM can be used as
a clock mux.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Ye Li c16789985e MLK-17221 clk: imx8mq: Add shared gate for apbh-dma and gpmi clocks
The CCGR RAWNAND is shared by apbh-dma and gpmi clocks, so must use
imx_clk_gate2_shared2 to produce two clocks. Otherwise, apbh-dma clock
won't be enabled individually.

Signed-off-by: Ye Li <ye.li@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 1247ba53ae MLK-17188-1 clk: imx: imx8qxp: add uSDHC clock MUX
Add uSDHC clock MUX to allow uSDHC driver to select
parent, currently only support PLL0 and PLL1 as
uSDHC clock's parent.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Tested-by: Haibo Chen <haibo.chen@nxp.com>
2018-10-29 11:10:38 +08:00
Ye Li 2a252d14c0 MLK-17158-1 drivers: clk: imx: Add RAWNAND root clock
i.MX8MQ CCGR has a clock enable signal for RAWNAND. Add this RAWNAND root
clock to clock tree.

Signed-off-by: Ye Li <ye.li@nxp.com>
2018-10-29 11:10:38 +08:00
Liu Ying 804c5c06fd MLK-15110-10 clk: imx: clk-imx8qxp: Add IMX8QXP_DC0_DPR1_APB/B_CLK support
This patch adds IMX8QXP_DC0_DPR1_APB_CLK and IMX8QXP_DC0_DPR1_B_CLK clocks
support.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping c68317cb16 MLK-17104 drivers: clk: imx: change the VPU related clock flags of imx8mq
When the system reaches the passive critical trip point, VPU device cooling
need to change the clock rate on the fly. So change the VPU related clocks
flags to make sure the clock rate can be changed successfully.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Peng Fan 72da679818 MLK-16750-4 clk: imx6sx: keep TZASC clock on
Keep TZASC clock on. With TEE enabled, TZASC enabled, if disable
tzasc clock, system may hang up.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Robby Cai c1d6668c72 MLK-16919-3 driver: clk: add CLKO2 for iMX8MQ
Add CLKO2 for i.MX8MQ
Set parent for MIPI CSI1/2 CORE/PHY_REF/ESC

Signed-off-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu 661c90bd03 MLK-16817-2 PCI: imx: enable the pm on imx8qm/qxp
Enable the pcie pm on imx8qm/qxp

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Anson Huang 46504a27f9 MLK-16804-08 driver: soc: Reduce NOC/AHB/MAIN_AXI to save SOC power for audio playback
reduce the NOC, main AXI and AHB bus clock frequency to save power when DDR enter low
frequency mode. VDDSOC is ~195mA during video play, and ~180mA in idle.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping d0015d1318 MLK-16804-03 driver: clk: Add video pll2 output gate clk on imx8mq
The Video PLL2 has a output enable bit to do clk gate,
So we need to register this gate to save power.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <anson.huang@nxp.com>
2018-10-29 11:10:38 +08:00
Robert Chiras e8737a8816 MLK-16347-11: clk: imx: imx8qxp: Add missing MIPI DSI clocks
Add missing clocks for MIPI-DSI SS: RX_ESC and TX_ESC
Also added the posibility to select clock parents for MIPI-DSI versus
LVDS.
The SCFW was changed, so now the LVDS pixel and phy clocks need to
specify their parrents.
Also, the TX_ESC and RX_ESC clocks from MIPI-DSI need to specify their
parrents in DTS files.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
Signed-off-by: Oliver Brown <oliver.brown@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu 4896d8ca1d MLK-16686-1 clk: imx8mq: add the mu clk
add the mu clock

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Peng Fan fea941f4ef MLK-16746 imx8mq: support m4
Support M4/A53 work together
1. add imx_src_is_m4_enabled
2. introduce a new dts dedicated for m4
3. add more pwm nodes
4. Since clk initialization is at very early stage, add m4 enabled check
   in the beginning of clk code.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping 3321775b05 MLK-16689-01 driver: clk: add dram_core clock on imx8mq
On i.MX8MQ, the dram core clock can be sourced from dram_pll or
the dram_alt clock, when sourced from the dram_alt, it has a fix
divider(1/4). When the DDRC core clock is lower than 800MHz, we
can swith the core clock to dram_alt source.

The dram apb clock's mux option 2 should be sys1_pll_40m, so fixed it.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
Reviewed-by: Anson Huang <Anson.Huang@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping 32df29e80f MLK-16708 clk: imx: change the nand_usdhc_bus clock's source
Change NAND_USDHC_BUS clock's source to SYS PLL1 266M.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu 949948aec0 MLK-16684-2 clk: imx: correct the pd of the sata phy pclk
Correct the pd of the sata phy pclk.

BuildInfo:
- SCFW 9559d5ec, IMX-MKIMAGE 06bc2767, ATF
- U-Boot 2017.03-imx_v2017.03_4.9.51_imx8_beta1+g6dc7b0f

Reviewed-by: Frank Li <frank.li@nxp.com>
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Frank Li a9ca897182 MLK-16645-1: clk: mx8qxp: correct JPEG clock source
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Sandor Yu <sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Dong Aisheng 8594e2f1ff MLK-16606-1 clk: imx8qm: add M4 I2C clocks
There're two M4 I2C instances in MX8QM.

Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu db4c578a14 MLK-16586-1 clk: imx8qm: add the cm41 ipg clk
Add the cm41 ipg clk

BuildInfo:
- SCFW a6fd9a48, IMX-MKIMAGE 0, ATF 0
- U-Boot 2017.03-imx_v2017.03_4.9.11_imx8_alpha+g258936c

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Robin Gong <yibin.gong@nxp.com>
Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com>
Tested-by: Andy Duan <fugang.duan@nxp.com>
2018-10-29 11:10:38 +08:00
Shengjiu Wang 2aaad37f1d MLK-13946-1: clk: imx8qm: fix the definition of HDMI I2S clock
The resource id of HDMI I2S clock is SC_R_HDMI_I2S, and SAI HDMITX
and HDMIRX clock need FUNCTION_NAME paremeter.

Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com>
2018-10-29 11:10:38 +08:00
Richard Zhu 558204d601 MLK-16530-2 clk: imx8qm: add the cm40 ipg clk
Add the cm40 ipg clk
BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu e62910a24e MLK-16538-1: clks: correct ipg_hdmi_clk_root clk parent
Correct imx8qm ipg_hdmi_clk_root clk parent name.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 5d41296b4c MLK-16225: clk: imx8qm: Add fsl,lpcg_base_offset property
Right now the imx8qm clock provider hardcodes physical addresses. In
virtualization scenarios the intermediate physical addresses visible
from a guest can be different. In theory a 1:1 mapping could be done but
that in xen it would overlap with hardcoded guest ram starting at
0x40000000.

Solve this by adding a property with a common offset for all lpcg
areas. This should be set in the guest dts.

In theory each lpcg block could be remapped with it's own offset but
that is not supported.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 0bf9578916 MLK-16225: clk: imx8: Do not register clocks for unowned resources
Registering clocks for unowned resources can result in lots of pointless
scfw errors and potential faults when attempting to use LPCG.

Solve this by checking ownership via sc_rm_is_resource_owned and
returning -ENODEV from clock registration functions. The top-level clock
provider is also modified so that it accepts such errors silently.

This is intended for xen but could also be useful for SCFW partitioning.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez 87c8e7562e MLK-16225: clk: imx8qm: Add LPCG_ADDR macro
All this does is replace the cast from physical address with a macro in
order to make later changes easier.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez c7221ac64e MLK-16225: clk: imx8qm: Ignore imx8qm-acm node missing
This can happen in virtualization scenarios, so just skip registering
the associated clocks instead of failing to boot.

Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Leonard Crestez f7f54e1320 MLK-16225: clk: imx8qm: Remove initial prepare/enable for A-core clk
Signed-off-by: Leonard Crestez <leonard.crestez@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Robert Chiras d7e080bb90 MLK-16056 clk: imx8qm: add new dsi clocks
Add clk for dsi0-i2c1, dsi1-i2c0 and dsi1-i2c1

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 2593bdd319 MLK-16442-2: clk: imx8qm: Add mux for DC clocks.
DC clocks can choose their clock source between PLL1, PLL2 and
bypass input.
This patch introduces a multiplexer in the dc clock topology to
allow this choice and introduces one set of parents that will be used
for both display0 and display1 clocks.

Clock paths tested:
    1. PLL2(dc0_pll1_clk)->DC0_DISP1(dc0_disp1_clk)->LVDS
    2. BYP(dc0_bypass0_clk)->DC0_DISP1(dc0_disp1_clk)->LVDS

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus e4aff55805 MLK-16442-1: clk: clk-mux-scu: Add new mux type.
Display clocks can choose their parrent between various clock sources
(ex pll1, pll2, bypass).

This patch adds a new mux type that uses the underlying support in scfw
to set/get a parent.

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus f711d5b098 MLK-16442-0: clk: imx8: Remove imx_clk_divider2_scu duplicate declaration.
The imx_clk_divider2_scu is declared twice.
Remove the second occurrence.

(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
Reviewed by: Ranjani Vaidyanathan <Ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 0695d71fa7 MLK-16469: clk-imx8qxp: Fix GPT clock hierarchy
This is a change similar to:

'commit 01fdf7bf572b ("MLK-16281-2: clk-imx8qm: Fix GPT clock hierarchy")'
    There are five gpt modules on imx8qm (gpt0 .. gpt4).
    Of these, gpt2 and gpt4 clock hierarchies are inconsistent
    with the rest.
    Having the per clocks (gpt_hf_clk and gpt_clk) as children of the
    peripheral access clock (ipg_s) and bus sync slave clock
    (ipg_slv_clk)
    ensures that the latter are enabled when the driver enables the
    gpt_clk
    (or hf).
    This patch reconciles these two gpt clock trees with the rest.

    Before:

     gpt_2_div
        gpt_2_hf_clk
        gpt_2_ipg_s_clk
           gpt_2_ipg_slv_clk
              gpt_2_clk

     gpt_4_div
        gpt_4_hf_clk
        gpt_4_clk
        gpt_4_ipg_s_clk
           gpt_4_ipg_slv_clk

    After:

     gpt_2_div
        gpt_2_ipg_s_clk
           gpt_2_ipg_slv_clk
              gpt_2_hf_clk
              gpt_2_clk

     gpt_4_div
        gpt_4_ipg_s_clk
           gpt_4_ipg_slv_clk
              gpt_4_hf_clk
              gpt_4_clk

Apply this change  for imx8qxp also which has the same inconsistency
regarding the gpt clocks.
(BuildInfo: SCFW 9e9f6ec6, IMX-MKIMAGE imx8-mu, ATF 0)

Reviewed-by: Anson Huang <anson.huang@nxp.com>
Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00
Zhengyu Shen f661ae56df MLK-16359-2: Change clock power domain for JPEG Encoder/Decoder to match DTS
Clocks use power domains from DTS.

Signed-off-by: Zhengyu Shen <zhengyu.shen_1@nxp.com>
Reviewed-by: Sandor Yu <sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Fugang Duan 564ca4b00a MLK-16471-01 clk: imx8qm/imx8qxp: fix ptp clock parent
Connectivity sbsystem ADD documention Figure 7-2 clock connection
of ENET-AVB has wrong clock connection for ipg_clk_time:
ENETn_CLK_ROOT -> LPCG -> CLKDIV -> ipg_clk_time

Confirm with IC and integration owner, in fact the timer clock path is:
ENETn_CLK_ROOT -> LPCG -> ipg_clk_time

(BuildInfo: SCFW 3e70523d, IMX-MKIMAGE 0, ATF 0)

Signed-off-by: Fugang Duan <fugang.duan@nxp.com>
Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com>
2018-10-29 11:10:38 +08:00
Viorel Suman 80e809014c MLK-16416-1 clk: imx: scu mux: refactor set/get_parent method
The current clk_mux_set_parent_scu() implementation returns error
if device power domain is not enabled. As consequence of this the
existing "assigned-clock-parents" DTS functionality cannot be used for
clk_mux. In order to avoid returning error in "set_parent" the code is
refactored as follows:

a) On "set_parent" the "mux->reg" value is prepared and stored in
   "mux->val" field. The "mux->reg" is updated if power domain is enabled,
   or triggered for update on "prepare" subsequent call otherwise.

b) On "prepare" the power domain status check is performed and "mux->val"
   is stored in "mux->reg" if triggered for update.

c) On "get_parent" the "mux->reg" is not read anymore and "mux->val" is
   used to get the "get_parent" output.

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
Reviewed-by: Ranjani Vaidyanathan <ranjani.vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping a622138ce0 MLK-16367 driver: clk: imx: enable ddrc apb clock always on i.mx8mq
Keep the DDRC APB init on, so we can access the DDRC register.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 8295f8e193 MLK-16281-2: clk-imx8qm: Fix GPT clock hierarchy
There are five gpt modules on imx8qm (gpt0 .. gpt4).
Of these, gpt2 and gpt4 clock hierarchies are inconsistent with the
rest.
Having the per clocks (gpt_hf_clk and gpt_clk) as children of the
peripheral access clock (ipg_s) and bus sync slave clock (ipg_slv_clk)
ensures that the latter are enabled when the driver enables the gpt_clk
(or hf).
This patch reconciles these two gpt clock trees with the rest.

Before:

 gpt_2_div
    gpt_2_hf_clk
    gpt_2_ipg_s_clk
       gpt_2_ipg_slv_clk
          gpt_2_clk

 gpt_4_div
    gpt_4_hf_clk
    gpt_4_clk
    gpt_4_ipg_s_clk
       gpt_4_ipg_slv_clk

After:

 gpt_2_div
    gpt_2_ipg_s_clk
       gpt_2_ipg_slv_clk
          gpt_2_hf_clk
          gpt_2_clk

 gpt_4_div
    gpt_4_ipg_s_clk
       gpt_4_ipg_slv_clk
          gpt_4_hf_clk
          gpt_4_clk

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 777305f3d2 MLK-16281-1: clk-imx8qm: Remove duplicated gpt clocks
Some gpt clocks are defined twice which results in:

 gpt0_div
    gpt0_clk

and also:

 gpt_0_div
    gpt_0_ipg_s_clk
       gpt_0_ipg_slv_clk
          gpt_0_hf_clk
          gpt_0_clk

The second version is correct as per gpt lpcg cell.
This patch removes the first set of clocks.

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping cdaf92d431 MLK-16266-02 ARM: imx: Enhance the code to support new TO for imx6qp
Previous code don't take care about the i.MX6QP revision update of
new TO. So improve the code to include future TO support for i.MX6QP.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Jason Liu f542573a31 MLK-16239 clk: imx: imx8qm/qxp: Adding the missing sentinel value of match table
Need to put the sentinel value to the end of the of_device_id array.
This patch also fixes the following KASAN complains when KASAN is enabled:

[    0.671315] ==================================================================
[    0.678400] BUG: KASAN: global-out-of-bounds in __of_match_node+0x70/0xb8 at addr ffff2000092958a8
[    0.687321] Read of size 1 by task swapper/0/1
[    0.691760] Address belongs to variable imx8qm_match+0xc8/0x260
[    0.697666] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.9.11-03033-ge2e5fb2 #44
[    0.704955] Hardware name: Freescale i.MX8QM ARM2 (DT)
[    0.710081] Call trace:
[    0.712528] [<ffff20000808b438>] dump_backtrace+0x0/0x278
[    0.717907] [<ffff20000808b6c4>] show_stack+0x14/0x20
[    0.722949] [<ffff2000085311ec>] dump_stack+0xa4/0xc8
[    0.727990] [<ffff200008256cbc>] kasan_report_error+0x4c4/0x4d8
[    0.733892] [<ffff2000082570f8>] kasan_report+0x40/0x48
[    0.739103] [<ffff2000082552cc>] __asan_load1+0x4c/0x58
[    0.744318] [<ffff200008d7ac28>] __of_match_node+0x70/0xb8
[    0.749791] [<ffff200008d7aca8>] of_match_node+0x38/0x60
[    0.755088] [<ffff200008d7d870>] of_match_device+0x30/0x50
[    0.760565] [<ffff200008858dbc>] platform_match+0x6c/0x130
[    0.766040] [<ffff200008855dec>] __device_attach_driver+0x5c/0x138
[    0.772205] [<ffff200008852d18>] bus_for_each_drv+0xd0/0x130
[    0.777852] [<ffff2000088557fc>] __device_attach+0x13c/0x1a0
[    0.783499] [<ffff200008855f30>] device_initial_probe+0x10/0x18
[    0.789406] [<ffff200008854608>] bus_probe_device+0xe0/0xf0
[    0.794965] [<ffff200008851310>] device_add+0x5c8/0x818
[    0.800176] [<ffff200008d7dc3c>] of_device_add+0x5c/0x88
[    0.805477] [<ffff200008d7e854>] of_platform_device_create_pdata+0xb4/0x118
[    0.812426] [<ffff200008d7e8cc>] of_platform_device_create+0x14/0x20
[    0.818771] [<ffff200009913374>] arm_smmu_of_init+0x38/0x50
[    0.824332] [<ffff200009913298>] of_iommu_init+0xa4/0x100
[    0.829715] [<ffff200008083990>] do_one_initcall+0x90/0x1c8
[    0.835278] [<ffff2000098c1034>] kernel_init_freeable+0x290/0x330
[    0.841361] [<ffff20000905be28>] kernel_init+0x10/0x110
[    0.846567] [<ffff200008083680>] ret_from_fork+0x10/0x50
[    0.851860] Memory state around the buggy address:
[    0.856648]  ffff200009295780: fa fa fa fa 00 03 fa fa fa fa fa fa 00 00 00 00
[    0.863854]  ffff200009295800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
[    0.871065] >ffff200009295880: 00 00 00 00 00 fa fa fa fa fa fa fa 00 00 00 00
[    0.878270]                                   ^
[    0.882792]  ffff200009295900: 02 fa fa fa fa fa fa fa 00 00 07 fa fa fa fa fa
[    0.890003]  ffff200009295980: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
[    0.897208] ==================================================================

Signed-off-by: Jason Liu <jason.hui.liu@nxp.com>
2018-10-29 11:10:38 +08:00
Peng Fan 55bddc9061 MLK-16204-3: clk: imx8mq: add ocotp clock
Add OCOTP clock support.

Signed-off-by: Peng Fan <peng.fan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 8407573a47 MLK-16124 clk: imx: clk-gate-scu: Replace enable/disable with prepare/unprepare
enable/disable are not allowed to sleep.
For clk_gate3_scu these functions use calls into scfw that may sleep.
Move this functionality into prepare/unprepare to avoid that.

Patch also adds is_prepared callback.

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00
Ranjani Vaidyanathan 0c5a331dd2 MLK16147-1 clk:imx - Add support to get the clock rate
Add support to get the clock rate of a gate clock. This is required
to save/restore devices clocks when they are powered up/down.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Fancy Fang 2a5a92e7ad MLK-16136-1 clk: imx: imx8mq: define DCSS root clocks.
Define three root clocks for DCSS module:

    .IMX8MQ_CLK_DISP_AXI_ROOT
    .IMX8MQ_CLK_DISP_APB_ROOT
    .IMX8MQ_CLK_DISP_RTRM_ROOT

These root clocks share one clock gate along with
'IMX8MQ_CLK_DISP_ROOT' clock. So change its type
to be shared gate clock too.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
2018-10-29 11:10:38 +08:00
Ranjani Vaidyanathan f22b9160a1 MLK16091-1 clk: imx8qxp: Register VPU encoder/decoder clocks
VPU encoder and decoder clocks can be enabled/disabled by
Linux on iMX8QX.

Signed-off-by: Ranjani Vaidyanathan <Ranjani.Vaidyanathan@nxp.com>
2018-10-29 11:10:38 +08:00
Adriana Reus 0a112f245b MLK-16124 clk: imx: clean-up: Add defines for gate enable bits.
Use defines for gate enable bits instead of raw values.

Signed-off-by: Adriana Reus <adriana.reus@nxp.com>
2018-10-29 11:10:38 +08:00
Bai Ping 3a951ba253 MLK-16102 driver: clk: fix clock source sels for gpu ahb on i.mx8mq
One of the GPU clock source should be from 'gpu_pll_out', not gpu_pll'.

Signed-off-by: Bai Ping <ping.bai@nxp.com>
2018-10-29 11:10:38 +08:00
Sandor Yu 6351288f53 MLK-16062-3: mx8qxp clk: imaging SS clock power domain update
Update i.MX8QXP imaging SS clock power domain setting.

Signed-off-by: Sandor Yu <Sandor.yu@nxp.com>
2018-10-29 11:10:38 +08:00
Viorel Suman 12db0a483c MLK-13951-1 clk: imx8qm: fix PD for SAI1 and SAI2 MCLK_SELs
Fix PD for SAI1 and SAI2 MCLK_SELs

Signed-off-by: Viorel Suman <viorel.suman@nxp.com>
2018-10-29 11:10:38 +08:00