Commit Graph

1073557 Commits

Author SHA1 Message Date
qctecmdr
6d3016517b Merge "soc: qcom: rpmh-rsc: Add fast-path request support" 2022-05-10 09:14:02 -07:00
qctecmdr
81865ff91a Merge "drivers: irqchip: pdc: Additionally set type in SPI config registers" 2022-05-10 06:29:35 -07:00
qctecmdr
219f36ae55 Merge "drivers: qcom: rpmh: Disallow active requests in solver mode" 2022-05-10 06:29:34 -07:00
qctecmdr
5697d5a599 Merge "soc: qcom: rpmh-rsc: Output debug information from RSC" 2022-05-10 01:20:00 -07:00
Lina Iyer
3e170c55eb drivers: irqchip: pdc: Additionally set type in SPI config registers
GPIOs that can be configured as wakeup are routed to the PDC wakeup
interrupt controller and from there to the GIC interrupt controller. On
some QCOM SoCs, the interface to the GIC for wakeup capable GPIOs have
additional hardware registers that need to be configured as well to
match the trigger type of the GPIO. This register interfaces the PDC to
the GIC and therefore updated from the PDC driver.

Typically, the firmware intializes the interface registers for the
wakeup capable GPIOs with commonly used GPIO trigger type, but it is
possible that a platform may want to use the GPIO differently. So, in
addition to configuring the PDC, configure the interface registers as
well.

Change-Id: I73250a04f67549dbf75c40b3672b6b1b78ff8adb
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 11:15:04 +05:30
Lina Iyer
ad5eb0a49a soc: qcom: rpmh-rsc: Add fast-path request support
In order to support lockless RPMh request, let's dedicate a TCS for this
purpose. This TCS shall be defined as FAST_PATH_TCS in the TCS
configuration for the RSC.

The fast-path TCS will have the following properties -
- A single TCS shall be defined as a fast-path TCS.
- Fast-path TCS will not use interrupt for signalling request
  completion.
- Fast path will poll controller status for idle before sending request.
- DRV properties are not updated during the fast-path use.
- Fast path requests must be first initialized with {addr, data}.
- Subsequent updates will only update the data in the TCS and trigger.
- Requests must be fire-n-forget only (no completion).

Change-Id: I235ea60159e40affa9ce1e4069e11eca3925a423
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:26 +05:30
Lina Iyer
419d3f8049 dt-bindings: Define FAST_PATH_TCS for use in RSC definition
Add a new definition for fast-path TCS configuration.

Change-Id: I610b14dcd893885e5b1c32c434caa7aa7102fd4c
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:24 +05:30
Lina Iyer
0d2c70be39 soc: qcom: rpmh: Optimize locking around flushing cache
In OS-Initiated mode of PSCI, a serialization is established in Linux
between the last CPU powering down the cluster / domain and the CPU
powering up back. The serialization is established by the genpd
framework and therefore it doesn't help to lock around the cache.

Refactor out the core of the flush functionality from the locking
wrappers. Calling the core functionality avoids a spin trylock, which
the RCU framework might consider suspicious under the circumstances.

Change-Id: I242fb4827b71152bda36ea5870393054b8703309
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:21 +05:30
Lina Iyer
7466fd9c13 soc: qcom: rpmh-rsc: Attach RSC to CPU cluster PM domain
RSC is part the CPU subsystem and powers off the CPU domains when all
the CPUs and no RPMH transactions are pending from any of the drivers.
The RSC needs to flush the 'sleep' and 'wake' votes that are critical
for saving power when all the CPUs are in idle. Doing this every time a
CPU powers down, increases latency to enter idle state. So, we want to
do this, only when it makes sense - when the last CPU is powering down.

Let's make RSC part of the CPU PM domains, by attaching it to the
cluster PD (defined in DT). Registering for PM domain notifications, RSC
driver can be notified that the last CPU is powering down. When the last
CPU is powering down the domain, let's flush the 'sleep' and 'wake'
votes that are stored in the data buffers into the hardware.

Change-Id: Id748413f0f86a4ac73c37e0780b2b22a143a1e61
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:18 +05:30
Maulik Shah
5a1e88f0c5 soc: qcom: rpmh: Conditionally check lockdep_assert_irqs_disabled()
lockdep_assert_irqs_disabled() was added to check rpmh_flush() can
only be invoked when irqs are disabled, this is true for APPS RSC
as the last CPU going to deepest low power mode is writing sleep and
wake TCSes.

However for Display RSC, drivers can invoke rpmh_write_sleep_and_wake()
to immediately write cached sleep and wake sets to TCSes from any CPU.
Conditionally check if RSC controller supports solver mode then do not
check for irqs disabled as such RSC can write sleep and wake TCSes at any
point.

Change-Id: I8ad05cd81af15a0d57353b55d8098cf0e47f79f7
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:16 +05:30
Maulik Shah
3601181d1b soc: qcom: rpmh: Add rpmh_write_sleep_and_wake() function
Let clients call rpmh_write_sleep_and_wake() to immediately
write cached sleep and wake data to the TCSes.

Change-Id: I04a94ee622a39a0aa0e829f4c40190a870fb2fb1
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:14 +05:30
Lina Iyer
08c5639165 drivers: qcom: rpmh: Add standalone mode support for RPMH
Allow RPMH requests to succeed even when the always-On subsystem is not
available. In standalone mode, requests are never sent to the TCS
mailbox driver. The command DB provides the information to make the
decision to run in standalone mode or not.

Change-Id: Ia2bc5024da0d7e6607347b1a481b2feb9584059a
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:46:10 +05:30
Lina Iyer
f1cbc5124a drivers: qcom: rpmh: Disallow active requests in solver mode
Controllers may be in 'solver' state, where they could be in autonomous
mode executing low power modes for their hardware and as such are not
available for sending active votes. Device driver may notify RPMH API
that the controller is in solver mode and when in such mode, disallow
requests from platform drivers for state change using the RSC.

Change-Id: Ibe777d23fd58489cfb8132c0168af8e29284084d
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-10 10:45:50 +05:30
qctecmdr
d923cfa5d6 Merge "power: supply: qti-battery-charger: Handle incorrect thermal levels" 2022-05-09 18:34:55 -07:00
Vivek Aknurwar
8e53704036 dt-bindings: clk-rpmh: Add xo_pad clock
Add xo_pad clk to capture xo_pad frequency separately from
bi_tcxo for chips where bi_tcxo and xo_pad frequencies are not
same. This allows consumers to query xo_pad frequency and also
vote on it.

Change-Id: I4af28c4aa23a58298ccbf3dda7b559dd3a95a97c
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
2022-05-09 14:13:46 -07:00
Raju P.L.S.S.S.N
e668147861 soc: qcom: rpmh-rsc: Output debug information from RSC
Output the TCS state when the debug api is invoked. The state of the
TCS, the contents and the IRQ status is presented. Additionally, crash
the system if any TCS is busy to help with the debug.

Change-Id: I7ef5480cc6da7208d5f82351d863561fcc1abf68
Signed-off-by: Raju P.L.S.S.S.N" <rplsssn@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-09 21:30:32 +05:30
qctecmdr
3e081d68b4 Merge "drivers: qcom: cmd-db: Report if command DB is initialized as standalone" 2022-05-09 05:27:09 -07:00
Lina Iyer
de5af87c3e drivers: qcom: cmd-db: Report if command DB is initialized as standalone
The command DB may be initialized outside the AOP, indicated by the
reserved bit 0. Export this information through a function.

Change-Id: I7b8c685cc03d919c5adb1b91134078bd96599bbd
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-09 16:29:09 +05:30
Maulik Shah
9b752a4c34 arm64: defconfig: Enable CommandDB, RPMH and PDC drivers
Enable CommandDB, RPMH communication and PDC irqchip drivers.

Change-Id: I1477df988732147a05e0fe87e344a9d4ff951ad3
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-05-09 14:04:43 +05:30
qctecmdr
95b3213a29 Merge "interconnect: qcom: icc-rpmh: Vote for keepalive BCMs during init" 2022-05-07 22:33:20 -07:00
qctecmdr
22c17bcabb Merge "interconnect: qcom: qnoc-qos: Don't skip writing urg_fwd when it's zero" 2022-05-06 21:19:37 -07:00
qctecmdr
6d53b5c5f8 Merge "interconnect: qcom: Add stub icc_set/aggregate() callbacks" 2022-05-06 18:58:48 -07:00
qctecmdr
05fd6cf81b Merge "soc: altmode: Add correct notify message length check" 2022-05-06 16:28:47 -07:00
qctecmdr
ce01c25ee7 Merge "soc: qcom: altmode-glink: add SSR support" 2022-05-06 14:00:40 -07:00
qctecmdr
0e80a8e22e Merge "soc: qcom: add initial version of qti_battery_debug driver" 2022-05-06 11:38:08 -07:00
qctecmdr
d1b8d9dbc6 Merge "drivers: soc: qcom: Add soft dependency of smem on hwspinlock" 2022-05-05 13:21:21 -07:00
Rishabh Bhatnagar
bbe2be8810 drivers: soc: qcom: Add soft dependency of smem on hwspinlock
Add module soft dependency of smem on qcom_hwspinlock driver.

Change-Id: If11256cb5acc133f7725f0c3b2ec708c53e2c328
Signed-off-by: Rishabh Bhatnagar <rishabhb@codeaurora.org>
2022-05-05 10:33:09 -07:00
qctecmdr
fb81948309 Merge "dma-heap: qcom: Take a snapshot of our DMA-BUF heap driver from msm-5.15" 2022-05-05 08:39:09 -07:00
qctecmdr
301f2078bd Merge "mem-buf: Take a snapshot of mem-buf-exporter.h from msm-5.15" 2022-05-04 19:03:45 -07:00
qctecmdr
6631289b86 Merge "arm64: defconfig: Add support for QCOM USB subsystem" 2022-05-04 12:47:13 -07:00
qctecmdr
6b1d10529a Merge "soc: qcom: smem: validate fields of shared structures" 2022-05-04 10:30:20 -07:00
Wesley Cheng
97c04070f3 arm64: defconfig: Add support for QCOM USB subsystem
Enable configurations for DWC3 MSM and EMU USB PHY drivers.

Change-Id: If725c0a2627c34bb2ee6305f88412c6caffc31be
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
2022-05-04 10:00:48 -07:00
qctecmdr
816396e98a Merge "soc: qcom: smem: map only partitions used by local HOST" 2022-05-03 14:14:55 -07:00
Guru Das Srinagesh
3465d8be3c abi_gki_aarch64_qcom: Update list of symbols
Add symbols currently present on kalama as of msm-5.15
'commit 1701298d2205 ("Merge "defconfig:kalama_consolidate: Enable
CONFIG_UFS_DBG"").

Change-Id: Ie9570f48bbcef1c32e49f629e079cf7af0f572a9
Signed-off-by: Guru Das Srinagesh <quic_gurus@quicinc.com>
2022-05-02 12:18:07 -07:00
Subbaraman Narayanamurthy
e1cb855e28 power: supply: qti-battery-charger: Handle incorrect thermal levels
Currently, when "qcom,thermal-levels" is specified and the
values are not in descending order, an error is returned which
fails the driver probe thereby causing battery/USB power supply
not available. Same problem can happen when charger firmware
returns a lower value for BATT_CHG_CTRL_LIM_MAX than the maximum
value specified under "qcom,thermal-levels" property. Without a
battery power supply, user would not know the battery charging
status. To avoid this, just return 0 after printing an error.

This would only affect the user by disallowing a change to the
POWER_SUPPLY_PROP_CHARGE_CONTROL_LIMIT property under battery
power supply.

Change-Id: I216d4d370e71ec5003adbee2600191e36a45e870
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:47:23 -07:00
Subbaraman Narayanamurthy
a6cad582c1 power: supply: qti_battery_charger: add support to set fake SOC for battery
Setting a fake battery SOC (state of charge) is useful to test
different mitigation levels. Add support for it by exposing
fake_soc under qcom-battery class which can be set only when
CONFIG_QTI_PMIC_GLINK_CLIENT_DEBUG is enabled.

To set fake_soc of 50%,

 echo 50 > /sys/class/qcom-battery/fake_soc

To clear fake_soc so that actual battery SOC can be displayed,
any value other than 0-100 can be set to fake_soc.

 echo -1 > /sys/class/qcom-battery/fake_soc

Change-Id: Ibff337fb4da9d4e9aadbe148f3eecca9e2d69604
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:46:22 -07:00
Subbaraman Narayanamurthy
4e207a47ef power: supply: qti_battery_charger: add SSR support
Add subsystem restart (SSR) support to battery charger driver so
that it can stop read/write properties when subsystem goes down.
Also, send message to enable notification again once subsystem
comes up.

Change-Id: I64f3abfa1d12c4e6a65fd01d7f66155c8741e68a
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:41:27 -07:00
Subbaraman Narayanamurthy
d48bfa7036 power: supply: qti_battery_charger: Allow ICL to be set only for SDP
Input Current Limit (ICL) needs to be set only for SDP and not
for other charger types. Add that logic.

Change-Id: Ib48acf5666ea4190b7a11c27ab9cefbb534632fb
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:40:32 -07:00
Subbaraman Narayanamurthy
5b3b763f8c power: supply: qti-battery-charger: Initialize pmic_glink_client_data
Fix pmic_glink_client_data initialization without which ssr_cb
that would be added in the upcoming patch causes an incorrect
list addition to PMIC Glink notification list.

Change-Id: I7588ae894e8188c30456f4c16711bc6b757a9863
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:39:02 -07:00
Subbaraman Narayanamurthy
d88934ddf0 power: supply: qti_battery_charger: add thermal mitigation support
Add "qcom,thermal-mitigation" property to specify charging
current thresholds for thermal mitigation levels. These values
will be passed on to the charger firmware running on a remote
subsystem when thermal SW sets CHARGE_CONTROL_LIMIT property in
battery power supply.

Change-Id: I67be3f9012718de9b2cd529ed6043fb54f503003
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:38:25 -07:00
Subbaraman Narayanamurthy
e72f2c89ce power: supply: qti_battery_charger: Handle generic notification
Charger firmware sends some battery related events with a generic
notification opcode. Handle such notifications as well to send
events up to the userspace.

Change-Id: Ia35fb7dbe56183d3c7c7a66b5f387b94072e6ed0
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:37:21 -07:00
Subbaraman Narayanamurthy
dd2116df9a power: supply: Add QTI battery charger
Add Qualcomm Technologies, Inc. battery charger driver which
interfaces with the charger firmware running on the remote
subsystem (e.g. DSP) by communicating over PMIC Glink channel and
provides information about the battery, USB and wireless charging
by exposing them as power supply devices.

Change-Id: I36a2efd0b66bc5f79515b5faa318c537a5927e76
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2022-05-02 11:36:08 -07:00
Mike Tipton
2fbcc44e15 interconnect: qcom: icc-rpmh: Vote for keepalive BCMs during init
Place initial votes for BCMs marked as keepalive during initialization
such that we force the BCMs on even in the absence of explicit client
votes.

Change-Id: I0cf1b2f2a76d5fc094329520ce2a9f1691a3f681
Signed-off-by: Mike Tipton <quic_mdtipton@quicinc.com>
2022-05-02 09:07:17 -07:00
Mike Tipton
d2d4f6d777 interconnect: qcom: icc-rpmh: Add keepalive_early flag
Some BCMs only need to be kept alive early in the boot process. Add the
keepalive_early flag, which only prevents them from turning off before
the sync_state callback.

Change-Id: I0699fb0420d1d9f9473e28ede57380fd5b08ca53
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2022-05-02 09:07:17 -07:00
Mike Tipton
b3588ad7e0 interconnect: qcom: icc-rpmh: Vote initial floor in sleep set
Currently the initial floor is only voted in AMC/WAKE, which means the
floor is removed when entering the sleep set. However, some use cases
require bus BW even when the CPU is idle. If all clients haven't voted
yet, then assume we need to keep these votes around permanently.

Change-Id: I2277e62e0a4e1ea949f1c7fbad052e76cf451c68
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2022-05-02 09:07:17 -07:00
Mike Tipton
81216c014f interconnect: qcom: qnoc-qos: Don't skip writing urg_fwd when it's zero
Some QoS enable urgent forwarding by default, but we don't always want
this. So don't assume the register already has zero and write it
unconditionally.

Change-Id: I257e099a588870f8d6e6d68b7fd794e22781450e
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2022-05-02 09:07:16 -07:00
Vivek Aknurwar
bba0dddd2a interconnect: qcom: qnoc-qos: Add prio_fwd_disable support
Add prio_fwd_disable flag support to stop forwarding QoS information
from the master. So respective noc will ignore master's claimed priority
and send out the default priortiy.

Change-Id: I21ca11b44f200453c70c02f195779ef583a90e8c
Signed-off-by: Vivek Aknurwar <quic_viveka@quicinc.com>
2022-05-02 09:07:16 -07:00
Vivek Aknurwar
bc2e1198cc interconnect: qcom: icc-rpmh: Implement stub handling
Skip bcm init and implement stubs for icc apis when stub property
is defined.

Change-Id: Ic56a75578b6fa4fe35bebaf103d41205e444efed
Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
2022-05-02 09:07:16 -07:00
Veera Vegivada
fd8e26e71e interconnect: qcom: icc-rpmh: Add support for enabling BCMs needed for QoS
Some QoS blocks require voting for BCMs before their registers can be
accessed, since they require clocks and regulators controlled by BCM.
Hence add qos_proxy flag to indicate the BCM needs to be voted for
QoS configuration.

Change-Id: Idc618e7a3d28d31d38d85f5b21e6b9f12e86ebe2
Signed-off-by: Veera Vegivada <vvegivad@codeaurora.org>
2022-05-02 09:07:16 -07:00
Mike Tipton
bdebb74665 interconnect: qcom: Add support for PERF_MODE on RPMh targets
Add support for QCOM_ICC_TAG_PERF_MODE on RPMh architectures. When
QCOM_ICC_TAG_PERF_MODE is specified using icc_set_tag(), each node in
the requested path will use latency-optimized settings if supported by
the node. The improved latency comes at the cost of higher power.

Change-Id: I83c52e5677f8842b4c17987053d566971b84086f
Signed-off-by: Mike Tipton <mdtipton@codeaurora.org>
2022-05-02 09:07:16 -07:00