mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 06:44:00 -04:00
Currently, ath12k AHB (in IPQ5332) uses SCM calls to authenticate the firmware image to bring up userpd. From IPQ5424 onwards, Q6 firmware can directly communicate with the Trusted Management Engine - Lite (TME-L), eliminating the need for SCM calls for userpd bring-up. Hence, to enable IPQ5424 device support, use qcom_mdt_load_no_init() and skip the SCM call as Q6 will directly authenticate the userpd firmware. Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5332 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1 Tested-on: IPQ5424 hw1.0 AHB WLAN.WBE.1.6-01275-QCAHKSWPL_SILICONZ-1 Signed-off-by: Sowmiya Sree Elavalagan <sowmiya.elavalagan@oss.qualcomm.com> Co-developed-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com> Signed-off-by: Saravanakumar Duraisamy <quic_saradura@quicinc.com> Co-developed-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com> Signed-off-by: Raj Kumar Bhagat <raj.bhagat@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260407-ath12k-ipq5424-v5-6-8e96aa660ec4@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
84 lines
2.0 KiB
C
84 lines
2.0 KiB
C
// SPDX-License-Identifier: BSD-3-Clause-Clear
|
|
/*
|
|
* Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
|
|
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
|
|
*/
|
|
|
|
#include <linux/of_device.h>
|
|
#include <linux/platform_device.h>
|
|
#include <linux/soc/qcom/mdt_loader.h>
|
|
#include "../ahb.h"
|
|
#include "ahb.h"
|
|
#include "../debug.h"
|
|
#include "../hif.h"
|
|
#include "hw.h"
|
|
#include "dp.h"
|
|
#include "core.h"
|
|
|
|
static const struct of_device_id ath12k_wifi7_ahb_of_match[] = {
|
|
{ .compatible = "qcom,ipq5332-wifi",
|
|
.data = (void *)ATH12K_HW_IPQ5332_HW10,
|
|
},
|
|
{ .compatible = "qcom,ipq5424-wifi",
|
|
.data = (void *)ATH12K_HW_IPQ5424_HW10,
|
|
},
|
|
{ }
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE(of, ath12k_wifi7_ahb_of_match);
|
|
|
|
static int ath12k_wifi7_ahb_probe(struct platform_device *pdev)
|
|
{
|
|
struct ath12k_ahb *ab_ahb;
|
|
enum ath12k_hw_rev hw_rev;
|
|
struct ath12k_base *ab;
|
|
int ret;
|
|
|
|
ab = platform_get_drvdata(pdev);
|
|
ab_ahb = ath12k_ab_to_ahb(ab);
|
|
|
|
hw_rev = (enum ath12k_hw_rev)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);
|
|
switch (hw_rev) {
|
|
case ATH12K_HW_IPQ5332_HW10:
|
|
ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
|
|
ab_ahb->scm_auth_enabled = true;
|
|
break;
|
|
case ATH12K_HW_IPQ5424_HW10:
|
|
ab_ahb->userpd_id = ATH12K_IPQ5332_USERPD_ID;
|
|
ab_ahb->scm_auth_enabled = false;
|
|
break;
|
|
default:
|
|
return -EOPNOTSUPP;
|
|
}
|
|
|
|
ab->target_mem_mode = ATH12K_QMI_MEMORY_MODE_DEFAULT;
|
|
ab->hw_rev = hw_rev;
|
|
|
|
ret = ath12k_wifi7_hw_init(ab);
|
|
if (ret) {
|
|
ath12k_err(ab, "WiFi-7 hw_init for AHB failed: %d\n", ret);
|
|
return ret;
|
|
}
|
|
|
|
return 0;
|
|
}
|
|
|
|
static struct ath12k_ahb_driver ath12k_wifi7_ahb_driver = {
|
|
.name = "ath12k_wifi7_ahb",
|
|
.id_table = ath12k_wifi7_ahb_of_match,
|
|
.ops.probe = ath12k_wifi7_ahb_probe,
|
|
.ops.arch_init = ath12k_wifi7_arch_init,
|
|
.ops.arch_deinit = ath12k_wifi7_arch_deinit,
|
|
};
|
|
|
|
int ath12k_wifi7_ahb_init(void)
|
|
{
|
|
return ath12k_ahb_register_driver(ATH12K_DEVICE_FAMILY_WIFI7,
|
|
&ath12k_wifi7_ahb_driver);
|
|
}
|
|
|
|
void ath12k_wifi7_ahb_exit(void)
|
|
{
|
|
ath12k_ahb_unregister_driver(ATH12K_DEVICE_FAMILY_WIFI7);
|
|
}
|