Commit graph

857,075 commits

Author SHA1 Message Date
Taniya Das
8a604ad3cc clk: qcom: rcg2: Add support for hardware control mode
Add a flag to indicate to support and enable hardware control mode
of an RCG.

Change-Id: I21194a463441ea13b7575a4174b1f96504b42b1e
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2019-08-29 16:05:06 -07:00
Taniya Das
638d2fe7e5 clk: qcom: rcg2: Remove support for update_src_map
The commit 7533b7fb5495 ("clk: qcom: clk-rcg2: Read RCG source before
calculating clk rate")' had introduced a function to update the src map,
but there could be a race where a set_rate for a clock from a particular
CC on a CPU could override the global cxo_f which was set by clock
enable/disable for a clock from another CC.

Change-Id: Id86818895e226a387e7fd1a09e2034eee18fd361
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2019-08-29 16:05:04 -07:00
Shefali Jain
90823f3cf3 clk: qcom: clk-rcg2: Read RCG source before calculating clk rate
If the clock rate is set previously to hlos and enable
safe config is true. In that case we need to check the
rcg source to make sure recalc will return correct rate.
Rate calculation is done based on selected source rather
than 19.2 MHZ. Also, we are setting correct src value for
XO based on the parent map of a particular clock.

Change-Id: Id6d2923136a0848d55cff37fb5ef2e3b092af27a
Signed-off-by: Shefali Jain <shefjain@codeaurora.org>
2019-08-29 16:05:03 -07:00
Taniya Das
0311d36738 clk: qcom: Retrieve pre_div from freq_tbl for shared RCG
There could be cases where a simultaneous clk_disable and clk_set_rate on
the same rcg could result in a wrong recalc rate. So for shared rcgs
get the pre_div value based on the current frequency from the frequency
table.

Change-Id: Ia5730e43965b2d0ba19da05fca47825514f98865
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2019-08-29 16:05:02 -07:00
Shefali Jain
90ded952e1 clk: qcom: rcg2: Add DIV_ROUND_CLOSEST_ULL to roundoff RCG frequency
The Alpha BW for Fabia PLL is 16 bit and the calculated hw rate has
additional KHz of frequency. Due to this additional frequency, the
source is wrongly selected. Truncate the additional KHz using the
DIV_ROUND_CLOSEST_ULL.

Change-Id: Ic9c523c87277c4813b676cf8a52a1207e8f1ecc2
Signed-off-by: Shefali Jain <shefjain@codeaurora.org>
2019-08-29 16:05:00 -07:00
David Collins
51ca8f6849 clk: qcom: add null pointer checks for parent clocks
Add null pointer checks for the parent clock pointers returned
by clk_hw_get_parent() and clk_hw_get_parent_by_index() in
several qcom clock drivers.

Change-Id: I869c9e35b7ec083b34bcc70d18601aec64c3ac97
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 16:04:59 -07:00
Vivek Aknurwar
3934ca8ec6 clk: qcom: clk-rcg2: Fix QUPV3 DFSR M and N register mode overwrite
Move reading of MN counter mode register earlier to source sel
to fix overwrite of MN counter mode variable.

Change-Id: I5a318112e85c4af83fdbf9bba8770f4ec1b84326
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-08-29 16:04:57 -07:00
David Collins
6d960dcc4f clk: qcom: clk-rcg: update DEFINE_RCG_DFS() macro
Update the DEFINE_RCG_DFS() macro to avoid the potential clock
struct name aliasing.

This modification originally came from:
commit c88b8062898c ("clk: qcom: Add cdiv clocks for gcc, video
and camera cc driver for KONA").

Change-Id: I5a8b694b5b8a8b5169639a3e09b1ab4c1936e010
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 16:04:56 -07:00
Taniya Das
228b95aa74 clk: qcom: Add support for clock dependency
Add clock ops for taking care of a dependent clock when the actual
clock requests are made.

Change-Id: I52691ef9f183da035ddf9c05fb73811f48fef74c
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 16:04:54 -07:00
Deepak Katragadda
b3394e839b clk: Add additional checking to some clock driver functions
Fix certain functions with potential for a NULL
pointer de-reference.

Change-Id: I855ef1d883a22616db7086bd5d47ee1f8e54694a
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 16:04:43 -07:00
Taniya Das
a41cfccad5 clk: qcom: Add RCG support for DP source
Add new RCG clock ops specific for the DP clock source.

Change-Id: I2ec5ddcfd47af8362f76d76d153e30d4e2f45370
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 16:04:16 -07:00
Taniya Das
fd6e6b0b16 clk: qcom: Add support for RCGs with dynamic and fixed sources
Some RCGs could have sources with dynamic frequencies and fixed sources
where if the RCG has the flag of CLK_SET_RATE_PARENT set, it would try to
propagate the clock rate to the fixed source PLLs too. To identify sources
of the RCGs where the rate should propagate to parent PLL, add a member in
freq_tbl to represent source frequency. This would be used by the
_freq_tbl_determine_rate to set its parent frequency on the PLL.

Change-Id: I7f1c0d9d84607821893a1e5d17934dae5acef5f4
Signed-off-by: Taniya Das <tdas@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 16:03:46 -07:00
Deepak Katragadda
198a419f76 clk: qcom: clk-rcg2: Add support to force enable an RCG
In certain cases, it is desirable for an RCG to be turned on
explicitly instead of just relying on the enable signal from
its branch clock(s). Add support for this.

Change-Id: I2b0b81bddfe7cc7543c313e4ed13a332fb1a0fcb
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 16:03:15 -07:00
Deepak Katragadda
3e549714a8 clk: qcom: clk-rcg2: Configure the RCGs to a safe frequency as needed
In certain cases, an RCG might be prone to being enabled even
though the overlying software thinks that it disabled the RCG.
In order to avoid letting the RCG go into an invalid state, support
parking it at a safe frequency during clk_disable() and deferring
all the RCG configuration updates to be done during clk_enable(),
if a scaling request comes in whilst the clock is disabled.

Change-Id: I55f1d1d346182a2b480127c57d6659fc9a63331b
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 16:02:40 -07:00
David Dai
07e8f7920d clk: qcom: clk-alpha-pll: check pcal_done from mode register
The sequence for alpha_pll_lucid_prepare is checking an incorrect bit
to determine whether or not a lucid PLL has calibrated successfully.
The bit in the status register is not observable unless pll_test_ctl[69]
is set and user_ctl[43:37] is 0 which should only be used as a fallback
option. Use the correct PCAL_DONE bit from the mode register to properly
determine PLL calibration status.

Change-Id: If952c30cacacd68c07e8d7dfd622069dbb70c909
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 15:03:26 -07:00
Vivek Aknurwar
ca1a5818b0 clk: qcom: clk-alpha-pll: add FREQ_DET support to Zonda PLL lock detection
Some instances of the Zonda PLL do not lock correctly
in high L-VAL regions. In such cases, CFA mode
can be configured via test_ctl_val to use an alternative
locking mechanism. Add support for CFA mode by
polling FREQ_LOCK_DET instead of PLL_DET_LOCK
whenever CFA mode has been configured.

Change-Id: Ief31592250ea9f329a34ffdbc4b17cfce431677d
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-08-29 15:03:24 -07:00
David Dai
5a78ac7272 clk: qcom: alpha: do not configure PLL during probe if already enabled
There are different configurations of display panels which may
or may not enable display PLLs before the display driver probes. Due to
continuous splash use cases, we may trample over existing PLL
configuration and cause the PLL to reset while it's in use. Prevent that
scenario by skipping the PLL configuration step if it's enabled.

Change-Id: I61f69c67ca57f18cbc6b551884ea199212ed4e9d
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 15:03:23 -07:00
David Collins
bd0b75950b clk: qcom: clk-alpha-pll: add support to reconfigure PLLs during prepare
Under some circumstances, such as during subsystem restart, the
registers for a clock controller may be reset to hardware default
values.  Add support to reconfigure a Lucid PLL during clk_prepare
in the case that the CAL_L_VAL is found to be 0 before performing
calibration.

Change-Id: Idef3c42dfb32748ec40f89a9dab9f6ab86e293f6
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 15:03:21 -07:00
David Collins
e2766aa662 clk: qcom: clk-alpha-pll: add support for custom register initialization
Add support for configuring custom target-specific registers
during PLL initialization.

Change-Id: Id296ae904d1b74e7c2f90027bd557bdc62b1d362
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 15:03:20 -07:00
Vivek Aknurwar
b09c4bd043 clk: qcom: clk-alpha-pll: Remove reconfiguration of PLLs
Remove reconfiguration of PLLs as configuration is expected
to be one time that is during probe.

Change-Id: I90f8ed553016ab32786beae0873424579ead564d
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2019-08-29 15:03:18 -07:00
Vivek Aknurwar
d9226e13f7 clk: qcom: clk-alpha-pll: Add support for controlling zonda pll
Zonda PLL is high frequency PLL clock generator. It supports
fine control of the digital controlled oscillator (DCO)
and clocked on rising edge of the reference.

Change-Id: I2a9726a0acbffcee1a52f5172b197bf125e60030
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 15:03:17 -07:00
David Dai
6a578b72c7 clk: qcom: clk-alpha-pll: add additional configuration support for PLLs
Add support to configure test_ctl, user_ctl and cal_l fields for PLLs.

Change-Id: Ib5a7a74aecd8d9885e0a3034f097c13cda4d2268
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2019-08-29 15:03:15 -07:00
David Dai
ce3fd3ebfd clk: qcom: clk-alpha-pll: Add support for controlling Lucid PLLs
Add programming sequence support for managing the Lucid
PLLs.

Change-Id: Ia63067d88bd1f309d190b1ec5b0f272b40209a71
Signed-off-by: David Dai <daidavid1@codeaurora.org>
Signed-off-by: David Collins <collinsd@codeaurora.org>
2019-08-29 15:02:28 -07:00
Lina Iyer
df2f76f8e8 drivers: qcom: rpmh-rsc: modularize RSC controller driver
Enable RSC controller driver to be compiled as modules. Since RPMH
communication is need for enabling/disabling critical clocks and busses
needed for the application processor, it is better to keep this module
enabled. Hence declare the driver as a builtin platform driver.

Change-Id: I41a657c0d618efb7c3460833ffb8eb5d445885a0
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2019-08-28 08:44:04 -06:00
Mahesh Sivasubramanian
d6b2e3798f drivers: qcom: cmd-db: Dump resource data via debugfs
Add support to dump command DB data via debugfs. This allows drivers to
lookup data resource information without a resource ID.

Updated to use leXX_to_cpu() functions when reading cmdDB memory.

Change-Id: I04e7466f76ceea00d762752e0c0123edfabe0f64
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
2019-08-28 08:44:04 -06:00
qctecmdr
b5920ef4fa Merge "arm64: defconfig: Enable llcc perfmon drivers" 2019-08-27 22:23:23 -07:00
qctecmdr
30a9af43ae Merge "drivers: llcc_perfmon: Add llcc_perfmon support" 2019-08-27 21:47:13 -07:00
qctecmdr
961790582c Merge "drivers: qcom: cmd-db: Report if command DB is initialized as standalone" 2019-08-27 16:12:16 -07:00
qctecmdr
630f98433d Merge "trace: rtb: add msm_rtb tracing" 2019-08-26 12:24:53 -07:00
Avinash Philip
7a47f5f9f0 arm64: defconfig: Enable llcc perfmon drivers
Enable llcc perfmon drivers for Lahaina SoC.

Change-Id: I5f679dfac0f00b6be1dfaa60de9ce74e9a071b00
Signed-off-by: Avinash Philip <avinashp@codeaurora.org>
2019-08-23 11:53:28 +05:30
Avinash Philip
559bd233f1 drivers: llcc_perfmon: support for dual memory controller added
llcc supports 2 memory controllers in backend on certain systems.
This patch adds support for dual memory controllers. Also fixed
filter related changes in LLCC. Cleaned up the code for better
code walk.

Change-Id: Ie054d9182b20ec0811f117c2289aa857f0384baf
Signed-off-by: Avinash Philip <avinashp@codeaurora.org>
2019-08-23 11:45:33 +05:30
Sankaran Nampoothiri
4c2cedeb04 drivers: llcc_perfmon: Add llcc_perfmon support
This is snapshot of the llcc_perfmon driver from msm-4.14
'commit c9961d61d6d8 ("drivers: soc: llcc_perfmon: Add llcc_perfmon
		support")'

This LLCC perfmon driver provides Sysfs interfaces for the clients to
monitor the events. Driver support for monitor events from LLCC sub blocks.
Also updated driver to handle opcode & cache alloc filters.

Change-Id: Ic711fdbc774d2da1938feff5c0d7888e5cf8495a
Signed-off-by: Sankaran Nampoothiri <snampoot@codeaurora.org>
Signed-off-by: Avinash Philip <avinashp@codeaurora.org>
2019-08-23 11:45:25 +05:30
Yuanyuan Liu
60450b0d00 net: cnss_prealloc: Add snapshot of cnss_prealloc driver
This is a snapshot of cnss_prealloc driver and associated files as of
msm-4.19 commit 94d53f998edd
("cnss_prealloc: Update prealloc memory table").

Change-Id: Ic6e853bf651e2a0e2b672bc68d42929c3b55ef93
CRs-Fixed: 2500800
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2019-08-22 09:23:14 -07:00
qctecmdr
b75bba1a68 Merge "defconfig: Enable fastmap on Lahaina" 2019-08-21 18:18:20 -07:00
qctecmdr
178b046932 Merge "net: cnss_genl: Add snapshot of cnss_genl driver" 2019-08-21 18:18:20 -07:00
Isaac J. Manjarres
b13ee6cd5c defconfig: Enable fastmap on Lahaina
Enable the fast IOMMU DMA mapping facilities on Lahaina.

Change-Id: Iaf94518581585d83bb731452183f45a320898b56
Signed-off-by: Isaac J. Manjarres <isaacm@codeaurora.org>
2019-08-20 17:12:45 -07:00
qctecmdr
ee24c7758f Merge "iommu: io-pgtable-fast: Use the DMA APIs for cache cleaning" 2019-08-20 16:33:28 -07:00
qctecmdr
3cd94d01cd Merge "defconfig: Enable the MSM ION heaps on Lahaina" 2019-08-20 15:59:59 -07:00
qctecmdr
eba5c99bf6 Merge "staging: android: ion: Do not assign heap IDs as heaps register" 2019-08-20 15:14:38 -07:00
qctecmdr
d5d931862a Merge "Revert "staging: android: ion: Remove file ion_carveout_heap.c"" 2019-08-20 14:11:32 -07:00
qctecmdr
1916b8dca0 Merge "arm64: defconfig: Enable SMP2P Sleepstate on Lahaina" 2019-08-20 13:36:20 -07:00
qctecmdr
dbac3d3368 Merge "arm64: defconfig: Enable MSM QMP driver for Lahaina" 2019-08-20 12:56:00 -07:00
qctecmdr
d0613fdf8d Merge "arm64: defconfig: Enable IPC logging driver on Lahaina" 2019-08-20 12:18:50 -07:00
Yuanyuan Liu
ffd8d0df6c net: cnss_genl: Add snapshot of cnss_genl driver
This is a snapshot of cnss_genl driver and associated files as of
msm-4.19 commit 2a93006b9f9f
("net: cnss_genl: Add snapshot of cnss_genl driver").

Change-Id: I86a557ce898ecb746c8e0afc70a1908415fc2e87
CRs-Fixed: 2500800
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2019-08-20 11:35:49 -07:00
qctecmdr
2f4e024c0e Merge "soc: qcom: Add snapshot of SSR, PIL, Sysmon, and PDR drivers" 2019-08-20 11:28:11 -07:00
qctecmdr
9cf31bfd9b Merge "net: cnss_utils: Add snapshot of cnss_utils driver" 2019-08-19 22:28:04 -07:00
Arun Kumar Neelakantam
2de05ba6fb soc: qcom: qmi_interface: Abort pending transaction
In some cases like SSR, qmi clients are releasing handles without
considering the waiting transactions which results in use after free
of qmi handles after the transaction wait time completes.

Abort the pending transaction during qmi_handle_release to avoid the
use after free.

CRs-Fixed: 2328443
Change-Id: I59e19222b2b9a8ace3d37b4a70ea891ff88db07e
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
2019-08-19 18:30:46 -07:00
Chris Lew
1a3a9c9cad soc: qcom: qmi_interface: Add default send timeout
Add a default send timeout for kernel qmi sockets. If a remote proc
crashes, there is a chance that the before shutdown cleanup will try
to send messages to the remote processor. When enough messages are
sent to a single port, the qrtr flow control will kick in and the QMI
socket will block indefinitly. Set the timeout to 10 seconds which
should be long enough to not affect normal functionality.

Change-Id: Ie12dd163a0c4ac1a3dc037e5a29e39395c3cc948
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-08-19 18:30:34 -07:00
Chris Lew
08740902ab soc: qcom: qmi_interface: Do not print error for 0 pkt
Add a check for the zero size flow control packet when handling data
from the socket. This packet is expected and should not be printed as
an error.

Change-Id: I74a9edf752cb5f186ef133ae9d8b12cc93ee1b18
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-08-19 18:30:17 -07:00
Chris Lew
68abb34ed2 arm64: defconfig: Enable SMP2P Sleepstate on Lahaina
Enable the SMP2P sleepstate driver to deliver power state changes
to remote processors like slpi.

Change-Id: I9fe755d2462b7a593e5cbffacd6b466cb21d9f15
Signed-off-by: Chris Lew <clew@codeaurora.org>
2019-08-19 18:21:56 -07:00