Skip to content

Commit a66cc65

Browse files
committed
Merge tag 'qcom-drivers-for-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux into soc/drivers
Qualcomm driver updates for v7.1 Add ECS LIVA QC710, Glymur CRD, Mahua CRD, Purwa IoT EVK, and Asus Vivobook to the QSEECOM allow-list, to enable UEFI variable access through uefisecapp. Register the Gunyah watchdog device if the SCM driver finds itself running under Gunyah. Clean up some locking using guards. Handle possible cases where AOSS cooling state is given a non-boolean state. Replace LLCC per-slice activation bitmap with reference counting. Also add SDM670 support. Improve probe deferral handling in the OCMEM driver. Add Milos, QCS615, Eliza, Glymur, and Mahua support to the pd-mapper. Add support for SoCCP-based pmic-glink, as found in Glymur and Kaanapali. Add common QMI service ids to the main qmi headerfile, to avoid spreading these constants in various drivers. Add support for version 2 of SMP2P and implement the irqchip state reading support. Add CQ7790, SA8650P, SM7450, SM7450P, and IPQ5210 SoC and the PM7550BA PMIC identifiers to the socinfo driver. Add Eliza and Mahua support to the UBWC driver, introduce helpers for drivers to read out min_acc length and other programmable values, and disable bank swizzling for Glymur. Simplify the logic related to allocation of NV download request in the WCNSS control driver. * tag 'qcom-drivers-for-7.1' of https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux: (51 commits) soc: qcom: ubwc: add helpers to get programmable values soc: qcom: ubwc: add helper to get min_acc length firmware: qcom: scm: Register gunyah watchdog device soc: qcom: socinfo: Add SoC ID for SA8650P dt-bindings: arm: qcom,ids: Add SoC ID for SA8650P firmware: qcom: scm: Allow QSEECOM on Mahua CRD soc: qcom: wcnss: simplify allocation of req soc: qcom: pd-mapper: Add support for Eliza soc: qcom: aoss: compare against normalized cooling state soc: qcom: llcc: fix v1 SB syndrome register offset dt-bindings: firmware: qcom,scm: Document ipq9650 SCM soc: qcom: ubwc: Add support for Mahua soc: qcom: pd-mapper: Add support for Glymur and Mahua soc: qcom: ubwc: Add configuration Eliza SoC soc: qcom: ubwc: Remove redundant x1e80100_data dt-bindings: firmware: qcom,scm: document Eliza SCM Firmware Interface soc: qcom: ocmem: return -EPROBE_DEFER is ocmem is not available soc: qcom: ocmem: register reasons for probe deferrals soc: qcom: ocmem: make the core clock optional soc: qcom: ubwc: disable bank swizzling for Glymur platform ... Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents fbf57f2 + d6e766e commit a66cc65

21 files changed

Lines changed: 480 additions & 139 deletions

File tree

Documentation/devicetree/bindings/cache/qcom,llcc.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ properties:
3333
- qcom,sc7280-llcc
3434
- qcom,sc8180x-llcc
3535
- qcom,sc8280xp-llcc
36+
- qcom,sdm670-llcc
3637
- qcom,sdm845-llcc
3738
- qcom,sm6350-llcc
3839
- qcom,sm7150-llcc
@@ -204,6 +205,7 @@ allOf:
204205
contains:
205206
enum:
206207
- qcom,sc7280-llcc
208+
- qcom,sdm670-llcc
207209
then:
208210
properties:
209211
reg:

Documentation/devicetree/bindings/firmware/qcom,scm.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@ properties:
2323
- enum:
2424
- qcom,scm-apq8064
2525
- qcom,scm-apq8084
26+
- qcom,scm-eliza
2627
- qcom,scm-glymur
2728
- qcom,scm-ipq4019
2829
- qcom,scm-ipq5018
30+
- qcom,scm-ipq5210
2931
- qcom,scm-ipq5332
3032
- qcom,scm-ipq5424
3133
- qcom,scm-ipq6018
3234
- qcom,scm-ipq806x
3335
- qcom,scm-ipq8074
3436
- qcom,scm-ipq9574
37+
- qcom,scm-ipq9650
3538
- qcom,scm-kaanapali
3639
- qcom,scm-mdm9607
3740
- qcom,scm-milos
@@ -204,6 +207,7 @@ allOf:
204207
compatible:
205208
contains:
206209
enum:
210+
- qcom,scm-eliza
207211
- qcom,scm-kaanapali
208212
- qcom,scm-milos
209213
- qcom,scm-sm8450

Documentation/devicetree/bindings/soc/qcom/qcom,pmic-glink.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ properties:
2323
oneOf:
2424
- items:
2525
- enum:
26+
- qcom,glymur-pmic-glink
27+
- qcom,kaanapali-pmic-glink
2628
- qcom,qcm6490-pmic-glink
2729
- qcom,sc8180x-pmic-glink
2830
- qcom,sc8280xp-pmic-glink

drivers/firmware/qcom/qcom_qseecom_uefisecapp.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -699,20 +699,18 @@ static DEFINE_MUTEX(__qcuefi_lock);
699699

700700
static int qcuefi_set_reference(struct qcuefi_client *qcuefi)
701701
{
702-
mutex_lock(&__qcuefi_lock);
702+
guard(mutex)(&__qcuefi_lock);
703703

704-
if (qcuefi && __qcuefi) {
705-
mutex_unlock(&__qcuefi_lock);
704+
if (qcuefi && __qcuefi)
706705
return -EEXIST;
707-
}
708706

709707
__qcuefi = qcuefi;
710708

711-
mutex_unlock(&__qcuefi_lock);
712709
return 0;
713710
}
714711

715712
static struct qcuefi_client *qcuefi_acquire(void)
713+
__acquires(__qcuefi_lock)
716714
{
717715
mutex_lock(&__qcuefi_lock);
718716
if (!__qcuefi) {
@@ -723,6 +721,7 @@ static struct qcuefi_client *qcuefi_acquire(void)
723721
}
724722

725723
static void qcuefi_release(void)
724+
__releases(__qcuefi_lock)
726725
{
727726
mutex_unlock(&__qcuefi_lock);
728727
}

drivers/firmware/qcom/qcom_scm.c

Lines changed: 63 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,19 +199,18 @@ static int qcom_scm_bw_enable(void)
199199
if (!__scm->path)
200200
return 0;
201201

202-
mutex_lock(&__scm->scm_bw_lock);
202+
guard(mutex)(&__scm->scm_bw_lock);
203+
203204
if (!__scm->scm_vote_count) {
204205
ret = icc_set_bw(__scm->path, 0, UINT_MAX);
205206
if (ret < 0) {
206207
dev_err(__scm->dev, "failed to set bandwidth request\n");
207-
goto err_bw;
208+
return ret;
208209
}
209210
}
210211
__scm->scm_vote_count++;
211-
err_bw:
212-
mutex_unlock(&__scm->scm_bw_lock);
213212

214-
return ret;
213+
return 0;
215214
}
216215

217216
static void qcom_scm_bw_disable(void)
@@ -923,14 +922,13 @@ struct resource_table *qcom_scm_pas_get_rsc_table(struct qcom_scm_pas_context *c
923922
goto free_input_rt;
924923
}
925924

926-
tbl_ptr = kzalloc(size, GFP_KERNEL);
925+
tbl_ptr = kmemdup(output_rt_tzm, size, GFP_KERNEL);
927926
if (!tbl_ptr) {
928927
qcom_tzmem_free(output_rt_tzm);
929928
ret = -ENOMEM;
930929
goto free_input_rt;
931930
}
932931

933-
memcpy(tbl_ptr, output_rt_tzm, size);
934932
*output_rt_size = size;
935933
qcom_tzmem_free(output_rt_tzm);
936934

@@ -2290,11 +2288,13 @@ EXPORT_SYMBOL_GPL(qcom_scm_qseecom_app_send);
22902288
*/
22912289
static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
22922290
{ .compatible = "asus,vivobook-s15" },
2291+
{ .compatible = "asus,vivobook-s15-x1p4" },
22932292
{ .compatible = "asus,zenbook-a14-ux3407qa" },
22942293
{ .compatible = "asus,zenbook-a14-ux3407ra" },
22952294
{ .compatible = "dell,inspiron-14-plus-7441" },
22962295
{ .compatible = "dell,latitude-7455" },
22972296
{ .compatible = "dell,xps13-9345" },
2297+
{ .compatible = "ecs,liva-qc710" },
22982298
{ .compatible = "hp,elitebook-ultra-g1q" },
22992299
{ .compatible = "hp,omnibook-x14" },
23002300
{ .compatible = "huawei,gaokun3" },
@@ -2309,7 +2309,10 @@ static const struct of_device_id qcom_scm_qseecom_allowlist[] __maybe_unused = {
23092309
{ .compatible = "microsoft,denali", },
23102310
{ .compatible = "microsoft,romulus13", },
23112311
{ .compatible = "microsoft,romulus15", },
2312+
{ .compatible = "qcom,glymur-crd" },
23122313
{ .compatible = "qcom,hamoa-iot-evk" },
2314+
{ .compatible = "qcom,mahua-crd" },
2315+
{ .compatible = "qcom,purwa-iot-evk" },
23132316
{ .compatible = "qcom,sc8180x-primus" },
23142317
{ .compatible = "qcom,x1e001de-devkit" },
23152318
{ .compatible = "qcom,x1e80100-crd" },
@@ -2467,6 +2470,56 @@ int qcom_scm_qtee_callback_response(phys_addr_t buf, size_t buf_size,
24672470
}
24682471
EXPORT_SYMBOL(qcom_scm_qtee_callback_response);
24692472

2473+
static void qcom_scm_gunyah_wdt_free(void *data)
2474+
{
2475+
struct platform_device *gunyah_wdt_dev = data;
2476+
2477+
platform_device_unregister(gunyah_wdt_dev);
2478+
}
2479+
2480+
static void qcom_scm_gunyah_wdt_init(struct qcom_scm *scm)
2481+
{
2482+
struct platform_device *gunyah_wdt_dev;
2483+
struct device_node *np;
2484+
bool of_wdt_available;
2485+
int i;
2486+
static const uuid_t gunyah_uuid = UUID_INIT(0xc1d58fcd, 0xa453, 0x5fdb,
2487+
0x92, 0x65, 0xce, 0x36,
2488+
0x67, 0x3d, 0x5f, 0x14);
2489+
static const char * const of_wdt_compatible[] = {
2490+
"qcom,kpss-wdt",
2491+
"arm,sbsa-gwdt",
2492+
};
2493+
2494+
/* Bail out if we are not running under Gunyah */
2495+
if (!IS_ENABLED(CONFIG_HAVE_ARM_SMCCC_DISCOVERY) ||
2496+
!arm_smccc_hypervisor_has_uuid(&gunyah_uuid))
2497+
return;
2498+
2499+
/*
2500+
* Gunyah emulates either of Qualcomm watchdog or ARM SBSA watchdog on
2501+
* newer platforms. Bail out if we find them in the devicetree.
2502+
*/
2503+
for (i = 0; i < ARRAY_SIZE(of_wdt_compatible); i++) {
2504+
np = of_find_compatible_node(NULL, NULL, of_wdt_compatible[i]);
2505+
of_wdt_available = of_device_is_available(np);
2506+
of_node_put(np);
2507+
if (of_wdt_available)
2508+
return;
2509+
}
2510+
2511+
gunyah_wdt_dev = platform_device_register_simple("gunyah-wdt", -1,
2512+
NULL, 0);
2513+
if (IS_ERR(gunyah_wdt_dev)) {
2514+
dev_err(scm->dev, "Failed to register Gunyah watchdog device: %ld\n",
2515+
PTR_ERR(gunyah_wdt_dev));
2516+
return;
2517+
}
2518+
2519+
devm_add_action_or_reset(scm->dev, qcom_scm_gunyah_wdt_free,
2520+
gunyah_wdt_dev);
2521+
}
2522+
24702523
static void qcom_scm_qtee_free(void *data)
24712524
{
24722525
struct platform_device *qtee_dev = data;
@@ -2811,6 +2864,9 @@ static int qcom_scm_probe(struct platform_device *pdev)
28112864
/* Initialize the QTEE object interface. */
28122865
qcom_scm_qtee_init(scm);
28132866

2867+
/* Initialize the Gunyah watchdog platform device. */
2868+
qcom_scm_gunyah_wdt_init(scm);
2869+
28142870
return 0;
28152871
}
28162872

0 commit comments

Comments
 (0)