All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver
@ 2021-12-21 18:28 Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-21 18:28 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz
  Cc: Felipe Balbi, linux-arm-msm, platform-driver-x86, linux-kernel,
	devicetree, Jarrett Schultz

From: Jarrett Schultz <jaschultz@microsoft.com>

Introduce the Surface Extensible Boot Loader driver for the Surface Duo.
Exposes information about the driver to user space via sysfs for
consumption in manufacturing mode.

Resend due to not showing in mailing list.

Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>

---

Changes in v4:

 - Small binding definition changes
 - Removed ACPI propagation from patch series since it has been
   cherry-picked
 - Fixed the Signed-off-by: and From: mismatch

---

Changes in v3:
 - For the yaml documentation:
    * Updated description
    * Fixed examples
    * Updated 'required' field
 - Further propogated ACPI dependency in Kconfigs
 - Updated sysfs several binding descriptions
 - Renamed files to conform to naming conventions

---

Changes in v2:
 - Per Maximilian, added patch 2: propagated ACPI dependency from the
   directory as a whole to each individual driver
 - For the yaml documentation:
    * Removed json-schema dependence
    * Elaborated on description of driver
    * Updated example
 - Changed target KernelVersion in sysfs documentation
 - Updated MAINTAINER changes to be properly applied across patches
 - For the driver itself,
    * Added types.h inclusion and removed unused inclusions
    * Minor updates to code and acronym style
    * Remove __packed attribute on driver struct
    * Use .dev_groups for sysfs
 - Added more in-depth description of driver in Kconfig
 - Modified dts to reference a newly added section in sm8150.dtsi

---

Jarrett Schultz (4):
  dt-bindings: platform: microsoft: Document surface xbl
  platform: surface: Add surface xbl
  arm64: dts: qcom: sm8150: Add imem section
  arm64: dts: qcom: surface-duo: Add surface xbl

 .../ABI/testing/sysfs-platform-surface-xbl    |  79 ++++++++
 .../platform/microsoft/surface-xbl.yaml       |  64 ++++++
 MAINTAINERS                                   |   9 +
 .../dts/qcom/sm8150-microsoft-surface-duo.dts |  10 +
 arch/arm64/boot/dts/qcom/sm8150.dtsi          |   8 +
 drivers/platform/surface/Kconfig              |  12 ++
 drivers/platform/surface/Makefile             |   1 +
 drivers/platform/surface/surface_xbl.c        | 186 ++++++++++++++++++
 8 files changed, 369 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-surface-xbl
 create mode 100644 Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
 create mode 100644 drivers/platform/surface/surface_xbl.c

-- 
2.25.1


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

* [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-21 18:28 [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver Jarrett Schultz
@ 2021-12-21 18:28 ` Jarrett Schultz
  2021-12-21 22:45   ` Rob Herring
  2021-12-21 23:23   ` Rob Herring
  2021-12-21 18:28 ` [PATCH RESEND v4 2/4] platform: surface: Add " Jarrett Schultz
                   ` (2 subsequent siblings)
  3 siblings, 2 replies; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-21 18:28 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz
  Cc: Felipe Balbi, linux-arm-msm, platform-driver-x86, linux-kernel,
	devicetree, Jarrett Schultz

From: Jarrett Schultz <jaschultz@microsoft.com>

Introduce yaml for surface xbl driver.

Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>

---

Changes in v4:
 - Addressed small formatting changes
 - Removed unnecessary lines

---

Changes in v3:
 - Updated description to only pertain to the hardware
 - Updated the required field to properly reflect the binding
 - Removed the first example
 - Fixed the size of the reg field in the second example

---

Changes in v2:
 - Removed json-schema dependence
 - Elaborated on description of driver
 - Updated example
---
 .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
 MAINTAINERS                                   |  7 ++
 2 files changed, 71 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml

diff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
new file mode 100644
index 000000000000..df5a87a016f4
--- /dev/null
+++ b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
@@ -0,0 +1,64 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/platform/microsoft/surface-xbl.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Surface Extensible Bootloader for Microsoft Surface Duo
+
+maintainers:
+  - Jarrett Schultz <jaschultz@microsoft.com>
+
+description: |
+  Defined to expose information that is used during production when
+  device is in manufacturing mode. Some of the information included
+  in this imem section is -
+    * board_id
+    * battery_present
+    * hw_init_retries
+    * is_customer_mode
+    * is_act_mode
+    * pmic_reset_reason
+    * touch_fw_version
+    * ocp_error_location
+  See sysfs documentation for more information.
+
+properties:
+  compatible:
+    const: simple-mfd
+
+  reg:
+    maxItems: 1
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - ranges
+  - address-cells
+  - size-cells
+
+examples:
+  - |
+    / {
+        compatible = "foo";
+        model = "foo";
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        imem@146bf000 {
+          compatible = "simple-mfd";
+          reg = <0x0 0x146bf000 0x0 0x1000>;
+          ranges = <0x0 0x0 0x146bf000 0x1000>;
+          #address-cells = <1>;
+          #size-cells = <1>;
+          status = "okay";
+
+          xbl@a94 {
+            compatible = "microsoft,sm8150-surface-duo-xbl";
+            reg = <0xa94 0x100>;
+            status = "okay";
+          };
+        };
+      };
diff --git a/MAINTAINERS b/MAINTAINERS
index 13f9a84a617e..5d0ca2a98b57 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12649,6 +12649,13 @@ F:	Documentation/driver-api/surface_aggregator/clients/dtx.rst
 F:	drivers/platform/surface/surface_dtx.c
 F:	include/uapi/linux/surface_aggregator/dtx.h
 
+MICROSOFT SURFACE DUO XBL DRIVER
+M:	Jarrett Schultz <jaschultz@microsoft.com>
+L:	linux-arm-msm@vger.kernel.org
+L:	platform-driver-x86@vger.kernel.org
+S:	Supported
+F:	Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
+
 MICROSOFT SURFACE GPE LID SUPPORT DRIVER
 M:	Maximilian Luz <luzmaximilian@gmail.com>
 L:	platform-driver-x86@vger.kernel.org
-- 
2.25.1


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

* [PATCH RESEND v4 2/4] platform: surface: Add surface xbl
  2021-12-21 18:28 [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
@ 2021-12-21 18:28 ` Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 3/4] arm64: dts: qcom: sm8150: Add imem section Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 4/4] arm64: dts: qcom: surface-duo: Add surface xbl Jarrett Schultz
  3 siblings, 0 replies; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-21 18:28 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz
  Cc: Felipe Balbi, linux-arm-msm, platform-driver-x86, linux-kernel,
	devicetree, Jarrett Schultz

From: Jarrett Schultz <jaschultz@microsoft.com>

Introduce support for the Extensible Boot Loader driver found on the
Surface Duo. Makes device information available to users via sysfs.

Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>

---

Changes in v4:
 - N/A

---

Changes in v3:
 - Updated several descriptions in the yaml to be more descriptive
 - Renamed files to use an underscore instead of a dash

---

Changes in v2:
 - Added types.h inclusion and removed unused inclusions
 - Minor updates to code and acronym style
 - Remove __packed attribute on driver struct
 - Use .dev_groups for sysfs
 - Added more in-depth description of driver in Kconfig
 - Changed target KernelVersion in sysfs documentation
---
 .../ABI/testing/sysfs-platform-surface-xbl    |  79 ++++++++
 MAINTAINERS                                   |   2 +
 drivers/platform/surface/Kconfig              |  12 ++
 drivers/platform/surface/Makefile             |   1 +
 drivers/platform/surface/surface_xbl.c        | 186 ++++++++++++++++++
 5 files changed, 280 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-platform-surface-xbl
 create mode 100644 drivers/platform/surface/surface_xbl.c

diff --git a/Documentation/ABI/testing/sysfs-platform-surface-xbl b/Documentation/ABI/testing/sysfs-platform-surface-xbl
new file mode 100644
index 000000000000..505a662d8511
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-platform-surface-xbl
@@ -0,0 +1,79 @@
+What:		/sys/devices/platform/146bfa94.xbl/battery_present
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns whether the battery is present. Valid
+		values are:
+			0 - battery absent
+			1 - battery present
+
+What:		/sys/devices/platform/146bfa94.xbl/board_id
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns a Microsoft specific board id.
+
+What:		/sys/devices/platform/146bfa94.xbl/hw_init_retries
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns a Microsoft specific value related to the
+		retries attempted to properly initialize the battery charging
+		subsystem.
+
+What:		/sys/devices/platform/146bfa94.xbl/is_act_mode
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns whether ACT mode is enabled. Valid values
+		are:
+			0 - ACT disabled
+			1 - ACT enabled
+
+		ACT mode is used to run checks and put the device to shipmode
+		at factory.
+
+What:		/sys/devices/platform/146bfa94.xbl/is_customer_mode
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+
+		mode. Valid values are:
+			0 - Not in manufacturing mode
+			1 - In manufacturing mode
+
+What:		/sys/devices/platform/146bfa94.xbl/ocp_error_location
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns 0 or the id of the power rail which has the
+		OCP error. Valid values are:
+			Bit(s)		Meaning
+			15		More than one OCP error occurred
+			14-12		PMIC
+			11-7		SMPS
+			6-2		LDO
+			1-0		BOB
+
+What:		/sys/devices/platform/146bfa94.xbl/pmic_reset_reason
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns the reason for the reset. Valid values
+		are:
+			0 - no reason lol
+			9 - Battery driver triggered
+
+What:		/sys/devices/platform/146bfa94.xbl/touch_fw_version
+Date:		October 2021
+KernelVersion:	5.16
+Contact:	jaschultz@microsoft.com
+Description:
+		Read only. It returns the version of the firmware.
diff --git a/MAINTAINERS b/MAINTAINERS
index 5d0ca2a98b57..e65eddf5d25d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -12654,7 +12654,9 @@ M:	Jarrett Schultz <jaschultz@microsoft.com>
 L:	linux-arm-msm@vger.kernel.org
 L:	platform-driver-x86@vger.kernel.org
 S:	Supported
+F:	Documentation/ABI/testing/sysfs-platform-surface-xbl
 F:	Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
+F:	drivers/platform/surface/surface-xbl.c
 
 MICROSOFT SURFACE GPE LID SUPPORT DRIVER
 M:	Maximilian Luz <luzmaximilian@gmail.com>
diff --git a/drivers/platform/surface/Kconfig b/drivers/platform/surface/Kconfig
index 5f0578e25f71..96d6030d8d49 100644
--- a/drivers/platform/surface/Kconfig
+++ b/drivers/platform/surface/Kconfig
@@ -185,6 +185,18 @@ config SURFACE_PRO3_BUTTON
 	help
 	  This driver handles the power/home/volume buttons on the Microsoft Surface Pro 3/4 tablet.
 
+config SURFACE_XBL
+        tristate "Surface XBL Driver"
+        depends on ARM64 || COMPILE_TEST
+        depends on OF
+        help
+          If you say 'Y' to this option, support will be included for the
+          Surface Extensible Boot Loader (XBL) Driver. This driver exposes
+          information about the device through sysfs.
+
+          This driver can also be built as a module.  If so, the module
+          will be called surface-xbl.
+
 source "drivers/platform/surface/aggregator/Kconfig"
 
 endif # SURFACE_PLATFORMS
diff --git a/drivers/platform/surface/Makefile b/drivers/platform/surface/Makefile
index 32889482de55..eef05d247f75 100644
--- a/drivers/platform/surface/Makefile
+++ b/drivers/platform/surface/Makefile
@@ -16,3 +16,4 @@ obj-$(CONFIG_SURFACE_GPE)		+= surface_gpe.o
 obj-$(CONFIG_SURFACE_HOTPLUG)		+= surface_hotplug.o
 obj-$(CONFIG_SURFACE_PLATFORM_PROFILE)	+= surface_platform_profile.o
 obj-$(CONFIG_SURFACE_PRO3_BUTTON)	+= surfacepro3_button.o
+obj-$(CONFIG_SURFACE_XBL)               += surface_xbl.o
diff --git a/drivers/platform/surface/surface_xbl.c b/drivers/platform/surface/surface_xbl.c
new file mode 100644
index 000000000000..e6272b704526
--- /dev/null
+++ b/drivers/platform/surface/surface_xbl.c
@@ -0,0 +1,186 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Surface eXtensible Boot Loader (XBL)
+ *
+ * Copyright (C) 2021 Microsoft Corporation
+ * Author: Jarrett Schultz <jaschultz@microsoft.com>
+ */
+
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+
+#define SURFACE_XBL_MAX_VERSION_LEN	16
+#define SURFACE_XBL_BOARD_ID		0
+#define SURFACE_XBL_BATTERY_PRESENT	1
+#define SURFACE_XBL_HW_INIT_RETRIES	2
+#define SURFACE_XBL_IS_CUSTOMER_MODE	3
+#define SURFACE_XBL_IS_ACT_MODE		4
+#define SURFACE_XBL_PMIC_RESET_REASON	5
+#define SURFACE_XBL_TOUCH_FW_VERSION	6
+#define SURFACE_XBL_OCP_ERROR_LOCATION		\
+		(SURFACE_XBL_TOUCH_FW_VERSION +	\
+		SURFACE_XBL_MAX_VERSION_LEN)
+
+struct surface_xbl {
+	struct device	*dev;
+
+	u8		board_id;
+	u8		battery_present;
+	u8		hw_init_retries;
+	u8		is_customer_mode;
+	u8		is_act_mode;
+	u8		pmic_reset_reason;
+	char		touch_fw_version[SURFACE_XBL_MAX_VERSION_LEN];
+	u16		ocp_error_location;
+};
+
+static ssize_t
+board_id_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->board_id);
+}
+static DEVICE_ATTR_RO(board_id);
+
+static ssize_t
+battery_present_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->battery_present);
+}
+static DEVICE_ATTR_RO(battery_present);
+
+static ssize_t
+hw_init_retries_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->hw_init_retries);
+}
+static DEVICE_ATTR_RO(hw_init_retries);
+
+static ssize_t
+is_customer_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->is_customer_mode);
+}
+static DEVICE_ATTR_RO(is_customer_mode);
+
+static ssize_t
+is_act_mode_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->is_act_mode);
+}
+static DEVICE_ATTR_RO(is_act_mode);
+
+static ssize_t
+pmic_reset_reason_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->pmic_reset_reason);
+}
+static DEVICE_ATTR_RO(pmic_reset_reason);
+
+static ssize_t
+touch_fw_version_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "0x%s\n", sxbl->touch_fw_version);
+}
+static DEVICE_ATTR_RO(touch_fw_version);
+
+static ssize_t
+ocp_error_location_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+	struct surface_xbl	*sxbl = dev_get_drvdata(dev);
+
+	return sysfs_emit(buf, "%d\n", sxbl->ocp_error_location);
+}
+static DEVICE_ATTR_RO(ocp_error_location);
+
+static struct attribute *xbl_attrs[] = {
+	&dev_attr_board_id.attr,
+	&dev_attr_battery_present.attr,
+	&dev_attr_hw_init_retries.attr,
+	&dev_attr_is_customer_mode.attr,
+	&dev_attr_is_act_mode.attr,
+	&dev_attr_pmic_reset_reason.attr,
+	&dev_attr_touch_fw_version.attr,
+	&dev_attr_ocp_error_location.attr,
+	NULL
+};
+
+static const struct attribute_group xbl_attr_group = {
+	.attrs = xbl_attrs,
+};
+
+const struct attribute_group *xbl_sysfs_groups[] = {
+	&xbl_attr_group,
+	NULL
+};
+
+static int surface_xbl_probe(struct platform_device *pdev)
+{
+	struct surface_xbl	*sxbl;
+	void __iomem		*regs;
+	int			i;
+
+	sxbl = devm_kzalloc(&pdev->dev, sizeof(*sxbl), GFP_KERNEL);
+	if (!sxbl)
+		return -ENOMEM;
+
+	sxbl->dev = &pdev->dev;
+
+	regs = devm_platform_ioremap_resource(pdev, 0);
+	if (IS_ERR(regs))
+		return PTR_ERR(regs);
+
+	platform_set_drvdata(pdev, sxbl);
+
+	sxbl->board_id = readb(regs + SURFACE_XBL_BOARD_ID);
+	sxbl->battery_present = readb(regs + SURFACE_XBL_BATTERY_PRESENT);
+	sxbl->hw_init_retries = readb(regs + SURFACE_XBL_HW_INIT_RETRIES);
+	sxbl->is_customer_mode = readb(regs + SURFACE_XBL_IS_CUSTOMER_MODE);
+	sxbl->is_act_mode = readb(regs + SURFACE_XBL_IS_ACT_MODE);
+	sxbl->pmic_reset_reason = readb(regs + SURFACE_XBL_PMIC_RESET_REASON);
+
+	for (i = 0; i < SURFACE_XBL_MAX_VERSION_LEN; i++)
+		sxbl->touch_fw_version[i] = readb(regs + SURFACE_XBL_TOUCH_FW_VERSION + i);
+
+	sxbl->ocp_error_location = readb(regs + SURFACE_XBL_OCP_ERROR_LOCATION);
+
+	return 0;
+}
+
+static const struct of_device_id surface_xbl_of_match[] = {
+	{
+		.compatible = "microsoft,sm8150-surface-duo-xbl"
+	},
+	{  }
+};
+MODULE_DEVICE_TABLE(of, surface_xbl_of_match);
+
+static struct platform_driver surface_xbl_driver = {
+	.driver	= {
+		.name		= "surface-xbl",
+		.of_match_table = surface_xbl_of_match,
+		.dev_groups	= xbl_sysfs_groups
+	},
+	.probe		= surface_xbl_probe,
+};
+module_platform_driver(surface_xbl_driver);
+
+MODULE_AUTHOR("Jarrett Schultz <jaschultz@microsoft.com>");
+MODULE_DESCRIPTION("Surface Extensible Bootloader");
+MODULE_LICENSE("GPL");
-- 
2.25.1


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

* [PATCH RESEND v4 3/4] arm64: dts: qcom: sm8150: Add imem section
  2021-12-21 18:28 [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 2/4] platform: surface: Add " Jarrett Schultz
@ 2021-12-21 18:28 ` Jarrett Schultz
  2021-12-21 18:28 ` [PATCH RESEND v4 4/4] arm64: dts: qcom: surface-duo: Add surface xbl Jarrett Schultz
  3 siblings, 0 replies; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-21 18:28 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz
  Cc: Felipe Balbi, linux-arm-msm, platform-driver-x86, linux-kernel,
	devicetree, Jarrett Schultz

From: Jarrett Schultz <jaschultz@microsoft.com>

Introduce the imem section in preparation for the surface xbl driver.

Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

---

Changes in v4:
 - N/A

---

Changes in v3:
 - N/A

---

Changes in v2:
 - Created to properly reference the xbl section inside of imem
---
 arch/arm64/boot/dts/qcom/sm8150.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150.dtsi b/arch/arm64/boot/dts/qcom/sm8150.dtsi
index 81b4ff2cc4cd..bcfcb7306cdc 100644
--- a/arch/arm64/boot/dts/qcom/sm8150.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm8150.dtsi
@@ -1175,6 +1175,14 @@ gpi_dma1: dma-controller@a00000 {
 			status = "disabled";
 		};
 
+		imem: imem@146bf000 {
+			compatible = "simple-mfd";
+			reg = <0x0 0x146bf000 0x0 0x1000>;
+			ranges = <0x0 0x0 0x146bf000 0x1000>;
+			#address-cells = <1>;
+			#size-cells = <1>;
+		};
+
 		qupv3_id_1: geniqup@ac0000 {
 			compatible = "qcom,geni-se-qup";
 			reg = <0x0 0x00ac0000 0x0 0x6000>;
-- 
2.25.1


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

* [PATCH RESEND v4 4/4] arm64: dts: qcom: surface-duo: Add surface xbl
  2021-12-21 18:28 [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver Jarrett Schultz
                   ` (2 preceding siblings ...)
  2021-12-21 18:28 ` [PATCH RESEND v4 3/4] arm64: dts: qcom: sm8150: Add imem section Jarrett Schultz
@ 2021-12-21 18:28 ` Jarrett Schultz
  3 siblings, 0 replies; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-21 18:28 UTC (permalink / raw)
  To: Rob Herring, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz
  Cc: Felipe Balbi, linux-arm-msm, platform-driver-x86, linux-kernel,
	devicetree, Jarrett Schultz

From: Jarrett Schultz <jaschultz@microsoft.com>

Introduce device tree source for the surface xbl driver.

Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>

---

Changes in v4:
 - N/A

---

Changes in v3:
 - N/A

---

Changes in v2:
 - Updated to reference an offset inside of imem
---
 .../boot/dts/qcom/sm8150-microsoft-surface-duo.dts     | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
index 5901c28e6696..abb7964daac4 100644
--- a/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
+++ b/arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts
@@ -430,6 +430,16 @@ &i2c19 {
 	/* MAX34417 @ 0x1e */
 };
 
+&imem {
+	status = "okay";
+
+	xbl@a94 {
+		compatible = "microsoft,sm8150-surface-duo-xbl";
+		reg = <0xa94 0x100>;
+		status = "okay";
+	};
+};
+
 &pon {
 	pwrkey {
 		status = "okay";
-- 
2.25.1


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

* Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
@ 2021-12-21 22:45   ` Rob Herring
  2021-12-21 23:23   ` Rob Herring
  1 sibling, 0 replies; 15+ messages in thread
From: Rob Herring @ 2021-12-21 22:45 UTC (permalink / raw)
  To: Jarrett Schultz
  Cc: linux-kernel, Maximilian Luz, Jarrett Schultz, linux-arm-msm,
	Rob Herring, platform-driver-x86, Felipe Balbi, bjorn.andersson,
	Mark Gross, Hans de Goede, devicetree, Andy Gross

On Tue, 21 Dec 2021 10:28:23 -0800, Jarrett Schultz wrote:
> From: Jarrett Schultz <jaschultz@microsoft.com>
> 
> Introduce yaml for surface xbl driver.
> 
> Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> 
> ---
> 
> Changes in v4:
>  - Addressed small formatting changes
>  - Removed unnecessary lines
> 
> ---
> 
> Changes in v3:
>  - Updated description to only pertain to the hardware
>  - Updated the required field to properly reflect the binding
>  - Removed the first example
>  - Fixed the size of the reg field in the second example
> 
> ---
> 
> Changes in v2:
>  - Removed json-schema dependence
>  - Elaborated on description of driver
>  - Updated example
> ---
>  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
>  MAINTAINERS                                   |  7 ++
>  2 files changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.example.dt.yaml:0:0: /imem@146bf000/xbl@a94: failed to match any schema with compatible: ['microsoft,sm8150-surface-duo-xbl']

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/patch/1571914

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.


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

* Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
  2021-12-21 22:45   ` Rob Herring
@ 2021-12-21 23:23   ` Rob Herring
  2021-12-27 14:54     ` [EXTERNAL] " Jarrett Schultz
  2022-02-03 23:23     ` Jarrett Schultz
  1 sibling, 2 replies; 15+ messages in thread
From: Rob Herring @ 2021-12-21 23:23 UTC (permalink / raw)
  To: Jarrett Schultz
  Cc: Andy Gross, bjorn.andersson, Hans de Goede, Mark Gross,
	Maximilian Luz, Felipe Balbi, linux-arm-msm, platform-driver-x86,
	linux-kernel, devicetree, Jarrett Schultz

On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> From: Jarrett Schultz <jaschultz@microsoft.com>
> 
> Introduce yaml for surface xbl driver.
> 
> Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> 
> ---
> 
> Changes in v4:
>  - Addressed small formatting changes
>  - Removed unnecessary lines
> 
> ---
> 
> Changes in v3:
>  - Updated description to only pertain to the hardware
>  - Updated the required field to properly reflect the binding
>  - Removed the first example
>  - Fixed the size of the reg field in the second example
> 
> ---
> 
> Changes in v2:
>  - Removed json-schema dependence
>  - Elaborated on description of driver
>  - Updated example
> ---
>  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
>  MAINTAINERS                                   |  7 ++
>  2 files changed, 71 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> 
> diff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> new file mode 100644
> index 000000000000..df5a87a016f4
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> @@ -0,0 +1,64 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/platform/microsoft/surface-xbl.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Surface Extensible Bootloader for Microsoft Surface Duo
> +
> +maintainers:
> +  - Jarrett Schultz <jaschultz@microsoft.com>
> +
> +description: |
> +  Defined to expose information that is used during production when
> +  device is in manufacturing mode. Some of the information included
> +  in this imem section is -

If this is onchip sram, we have a binding for that. That's not an MFD.

> +    * board_id
> +    * battery_present
> +    * hw_init_retries
> +    * is_customer_mode
> +    * is_act_mode
> +    * pmic_reset_reason
> +    * touch_fw_version
> +    * ocp_error_location

nvmem binding doesn't work for describing these fields?

> +  See sysfs documentation for more information.

sysfs? Not relevant to the binding.

> +
> +properties:
> +  compatible:
> +    const: simple-mfd
> +
> +  reg:
> +    maxItems: 1
> +
> +additionalProperties: false
> +
> +required:
> +  - compatible
> +  - reg
> +  - ranges
> +  - address-cells
> +  - size-cells
> +
> +examples:
> +  - |
> +    / {
> +        compatible = "foo";
> +        model = "foo";

No need to make this the root node with a fake compatible.

> +        #address-cells = <2>;
> +        #size-cells = <2>;
> +
> +        imem@146bf000 {
> +          compatible = "simple-mfd";
> +          reg = <0x0 0x146bf000 0x0 0x1000>;
> +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> +          #address-cells = <1>;
> +          #size-cells = <1>;
> +          status = "okay";

Don't show status in examples.

> +
> +          xbl@a94 {
> +            compatible = "microsoft,sm8150-surface-duo-xbl";
> +            reg = <0xa94 0x100>;
> +            status = "okay";
> +          };
> +        };
> +      };
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 13f9a84a617e..5d0ca2a98b57 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -12649,6 +12649,13 @@ F:	Documentation/driver-api/surface_aggregator/clients/dtx.rst
>  F:	drivers/platform/surface/surface_dtx.c
>  F:	include/uapi/linux/surface_aggregator/dtx.h
>  
> +MICROSOFT SURFACE DUO XBL DRIVER
> +M:	Jarrett Schultz <jaschultz@microsoft.com>
> +L:	linux-arm-msm@vger.kernel.org
> +L:	platform-driver-x86@vger.kernel.org
> +S:	Supported
> +F:	Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> +
>  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
>  M:	Maximilian Luz <luzmaximilian@gmail.com>
>  L:	platform-driver-x86@vger.kernel.org
> -- 
> 2.25.1
> 
> 

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

* RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-21 23:23   ` Rob Herring
@ 2021-12-27 14:54     ` Jarrett Schultz
  2021-12-27 15:45       ` Rob Herring
  2022-02-03 23:23     ` Jarrett Schultz
  1 sibling, 1 reply; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-27 14:54 UTC (permalink / raw)
  To: Rob Herring, Jarrett Schultz
  Cc: Andy Gross, bjorn.andersson, Hans de Goede, Mark Gross,
	Maximilian Luz, Felipe Balbi, linux-arm-msm, platform-driver-x86,
	linux-kernel, devicetree



> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Tuesday, December 21, 2021 5:24 PM
> To: Jarrett Schultz <jaschultzms@gmail.com>
> Cc: Andy Gross <agross@kernel.org>; bjorn.andersson@linaro.org; Hans de
> Goede <hdegoede@redhat.com>; Mark Gross <markgross@kernel.org>;
> Maximilian Luz <luzmaximilian@gmail.com>; Felipe Balbi
> <balbi@kernel.org>; linux-arm-msm@vger.kernel.org; platform-driver-
> x86@vger.kernel.org; linux-kernel@vger.kernel.org;
> devicetree@vger.kernel.org; Jarrett Schultz <jaschultz@microsoft.com>
> Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> microsoft: Document surface xbl
> 
> On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > From: Jarrett Schultz <jaschultz@microsoft.com>
> >
> > Introduce yaml for surface xbl driver.
> >
> > Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> >
> > ---
> >
> > Changes in v4:
> >  - Addressed small formatting changes
> >  - Removed unnecessary lines
> >
> > ---
> >
> > Changes in v3:
> >  - Updated description to only pertain to the hardware
> >  - Updated the required field to properly reflect the binding
> >  - Removed the first example
> >  - Fixed the size of the reg field in the second example
> >
> > ---
> >
> > Changes in v2:
> >  - Removed json-schema dependence
> >  - Elaborated on description of driver
> >  - Updated example
> > ---
> >  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
> >  MAINTAINERS                                   |  7 ++
> >  2 files changed, 71 insertions(+)
> >  create mode 100644
> > Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> >
> > diff --git
> > a/Documentation/devicetree/bindings/platform/microsoft/surface-
> xbl.yam
> > l
> > b/Documentation/devicetree/bindings/platform/microsoft/surface-
> xbl.yam
> > l
> > new file mode 100644
> > index 000000000000..df5a87a016f4
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl
> > +++ .yaml
> > @@ -0,0 +1,64 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > +---
> > +$id:
> >
> +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > +cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-
> xbl.yaml%23&amp
> >
> +;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472
> 08d9c
> >
> +4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258
> 3887312
> >
> +05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> zIiLCJBTi
> >
> +I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=jG0qubz122GG2s8%2B
> 1ZuMCcPIa
> > +33KWwPoO2VNlDySmvs%3D&amp;reserved=0
> > +$schema:
> >
> +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > +cetree.org%2Fmeta-
> schemas%2Fcore.yaml%23&amp;data=04%7C01%7Cjaschultz
> >
> +%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8
> 6f141a
> >
> +f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C
> TWFpbGZsb3
> >
> +d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> %3D%
> >
> +7C3000&amp;sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA
> UzA%3D&amp
> > +;reserved=0
> > +
> > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > +
> > +maintainers:
> > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > +
> > +description: |
> > +  Defined to expose information that is used during production when
> > +  device is in manufacturing mode. Some of the information included
> > +  in this imem section is -
> 
> If this is onchip sram, we have a binding for that. That's not an MFD.
> 
> > +    * board_id
> > +    * battery_present
> > +    * hw_init_retries
> > +    * is_customer_mode
> > +    * is_act_mode
> > +    * pmic_reset_reason
> > +    * touch_fw_version
> > +    * ocp_error_location
> 
> nvmem binding doesn't work for describing these fields?
> 
> > +  See sysfs documentation for more information.
> 
> sysfs? Not relevant to the binding.
> 
> > +
> > +properties:
> > +  compatible:
> > +    const: simple-mfd
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - ranges
> > +  - address-cells
> > +  - size-cells
> > +
> > +examples:
> > +  - |
> > +    / {
> > +        compatible = "foo";
> > +        model = "foo";
> 
> No need to make this the root node with a fake compatible.

I included this root node in order to make #address-cells = #size-cells = 2,
since this example raises errors otherwise.

> 
> > +        #address-cells = <2>;
> > +        #size-cells = <2>;
> > +
> > +        imem@146bf000 {
> > +          compatible = "simple-mfd";
> > +          reg = <0x0 0x146bf000 0x0 0x1000>;
> > +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> > +          #address-cells = <1>;
> > +          #size-cells = <1>;
> > +          status = "okay";
> 
> Don't show status in examples.
> 
> > +
> > +          xbl@a94 {
> > +            compatible = "microsoft,sm8150-surface-duo-xbl";
> > +            reg = <0xa94 0x100>;
> > +            status = "okay";
> > +          };
> > +        };
> > +      };
> > diff --git a/MAINTAINERS b/MAINTAINERS index
> > 13f9a84a617e..5d0ca2a98b57 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -12649,6 +12649,13 @@ F:	Documentation/driver-
> api/surface_aggregator/clients/dtx.rst
> >  F:	drivers/platform/surface/surface_dtx.c
> >  F:	include/uapi/linux/surface_aggregator/dtx.h
> >
> > +MICROSOFT SURFACE DUO XBL DRIVER
> > +M:	Jarrett Schultz <jaschultz@microsoft.com>
> > +L:	linux-arm-msm@vger.kernel.org
> > +L:	platform-driver-x86@vger.kernel.org
> > +S:	Supported
> > +F:	Documentation/devicetree/bindings/platform/microsoft/surface-
> xbl.yaml
> > +
> >  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
> >  M:	Maximilian Luz <luzmaximilian@gmail.com>
> >  L:	platform-driver-x86@vger.kernel.org
> > --
> > 2.25.1
> >
> >

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

* Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-27 14:54     ` [EXTERNAL] " Jarrett Schultz
@ 2021-12-27 15:45       ` Rob Herring
  2021-12-27 16:16         ` Jarrett Schultz
  0 siblings, 1 reply; 15+ messages in thread
From: Rob Herring @ 2021-12-27 15:45 UTC (permalink / raw)
  To: Jarrett Schultz
  Cc: Jarrett Schultz, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz, Felipe Balbi, linux-arm-msm,
	platform-driver-x86, linux-kernel, devicetree

On Mon, Dec 27, 2021 at 10:54 AM Jarrett Schultz
<jaschultz@microsoft.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: Tuesday, December 21, 2021 5:24 PM
> > To: Jarrett Schultz <jaschultzms@gmail.com>
> > Cc: Andy Gross <agross@kernel.org>; bjorn.andersson@linaro.org; Hans de
> > Goede <hdegoede@redhat.com>; Mark Gross <markgross@kernel.org>;
> > Maximilian Luz <luzmaximilian@gmail.com>; Felipe Balbi
> > <balbi@kernel.org>; linux-arm-msm@vger.kernel.org; platform-driver-
> > x86@vger.kernel.org; linux-kernel@vger.kernel.org;
> > devicetree@vger.kernel.org; Jarrett Schultz <jaschultz@microsoft.com>
> > Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> > microsoft: Document surface xbl
> >
> > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > >
> > > Introduce yaml for surface xbl driver.
> > >
> > > Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> > >
> > > ---
> > >
> > > Changes in v4:
> > >  - Addressed small formatting changes
> > >  - Removed unnecessary lines
> > >
> > > ---
> > >
> > > Changes in v3:
> > >  - Updated description to only pertain to the hardware
> > >  - Updated the required field to properly reflect the binding
> > >  - Removed the first example
> > >  - Fixed the size of the reg field in the second example
> > >
> > > ---
> > >
> > > Changes in v2:
> > >  - Removed json-schema dependence
> > >  - Elaborated on description of driver
> > >  - Updated example
> > > ---
> > >  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
> > >  MAINTAINERS                                   |  7 ++
> > >  2 files changed, 71 insertions(+)
> > >  create mode 100644
> > > Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml
> > >
> > > diff --git
> > > a/Documentation/devicetree/bindings/platform/microsoft/surface-
> > xbl.yam
> > > l
> > > b/Documentation/devicetree/bindings/platform/microsoft/surface-
> > xbl.yam
> > > l
> > > new file mode 100644
> > > index 000000000000..df5a87a016f4
> > > --- /dev/null
> > > +++ b/Documentation/devicetree/bindings/platform/microsoft/surface-xbl
> > > +++ .yaml
> > > @@ -0,0 +1,64 @@
> > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML 1.2
> > > +---
> > > +$id:
> > >
> > +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > > +cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-
> > xbl.yaml%23&amp
> > >
> > +;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472
> > 08d9c
> > >
> > +4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258
> > 3887312
> > >
> > +05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> > zIiLCJBTi
> > >
> > +I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=jG0qubz122GG2s8%2B
> > 1ZuMCcPIa
> > > +33KWwPoO2VNlDySmvs%3D&amp;reserved=0
> > > +$schema:
> > >
> > +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
> > > +cetree.org%2Fmeta-
> > schemas%2Fcore.yaml%23&amp;data=04%7C01%7Cjaschultz
> > >
> > +%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8
> > 6f141a
> > >
> > +f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C
> > TWFpbGZsb3
> > >
> > +d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> > %3D%
> > >
> > +7C3000&amp;sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA
> > UzA%3D&amp
> > > +;reserved=0
> > > +
> > > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > > +
> > > +maintainers:
> > > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > > +
> > > +description: |
> > > +  Defined to expose information that is used during production when
> > > +  device is in manufacturing mode. Some of the information included
> > > +  in this imem section is -
> >
> > If this is onchip sram, we have a binding for that. That's not an MFD.
> >
> > > +    * board_id
> > > +    * battery_present
> > > +    * hw_init_retries
> > > +    * is_customer_mode
> > > +    * is_act_mode
> > > +    * pmic_reset_reason
> > > +    * touch_fw_version
> > > +    * ocp_error_location
> >
> > nvmem binding doesn't work for describing these fields?
> >
> > > +  See sysfs documentation for more information.
> >
> > sysfs? Not relevant to the binding.
> >
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: simple-mfd
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +additionalProperties: false
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - ranges
> > > +  - address-cells
> > > +  - size-cells
> > > +
> > > +examples:
> > > +  - |
> > > +    / {
> > > +        compatible = "foo";
> > > +        model = "foo";
> >
> > No need to make this the root node with a fake compatible.
>
> I included this root node in order to make #address-cells = #size-cells = 2,
> since this example raises errors otherwise.

Why does your example require 2 cells? You only have 4KB of address space.

Though you can do:

bus {
  #address-cells = <2>;
  #size-cells = <2>;
  ...
};

Rob

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

* RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-27 15:45       ` Rob Herring
@ 2021-12-27 16:16         ` Jarrett Schultz
  2022-01-04 22:00           ` Rob Herring
  0 siblings, 1 reply; 15+ messages in thread
From: Jarrett Schultz @ 2021-12-27 16:16 UTC (permalink / raw)
  To: Rob Herring
  Cc: Jarrett Schultz, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz, Felipe Balbi, linux-arm-msm,
	platform-driver-x86, linux-kernel, devicetree



> -----Original Message-----
> From: Rob Herring <robh@kernel.org>
> Sent: Monday, December 27, 2021 9:46 AM
> To: Jarrett Schultz <jaschultz@microsoft.com>
> Cc: Jarrett Schultz <jaschultzms@gmail.com>; Andy Gross
> <agross@kernel.org>; bjorn.andersson@linaro.org; Hans de Goede
> <hdegoede@redhat.com>; Mark Gross <markgross@kernel.org>; Maximilian
> Luz <luzmaximilian@gmail.com>; Felipe Balbi <balbi@kernel.org>; linux-arm-
> msm@vger.kernel.org; platform-driver-x86@vger.kernel.org; linux-
> kernel@vger.kernel.org; devicetree@vger.kernel.org
> Subject: Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> microsoft: Document surface xbl
> 
> On Mon, Dec 27, 2021 at 10:54 AM Jarrett Schultz
> <jaschultz@microsoft.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Rob Herring <robh@kernel.org>
> > > Sent: Tuesday, December 21, 2021 5:24 PM
> > > To: Jarrett Schultz <jaschultzms@gmail.com>
> > > Cc: Andy Gross <agross@kernel.org>; bjorn.andersson@linaro.org; Hans
> > > de Goede <hdegoede@redhat.com>; Mark Gross
> <markgross@kernel.org>;
> > > Maximilian Luz <luzmaximilian@gmail.com>; Felipe Balbi
> > > <balbi@kernel.org>; linux-arm-msm@vger.kernel.org; platform-driver-
> > > x86@vger.kernel.org; linux-kernel@vger.kernel.org;
> > > devicetree@vger.kernel.org; Jarrett Schultz
> > > <jaschultz@microsoft.com>
> > > Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> > > microsoft: Document surface xbl
> > >
> > > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > > >
> > > > Introduce yaml for surface xbl driver.
> > > >
> > > > Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> > > >
> > > > ---
> > > >
> > > > Changes in v4:
> > > >  - Addressed small formatting changes
> > > >  - Removed unnecessary lines
> > > >
> > > > ---
> > > >
> > > > Changes in v3:
> > > >  - Updated description to only pertain to the hardware
> > > >  - Updated the required field to properly reflect the binding
> > > >  - Removed the first example
> > > >  - Fixed the size of the reg field in the second example
> > > >
> > > > ---
> > > >
> > > > Changes in v2:
> > > >  - Removed json-schema dependence
> > > >  - Elaborated on description of driver
> > > >  - Updated example
> > > > ---
> > > >  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
> > > >  MAINTAINERS                                   |  7 ++
> > > >  2 files changed, 71 insertions(+)  create mode 100644
> > > > Documentation/devicetree/bindings/platform/microsoft/surface-xbl.y
> > > > aml
> > > >
> > > > diff --git
> > > > a/Documentation/devicetree/bindings/platform/microsoft/surface-
> > > xbl.yam
> > > > l
> > > > b/Documentation/devicetree/bindings/platform/microsoft/surface-
> > > xbl.yam
> > > > l
> > > > new file mode 100644
> > > > index 000000000000..df5a87a016f4
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/platform/microsoft/surface
> > > > +++ -xbl
> > > > +++ .yaml
> > > > @@ -0,0 +1,64 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML
> > > > +1.2
> > > > +---
> > > > +$id:
> > > >
> > >
> +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fde
> > > +vi
> > > > +cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-
> > > xbl.yaml%23&amp
> > > >
> > >
> +;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472
> > > 08d9c
> > > >
> > >
> +4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258
> > > 3887312
> > > >
> > >
> +05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
> > > zIiLCJBTi
> > > >
> > >
> +I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=jG0qubz122GG2s8%2B
> > > 1ZuMCcPIa
> > > > +33KWwPoO2VNlDySmvs%3D&amp;reserved=0
> > > > +$schema:
> > > >
> > >
> +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fde
> > > +vi
> > > > +cetree.org%2Fmeta-
> > > schemas%2Fcore.yaml%23&amp;data=04%7C01%7Cjaschultz
> > > >
> > >
> +%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8
> > > 6f141a
> > > >
> > >
> +f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C
> > > TWFpbGZsb3
> > > >
> > >
> +d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
> > > %3D%
> > > >
> > >
> +7C3000&amp;sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA
> > > UzA%3D&amp
> > > > +;reserved=0
> > > > +
> > > > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > > > +
> > > > +maintainers:
> > > > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > > > +
> > > > +description: |
> > > > +  Defined to expose information that is used during production
> > > > +when
> > > > +  device is in manufacturing mode. Some of the information
> > > > +included
> > > > +  in this imem section is -
> > >
> > > If this is onchip sram, we have a binding for that. That's not an MFD.
> > >
> > > > +    * board_id
> > > > +    * battery_present
> > > > +    * hw_init_retries
> > > > +    * is_customer_mode
> > > > +    * is_act_mode
> > > > +    * pmic_reset_reason
> > > > +    * touch_fw_version
> > > > +    * ocp_error_location
> > >
> > > nvmem binding doesn't work for describing these fields?
> > >
> > > > +  See sysfs documentation for more information.
> > >
> > > sysfs? Not relevant to the binding.
> > >
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: simple-mfd
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +additionalProperties: false
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > > > +  - ranges
> > > > +  - address-cells
> > > > +  - size-cells
> > > > +
> > > > +examples:
> > > > +  - |
> > > > +    / {
> > > > +        compatible = "foo";
> > > > +        model = "foo";
> > >
> > > No need to make this the root node with a fake compatible.
> >
> > I included this root node in order to make #address-cells =
> > #size-cells = 2, since this example raises errors otherwise.
> 
> Why does your example require 2 cells? You only have 4KB of address space.

The soc node that imem sits under in sm8150.dtsi defines it that way so for
continuity I figured that it would make sense for the example to mirror that.

Also, should imem and xbl be documented in separate files?

> 
> Though you can do:
> 
> bus {
>   #address-cells = <2>;
>   #size-cells = <2>;
>   ...
> };
> 
> Rob

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

* Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-27 16:16         ` Jarrett Schultz
@ 2022-01-04 22:00           ` Rob Herring
  0 siblings, 0 replies; 15+ messages in thread
From: Rob Herring @ 2022-01-04 22:00 UTC (permalink / raw)
  To: Jarrett Schultz
  Cc: Jarrett Schultz, Andy Gross, bjorn.andersson, Hans de Goede,
	Mark Gross, Maximilian Luz, Felipe Balbi, linux-arm-msm,
	platform-driver-x86, linux-kernel, devicetree

On Mon, Dec 27, 2021 at 10:17 AM Jarrett Schultz
<jaschultz@microsoft.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Rob Herring <robh@kernel.org>
> > Sent: Monday, December 27, 2021 9:46 AM
> > To: Jarrett Schultz <jaschultz@microsoft.com>
> > Cc: Jarrett Schultz <jaschultzms@gmail.com>; Andy Gross
> > <agross@kernel.org>; bjorn.andersson@linaro.org; Hans de Goede
> > <hdegoede@redhat.com>; Mark Gross <markgross@kernel.org>; Maximilian
> > Luz <luzmaximilian@gmail.com>; Felipe Balbi <balbi@kernel.org>; linux-arm-
> > msm@vger.kernel.org; platform-driver-x86@vger.kernel.org; linux-
> > kernel@vger.kernel.org; devicetree@vger.kernel.org
> > Subject: Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> > microsoft: Document surface xbl

Please fix your mail client reply style.

> >
> > On Mon, Dec 27, 2021 at 10:54 AM Jarrett Schultz
> > <jaschultz@microsoft.com> wrote:
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Rob Herring <robh@kernel.org>
> > > > Sent: Tuesday, December 21, 2021 5:24 PM
> > > > To: Jarrett Schultz <jaschultzms@gmail.com>
> > > > Cc: Andy Gross <agross@kernel.org>; bjorn.andersson@linaro.org; Hans
> > > > de Goede <hdegoede@redhat.com>; Mark Gross
> > <markgross@kernel.org>;
> > > > Maximilian Luz <luzmaximilian@gmail.com>; Felipe Balbi
> > > > <balbi@kernel.org>; linux-arm-msm@vger.kernel.org; platform-driver-
> > > > x86@vger.kernel.org; linux-kernel@vger.kernel.org;
> > > > devicetree@vger.kernel.org; Jarrett Schultz
> > > > <jaschultz@microsoft.com>
> > > > Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
> > > > microsoft: Document surface xbl
> > > >
> > > > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > > > >
> > > > > Introduce yaml for surface xbl driver.
> > > > >
> > > > > Signed-off-by: Jarrett Schultz <jaschultz@microsoft.com>
> > > > >
> > > > > ---
> > > > >
> > > > > Changes in v4:
> > > > >  - Addressed small formatting changes
> > > > >  - Removed unnecessary lines
> > > > >
> > > > > ---
> > > > >
> > > > > Changes in v3:
> > > > >  - Updated description to only pertain to the hardware
> > > > >  - Updated the required field to properly reflect the binding
> > > > >  - Removed the first example
> > > > >  - Fixed the size of the reg field in the second example
> > > > >
> > > > > ---
> > > > >
> > > > > Changes in v2:
> > > > >  - Removed json-schema dependence
> > > > >  - Elaborated on description of driver
> > > > >  - Updated example
> > > > > ---
> > > > >  .../platform/microsoft/surface-xbl.yaml       | 64 +++++++++++++++++++
> > > > >  MAINTAINERS                                   |  7 ++
> > > > >  2 files changed, 71 insertions(+)  create mode 100644
> > > > > Documentation/devicetree/bindings/platform/microsoft/surface-xbl.y
> > > > > aml
> > > > >
> > > > > diff --git
> > > > > a/Documentation/devicetree/bindings/platform/microsoft/surface-
> > > > xbl.yam
> > > > > l
> > > > > b/Documentation/devicetree/bindings/platform/microsoft/surface-
> > > > xbl.yam
> > > > > l
> > > > > new file mode 100644
> > > > > index 000000000000..df5a87a016f4
> > > > > --- /dev/null
> > > > > +++ b/Documentation/devicetree/bindings/platform/microsoft/surface
> > > > > +++ -xbl
> > > > > +++ .yaml
> > > > > @@ -0,0 +1,64 @@
> > > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML
> > > > > +1.2
> > > > > +---
> > > > > +$id:
> > > > >
> > > >
> > +https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fde
> > > > +vi
> > > > > +cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-
> > > > xbl.yaml%23&amp

And this...

Or trim the context if not relevant to the discussion.

[...]

> > > > > +examples:
> > > > > +  - |
> > > > > +    / {
> > > > > +        compatible = "foo";
> > > > > +        model = "foo";
> > > >
> > > > No need to make this the root node with a fake compatible.
> > >
> > > I included this root node in order to make #address-cells =
> > > #size-cells = 2, since this example raises errors otherwise.
> >
> > Why does your example require 2 cells? You only have 4KB of address space.
>
> The soc node that imem sits under in sm8150.dtsi defines it that way so for
> continuity I figured that it would make sense for the example to mirror that.

It's just an example. If you are just duplicating dts files, why have examples?

>
> Also, should imem and xbl be documented in separate files?

No. That depends more on the size of the schema. So it's a judgment
call typically.

Rob

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

* RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2021-12-21 23:23   ` Rob Herring
  2021-12-27 14:54     ` [EXTERNAL] " Jarrett Schultz
@ 2022-02-03 23:23     ` Jarrett Schultz
  2022-02-15  1:04       ` Jarrett Schultz
  1 sibling, 1 reply; 15+ messages in thread
From: Jarrett Schultz @ 2022-02-03 23:23 UTC (permalink / raw)
  To: Rob Herring, Jarrett Schultz
  Cc: Andy Gross, bjorn.andersson, Hans de Goede, Mark Gross,
	Maximilian Luz, Felipe Balbi, linux-arm-msm, platform-driver-x86,
	linux-kernel, devicetree


Rob Herring wrote:
> From: Rob Herring <robh@kernel.org>
> 
> On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > From: Jarrett Schultz <jaschultz@microsoft.com>
> >
> > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > +
> > +maintainers:
> > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > +
> > +description: |
> > +  Defined to expose information that is used during production when
> > +  device is in manufacturing mode. Some of the information included
> > +  in this imem section is -
> 
> If this is onchip sram, we have a binding for that. That's not an MFD.

I now have this driver working with nvmem, but I could not find the binding
that you are talking about here. Could you point me to the binding?

Thanks,
Jarrett

> 
> > +    * board_id
> > +    * battery_present
> > +    * hw_init_retries
> > +    * is_customer_mode
> > +    * is_act_mode
> > +    * pmic_reset_reason
> > +    * touch_fw_version
> > +    * ocp_error_location
> 
> nvmem binding doesn't work for describing these fields?
> 
> > +  See sysfs documentation for more information.
> 
> sysfs? Not relevant to the binding.
> 
> > +
> > +properties:
> > +  compatible:
> > +    const: simple-mfd
> > +
> > +  reg:
> > +    maxItems: 1
> > +
> > +additionalProperties: false
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - ranges
> > +  - address-cells
> > +  - size-cells
> > +
> > +examples:
> > +  - |
> > +    / {
> > +        compatible = "foo";
> > +        model = "foo";
> 
> No need to make this the root node with a fake compatible.
> 
> > +        #address-cells = <2>;
> > +        #size-cells = <2>;
> > +
> > +        imem@146bf000 {
> > +          compatible = "simple-mfd";
> > +          reg = <0x0 0x146bf000 0x0 0x1000>;
> > +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> > +          #address-cells = <1>;
> > +          #size-cells = <1>;
> > +          status = "okay";
> 
> Don't show status in examples.
> 
> > +
> > +          xbl@a94 {
> > +            compatible = "microsoft,sm8150-surface-duo-xbl";
> > +            reg = <0xa94 0x100>;
> > +            status = "okay";
> > +          };
> > +        };
> > +      };
> > diff --git a/MAINTAINERS b/MAINTAINERS index
> > 13f9a84a617e..5d0ca2a98b57 100644
> > --- a/MAINTAINERS
> > +++ b/MAINTAINERS
> > @@ -12649,6 +12649,13 @@ F:	Documentation/driver-
> api/surface_aggregator/clients/dtx.rst
> >  F:	drivers/platform/surface/surface_dtx.c
> >  F:	include/uapi/linux/surface_aggregator/dtx.h
> >
> > +MICROSOFT SURFACE DUO XBL DRIVER
> > +M:	Jarrett Schultz <jaschultz@microsoft.com>
> > +L:	linux-arm-msm@vger.kernel.org
> > +L:	platform-driver-x86@vger.kernel.org
> > +S:	Supported
> > +F:	Documentation/devicetree/bindings/platform/microsoft/surface-
> xbl.yaml
> > +
> >  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
> >  M:	Maximilian Luz <luzmaximilian@gmail.com>
> >  L:	platform-driver-x86@vger.kernel.org
> > --
> > 2.25.1
> >
> >

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

* RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2022-02-03 23:23     ` Jarrett Schultz
@ 2022-02-15  1:04       ` Jarrett Schultz
  2022-02-15 14:39         ` Bjorn Andersson
  0 siblings, 1 reply; 15+ messages in thread
From: Jarrett Schultz @ 2022-02-15  1:04 UTC (permalink / raw)
  To: Rob Herring, Jarrett Schultz
  Cc: Andy Gross, bjorn.andersson, Hans de Goede, Mark Gross,
	Maximilian Luz, Felipe Balbi, linux-arm-msm, platform-driver-x86,
	linux-kernel, devicetree

Jarrett Schultz wrote:
> From: Jarrett Schultz
> 
> Rob Herring wrote:
> > From: Rob Herring <robh@kernel.org>
> >
> > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > >
> > > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > > +
> > > +maintainers:
> > > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > > +
> > > +description: |
> > > +  Defined to expose information that is used during production when
> > > +  device is in manufacturing mode. Some of the information included
> > > +  in this imem section is -
> >
> > If this is onchip sram, we have a binding for that. That's not an MFD.
> 
> I now have this driver working with nvmem, but I could not find the binding
> that you are talking about here. Could you point me to the binding?
> 
> Thanks,
> Jarrett
> 

Rob,

I followed up with my team members who have let me know that this lies in DDR rather than SRAM. Could you please point me to the correct binding to use?

Thanks,
Jarrett

> >
> > > +    * board_id
> > > +    * battery_present
> > > +    * hw_init_retries
> > > +    * is_customer_mode
> > > +    * is_act_mode
> > > +    * pmic_reset_reason
> > > +    * touch_fw_version
> > > +    * ocp_error_location
> >
> > nvmem binding doesn't work for describing these fields?
> >
> > > +  See sysfs documentation for more information.
> >
> > sysfs? Not relevant to the binding.
> >
> > > +
> > > +properties:
> > > +  compatible:
> > > +    const: simple-mfd
> > > +
> > > +  reg:
> > > +    maxItems: 1
> > > +
> > > +additionalProperties: false
> > > +
> > > +required:
> > > +  - compatible
> > > +  - reg
> > > +  - ranges
> > > +  - address-cells
> > > +  - size-cells
> > > +
> > > +examples:
> > > +  - |
> > > +    / {
> > > +        compatible = "foo";
> > > +        model = "foo";
> >
> > No need to make this the root node with a fake compatible.
> >
> > > +        #address-cells = <2>;
> > > +        #size-cells = <2>;
> > > +
> > > +        imem@146bf000 {
> > > +          compatible = "simple-mfd";
> > > +          reg = <0x0 0x146bf000 0x0 0x1000>;
> > > +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> > > +          #address-cells = <1>;
> > > +          #size-cells = <1>;
> > > +          status = "okay";
> >
> > Don't show status in examples.
> >
> > > +
> > > +          xbl@a94 {
> > > +            compatible = "microsoft,sm8150-surface-duo-xbl";
> > > +            reg = <0xa94 0x100>;
> > > +            status = "okay";
> > > +          };
> > > +        };
> > > +      };
> > > diff --git a/MAINTAINERS b/MAINTAINERS index
> > > 13f9a84a617e..5d0ca2a98b57 100644
> > > --- a/MAINTAINERS
> > > +++ b/MAINTAINERS
> > > @@ -12649,6 +12649,13 @@ F:	Documentation/driver-
> > api/surface_aggregator/clients/dtx.rst
> > >  F:	drivers/platform/surface/surface_dtx.c
> > >  F:	include/uapi/linux/surface_aggregator/dtx.h
> > >
> > > +MICROSOFT SURFACE DUO XBL DRIVER
> > > +M:	Jarrett Schultz <jaschultz@microsoft.com>
> > > +L:	linux-arm-msm@vger.kernel.org
> > > +L:	platform-driver-x86@vger.kernel.org
> > > +S:	Supported
> > > +F:	Documentation/devicetree/bindings/platform/microsoft/surface-
> > xbl.yaml
> > > +
> > >  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
> > >  M:	Maximilian Luz <luzmaximilian@gmail.com>
> > >  L:	platform-driver-x86@vger.kernel.org
> > > --
> > > 2.25.1
> > >
> > >

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

* Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2022-02-15  1:04       ` Jarrett Schultz
@ 2022-02-15 14:39         ` Bjorn Andersson
  2022-02-24 23:42           ` Jarrett Schultz
  0 siblings, 1 reply; 15+ messages in thread
From: Bjorn Andersson @ 2022-02-15 14:39 UTC (permalink / raw)
  To: Jarrett Schultz
  Cc: Rob Herring, Jarrett Schultz, Andy Gross, Hans de Goede,
	Mark Gross, Maximilian Luz, Felipe Balbi, linux-arm-msm,
	platform-driver-x86, linux-kernel, devicetree

On Mon 14 Feb 19:04 CST 2022, Jarrett Schultz wrote:

> Jarrett Schultz wrote:
> > From: Jarrett Schultz
> > 
> > Rob Herring wrote:
> > > From: Rob Herring <robh@kernel.org>
> > >
> > > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > > >
> > > > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > > > +
> > > > +maintainers:
> > > > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > > > +
> > > > +description: |
> > > > +  Defined to expose information that is used during production when
> > > > +  device is in manufacturing mode. Some of the information included
> > > > +  in this imem section is -
> > >
> > > If this is onchip sram, we have a binding for that. That's not an MFD.
> > 
> > I now have this driver working with nvmem, but I could not find the binding
> > that you are talking about here. Could you point me to the binding?
> > 
> > Thanks,
> > Jarrett
> > 
> 
> Rob,
> 
> I followed up with my team members who have let me know that this lies
> in DDR rather than SRAM. Could you please point me to the correct
> binding to use?
> 

It might be DDR, but it's on-chip and the memory region that you
describe is a region within "imem" - something used for various purposes
by Qualcomm, presumably also in your device. Unfortunately we haven't
specified a binding for "imem", only some of its regions.

Perhaps it would be appropriate to express the entire imem as nvmem, in
addition to the region-specific logic, if that suits you.

Regards,
Bjorn

> Thanks,
> Jarrett
> 
> > >
> > > > +    * board_id
> > > > +    * battery_present
> > > > +    * hw_init_retries
> > > > +    * is_customer_mode
> > > > +    * is_act_mode
> > > > +    * pmic_reset_reason
> > > > +    * touch_fw_version
> > > > +    * ocp_error_location
> > >
> > > nvmem binding doesn't work for describing these fields?
> > >
> > > > +  See sysfs documentation for more information.
> > >
> > > sysfs? Not relevant to the binding.
> > >
> > > > +
> > > > +properties:
> > > > +  compatible:
> > > > +    const: simple-mfd
> > > > +
> > > > +  reg:
> > > > +    maxItems: 1
> > > > +
> > > > +additionalProperties: false
> > > > +
> > > > +required:
> > > > +  - compatible
> > > > +  - reg
> > > > +  - ranges
> > > > +  - address-cells
> > > > +  - size-cells
> > > > +
> > > > +examples:
> > > > +  - |
> > > > +    / {
> > > > +        compatible = "foo";
> > > > +        model = "foo";
> > >
> > > No need to make this the root node with a fake compatible.
> > >
> > > > +        #address-cells = <2>;
> > > > +        #size-cells = <2>;
> > > > +
> > > > +        imem@146bf000 {
> > > > +          compatible = "simple-mfd";
> > > > +          reg = <0x0 0x146bf000 0x0 0x1000>;
> > > > +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> > > > +          #address-cells = <1>;
> > > > +          #size-cells = <1>;
> > > > +          status = "okay";
> > >
> > > Don't show status in examples.
> > >
> > > > +
> > > > +          xbl@a94 {
> > > > +            compatible = "microsoft,sm8150-surface-duo-xbl";
> > > > +            reg = <0xa94 0x100>;
> > > > +            status = "okay";
> > > > +          };
> > > > +        };
> > > > +      };
> > > > diff --git a/MAINTAINERS b/MAINTAINERS index
> > > > 13f9a84a617e..5d0ca2a98b57 100644
> > > > --- a/MAINTAINERS
> > > > +++ b/MAINTAINERS
> > > > @@ -12649,6 +12649,13 @@ F:	Documentation/driver-
> > > api/surface_aggregator/clients/dtx.rst
> > > >  F:	drivers/platform/surface/surface_dtx.c
> > > >  F:	include/uapi/linux/surface_aggregator/dtx.h
> > > >
> > > > +MICROSOFT SURFACE DUO XBL DRIVER
> > > > +M:	Jarrett Schultz <jaschultz@microsoft.com>
> > > > +L:	linux-arm-msm@vger.kernel.org
> > > > +L:	platform-driver-x86@vger.kernel.org
> > > > +S:	Supported
> > > > +F:	Documentation/devicetree/bindings/platform/microsoft/surface-
> > > xbl.yaml
> > > > +
> > > >  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
> > > >  M:	Maximilian Luz <luzmaximilian@gmail.com>
> > > >  L:	platform-driver-x86@vger.kernel.org
> > > > --
> > > > 2.25.1
> > > >
> > > >

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

* RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
  2022-02-15 14:39         ` Bjorn Andersson
@ 2022-02-24 23:42           ` Jarrett Schultz
  0 siblings, 0 replies; 15+ messages in thread
From: Jarrett Schultz @ 2022-02-24 23:42 UTC (permalink / raw)
  To: Bjorn Andersson
  Cc: Rob Herring, Jarrett Schultz, Andy Gross, Hans de Goede,
	Mark Gross, Maximilian Luz, Felipe Balbi, linux-arm-msm,
	platform-driver-x86, linux-kernel, devicetree

On Tuesday, February 15, 2022 8:39 AM, Bjorn Andersson
> 
> On Mon 14 Feb 19:04 CST 2022, Jarrett Schultz wrote:
> 
> > Jarrett Schultz wrote:
> > > From: Jarrett Schultz
> > >
> > > Rob Herring wrote:
> > > > From: Rob Herring <robh@kernel.org>
> > > >
> > > > On Tue, Dec 21, 2021 at 10:28:23AM -0800, Jarrett Schultz wrote:
> > > > > From: Jarrett Schultz <jaschultz@microsoft.com>
> > > > >
> > > > > +title: Surface Extensible Bootloader for Microsoft Surface Duo
> > > > > +
> > > > > +maintainers:
> > > > > +  - Jarrett Schultz <jaschultz@microsoft.com>
> > > > > +
> > > > > +description: |
> > > > > +  Defined to expose information that is used during production
> > > > > +when
> > > > > +  device is in manufacturing mode. Some of the information
> > > > > +included
> > > > > +  in this imem section is -
> > > >
> > > > If this is onchip sram, we have a binding for that. That's not an MFD.
> > >
> > > I now have this driver working with nvmem, but I could not find the
> > > binding that you are talking about here. Could you point me to the
> binding?
> > >
> > > Thanks,
> > > Jarrett
> > >
> >
> > Rob,
> >
> > I followed up with my team members who have let me know that this lies
> > in DDR rather than SRAM. Could you please point me to the correct
> > binding to use?
> >
> 
> It might be DDR, but it's on-chip and the memory region that you describe is
> a region within "imem" - something used for various purposes by Qualcomm,
> presumably also in your device. Unfortunately we haven't specified a binding
> for "imem", only some of its regions.
> 
> Perhaps it would be appropriate to express the entire imem as nvmem, in
> addition to the region-specific logic, if that suits you.
> 
> Regards,
> Bjorn

Bjorn et al.,

This xbl driver was meant to be something simple and the intent was to merge it into the tree with an existing structure. Your suggestion makes sense, and I believe that it could be implemented as a separate patch after this patch with the initial xbl driver has been accepted and merged.

Please let me know what you think,
Jarrett Schultz

> 
> > Thanks,
> > Jarrett
> >
> > > >
> > > > > +    * board_id
> > > > > +    * battery_present
> > > > > +    * hw_init_retries
> > > > > +    * is_customer_mode
> > > > > +    * is_act_mode
> > > > > +    * pmic_reset_reason
> > > > > +    * touch_fw_version
> > > > > +    * ocp_error_location
> > > >
> > > > nvmem binding doesn't work for describing these fields?
> > > >
> > > > > +  See sysfs documentation for more information.
> > > >
> > > > sysfs? Not relevant to the binding.
> > > >
> > > > > +
> > > > > +properties:
> > > > > +  compatible:
> > > > > +    const: simple-mfd
> > > > > +
> > > > > +  reg:
> > > > > +    maxItems: 1
> > > > > +
> > > > > +additionalProperties: false
> > > > > +
> > > > > +required:
> > > > > +  - compatible
> > > > > +  - reg
> > > > > +  - ranges
> > > > > +  - address-cells
> > > > > +  - size-cells
> > > > > +
> > > > > +examples:
> > > > > +  - |
> > > > > +    / {
> > > > > +        compatible = "foo";
> > > > > +        model = "foo";
> > > >
> > > > No need to make this the root node with a fake compatible.
> > > >
> > > > > +        #address-cells = <2>;
> > > > > +        #size-cells = <2>;
> > > > > +
> > > > > +        imem@146bf000 {
> > > > > +          compatible = "simple-mfd";
> > > > > +          reg = <0x0 0x146bf000 0x0 0x1000>;
> > > > > +          ranges = <0x0 0x0 0x146bf000 0x1000>;
> > > > > +          #address-cells = <1>;
> > > > > +          #size-cells = <1>;
> > > > > +          status = "okay";
> > > >
> > > > Don't show status in examples.
> > > >
> > > > > +
> > > > > +          xbl@a94 {
> > > > > +            compatible = "microsoft,sm8150-surface-duo-xbl";
> > > > > +            reg = <0xa94 0x100>;
> > > > > +            status = "okay";
> > > > > +          };
> > > > > +        };
> > > > > +      };
> > > > > diff --git a/MAINTAINERS b/MAINTAINERS index
> > > > > 13f9a84a617e..5d0ca2a98b57 100644
> > > > > --- a/MAINTAINERS
> > > > > +++ b/MAINTAINERS
> > > > > @@ -12649,6 +12649,13 @@ F:	Documentation/driver-
> > > > api/surface_aggregator/clients/dtx.rst
> > > > >  F:	drivers/platform/surface/surface_dtx.c
> > > > >  F:	include/uapi/linux/surface_aggregator/dtx.h
> > > > >
> > > > > +MICROSOFT SURFACE DUO XBL DRIVER
> > > > > +M:	Jarrett Schultz <jaschultz@microsoft.com>
> > > > > +L:	linux-arm-msm@vger.kernel.org
> > > > > +L:	platform-driver-x86@vger.kernel.org
> > > > > +S:	Supported
> > > > > +F:
> 	Documentation/devicetree/bindings/platform/microsoft/surface-
> > > > xbl.yaml
> > > > > +
> > > > >  MICROSOFT SURFACE GPE LID SUPPORT DRIVER
> > > > >  M:	Maximilian Luz <luzmaximilian@gmail.com>
> > > > >  L:	platform-driver-x86@vger.kernel.org
> > > > > --
> > > > > 2.25.1
> > > > >
> > > > >

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

end of thread, other threads:[~2022-02-24 23:42 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-21 18:28 [PATCH RESEND v4 0/4] platform: surface: Introduce Surface XBL Driver Jarrett Schultz
2021-12-21 18:28 ` [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl Jarrett Schultz
2021-12-21 22:45   ` Rob Herring
2021-12-21 23:23   ` Rob Herring
2021-12-27 14:54     ` [EXTERNAL] " Jarrett Schultz
2021-12-27 15:45       ` Rob Herring
2021-12-27 16:16         ` Jarrett Schultz
2022-01-04 22:00           ` Rob Herring
2022-02-03 23:23     ` Jarrett Schultz
2022-02-15  1:04       ` Jarrett Schultz
2022-02-15 14:39         ` Bjorn Andersson
2022-02-24 23:42           ` Jarrett Schultz
2021-12-21 18:28 ` [PATCH RESEND v4 2/4] platform: surface: Add " Jarrett Schultz
2021-12-21 18:28 ` [PATCH RESEND v4 3/4] arm64: dts: qcom: sm8150: Add imem section Jarrett Schultz
2021-12-21 18:28 ` [PATCH RESEND v4 4/4] arm64: dts: qcom: surface-duo: Add surface xbl Jarrett Schultz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.