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

Commit 2ecac020 authored by David Keitel's avatar David Keitel
Browse files

soc: qcom: socinfo: Add support for socinfo v10



A new socinfo format version 10 is added with support
for serial number. Update the socinfo struct to reflect
this change.

Change-Id: I0488313074f807ff2ba8b9d7dc6edb6e9bdf4d74
Signed-off-by: default avatarDavid Keitel <dkeitel@codeaurora.org>
parent f1a9f6d4
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
@@ -188,6 +188,13 @@ struct socinfo_v9 {
	uint32_t foundry_id;
};

struct socinfo_v10 {
	struct socinfo_v9 v9;

	/* only valid when format==10*/
	uint32_t serial_number;
};

static union {
	struct socinfo_v1 v1;
	struct socinfo_v2 v2;
@@ -198,6 +205,7 @@ static union {
	struct socinfo_v7 v7;
	struct socinfo_v8 v8;
	struct socinfo_v9 v9;
	struct socinfo_v10 v10;
} *socinfo;

static struct msm_soc_info cpu_of_id[] = {
@@ -1024,6 +1032,7 @@ static void __init populate_soc_sysfs_files(struct device *msm_soc_device)
	device_create_file(msm_soc_device, &select_image);

	switch (legacy_format) {
	case 10:
	case 9:
		 device_create_file(msm_soc_device,
					&msm_soc_attr_foundry_id);
@@ -1199,6 +1208,22 @@ static void socinfo_print(void)
			socinfo->v7.pmic_die_revision,
			socinfo->v9.foundry_id);
		break;
	case 10:
		pr_info("%s: v%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\n",
			__func__,
			socinfo->v1.format,
			socinfo->v1.id,
			SOCINFO_VERSION_MAJOR(socinfo->v1.version),
			SOCINFO_VERSION_MINOR(socinfo->v1.version),
			socinfo->v2.raw_id, socinfo->v2.raw_version,
			socinfo->v3.hw_platform, socinfo->v4.platform_version,
			socinfo->v5.accessory_chip,
			socinfo->v6.hw_platform_subtype,
			socinfo->v7.pmic_model,
			socinfo->v7.pmic_die_revision,
			socinfo->v9.foundry_id,
			socinfo->v10.serial_number);
		break;

	default:
		pr_err("%s: Unknown format found\n", __func__);
@@ -1213,6 +1238,12 @@ int __init socinfo_init(void)
	if (socinfo_init_done)
		return 0;

	socinfo = smem_find(SMEM_HW_SW_BUILD_ID,
				sizeof(struct socinfo_v10),
				0,
				SMEM_ANY_HOST_FLAG);

	if (IS_ERR_OR_NULL(socinfo))
		socinfo = smem_find(SMEM_HW_SW_BUILD_ID,
				sizeof(struct socinfo_v9),
				0,