platform: surface: Introduce Surface XBL Driver
Subsystems (5)
v4 cover platform: surface: Introduce Surface XBL Driver
From: Jarrett Schultz <[email protected]>
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.
---
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
Signature · 1 line
2.25.1
PATCH RESEND v4 1/4 dt-bindings: platform: microsoft: Document surface xbl
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
---
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
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +64 -0
@@ -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 <[email protected]> + +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"; + }; + }; + };
MAINTAINERS +7 -0
@@ -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 <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml + MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected]
Signature · 1 line
2.25.1
Rob Herring
maintainerRe: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 26 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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
Quoted 6 lines
--- .../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.
Rob Herring
maintainerRe: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
In reply to Jarrett SchultzQuoted 43 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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.yamlDocumentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +5
-0@@ -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#
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 15
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ +title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 23
Quoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ * 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?
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 24
Quoted 1 line
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +1
-0+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatible
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";
No need to make this the root node with a fake compatible.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 56
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ #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.
Quoted 30 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS +7
-0@@ -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 <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml + MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected]Signature · 1 line
2.25.1
RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 144 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 21, 2021 5:24 PM
To: Jarrett Schultz <[email protected]>
Cc: Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; [email protected]; platform-driver- [email protected]; [email protected]; [email protected]; Jarrett Schultz <[email protected]>
Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xblQuoted 31 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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 100644Quoted 4 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yamldiff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 2 lines
l b/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Documentation/devicetree/bindings/platform/microsoft/surface-xbl line 3
Quoted 11 lines
l
new file mode 100644
index 000000000000..df5a87a016f4Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +4
-0+++ .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
Documentation/devicetree/bindings/platform/microsoft/surface-xbl line 4
Quoted 1 line
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +1
-0+cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-xbl.yaml%23&
Quoted 1 line
+;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472 08d9c
Quoted 1 line
+4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258 3887312
Quoted 1 line
+05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM zIiLCJBTi
Quoted 1 line
+I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jG0qubz122GG2s8%2B 1ZuMCcPIa
Quoted 3 lines
+33KWwPoO2VNlDySmvs%3D&reserved=0
+$schema:+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
Quoted 1 line
+cetree.org%2Fmeta-
schemas%2Fcore.yaml%23&data=04%7C01%7Cjaschultz
Quoted 1 line
+%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8 6f141a
Quoted 1 line
+f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C TWFpbGZsb3
Quoted 1 line
+d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 %3D%
Quoted 1 line
+7C3000&sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA UzA%3D&
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +11
-0+;reserved=0 + +title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 16 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +16
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatible + - reg + - ranges + - address-cells + - size-cells
Quoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 6 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +6
-0+ +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.
Quoted 46 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +10
-0+ #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.
MAINTAINERS F: Documentation/driver-
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS index renamed from MAINTAINERS +0
-0
13f9a84a617e..5d0ca2a98b57100644MAINTAINERS +0
-0@@ -12649,6 +12649,13 @@ F: Documentation/driver-
api/surface_aggregator/clients/dtx.rstMAINTAINERS F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
Quoted 9 lines
MAINTAINERS +6
-0F: drivers/platform/surface/surface_dtx.c F: include/uapi/linux/surface_aggregator/dtx.h +MICROSOFT SURFACE DUO XBL DRIVER +M: Jarrett Schultz <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yamlQuoted 8 lines
MAINTAINERS +1
-1+ MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected] --2.25.1
Rob Herring
maintainerRe: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 154 lines · Jarrett Schultz
Quoted 145 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 21, 2021 5:24 PM
To: Jarrett Schultz <[email protected]>
Cc: Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; [email protected]; platform-driver- [email protected]; [email protected]; [email protected]; Jarrett Schultz <[email protected]>
Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xblQuoted 31 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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 100644Quoted 4 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yamldiff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 2 lines
l b/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Documentation/devicetree/bindings/platform/microsoft/surface-xbl line 3
Quoted 11 lines
l
new file mode 100644
index 000000000000..df5a87a016f4Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +4
-0+++ .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
Documentation/devicetree/bindings/platform/microsoft/surface-xbl line 4
Quoted 1 line
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +1
-0+cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-xbl.yaml%23&
Quoted 1 line
+;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472 08d9c
Quoted 1 line
+4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258 3887312
Quoted 1 line
+05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM zIiLCJBTi
Quoted 1 line
+I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jG0qubz122GG2s8%2B 1ZuMCcPIa
Quoted 3 lines
+33KWwPoO2VNlDySmvs%3D&reserved=0
+$schema:+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fdevi
Quoted 1 line
+cetree.org%2Fmeta-
schemas%2Fcore.yaml%23&data=04%7C01%7Cjaschultz
Quoted 1 line
+%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8 6f141a
Quoted 1 line
+f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C TWFpbGZsb3
Quoted 1 line
+d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0 %3D%
Quoted 1 line
+7C3000&sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA UzA%3D&
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +11
-0+;reserved=0 + +title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 16 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +16
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatible + - reg + - ranges + - address-cells + - size-cellsQuoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl
Quoted 6 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl new file +6
-0+ +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Quoted 2 lines
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
RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 189 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Monday, December 27, 2021 9:46 AM
To: Jarrett Schultz <[email protected]>
Cc: Jarrett Schultz <[email protected]>; Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xblQuoted 9 lines · Jarrett Schultz
Quoted 9 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 21, 2021 5:24 PM
To: Jarrett Schultz <[email protected]>
Cc: Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark GrossQuoted 48 lines
Quoted 48 lines
Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; [email protected]; platform-driver- [email protected]; [email protected]; [email protected]; Jarrett Schultz <[email protected]>
Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xblQuoted 30 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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 100644Quoted 5 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yamldiff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 2 lines
l b/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 14 lines
Quoted 5 lines
Quoted 5 lines
l
new file mode 100644
index 000000000000..df5a87a016f4Documentation/devicetree/bindings/platform/microsoft/surface new file +0
-0Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface line 4
Quoted 8 lines
+++ -xbl
+++ .yamlDocumentation/devicetree/bindings/platform/microsoft/surface new file +4
-0@@ -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
Quoted 5 lines
Quoted 5 lines
+vi
Documentation/devicetree/bindings/platform/microsoft/surface line 5
Quoted 1 line
Documentation/devicetree/bindings/platform/microsoft/surface new file +1
-0+cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-xbl.yaml%23&
Quoted 1 line
+;data=04%7C01%7Cjaschultz%40microsoft.com%7C77abe729b69a40624472
Quoted 3 lines
Quoted 3 lines
08d9c
Quoted 1 line
+4d8f44e%7C72f988bf86f141af91ab2d7cd011db47%7C0%7C0%7C637757258
Quoted 3 lines
Quoted 3 lines
3887312
Quoted 1 line
+05%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luM
Quoted 3 lines
Quoted 3 lines
zIiLCJBTi
Quoted 1 line
+I6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=jG0qubz122GG2s8%2B
Quoted 5 lines
Quoted 5 lines
1ZuMCcPIa
Quoted 3 lines
+33KWwPoO2VNlDySmvs%3D&reserved=0
+$schema:+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fde
Quoted 5 lines
Quoted 5 lines
+vi
Quoted 1 line
+cetree.org%2Fmeta-
schemas%2Fcore.yaml%23&data=04%7C01%7Cjaschultz
Quoted 1 line
+%40microsoft.com%7C77abe729b69a4062447208d9c4d8f44e%7C72f988bf8
Quoted 3 lines
Quoted 3 lines
6f141a
Quoted 1 line
+f91ab2d7cd011db47%7C0%7C0%7C637757258388731205%7CUnknown%7C
Quoted 3 lines
Quoted 3 lines
TWFpbGZsb3
Quoted 1 line
+d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0
Quoted 3 lines
Quoted 3 lines
%3D%
Quoted 1 line
+7C3000&sdata=FxKNLPok9eW%2FBPmuGzU6x7dPwpnev0Ngr8epO4NA
Quoted 57 lines
Quoted 56 lines
UzA%3D&
Documentation/devicetree/bindings/platform/microsoft/surface
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface new file +13
-0+;reserved=0 + +title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Documentation/devicetree/bindings/platform/microsoft/surface
Quoted 8 lines
Documentation/devicetree/bindings/platform/microsoft/surface new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatibleDocumentation/devicetree/bindings/platform/microsoft/surface
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Quoted 4 lines
Quoted 2 lines
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?
Quoted 10 lines
Though you can do:
bus {
#address-cells = <2>;
#size-cells = <2>;
...
};Rob
Rob Herring
maintainerRe: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 15 lines · Jarrett Schultz
Quoted 15 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Monday, December 27, 2021 9:46 AM
To: Jarrett Schultz <[email protected]>
Cc: Jarrett Schultz <[email protected]>; Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark Gross <[email protected]>; Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xbl
Please fix your mail client reply style.
Quoted 75 lines
Quoted 75 lines
Quoted 9 lines · Jarrett Schultz
Quoted 9 lines
-----Original Message-----
From: Rob Herring <[email protected]>
Sent: Tuesday, December 21, 2021 5:24 PM
To: Jarrett Schultz <[email protected]>
Cc: Andy Gross <[email protected]>; [email protected]; Hans de Goede <[email protected]>; Mark GrossQuoted 62 lines
Quoted 62 lines
Maximilian Luz <[email protected]>; Felipe Balbi <[email protected]>; [email protected]; platform-driver- [email protected]; [email protected]; [email protected]; Jarrett Schultz <[email protected]>
Subject: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform:
microsoft: Document surface xblQuoted 30 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Introduce yaml for surface xbl driver.
Signed-off-by Jarrett Schultz <[email protected]>---
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 100644Quoted 5 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yamldiff --git a/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 2 lines
l b/Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yam
Quoted 13 lines
l
new file mode 100644
index 000000000000..df5a87a016f4Documentation/devicetree/bindings/platform/microsoft/surface new file +6
-0+++ -xbl +++ .yaml@@ -0,0 +1,64 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) %YAML +1.2 +--- +$id:
Quoted 4 lines
Quoted 4 lines
+https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fde
Quoted 3 lines
Quoted 3 lines
+vi
Documentation/devicetree/bindings/platform/microsoft/surface line 5
Quoted 1 line
Documentation/devicetree/bindings/platform/microsoft/surface new file +1
-0+cetree.org%2Fschemas%2Fplatform%2Fmicrosoft%2Fsurface-xbl.yaml%23&
And this...
Or trim the context if not relevant to the discussion.
[...]
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Documentation/devicetree/bindings/platform/microsoft/surface line 10
Quoted 5 lines
Documentation/devicetree/bindings/platform/microsoft/surface new file +5
-0+examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
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.dtsidefines 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?
Quoted 2 lines
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
RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
In reply to Rob HerringQuoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Quoted 2 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 15
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +9
-0+title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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
Quoted 86 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 23
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatibleDocumentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 56
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ #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.
MAINTAINERS F: Documentation/driver-
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS index renamed from MAINTAINERS +0
-0
13f9a84a617e..5d0ca2a98b57100644MAINTAINERS +0
-0@@ -12649,6 +12649,13 @@ F: Documentation/driver-
api/surface_aggregator/clients/dtx.rstMAINTAINERS F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
Quoted 9 lines
MAINTAINERS +6
-0F: drivers/platform/surface/surface_dtx.c F: include/uapi/linux/surface_aggregator/dtx.h +MICROSOFT SURFACE DUO XBL DRIVER +M: Jarrett Schultz <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yamlQuoted 8 lines
MAINTAINERS +1
-1+ MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected] --2.25.1
RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 20 lines · Jarrett Schultz
From: Jarrett Schultz
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Quoted 2 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 15
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +9
-0+title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Quoted 6 lines
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
Quoted 86 lines
Quoted 86 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 23
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatibleDocumentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 56
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ #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.
MAINTAINERS F: Documentation/driver-
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS index renamed from MAINTAINERS +0
-0
13f9a84a617e..5d0ca2a98b57100644MAINTAINERS +0
-0@@ -12649,6 +12649,13 @@ F: Documentation/driver-
api/surface_aggregator/clients/dtx.rstMAINTAINERS F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
Quoted 9 lines
MAINTAINERS +6
-0F: drivers/platform/surface/surface_dtx.c F: include/uapi/linux/surface_aggregator/dtx.h +MICROSOFT SURFACE DUO XBL DRIVER +M: Jarrett Schultz <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yamlQuoted 8 lines
MAINTAINERS +1
-1+ MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected] --2.25.1
Re: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
Quoted 28 lines · Jarrett Schultz
Quoted 20 lines · Jarrett Schultz
From: Jarrett Schultz
Quoted 5 lines · Rob Herring
From: Rob Herring <[email protected]>
Quoted 2 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Quoted 11 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 15
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +9
-0+title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Quoted 6 lines
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
Quoted 6 lines
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
Quoted 89 lines
Thanks,
JarrettQuoted 86 lines
Quoted 86 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 23
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatibleDocumentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 56
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ #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.
MAINTAINERS F: Documentation/driver-
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS index renamed from MAINTAINERS +0
-0
13f9a84a617e..5d0ca2a98b57100644MAINTAINERS +0
-0@@ -12649,6 +12649,13 @@ F: Documentation/driver-
api/surface_aggregator/clients/dtx.rstMAINTAINERS F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
Quoted 9 lines
MAINTAINERS +6
-0F: drivers/platform/surface/surface_dtx.c F: include/uapi/linux/surface_aggregator/dtx.h +MICROSOFT SURFACE DUO XBL DRIVER +M: Jarrett Schultz <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F: Documentation/devicetree/bindings/platform/microsoft/surface-
xbl.yamlQuoted 8 lines
MAINTAINERS +1
-1+ MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected] --2.25.1
RE: [EXTERNAL] Re: [PATCH RESEND v4 1/4] dt-bindings: platform: microsoft: Document surface xbl
On Tuesday, February 15, 2022 8:39 AM, Bjorn Andersson
Quoted 46 lines · Jarrett Schultz
Quoted 24 lines
Quoted 22 lines · Jarrett Schultz
From: Jarrett Schultz
Quoted 18 lines · Rob Herring
From: Rob Herring <[email protected]>
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 15
Quoted 13 lines · Jarrett Schultz
From: Jarrett Schultz <[email protected]>
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +11
-0+title: Surface Extensible Bootloader for Microsoft Surface Duo + +maintainers: + - Jarrett Schultz <[email protected]> + +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.
Quoted 2 lines
Quoted 2 lines
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?
Quoted 11 lines
Quoted 4 lines
Thanks,
JarrettRob,
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.
Quoted 5 lines
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
Quoted 91 lines
Quoted 75 lines
Thanks,
JarrettQuoted 71 lines
Quoted 71 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 23
Quoted 9 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ * board_id + * battery_present + * hw_init_retries + * is_customer_mode + * is_act_mode + * pmic_reset_reason + * touch_fw_version + * ocp_error_locationnvmem binding doesn't work for describing these fields?
Quoted 1 line
+ See sysfs documentation for more information.
sysfs? Not relevant to the binding.
Quoted 12 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +12
-0+ +properties: + compatible: + const: simple-mfd + + reg: + maxItems: 1 + +additionalProperties: false + +required: + - compatibleDocumentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 46
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ - reg + - ranges + - address-cells + - size-cells + +examples: + - | + / { + compatible = "foo"; + model = "foo";No need to make this the root node with a fake compatible.
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml line 56
Quoted 10 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +10
-0+ #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.
MAINTAINERS F: Documentation/driver-
Quoted 13 lines
Documentation/devicetree/bindings/platform/microsoft/surface-xbl.yaml new file +8
-0+ + xbl@a94 { + compatible = "microsoft,sm8150-surface-duo-xbl"; + reg = <0xa94 0x100>; + status = "okay"; + }; + }; + };MAINTAINERS index renamed from MAINTAINERS +0
-0
13f9a84a617e..5d0ca2a98b57100644MAINTAINERS +0
-0@@ -12649,6 +12649,13 @@ F: Documentation/driver-
api/surface_aggregator/clients/dtx.rstQuoted 3 lines
MAINTAINERS +0
-0F: drivers/platform/surface/surface_dtx.c F: include/uapi/linux/surface_aggregator/dtx.hQuoted 6 lines
Quoted 6 lines
Quoted 6 lines
MAINTAINERS F: Documentation/driver-api/surface_aggregator/clients/dtx.rst
Quoted 6 lines
MAINTAINERS +6
-0+MICROSOFT SURFACE DUO XBL DRIVER +M: Jarrett Schultz <[email protected]> +L: [email protected] +L: [email protected] +S: Supported +F:
Documentation/devicetree/bindings/platform/microsoft/surface-Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
xbl.yamlQuoted 8 lines
MAINTAINERS +1
-1+ MICROSOFT SURFACE GPE LID SUPPORT DRIVER M: Maximilian Luz <[email protected]> L: [email protected] --2.25.1
PATCH RESEND v4 2/4 platform: surface: Add surface xbl
In reply to Jarrett SchultzFrom: Jarrett Schultz <[email protected]>
Introduce support for the Extensible Boot Loader driver found on the Surface Duo. Makes device information available to users via sysfs.
---
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
Documentation/ABI/testing/sysfs-platform-surface-xbl new file +79 -0
@@ -0,0 +1,79 @@ +What: /sys/devices/platform/146bfa94.xbl/battery_present +Date: October 2021 +KernelVersion: 5.16 +Contact: [email protected] +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: [email protected] +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: [email protected] +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: [email protected] +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: [email protected] +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: [email protected] +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: [email protected] +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: [email protected] +Description: + Read only. It returns the version of the firmware.
MAINTAINERS +2 -0
@@ -12654,7 +12654,9 @@ M: Jarrett Schultz <[email protected]> L: [email protected] L: [email protected] 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 <[email protected]>
drivers/platform/surface/Kconfig +12 -0
@@ -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
drivers/platform/surface/Makefile +1 -0
@@ -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
drivers/platform/surface/surface_xbl.c new file +186 -0
186 lines not on this page · raw message
Signature · 1 line
2.25.1
PATCH RESEND v4 3/4 arm64: dts: qcom: sm8150: Add imem section
In reply to Jarrett SchultzFrom: Jarrett Schultz <[email protected]>
Introduce the imem section in preparation for the surface xbl driver.
---
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(+)
arch/arm64/boot/dts/qcom/sm8150.dtsi +8 -0
@@ -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>;
Signature · 1 line
2.25.1
PATCH RESEND v4 4/4 arm64: dts: qcom: surface-duo: Add surface xbl
In reply to Jarrett SchultzFrom: Jarrett Schultz <[email protected]>
Introduce device tree source for the surface xbl driver.
---
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(+)
arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dts +10 -0
@@ -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";
Signature · 1 line
2.25.1