mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/3] Add modemsmem for Google phones
@ 2026-11-16 15:50 David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 1/3] dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo David Heidelberg via B4 Relay
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-16 15:50 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sibi Sankar, Konrad Dybcio,
	Abel Vesa, Miro Mraz
  Cc: Richard Acayan, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel, phone-devel, David Heidelberg

The modem on the Pixel 3 family will not come up without the SoC
information Google's downstream kernel publishes in SMEM item 134.
This is the upstream version, modelled per review feedback as a
property of the modem remoteproc node rather than a standalone node
and driver.

This replaces the standalone drivers/soc/qcom/modemsmem driver from
the previous revision: per review feedback the requirement is better
modelled as a property of the modem remoteproc node, with the
conditional snippet in the remoteproc driver.

Changes in v2:
- Represent the requirement as a "google,require-socinfo" property on
  the MSS remoteproc node instead of a standalone node and driver.
  (Bjorn)
- Move the SMEM publish code into the qcom_q6v5_mss remoteproc driver,
  gated by the property. (Bjorn)
- Hard-code SMEM item id 134, no qcom,smem-id property. (Bjorn, Konrad)
- Drop the RFC prefix.
- Link to v1: https://patch.msgid.link/20260906-modemsmem-v1-0-a3634b553841@ixit.cz
    

---
David Heidelberg (3):
      dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo
      remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems
      arm64: dts: qcom: sdm845-google: Require modem socinfo

 .../bindings/remoteproc/qcom,msm8996-mss-pil.yaml  |  9 +++
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi |  2 +
 drivers/remoteproc/qcom_q6v5_mss.c                 | 75 ++++++++++++++++++++++
 3 files changed, 86 insertions(+)
---
base-commit: aaa2f954c21b205a0bcd0961e5b2be4e82e58455
change-id: 20260906-modemsmem-9a1dc1070f7b

Best regards,
--  
David Heidelberg <david@ixit.cz>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 1/3] dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo
  2026-11-16 15:50 [PATCH v3 0/3] Add modemsmem for Google phones David Heidelberg via B4 Relay
@ 2026-11-16 15:50 ` David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-google: Require modem socinfo David Heidelberg via B4 Relay
  2 siblings, 0 replies; 4+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-16 15:50 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sibi Sankar, Konrad Dybcio,
	Abel Vesa, Miro Mraz
  Cc: Richard Acayan, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel, phone-devel, David Heidelberg

From: David Heidelberg <david@ixit.cz>

The modem firmware on Google Pixel boards (Pixel 3 through Pixel 5a)
expects the application processor to publish the SoC platform type,
subtype and revision in the first vendor-reserved SMEM item before the
modem is started. Represent that requirement as a boolean property on
the MSS remoteproc node so the MSS driver can publish the data before
booting the modem, instead of carrying a separate node and driver for
it.

This patch was written with assistance from a large language model.

Signed-off-by: David Heidelberg <david@ixit.cz>
---
 .../devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml     | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml b/Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml
index 4a1b439f985e3..ecc6782a92245 100644
--- a/Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml
+++ b/Documentation/devicetree/bindings/remoteproc/qcom,msm8996-mss-pil.yaml
@@ -91,16 +91,25 @@ properties:
       - const: mss_restart
       - const: pdc_reset # only valid for qcom,sdm845-mss-pil
     minItems: 1
 
   qcom,qmp:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: Reference to the AOSS side-channel message RAM.
 
+  google,require-socinfo:
+    type: boolean
+    description:
+      The modem firmware on Google Pixel boards (Pixel 3 through Pixel 5a)
+      expects the application processor to publish the SoC platform type,
+      subtype and revision in the first vendor-reserved SMEM item (item 134)
+      before the modem is started. When present, the MSS driver fills that
+      item from the socinfo SMEM data before booting the modem.
+
   qcom,smem-states:
     $ref: /schemas/types.yaml#/definitions/phandle-array
     description: States used by the AP to signal the Hexagon core
     items:
       - description: Stop modem
         items:
           - description: Phandle to the Shared Memory Point 2 Point or Shared
               Memory Manager device handling the communication with a remote

-- 
2.55.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems
  2026-11-16 15:50 [PATCH v3 0/3] Add modemsmem for Google phones David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 1/3] dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo David Heidelberg via B4 Relay
@ 2026-11-16 15:50 ` David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-google: Require modem socinfo David Heidelberg via B4 Relay
  2 siblings, 0 replies; 4+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-16 15:50 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sibi Sankar, Konrad Dybcio,
	Abel Vesa, Miro Mraz
  Cc: Richard Acayan, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel, phone-devel, David Heidelberg

From: David Heidelberg <david@ixit.cz>

The modem firmware on Google Pixel boards (Pixel 3 through Pixel 5a)
reads the SoC platform type, subtype and revision from the first
vendor-reserved SMEM item (item 134) when it boots, and refuses to
come up unless the application processor has filled it in.

When the "google,require-socinfo" property is present on the MSS
remoteproc node, copy the relevant socinfo fields into that item from
the socinfo SMEM data before starting the modem. The SMEM item id and
layout are a contract between Google's downstream kernel and the modem
firmware rather than hardware, so they are hard-coded in the driver.

The item is written in full: modem_flag, efs_magic and ftm_magic are
left zero. Downstream fills modem_flag from a bootloader-provided
/chosen/cdt/cdb2 property that is not always present, and the two magic
values only matter for factory test mode.

Based on work of: Richard Acayan.
Adapted from the original form using both human & LLM work.

Suggested-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
---
 drivers/remoteproc/qcom_q6v5_mss.c | 75 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 75 insertions(+)

diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c
index dd052a62b8583..53deabea62259 100644
--- a/drivers/remoteproc/qcom_q6v5_mss.c
+++ b/drivers/remoteproc/qcom_q6v5_mss.c
@@ -23,27 +23,35 @@
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 #include <linux/remoteproc.h>
 #include <linux/reset.h>
 #include <linux/soc/qcom/mdt_loader.h>
 #include <linux/iopoll.h>
 #include <linux/slab.h>
+#include <linux/soc/qcom/smem.h>
+#include <linux/soc/qcom/socinfo.h>
 
 #include "remoteproc_internal.h"
 #include "qcom_common.h"
 #include "qcom_pil_info.h"
 #include "qcom_q6v5.h"
 
 #include <linux/firmware/qcom/qcom_pas.h>
 #include <linux/firmware/qcom/qcom_scm.h>
 
 #define MPSS_CRASH_REASON_SMEM		421
 
+/*
+ * First vendor-reserved SMEM item; Google's modem firmware reads the SoC
+ * platform information from it when the modem boots.
+ */
+#define SMEM_ID_VENDOR0			134
+
 #define MBA_LOG_SIZE			SZ_4K
 
 #define MPSS_PAS_ID			5
 
 /* RMB Status Register Values */
 #define RMB_PBL_SUCCESS			0x1
 
 #define RMB_MBA_XPU_UNLOCKED		0x1
@@ -247,16 +255,17 @@ struct q6v5 {
 	bool need_pas_mem_setup;
 	bool has_alt_reset;
 	bool has_mba_logs;
 	bool has_spare_reg;
 	bool has_qaccept_regs;
 	bool has_ext_bhs_reg;
 	bool has_ext_cntl_regs;
 	bool has_vq6;
+	bool need_socinfo;
 	u64 mpss_perm;
 	u64 mba_perm;
 	const char *hexagon_mdt_image;
 	int version;
 };
 
 enum {
 	MSS_MDM9607,
@@ -1668,22 +1677,86 @@ static void qcom_q6v5_dump_segment(struct rproc *rproc,
 						false, true,
 						qproc->mpss_phys,
 						qproc->mpss_size);
 			q6v5_mba_reclaim(qproc);
 		}
 	}
 }
 
+/* Layout of the vendor-defined SMEM item read by the Pixel modem firmware */
+struct modem_smem_info {
+	__le32 version;
+	__le32 modem_flag;
+	__le32 major_id;
+	__le32 minor_id;
+	__le32 subtype;
+	__le32 platform;
+	__le32 efs_magic;
+	__le32 ftm_magic;
+};
+
+#define MODEM_SMEM_VERSION	0
+#define PLAT_VER_TO_MAJOR_ID(v)	(((v) >> 16) & 0xff)
+#define PLAT_VER_TO_MINOR_ID(v)	((v) & 0xff)
+
+static int q6v5_socinfo_publish(struct q6v5 *qproc)
+{
+	struct modem_smem_info *info;
+	struct socinfo *socinfo;
+	u32 plat_ver;
+	int ret;
+
+	socinfo = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_HW_SW_BUILD_ID, NULL);
+	if (IS_ERR(socinfo))
+		return dev_err_probe(qproc->dev, PTR_ERR(socinfo),
+				     "could not get socinfo\n");
+
+	/* hw_plat_subtype was added in socinfo format 0.6 */
+	if (le32_to_cpu(socinfo->fmt) < SOCINFO_VERSION(0, 6))
+		return dev_err_probe(qproc->dev, -EOPNOTSUPP,
+				     "socinfo format too old\n");
+
+	/* -EEXIST: the item survived an earlier boot */
+	ret = qcom_smem_alloc(QCOM_SMEM_HOST_ANY, SMEM_ID_VENDOR0, sizeof(*info));
+	if (ret && ret != -EEXIST)
+		return dev_err_probe(qproc->dev, ret,
+				     "could not allocate modem smem\n");
+
+	info = qcom_smem_get(QCOM_SMEM_HOST_ANY, SMEM_ID_VENDOR0, NULL);
+	if (IS_ERR(info))
+		return dev_err_probe(qproc->dev, PTR_ERR(info),
+				     "could not get modem smem\n");
+
+	plat_ver = le32_to_cpu(socinfo->plat_ver);
+
+	/* modem_flag, efs_magic and ftm_magic are left zero */
+	*info = (struct modem_smem_info) {
+		.version   = cpu_to_le32(MODEM_SMEM_VERSION),
+		.major_id  = cpu_to_le32(PLAT_VER_TO_MAJOR_ID(plat_ver)),
+		.minor_id  = cpu_to_le32(PLAT_VER_TO_MINOR_ID(plat_ver)),
+		.subtype   = socinfo->hw_plat_subtype,
+		.platform  = socinfo->hw_plat,
+	};
+
+	return 0;
+}
+
 static int q6v5_start(struct rproc *rproc)
 {
 	struct q6v5 *qproc = rproc->priv;
 	int xfermemop_ret;
 	int ret;
 
+	if (qproc->need_socinfo) {
+		ret = q6v5_socinfo_publish(qproc);
+		if (ret)
+			return ret;
+	}
+
 	ret = q6v5_mba_load(qproc);
 	if (ret)
 		return ret;
 
 	dev_info(qproc->dev, "MBA booted with%s debug policy, loading mpss\n",
 		 qproc->dp_size ? "" : "out");
 
 	ret = q6v5_mpss_load(qproc);
@@ -2127,16 +2200,18 @@ static int q6v5_probe(struct platform_device *pdev)
 
 	platform_set_drvdata(pdev, qproc);
 
 	qproc->has_qaccept_regs = desc->has_qaccept_regs;
 	qproc->has_ext_bhs_reg = desc->has_ext_bhs_reg;
 	qproc->has_ext_cntl_regs = desc->has_ext_cntl_regs;
 	qproc->has_vq6 = desc->has_vq6;
 	qproc->has_spare_reg = desc->has_spare_reg;
+	qproc->need_socinfo =
+		of_property_read_bool(pdev->dev.of_node, "google,require-socinfo");
 	ret = q6v5_init_mem(qproc, pdev);
 	if (ret)
 		return ret;
 
 	ret = q6v5_alloc_memory_region(qproc);
 	if (ret)
 		return ret;
 

-- 
2.55.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v3 3/3] arm64: dts: qcom: sdm845-google: Require modem socinfo
  2026-11-16 15:50 [PATCH v3 0/3] Add modemsmem for Google phones David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 1/3] dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo David Heidelberg via B4 Relay
  2026-11-16 15:50 ` [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems David Heidelberg via B4 Relay
@ 2026-11-16 15:50 ` David Heidelberg via B4 Relay
  2 siblings, 0 replies; 4+ messages in thread
From: David Heidelberg via B4 Relay @ 2026-11-16 15:50 UTC (permalink / raw)
  To: Bjorn Andersson, Mathieu Poirier, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Sibi Sankar, Konrad Dybcio,
	Abel Vesa, Miro Mraz
  Cc: Richard Acayan, linux-arm-msm, linux-remoteproc, devicetree,
	linux-kernel, phone-devel, David Heidelberg

From: David Heidelberg <david@ixit.cz>

The modem firmware on the Google Pixel 3 and Pixel 3 XL reads the SoC
platform information from the first vendor-reserved SMEM item before
booting. Add the google,require-socinfo property to the MSS remoteproc
node so the MSS driver publishes it.

Signed-off-by: David Heidelberg <david@ixit.cz>
---
 arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
index 3c9656b88b696..0a18d9a124566 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-google-common.dtsi
@@ -426,16 +426,18 @@ &ipa {
 &mdss {
 	status = "okay";
 };
 
 &mss_pil {
 	firmware-name = "qcom/sdm845/Google/blueline/mba.mbn",
 			"qcom/sdm845/Google/blueline/modem.mbn";
 
+	google,require-socinfo;
+
 	status = "okay";
 };
 
 &pm8998_gpios {
 	volume_up_gpio: vol-up-active-state {
 		pins = "gpio6";
 		function = "normal";
 		input-enable;

-- 
2.55.0



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-16 15:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-16 15:50 [PATCH v3 0/3] Add modemsmem for Google phones David Heidelberg via B4 Relay
2026-11-16 15:50 ` [PATCH v3 1/3] dt-bindings: remoteproc: qcom,msm8996-mss-pil: Document google,require-socinfo David Heidelberg via B4 Relay
2026-11-16 15:50 ` [PATCH v3 2/3] remoteproc: qcom_q6v5_mss: Publish socinfo for Pixel modems David Heidelberg via B4 Relay
2026-11-16 15:50 ` [PATCH v3 3/3] arm64: dts: qcom: sdm845-google: Require modem socinfo David Heidelberg via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®