Qualcomm Atheros IPQ807x is a modern WiSoC featuring: * Quad Core ARMv8 Cortex A-53 * @ 2.2 GHz (IPQ8072A/4A/6A/8A) Codename Hawkeye * @ 1.4 GHz (IPQ8070A/1A) Codename Acorn * Dual Band simultaneaous IEEE 802.11ax * 5G: 8x8/80 or 4x4/160MHz (IPQ8074A/8A) * 5G: 4x4/80 or 2x2/160MHz (IPQ8071A/2A/6A) * 5G: 2x2/80MHz (IPQ8070A) * 2G: 4x4/40MHz (IPQ8072A/4A/6A/8A) * 2G: 2x2/40MHz (IPQ8070A/1A) * 1x PSGMII via QCA8072/5 (Max 5x 1GbE ports) * 2x SGMII/USXGMII (1/2.5/5/10 GbE) on Hawkeye * 2x SGMII/USXGMII (1/2.5/5 GbE) on Acorn * DDR3L/4 32/16 bit up to 2400MT/s * SDIO 3.0/SD card 3.0/eMMC 5.1 * Dual USB 3.0 * One PCIe Gen2.1 and one PCIe Gen3.0 port (Single lane) * Parallel NAND (ONFI)/LCD * 6x QUP BLSP SPI/I2C/UART * I2S, PCM, and TDMA * HW PWM * 1.8V configurable GPIO * Companion PMP8074 PMIC via SPMI (GPIOS, RTC etc) Note that only v2 SOC models aka the ones ending with A suffix are supported, v1 models do not comply to the final 802.11ax and have lower clocks, lack the Gen3 PCIe etc. SoC itself has two UBI32 cores for the NSS offloading system, however currently no offloading is supported. Signed-off-by: Robert Marko <robimarko@gmail.com>
107 lines
2.9 KiB
Diff
107 lines
2.9 KiB
Diff
From 85bf71b130ab0e939f53ec9cf1131d67d148bc9a Mon Sep 17 00:00:00 2001
|
|
From: Robert Marko <robimarko@gmail.com>
|
|
Date: Sat, 31 Dec 2022 12:45:31 +0100
|
|
Subject: [PATCH] cpufreq: qcom-nvmem: make qcom_cpufreq_get_msm_id() return
|
|
the SoC ID
|
|
|
|
Currently, qcom_cpufreq_get_msm_id() does not simply return the SoC ID
|
|
after getting it via SMEM call but instead uses an enum to encode the
|
|
matched SMEM ID to 2 variants of MSM8996 which are then used in
|
|
qcom_cpufreq_kryo_name_version() to set the supported version.
|
|
|
|
This prevents qcom_cpufreq_get_msm_id() from being universal and its doing
|
|
more than its name suggests, so lets make it just return the SoC ID
|
|
directly which allows matching directly on the SoC ID and removes the need
|
|
for msm8996_version enum which simplifies the driver.
|
|
It also allows reusing the qcom_cpufreq_get_msm_id() for new SoC-s.
|
|
|
|
Signed-off-by: Robert Marko <robimarko@gmail.com>
|
|
---
|
|
drivers/cpufreq/qcom-cpufreq-nvmem.c | 44 ++++++++--------------------
|
|
1 file changed, 12 insertions(+), 32 deletions(-)
|
|
|
|
--- a/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
|
+++ b/drivers/cpufreq/qcom-cpufreq-nvmem.c
|
|
@@ -32,12 +32,6 @@
|
|
|
|
#include <dt-bindings/arm/qcom,ids.h>
|
|
|
|
-enum _msm8996_version {
|
|
- MSM8996_V3,
|
|
- MSM8996_SG,
|
|
- NUM_OF_MSM8996_VERSIONS,
|
|
-};
|
|
-
|
|
struct qcom_cpufreq_drv;
|
|
|
|
struct qcom_cpufreq_match_data {
|
|
@@ -136,30 +130,16 @@ static void get_krait_bin_format_b(struc
|
|
dev_dbg(cpu_dev, "PVS version: %d\n", *pvs_ver);
|
|
}
|
|
|
|
-static enum _msm8996_version qcom_cpufreq_get_msm_id(void)
|
|
+static int qcom_cpufreq_get_msm_id(void)
|
|
{
|
|
size_t len;
|
|
struct socinfo *info;
|
|
- enum _msm8996_version version;
|
|
|
|
info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, &len);
|
|
if (IS_ERR(info))
|
|
- return NUM_OF_MSM8996_VERSIONS;
|
|
-
|
|
- switch (info->id) {
|
|
- case QCOM_ID_MSM8996:
|
|
- case QCOM_ID_APQ8096:
|
|
- version = MSM8996_V3;
|
|
- break;
|
|
- case QCOM_ID_MSM8996SG:
|
|
- case QCOM_ID_APQ8096SG:
|
|
- version = MSM8996_SG;
|
|
- break;
|
|
- default:
|
|
- version = NUM_OF_MSM8996_VERSIONS;
|
|
- }
|
|
+ return PTR_ERR(info);
|
|
|
|
- return version;
|
|
+ return info->id;
|
|
}
|
|
|
|
static int qcom_cpufreq_kryo_name_version(struct device *cpu_dev,
|
|
@@ -168,25 +148,25 @@ static int qcom_cpufreq_kryo_name_versio
|
|
struct qcom_cpufreq_drv *drv)
|
|
{
|
|
size_t len;
|
|
+ int msm_id;
|
|
u8 *speedbin;
|
|
- enum _msm8996_version msm8996_version;
|
|
*pvs_name = NULL;
|
|
|
|
- msm8996_version = qcom_cpufreq_get_msm_id();
|
|
- if (NUM_OF_MSM8996_VERSIONS == msm8996_version) {
|
|
- dev_err(cpu_dev, "Not Snapdragon 820/821!");
|
|
- return -ENODEV;
|
|
- }
|
|
+ msm_id = qcom_cpufreq_get_msm_id();
|
|
+ if (msm_id < 0)
|
|
+ return msm_id;
|
|
|
|
speedbin = nvmem_cell_read(speedbin_nvmem, &len);
|
|
if (IS_ERR(speedbin))
|
|
return PTR_ERR(speedbin);
|
|
|
|
- switch (msm8996_version) {
|
|
- case MSM8996_V3:
|
|
+ switch (msm_id) {
|
|
+ case QCOM_ID_MSM8996:
|
|
+ case QCOM_ID_APQ8096:
|
|
drv->versions = 1 << (unsigned int)(*speedbin);
|
|
break;
|
|
- case MSM8996_SG:
|
|
+ case QCOM_ID_MSM8996SG:
|
|
+ case QCOM_ID_APQ8096SG:
|
|
drv->versions = 1 << ((unsigned int)(*speedbin) + 4);
|
|
break;
|
|
default:
|