Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f7cd0735 authored by Mukesh Ojha's avatar Mukesh Ojha Committed by Gerrit - the friendly Code Review server
Browse files

soc: qcom: socinfo: Add revision 16 support in socinfo structure



Below are some new fields are getting updated in socinfo
structure from bootloader under revision 16.
e.g

esku;
nproduct_code;
npartnamemap_offset;
nnum_partname_mapping;

Add the change in socinfo driver to accommodate this.

Change-Id: I11b5182c15af32da61cddbf4bb45d5aef390135a
Signed-off-by: default avatarMukesh Ojha <quic_mojha@quicinc.com>
Signed-off-by: default avatarSwetha Chikkaboraiah <quic_schikk@quicinc.com>
parent d7257578
Loading
Loading
Loading
Loading
+36 −1
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2009-2021, The Linux Foundation. All rights reserved.
 * Copyright (c) 2022, Qualcomm Innovation Center, Inc. All rights reserved.
 */

#define pr_fmt(fmt) "%s: " fmt, __func__
@@ -209,6 +210,14 @@ struct socinfo_v0_15 {
	uint32_t nmodem_supported;
};

struct socinfo_v0_16 {
	struct socinfo_v0_15 v0_15;
	__le32  esku;
	__le32  nproduct_code;
	__le32  npartnamemap_offset;
	__le32  nnum_partname_mapping;
};

static union {
	struct socinfo_v0_1 v0_1;
	struct socinfo_v0_2 v0_2;
@@ -225,10 +234,11 @@ static union {
	struct socinfo_v0_13 v0_13;
	struct socinfo_v0_14 v0_14;
	struct socinfo_v0_15 v0_15;
	struct socinfo_v0_16 v0_16;
} *socinfo;

/* max socinfo format version supported */
#define MAX_SOCINFO_FORMAT SOCINFO_VERSION(0, 15)
#define MAX_SOCINFO_FORMAT SOCINFO_VERSION(0, 16)

static struct msm_soc_info cpu_of_id[] = {
	[0]  = {MSM_CPU_UNKNOWN, "Unknown CPU"},
@@ -1489,6 +1499,7 @@ static void __init populate_soc_sysfs_files(struct device *msm_soc_device)
	device_create_file(msm_soc_device, &images);

	switch (socinfo_format) {
	case SOCINFO_VERSION(0, 16):
	case SOCINFO_VERSION(0, 15):
		device_create_file(msm_soc_device,
					&msm_soc_attr_nmodem_supported);
@@ -1787,6 +1798,30 @@ static void socinfo_print(void)
			socinfo->v0_15.nmodem_supported);
		break;

	case SOCINFO_VERSION(0, 16):
		pr_info("v%u.%u, id=%u, ver=%u.%u, raw_id=%u, raw_ver=%u, hw_plat=%u, hw_plat_ver=%u\n accessory_chip=%u, hw_plat_subtype=%u, pmic_model=%u, pmic_die_revision=%u foundry_id=%u serial_number=%u num_pmics=%u chip_family=0x%x raw_device_family=0x%x raw_device_number=0x%x nproduct_id=0x%x num_clusters=0x%x ncluster_array_offset=0x%x num_subset_parts=0x%x nsubset_parts_array_offset=0x%x nmodem_supported=0x%x\n",
			f_maj, f_min, socinfo->v0_1.id, v_maj, v_min,
			socinfo->v0_2.raw_id, socinfo->v0_2.raw_version,
			socinfo->v0_3.hw_platform,
			socinfo->v0_4.platform_version,
			socinfo->v0_5.accessory_chip,
			socinfo->v0_6.hw_platform_subtype,
			socinfo->v0_7.pmic_model,
			socinfo->v0_7.pmic_die_revision,
			socinfo->v0_9.foundry_id,
			socinfo->v0_10.serial_number,
			socinfo->v0_11.num_pmics,
			socinfo->v0_12.chip_family,
			socinfo->v0_12.raw_device_family,
			socinfo->v0_12.raw_device_number,
			socinfo->v0_13.nproduct_id,
			socinfo->v0_14.num_clusters,
			socinfo->v0_14.ncluster_array_offset,
			socinfo->v0_14.num_subset_parts,
			socinfo->v0_14.nsubset_parts_array_offset,
			socinfo->v0_15.nmodem_supported);
		break;

	default:
		pr_err("Unknown format found: v%u.%u\n", f_maj, f_min);
		break;