Commit Graph

1130143 Commits

Author SHA1 Message Date
Chris Lew
da8adeaf36 rpmsg: glink: Cancel sending on processor reset
Unblock threads waiting for space in the smem fifo when the peer remote
processor reset is detected. This will allow processes to unblock and
cleanup instead of waiting for a 10 second timeout.

Change-Id: I1a033a81424dd0c40dd4aa709c4fb9a89e2fa124
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
2022-11-22 12:54:40 -08:00
Chris Lew
d19561af42 rpmsg: glink: Use irqsave/irqrestore spin locks
The glink rx done function can be called from both soft irq and hard
irq context. To avoid any potential deadlock scenarios, use the irq
save and restore variants of the spin locks.

Change-Id: Id85367226a16db1c0e44f8e00c7b7f74f4c8b8fd
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
2022-11-22 12:53:08 -08:00
Chris Lew
28149075f5 rpmsg: glink: Move glink packet driver
Move the glink packet driver from soc/qcom to rpmsg. The RPMSG char
driver is under rpmsg and the glink packet driver mirrors the RPMSG
char driver.

Change-Id: I4d1c5abbe656e4c54da74769067d35cd513f3b75
Signed-off-by: Chris Lew <quic_clew@quicinc.com>
2022-11-22 12:51:26 -08:00
qctecmdr
043bb02f96 Merge "power: supply: qti_battery_charger: add support for charge control" 2022-11-21 13:08:56 -08:00
qctecmdr
77b95503a4 Merge "defconfig: pineapple-gki: enable SPMI PMIC arbiter debug driver" 2022-11-21 13:08:56 -08:00
qctecmdr
dbf06163bb Merge "defconfig: pineapple-gki: Enable QMI sensor and cooling driver" 2022-11-21 13:08:56 -08:00
qctecmdr
8ec0745083 Merge "soc: qcom: eud: Do USB spoof disconnect and connect with enable/disable EUD" 2022-11-21 13:08:55 -08:00
qctecmdr
32f46d5813 Merge "qcom-iommu-debug: handle unexpected dma_addr" 2022-11-21 10:54:05 -08:00
qctecmdr
1230185c62 Merge "leds: qti-flash:Show MAX_FLASH_CURRENT_MA for no battery use case" 2022-11-21 10:54:05 -08:00
qctecmdr
6210f2848e Merge "soc: qcom: panel_event_notifier: Add support for driver" 2022-11-21 10:54:05 -08:00
John Moon
c2170f5e11 build: Change paths to Bazel extensions
The canonical location of msm_kernel_extensions.bzl is changing.

Update the load() calls to the new location.

Change-Id: I27df6131de155cd0592cad5d57202ca01c4affb5
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-20 17:40:14 -08:00
Bruce Levy
9c6f80d9fe soc: qcom: panel_event_notifier: Add support for driver
Add Config and make rules for panel_event_notifier
driver.

Change-Id: Id8975ac19e3201a1ac7396821c1be0288bfa8617
Signed-off-by: Bruce Levy <quic_blevy@quicinc.com>
2022-11-19 22:34:18 -08:00
Rashid Zafar
37d965eca6 defconfig: pineapple-gki: Enable QMI sensor and cooling driver
Enable QMI sensor and cooling device driver to register sensors
and cooling devices respectively from remote subsystem.

Change-Id: I18b54812b91a2a01f273e83b5627c05d1cbeab46
Signed-off-by: Rashid Zafar <quic_rzafar@quicinc.com>
2022-11-19 15:33:56 -08:00
qctecmdr
db1207c6eb Merge "iio: qcom-spmi-adc5-gen3: Update immediate read handling" 2022-11-18 17:29:50 -08:00
qctecmdr
5dc6e460a1 Merge "soc: qcom: llcc: ioremap resource only when multi_ch_reg exists" 2022-11-18 15:21:16 -08:00
qctecmdr
9582642b83 Merge "pinctrl: qcom: Add wakeup_enable and wakeup_present bit" 2022-11-18 15:21:16 -08:00
qctecmdr
762d3e0b9a Merge "defconfig: pineapple: enable tmecom and hwkm" 2022-11-18 15:21:15 -08:00
qctecmdr
937267bb46 Merge "spi: spi-msm-geni: Keep IRQ disabled while requesting an IRQ" 2022-11-18 15:21:14 -08:00
qctecmdr
2df1d35e0b Merge "defconfig: pineapple-gki: enable regulator OCP notifier driver" 2022-11-18 15:21:13 -08:00
qctecmdr
7ae6acdb7b Merge "coresight-tmc: set StopOnFl bit for etf" 2022-11-18 15:21:12 -08:00
qctecmdr
5e00cbace8 Merge "remoteproc: qcom_q6v5_pas: Map modem DSM memory ownership to MPSS" 2022-11-18 15:21:10 -08:00
Sukadev Bhattiprolu
7ff9dff2e6 qcom-iommu-debug: handle unexpected dma_addr
When __full_va_sweep(), __rand_va_sweep() and __tlb_stress_sweep(), do
their cleanup, they assume that the entire iova range 0..4G was mapped
correctly (i.e assigned iova starts at 0 and goes to 4G).

But if for some reason the iova starts at a different address (eg: with
fastmap, it could start at 0xFFFFF000), we end up with the following
warning from iommu_dma_unmap_page() because the iova 0 was never mapped.

 898         phys = iommu_iova_to_phys(domain, dma_handle);
 899         if (WARN_ON(!phys))
 900                 return;

Worse, since the cleanup tries to unmap the entire 0..4G range, this
warning is repeated a large number of times, making the device unusable.

Instead, report an error on the unexpected and unmap the incorrect dma
address immediately. And when unmapping the iova range, make sure to only
unmap regions that were correctly (when iova == dma_addr) mapped.

Change-Id: Ia0ab4fd49ba5021d4866daf69fb9a3fa7e61928d
Signed-off-by: Sukadev Bhattiprolu <quic_sukadev@quicinc.com>
2022-11-18 14:20:59 -08:00
Qingqing Zhou
86b4d3af60 iommu: Fix compilation issues on sdxbaagha
Current codes may don't consider the 32-bit possibility, some
compilation errors happen when try to enable smmu on sdxbaagha:
  1. arm-smmu-qcom.c:
    "error: shift count is negative" reports at
    "FIELD_GET(QTB_OVR_ECATS_OUTFLD0_PA, val)".
  2. qcom-iommu-debug-user.c:
    "error: incompatible pointer types passing" reports at
    "if (kstrtox_from_user(ubuf, count, 0, &iova))".
  3. qcom-io-pgtable-arm.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(TOP_IGNORED_MASK, table_pte)".
  4. qcom-iommu-debug-user.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(ARM_SMMU_SMR_ID, fwspec->ids[0])".
  5. qcom-iommu-debug.c:
    "error: implicit declaration of function 'FIELD_GET'"
    reports at "FIELD_GET(ARM_SMMU_SMR_ID, (fwspec->ids[0]))".

Change-Id: I38b96e411eaf37d87e48b4c9fe860a94643bc5b7
Signed-off-by: Qingqing Zhou <quic_qqzhou@quicinc.com>
2022-11-18 14:20:52 -08:00
qctecmdr
d977260b19 Merge "build: Refactor build_with_bazel.py to discover targets" 2022-11-18 11:59:19 -08:00
qctecmdr
c0d8c0c5b1 Merge "build: adding top-level DDK headers definition" 2022-11-18 11:59:19 -08:00
qctecmdr
ce5e2d75b4 Merge "build: Export UAPI headers as Bazel cc_library" 2022-11-18 11:59:18 -08:00
qctecmdr
1aacc3bc8b Merge "soc: qcom: Add v19 support for socinfo" 2022-11-18 11:59:18 -08:00
qctecmdr
93bd469ba9 Merge "soc: qcom: qcom_stats: Fix the DDR stats entry offset" 2022-11-18 11:59:16 -08:00
Subbaraman Narayanamurthy
678d38a6fa power: supply: qti_battery_charger: add support for charge control
Add support for charge control via the following power supply
properties.

charge_control_end_threshold: SOC threshold at which the charging
should be terminated.

charge_control_start_threshold: SOC threshold at which the charging
should be resumed.

"/sys/class/qcom-battery/charge_control_en" controls the feature.

E.g. To enable this feature to stop charging @ 80% and resume
charging @ 77%.

echo 1 > /sys/class/qcom-battery/charge_control_en
echo 80 > /sys/class/power_supply/battery/charge_control_end_threshold
echo 77 > /sys/class/power_supply/battery/charge_control_start_threshold

If charge_control_start_threshold is not set, then a delta_soc of
5 (i.e. charge_control_end_threshold - 5) would be configured.

Write "echo 0 > /sys/class/qcom-battery/charge_control_en" to
disable the charge control feature.

Change-Id: I02eef6bf9a23f313c661cbddb4feefa37639d520
Signed-off-by: Subbaraman Narayanamurthy <quic_subbaram@quicinc.com>
2022-11-17 20:32:29 -08:00
qctecmdr
71694d1b47 Merge "msm:abi_gki: Add v4l2,video,display and gpu api to export symbols list" 2022-11-17 18:53:06 -08:00
Gokul krishna Krishnakumar
7b161ee9c9 remoteproc: qcom_q6v5_pas: Map modem DSM memory ownership to MPSS
Replace the hyp_assign_phys with upstream friendly qcom_scm_assign_mem.
dsm memory region is needed by MPSS PDs, this call reassigns the
ownership to MPSS.

Change-Id: I1ae7e61d1bc74d45bb1bc58b762c5d3d59e12501
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
2022-11-17 12:48:16 -08:00
Gokul krishna Krishnakumar
a5235ba22e remoteproc: qcom_q6v5_pas: Add flag for dsm region setup
Some targets don't have dsm region to be setup by
remoteproc, so add a flag to check if we need to setup
the dsm region or not and enable for pineapple.

Change-Id: I1cdfa7ef05c3a59878ae4b07d5e0c776962a075b
Signed-off-by: Melody Olvera <quic_molvera@quicinc.com>
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
2022-11-17 12:48:07 -08:00
Gokul krishna Krishnakumar
f5e30fb6c7 remoteproc: qcom_q6v5_pas: Add support to setup mpss dsm mem region
MPSS DSM mem region is needed by Modem PDs. This change
sets it up before bringing MPSS out of reset.

Change-Id: Ic882b678f373deb5c61e250f8620b5dd4c092ee2
Signed-off-by: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
Signed-off-by: Gokul krishna Krishnakumar <quic_gokukris@quicinc.com>
2022-11-17 12:45:33 -08:00
Soumen Ghosh
105298b2e1 msm:abi_gki: Add v4l2,video,display and gpu api to export symbols list
Adding symbols in abi file.

Change-Id: Ia8736cb08208353c4fc29b00cb61b1e41a79aa3b
Signed-off-by: Soumen Ghosh <quic_soumeng@quicinc.com>
2022-11-17 12:45:12 -08:00
John Moon
97cd4ddc27 pinctrl: qcom: Add wakeup_enable and wakeup_present bit
wakeup_enable bit sets the corresponding bit in the INTR_CFG register.

Also correct target bit to reflect its true position within the
INTR_CFG register.

This adds back a portion of commit 5ea61b95b8 ("pinctrl: qcom: Add
support to set wakeup_enable bit").

Change-Id: I50c4212c15cca02aff495c4af9ed5f91bc9cfa40
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-17 11:25:35 -08:00
Anjelique Melendez
a12988b252 leds: qti-flash:Show MAX_FLASH_CURRENT_MA for no battery use case
Show max_avail_current to MAX_FLASH_CURRENT_MA when there is no
battery power supply device available.

Change-Id: I6a854509d0432cf4b234bbb39422ce0d3031913b
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
2022-11-17 10:00:38 -08:00
Gaurav Kashyap
ec5eb04dfe defconfig: pineapple: enable tmecom and hwkm
Enable the following modules on pineapple, required
to use HWKM operations in TME.
CONFIG_MSM_TMECOM_QMP=m
CONFIG_QTI_HW_KEY_MANAGER=m.

Change-Id: If587bdd8e0c9d351e26c8fccea5807b01d7231b5
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-11-17 08:57:53 -08:00
Mao Jinlong
b134d14e96 coresight-tmc: set StopOnFl bit for etf
Set StopOnFl bit for etf to stop trace when FLUSH
is completed.

Change-Id: Idda16fcf1190960ac225c42ef41eaf01d8c286f2
Signed-off-by: Yuanfang Zhang <quic_yuanfang@quicinc.com>
Signed-off-by: Mao Jinlong <quic_jinlmao@quicinc.com>
2022-11-17 04:13:42 -08:00
Huang Yiwei
53003e4ca5 soc: qcom: llcc: ioremap resource only when multi_ch_reg exists
Since not all the platforms have multi_ch_reg, the usage of
devm_platform_ioremap_resource_byname will cause "invalid resource"
error, split it and ioremap resource only when multi_ch_reg exists
to avoid the error message.

Change-Id: I2f11eb139c3d9626685206eb3707917d70d3592d
Signed-off-by: Huang Yiwei <quic_hyiwei@quicinc.com>
2022-11-17 11:07:24 +08:00
Jishnu Prakash
f177d32612 iio: qcom-spmi-adc5-gen3: Update immediate read handling
Update logic used in immediate reading path to ensure that
immediate reads performed on channels monitored in ADC_TM
on all SDAMs work correctly.

Fixes: 2b91fcd524b0 ("iio: qcom-spmi-adc5-gen3: update API for immediate conversions")
Change-Id: I4a5b44c493058eed5d43ebed4d7a91cdf0fef29b
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
2022-11-15 13:19:43 -08:00
Maulik Shah
ea31d19faa soc: qcom: qcom_stats: Fix the DDR stats entry offset
Fix the DDR stats entry offset.

Change-Id: I4783d65c5d71721b6dc5fff1b39517377a8e2cbb
Signed-off-by: Maulik Shah <quic_mkshah@quicinc.com>
2022-11-15 14:08:59 +05:30
Mukesh Kumar Savaliya
6ab16af158 spi: spi-msm-geni: Keep IRQ disabled while requesting an IRQ
we are specifically enabling an IRQ at resume/suspend time, hence
keep it disabled while registering for an interrupt. Else this
results into double enablement and kernel dumps stack.

Change-Id: I6a0675d34ba307bbbd76f6e958bc1ffe7bfb2c66
Signed-off-by: Mukesh Kumar Savaliya <quic_msavaliy@quicinc.com>
2022-11-15 13:56:03 +05:30
Naman Jain
1f35818a0e soc: qcom: Add v19 support for socinfo
Add support for version 19 in socinfo which introduces fields
for reading fuse values to determine number of clusters,
boot cluster and boot core.

Change-Id: I0cce5109785fdd7b649b2185da7a9aff3cbdf5d0
Signed-off-by: Naman Jain <quic_namajain@quicinc.com>
2022-11-15 11:47:19 +05:30
David Collins
d2387a87e1 defconfig: pineapple-gki: enable SPMI PMIC arbiter debug driver
Enable the SPMI PMIC arbiter debug driver so that all PMIC
peripheral registers can be accessed for debugging purposes.

Change-Id: I55438db91688c200caa043621c32d00db49ba93b
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-11-14 18:40:37 -08:00
David Collins
83433ccb22 defconfig: pineapple-gki: enable regulator OCP notifier driver
Enable CONFIG_REGULATOR_QTI_OCP_NOTIFIER so that consumers can
receive notifications about regulator over-current (OCP) events.

Change-Id: I617c16aaba2d45bdc67721a9edb4880b63786e7e
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-11-14 18:40:37 -08:00
David Collins
b76b5edc79 defconfig: pineapple-gki: enable QFPROM and TSENS drivers
Enable the qcom-qfprom and qcom-tsens drivers.  This is
needed so that the qcom-spmi-temp-alarm driver can be compiled.

Change-Id: Iae6ff0def8b575da9ad5ae0c3b106c5f0f7eddc5
Signed-off-by: David Collins <quic_collinsd@quicinc.com>
2022-11-14 18:40:37 -08:00
John Moon
13a5aa4fac build: Export UAPI headers as Bazel cc_library
There's currently no way for userspace programs building with
Bazel to ingest the kernel UAPI headers. Kleaf generates a tarball
of the headers, but a Bazel cc_binary rule cannot use that as an
input.

Define a native Bazel header-only cc_library which userspace
programs can use to build with the kernel's UAPI headers. For
example:

cc_binary(
    name = "foo",
    srcs = ["foo.c"],
    deps = ["//msm-kernel:kalama_gki_uapi_header_library"],
)

Change-Id: Ib884d9123e4ffd0bead97e8cebb5a3456e73b2a6
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-14 16:02:01 -08:00
John Moon
c45c4b798b build: Refactor build_with_bazel.py to discover targets
Currently, the build_with_bazel.py script has an internal list
of targets. As we add/subtract targets, this becomes more difficult
to maintain. It also makes adding extra targets defined by
msm_kernel_extensions.bzl a manual process.

Instead, query the Bazel DAG to dynamically determine the
build targets based on input target name.

Change-Id: Id39889260b8f8af5c0c157ff091ee6e0d253c90f
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-14 15:59:51 -08:00
Gaurav Kashyap
e0fc08d3c0 soc: qcom: Decouple hwkm and fbe modules
Currently HWKM and FBE module compilations are bound
to each other, separate this out to remove the
dependencies.

Change-Id: I7735e14d95f332eff9e5ad7a6de9947e0ce9420d
Signed-off-by: Gaurav Kashyap <quic_gaurkash@quicinc.com>
2022-11-14 15:22:12 -08:00
John Moon
7f1305d0f5 build: adding top-level DDK headers definition
Currently, kernel_module() Kleaf rules will automatically include
kernel headers based on the input kernel_build parameter.

The new ddk_module() rule requires kernel headers to be explicitly
exported to the build system.

Change-Id: I3b4808270e0c70adf38ba382000172d7b81fda61
Signed-off-by: John Moon <quic_johmoo@quicinc.com>
2022-11-14 15:08:01 -08:00