* [PATCH v2 0/5] Driver for pre-DCP apple display controller.
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau, Nick Chan
Hi.
This patch series adds support for a secondary display controller
present on Apple M1/M2 chips and used to drive the display of the
"touchbar" touch panel present on those.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
Changes in v2:
- Addressing the review feedback.
- Split out the mipi part of the display controller into a separate device
- Link to v1: https://lore.kernel.org/r/20241124-adpdrm-v1-0-3191d8e6e49a@gmail.com
---
Sasha Finkelstein (5):
dt-bindings: display: Add Apple pre-DCP display controller bindings
drm: adp: Add Apple Display Pipe driver
drm: panel: Add a panel driver for the Summit display
arm64: dts: apple: Add touchbar screen nodes
MAINTAINERS: Add entries for touchbar display driver
.../display/apple,h7-display-pipe-mipi.yaml | 89 +++
.../bindings/display/apple,h7-display-pipe.yaml | 77 +++
.../bindings/display/panel/apple,summit.yaml | 58 ++
MAINTAINERS | 5 +
arch/arm64/boot/dts/apple/t8103-j293.dts | 31 ++
arch/arm64/boot/dts/apple/t8103.dtsi | 61 +++
arch/arm64/boot/dts/apple/t8112-j493.dts | 31 ++
arch/arm64/boot/dts/apple/t8112.dtsi | 62 +++
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/adp/Kconfig | 16 +
drivers/gpu/drm/adp/Makefile | 4 +
drivers/gpu/drm/adp/adp-mipi.c | 251 +++++++++
drivers/gpu/drm/adp/adp_drv.c | 594 +++++++++++++++++++++
drivers/gpu/drm/panel/Kconfig | 9 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-summit.c | 143 +++++
17 files changed, 1435 insertions(+)
---
base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
change-id: 20241124-adpdrm-25fce3dd8a71
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 0/5] Driver for pre-DCP apple display controller.
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau, Nick Chan
Hi.
This patch series adds support for a secondary display controller
present on Apple M1/M2 chips and used to drive the display of the
"touchbar" touch panel present on those.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
Changes in v2:
- Addressing the review feedback.
- Split out the mipi part of the display controller into a separate device
- Link to v1: https://lore.kernel.org/r/20241124-adpdrm-v1-0-3191d8e6e49a@gmail.com
---
Sasha Finkelstein (5):
dt-bindings: display: Add Apple pre-DCP display controller bindings
drm: adp: Add Apple Display Pipe driver
drm: panel: Add a panel driver for the Summit display
arm64: dts: apple: Add touchbar screen nodes
MAINTAINERS: Add entries for touchbar display driver
.../display/apple,h7-display-pipe-mipi.yaml | 89 +++
.../bindings/display/apple,h7-display-pipe.yaml | 77 +++
.../bindings/display/panel/apple,summit.yaml | 58 ++
MAINTAINERS | 5 +
arch/arm64/boot/dts/apple/t8103-j293.dts | 31 ++
arch/arm64/boot/dts/apple/t8103.dtsi | 61 +++
arch/arm64/boot/dts/apple/t8112-j493.dts | 31 ++
arch/arm64/boot/dts/apple/t8112.dtsi | 62 +++
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/adp/Kconfig | 16 +
drivers/gpu/drm/adp/Makefile | 4 +
drivers/gpu/drm/adp/adp-mipi.c | 251 +++++++++
drivers/gpu/drm/adp/adp_drv.c | 594 +++++++++++++++++++++
drivers/gpu/drm/panel/Kconfig | 9 +
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-summit.c | 143 +++++
17 files changed, 1435 insertions(+)
---
base-commit: 9f16d5e6f220661f73b36a4be1b21575651d8833
change-id: 20241124-adpdrm-25fce3dd8a71
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:34 ` Sasha Finkelstein
@ 2024-11-26 16:34 ` Sasha Finkelstein
-1 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein
From: Sasha Finkelstein <fnkl.kernel@gmail.com>
Add bindings for a secondary display controller present on certain
Apple laptops.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
.../display/apple,h7-display-pipe-mipi.yaml | 89 ++++++++++++++++++++++
.../bindings/display/apple,h7-display-pipe.yaml | 77 +++++++++++++++++++
.../bindings/display/panel/apple,summit.yaml | 58 ++++++++++++++
3 files changed, 224 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..2cf2f50e9fc7329a5b424d5ddf8c34cad2ebb6be
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/apple,h7-display-pipe-mipi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple pre-DCP display controller MIPI interface.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+description:
+ The MIPI controller part of the pre-DCP Apple display controller
+
+allOf:
+ - $ref: dsi-controller.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,t8112-display-pipe-mipi
+ - apple,t8103-display-pipe-mipi
+ - const: apple,h7-display-pipe-mipi
+
+ reg:
+ maxItems: 1
+
+ reg-names:
+ const: mipi
+
+ power-domains:
+ maxItems: 1
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+
+ required:
+ - port@0
+ - port@1
+
+ '#address-cells': true
+
+ '#size-cells': true
+
+patternProperties:
+ "^panel@[0-3]$": true
+
+required:
+ - compatible
+ - reg
+ - ports
+
+additionalProperties: false
+
+examples:
+ - |
+ display_dfr: dsi@228200000 {
+ compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x28200000 0xc000>;
+ power-domains = <&ps_dispdfr_mipi>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..98982da9c5f672167d67e4cd3b47e1fbdafc9510
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/apple,h7-display-pipe.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple pre-DCP display controller.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+description:
+ A secondary display controller used to drive the "touchbar" on certain Apple laptops.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,t8112-display-pipe
+ - apple,t8103-display-pipe
+ - const: apple,h7-display-pipe
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: be
+ - const: fe
+
+ power-domains:
+ maxItems: 2
+
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ items:
+ - const: be
+ - const: fe
+
+ iommus:
+ maxItems: 1
+
+ port:
+ $ref: /schemas/graph.yaml#/properties/port
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/apple-aic.h>
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x28200000 0xc000>,
+ <0x28400000 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/display/panel/apple,summit.yaml b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..db14f7af3787076c84ccdda08fedeb8912d5514d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/apple,summit.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple "Summit" display panel.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+allOf:
+ - $ref: panel-common.yaml#
+ - $ref: /schemas/leds/backlight/common.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,j293-summit
+ - apple,j493-summit
+ - const: apple,summit
+
+ reg:
+ maxItems: 1
+
+ max-brightness: true
+
+ port: true
+
+required:
+ - compatible
+ - reg
+ - max-brightness
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "apple,j293-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_bridge_out>;
+ };
+ };
+ };
+ };
+...
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein
Add bindings for a secondary display controller present on certain
Apple laptops.
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
.../display/apple,h7-display-pipe-mipi.yaml | 89 ++++++++++++++++++++++
.../bindings/display/apple,h7-display-pipe.yaml | 77 +++++++++++++++++++
.../bindings/display/panel/apple,summit.yaml | 58 ++++++++++++++
3 files changed, 224 insertions(+)
diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..2cf2f50e9fc7329a5b424d5ddf8c34cad2ebb6be
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
@@ -0,0 +1,89 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/apple,h7-display-pipe-mipi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple pre-DCP display controller MIPI interface.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+description:
+ The MIPI controller part of the pre-DCP Apple display controller
+
+allOf:
+ - $ref: dsi-controller.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,t8112-display-pipe-mipi
+ - apple,t8103-display-pipe-mipi
+ - const: apple,h7-display-pipe-mipi
+
+ reg:
+ maxItems: 1
+
+ reg-names:
+ const: mipi
+
+ power-domains:
+ maxItems: 1
+
+ ports:
+ $ref: /schemas/graph.yaml#/properties/ports
+
+ properties:
+ port@0:
+ $ref: /schemas/graph.yaml#/properties/port
+
+ port@1:
+ $ref: /schemas/graph.yaml#/properties/port
+
+ required:
+ - port@0
+ - port@1
+
+ '#address-cells': true
+
+ '#size-cells': true
+
+patternProperties:
+ "^panel@[0-3]$": true
+
+required:
+ - compatible
+ - reg
+ - ports
+
+additionalProperties: false
+
+examples:
+ - |
+ display_dfr: dsi@228200000 {
+ compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x28200000 0xc000>;
+ power-domains = <&ps_dispdfr_mipi>;
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..98982da9c5f672167d67e4cd3b47e1fbdafc9510
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/apple,h7-display-pipe.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple pre-DCP display controller.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+description:
+ A secondary display controller used to drive the "touchbar" on certain Apple laptops.
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,t8112-display-pipe
+ - apple,t8103-display-pipe
+ - const: apple,h7-display-pipe
+
+ reg:
+ maxItems: 2
+
+ reg-names:
+ items:
+ - const: be
+ - const: fe
+
+ power-domains:
+ maxItems: 2
+
+ interrupts:
+ maxItems: 2
+
+ interrupt-names:
+ items:
+ - const: be
+ - const: fe
+
+ iommus:
+ maxItems: 1
+
+ port:
+ $ref: /schemas/graph.yaml#/properties/port
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/apple-aic.h>
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x28200000 0xc000>,
+ <0x28400000 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+...
diff --git a/Documentation/devicetree/bindings/display/panel/apple,summit.yaml b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..db14f7af3787076c84ccdda08fedeb8912d5514d
--- /dev/null
+++ b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
@@ -0,0 +1,58 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/display/panel/apple,summit.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Apple "Summit" display panel.
+
+maintainers:
+ - asahi@lists.linux.dev
+ - Sasha Finkelstein <fnkl.kernel@gmail.com>
+
+allOf:
+ - $ref: panel-common.yaml#
+ - $ref: /schemas/leds/backlight/common.yaml#
+
+properties:
+ compatible:
+ items:
+ - enum:
+ - apple,j293-summit
+ - apple,j493-summit
+ - const: apple,summit
+
+ reg:
+ maxItems: 1
+
+ max-brightness: true
+
+ port: true
+
+required:
+ - compatible
+ - reg
+ - max-brightness
+ - port
+
+additionalProperties: false
+
+examples:
+ - |
+ dsi {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ panel@0 {
+ compatible = "apple,j293-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_bridge_out>;
+ };
+ };
+ };
+ };
+...
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 2/5] drm: adp: Add Apple Display Pipe driver
2024-11-26 16:34 ` Sasha Finkelstein
@ 2024-11-26 16:34 ` Sasha Finkelstein
-1 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau
From: Sasha Finkelstein <fnkl.kernel@gmail.com>
This display controller is present on M-series chips and is used
to drive the touchbar display.
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/adp/Kconfig | 16 ++
drivers/gpu/drm/adp/Makefile | 4 +
drivers/gpu/drm/adp/adp-mipi.c | 251 +++++++++++++++++
drivers/gpu/drm/adp/adp_drv.c | 594 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 868 insertions(+)
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 5504721007cc190e7d768d42aa9633baa0115f5e..acd1111f1773ef044c306c62ad9f850996259ef1 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -499,6 +499,8 @@ source "drivers/gpu/drm/mcde/Kconfig"
source "drivers/gpu/drm/tidss/Kconfig"
+source "drivers/gpu/drm/adp/Kconfig"
+
source "drivers/gpu/drm/xlnx/Kconfig"
source "drivers/gpu/drm/gud/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 463afad1b5ca6275e61223adc8ca036c3d4d6b03..acd8d8943ef2bf85c80db7c218c59a7ec2df56da 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -213,6 +213,7 @@ obj-y += mxsfb/
obj-y += tiny/
obj-$(CONFIG_DRM_PL111) += pl111/
obj-$(CONFIG_DRM_TVE200) += tve200/
+obj-$(CONFIG_DRM_ADP) += adp/
obj-$(CONFIG_DRM_XEN) += xen/
obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo/
obj-$(CONFIG_DRM_LIMA) += lima/
diff --git a/drivers/gpu/drm/adp/Kconfig b/drivers/gpu/drm/adp/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..7e70b2e26555a2c2ddf71350bce74c97dfe292da
--- /dev/null
+++ b/drivers/gpu/drm/adp/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only OR MIT
+config DRM_ADP
+ tristate "DRM Support for pre-DCP Apple display controllers"
+ depends on DRM && OF && ARM64
+ depends on ARCH_APPLE || COMPILE_TEST
+ select DRM_KMS_HELPER
+ select DRM_BRIDGE_CONNECTOR
+ select DRM_DISPLAY_HELPER
+ select DRM_KMS_DMA_HELPER
+ select DRM_GEM_DMA_HELPER
+ select VIDEOMODE_HELPERS
+ select DRM_MIPI_DSI
+ help
+ Chose this option if you have an Apple Arm laptop with a touchbar.
+
+ If M is selected, this module will be called adpdrm.
diff --git a/drivers/gpu/drm/adp/Makefile b/drivers/gpu/drm/adp/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..7531fddfe6706ace716b288739e420379d98a8cc
--- /dev/null
+++ b/drivers/gpu/drm/adp/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+adpdrm-y := adp_drv.o adp-mipi.o
+obj-$(CONFIG_DRM_ADP) += adpdrm.o
diff --git a/drivers/gpu/drm/adp/adp-mipi.c b/drivers/gpu/drm/adp/adp-mipi.c
new file mode 100644
index 0000000000000000000000000000000000000000..8ac17ddd0fc84acc63006202df1d8afa1189501f
--- /dev/null
+++ b/drivers/gpu/drm/adp/adp-mipi.c
@@ -0,0 +1,251 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/iopoll.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_mipi_dsi.h>
+
+#define DSI_GEN_HDR 0x6c
+#define DSI_GEN_PLD_DATA 0x70
+
+#define DSI_CMD_PKT_STATUS 0x74
+
+#define GEN_PLD_R_EMPTY BIT(4)
+#define GEN_PLD_W_FULL BIT(3)
+#define GEN_PLD_W_EMPTY BIT(2)
+#define GEN_CMD_FULL BIT(1)
+#define GEN_CMD_EMPTY BIT(0)
+#define GEN_RD_CMD_BUSY BIT(6)
+#define CMD_PKT_STATUS_TIMEOUT_US 20000
+
+struct adp_mipi_drv_private {
+ struct mipi_dsi_host dsi;
+ struct drm_bridge bridge;
+ struct drm_bridge *next_bridge;
+ void __iomem *mipi;
+};
+
+#define mipi_to_adp(x) container_of(x, struct adp_mipi_drv_private, dsi)
+
+static int adp_dsi_gen_pkt_hdr_write(struct adp_mipi_drv_private *adp, u32 hdr_val)
+{
+ int ret;
+ u32 val, mask;
+
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_CMD_FULL), 1000,
+ CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to get available command FIFO\n");
+ return ret;
+ }
+
+ writel(hdr_val, adp->mipi + DSI_GEN_HDR);
+
+ mask = GEN_CMD_EMPTY | GEN_PLD_W_EMPTY;
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, (val & mask) == mask,
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to write command FIFO\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int adp_dsi_write(struct adp_mipi_drv_private *adp,
+ const struct mipi_dsi_packet *packet)
+{
+ const u8 *tx_buf = packet->payload;
+ int len = packet->payload_length, pld_data_bytes = sizeof(u32), ret;
+ __le32 word;
+ u32 val;
+
+ while (len) {
+ if (len < pld_data_bytes) {
+ word = 0;
+ memcpy(&word, tx_buf, len);
+ writel(le32_to_cpu(word), adp->mipi + DSI_GEN_PLD_DATA);
+ len = 0;
+ } else {
+ memcpy(&word, tx_buf, pld_data_bytes);
+ writel(le32_to_cpu(word), adp->mipi + DSI_GEN_PLD_DATA);
+ tx_buf += pld_data_bytes;
+ len -= pld_data_bytes;
+ }
+
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_PLD_W_FULL), 1000,
+ CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev,
+ "failed to get available write payload FIFO\n");
+ return ret;
+ }
+ }
+
+ word = 0;
+ memcpy(&word, packet->header, sizeof(packet->header));
+ return adp_dsi_gen_pkt_hdr_write(adp, le32_to_cpu(word));
+}
+
+static int adp_dsi_read(struct adp_mipi_drv_private *adp,
+ const struct mipi_dsi_msg *msg)
+{
+ int i, j, ret, len = msg->rx_len;
+ u8 *buf = msg->rx_buf;
+ u32 val;
+
+ /* Wait end of the read operation */
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_RD_CMD_BUSY),
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "Timeout during read operation\n");
+ return ret;
+ }
+
+ for (i = 0; i < len; i += 4) {
+ /* Read fifo must not be empty before all bytes are read */
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_PLD_R_EMPTY),
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "Read payload FIFO is empty\n");
+ return ret;
+ }
+
+ val = readl(adp->mipi + DSI_GEN_PLD_DATA);
+ for (j = 0; j < 4 && j + i < len; j++)
+ buf[i + j] = val >> (8 * j);
+ }
+
+ return ret;
+}
+
+static ssize_t adp_dsi_host_transfer(struct mipi_dsi_host *host,
+ const struct mipi_dsi_msg *msg)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+ struct mipi_dsi_packet packet;
+ int ret, nb_bytes;
+
+ ret = mipi_dsi_create_packet(&packet, msg);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to create packet: %d\n", ret);
+ return ret;
+ }
+
+ ret = adp_dsi_write(adp, &packet);
+ if (ret)
+ return ret;
+
+ if (msg->rx_buf && msg->rx_len) {
+ ret = adp_dsi_read(adp, msg);
+ if (ret)
+ return ret;
+ nb_bytes = msg->rx_len;
+ } else {
+ nb_bytes = packet.size;
+ }
+
+ return nb_bytes;
+}
+
+static int adp_dsi_host_attach(struct mipi_dsi_host *host,
+ struct mipi_dsi_device *dev)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+ struct drm_bridge *next;
+
+ next = devm_drm_of_get_bridge(adp->dsi.dev, adp->dsi.dev->of_node, 1, 0);
+ if (IS_ERR(next))
+ return PTR_ERR(next);
+
+ adp->next_bridge = next;
+
+ drm_bridge_add(&adp->bridge);
+ return 0;
+}
+
+static int adp_dsi_host_detach(struct mipi_dsi_host *host,
+ struct mipi_dsi_device *dev)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+
+ drm_bridge_remove(&adp->bridge);
+ return 0;
+}
+
+static const struct mipi_dsi_host_ops adp_dsi_host_ops = {
+ .transfer = adp_dsi_host_transfer,
+ .attach = adp_dsi_host_attach,
+ .detach = adp_dsi_host_detach,
+};
+
+static int adp_dsi_bridge_attach(struct drm_bridge *bridge,
+ enum drm_bridge_attach_flags flags)
+{
+ struct adp_mipi_drv_private *adp =
+ container_of(bridge, struct adp_mipi_drv_private, bridge);
+
+ return drm_bridge_attach(bridge->encoder, adp->next_bridge, bridge, flags);
+}
+
+static const struct drm_bridge_funcs adp_dsi_bridge_funcs = {
+ .attach = adp_dsi_bridge_attach,
+};
+
+static int adp_mipi_probe(struct platform_device *pdev)
+{
+ struct adp_mipi_drv_private *adp;
+
+ adp = devm_kzalloc(&pdev->dev, sizeof(*adp), GFP_KERNEL);
+ if (!adp)
+ return -ENOMEM;
+
+ adp->mipi = devm_platform_ioremap_resource_byname(pdev, "mipi");
+ if (IS_ERR(adp->mipi)) {
+ dev_err(&pdev->dev, "failed to map mipi mmio");
+ return PTR_ERR(adp->mipi);
+ }
+
+ adp->dsi.dev = &pdev->dev;
+ adp->dsi.ops = &adp_dsi_host_ops;
+ adp->bridge.funcs = &adp_dsi_bridge_funcs;
+ adp->bridge.of_node = pdev->dev.of_node;
+ adp->bridge.type = DRM_MODE_CONNECTOR_DSI;
+ dev_set_drvdata(&pdev->dev, adp);
+ return mipi_dsi_host_register(&adp->dsi);
+}
+
+static void adp_mipi_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct adp_mipi_drv_private *adp = dev_get_drvdata(dev);
+
+ mipi_dsi_host_unregister(&adp->dsi);
+}
+
+static const struct of_device_id adp_mipi_of_match[] = {
+ { .compatible = "apple,h7-display-pipe-mipi", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adp_mipi_of_match);
+
+static struct platform_driver adp_mipi_platform_driver = {
+ .driver = {
+ .name = "adp-mipi",
+ .of_match_table = adp_mipi_of_match,
+ },
+ .probe = adp_mipi_probe,
+ .remove = adp_mipi_remove,
+};
+
+module_platform_driver(adp_mipi_platform_driver);
+
+MODULE_DESCRIPTION("Apple Display Pipe MIPI driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c
new file mode 100644
index 0000000000000000000000000000000000000000..9384490e2895f7808a987b0aec147b52516a2f8c
--- /dev/null
+++ b/drivers/gpu/drm/adp/adp_drv.c
@@ -0,0 +1,594 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/iopoll.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_fb_dma_helper.h>
+#include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_gem_dma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_vblank.h>
+
+#define ADP_INT_STATUS 0x34
+#define ADP_INT_STATUS_INT_MASK 0x7
+#define ADP_INT_STATUS_VBLANK 0x1
+#define ADP_CTRL 0x100
+#define ADP_CTRL_VBLANK_ON 0x12
+#define ADP_CTRL_FIFO_ON 0x601
+#define ADP_SCREEN_SIZE 0x0c
+#define ADP_SCREEN_HSIZE GENMASK(15, 0)
+#define ADP_SCREEN_VSIZE GENMASK(31, 16)
+
+#define ADBE_FIFO 0x10c0
+#define ADBE_FIFO_SYNC 0xc0000000
+
+#define ADBE_BLEND_BYPASS 0x2020
+#define ADBE_BLEND_EN1 0x2028
+#define ADBE_BLEND_EN2 0x2074
+#define ADBE_BLEND_EN3 0x202c
+#define ADBE_BLEND_EN4 0x2034
+#define ADBE_MASK_BUF 0x2200
+
+#define ADBE_SRC_START 0x4040
+#define ADBE_SRC_SIZE 0x4048
+#define ADBE_DST_START 0x4050
+#define ADBE_DST_SIZE 0x4054
+#define ADBE_STRIDE 0x4038
+#define ADBE_FB_BASE 0x4030
+
+#define ADBE_LAYER_EN1 0x4020
+#define ADBE_LAYER_EN2 0x4068
+#define ADBE_LAYER_EN3 0x40b4
+#define ADBE_LAYER_EN4 0x40f4
+#define ADBE_SCALE_CTL 0x40ac
+#define ADBE_SCALE_CTL_BYPASS 0x100000
+
+#define ADBE_LAYER_CTL 0x1038
+#define ADBE_LAYER_CTL_ENABLE 0x10000
+
+#define ADBE_PIX_FMT 0x402c
+#define ADBE_PIX_FMT_XRGB32 0x53e4001
+
+static int adp_open(struct inode *inode, struct file *filp)
+{
+ /*
+ * The modesetting driver does not check the non-desktop connector
+ * property and keeps the device open and locked. If the touchbar daemon
+ * opens the device first modesetting breaks the whole X session.
+ * Simply refuse to open the device for X11 server processes as
+ * workaround.
+ */
+ if (current->comm[0] == 'X')
+ return -EBUSY;
+
+ return drm_open(inode, filp);
+}
+
+static const struct file_operations adp_fops = {
+ .owner = THIS_MODULE,
+ .open = adp_open,
+ .release = drm_release,
+ .unlocked_ioctl = drm_ioctl,
+ .compat_ioctl = drm_compat_ioctl,
+ .poll = drm_poll,
+ .read = drm_read,
+ .llseek = noop_llseek,
+ .mmap = drm_gem_mmap,
+ .fop_flags = FOP_UNSIGNED_OFFSET,
+ DRM_GEM_DMA_UNMAPPED_AREA_FOPS
+};
+
+static int adp_drm_gem_dumb_create(struct drm_file *file_priv,
+ struct drm_device *drm,
+ struct drm_mode_create_dumb *args)
+{
+ args->height = ALIGN(args->height, 64);
+ args->size = args->pitch * args->height;
+
+ return drm_gem_dma_dumb_create_internal(file_priv, drm, args);
+}
+
+static const struct drm_driver adp_driver = {
+ .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
+ .fops = &adp_fops,
+ DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(adp_drm_gem_dumb_create),
+ .name = "adp",
+ .desc = "Apple Display Pipe DRM Driver",
+ .date = "20230412",
+ .major = 0,
+ .minor = 1,
+};
+
+struct adp_drv_private {
+ struct drm_device drm;
+ struct drm_crtc crtc;
+ struct drm_encoder encoder;
+ struct drm_connector *connector;
+ struct drm_bridge *next_bridge;
+ void __iomem *be;
+ void __iomem *fe;
+ u32 *mask_buf;
+ u64 mask_buf_size;
+ dma_addr_t mask_iova;
+ int be_irq;
+ int fe_irq;
+ spinlock_t irq_lock;
+ struct drm_pending_vblank_event *event;
+};
+
+struct adp_plane {
+ struct drm_plane base_plane;
+ u8 id;
+};
+
+#define to_adp(x) container_of(x, struct adp_drv_private, drm)
+#define crtc_to_adp(x) container_of(x, struct adp_drv_private, crtc)
+
+static int adp_plane_atomic_check(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct drm_plane_state *new_plane_state;
+ struct drm_crtc_state *crtc_state;
+
+ new_plane_state = drm_atomic_get_new_plane_state(state, plane);
+
+ if (!new_plane_state->crtc)
+ return 0;
+
+ crtc_state = drm_atomic_get_crtc_state(state, new_plane_state->crtc);
+ if (IS_ERR(crtc_state))
+ return PTR_ERR(crtc_state);
+ return drm_atomic_helper_check_plane_state(new_plane_state,
+ crtc_state,
+ DRM_PLANE_NO_SCALING,
+ DRM_PLANE_NO_SCALING,
+ true, true);
+}
+
+static void adp_plane_atomic_update(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp;
+ struct drm_rect src_rect;
+ struct drm_gem_dma_object *obj;
+ struct drm_framebuffer *fb;
+ struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
+ u32 src_pos, src_size, dst_pos, dst_size;
+
+ if (!plane || !new_state)
+ return;
+
+ fb = new_state->fb;
+ if (!fb)
+ return;
+ adp = to_adp(plane->dev);
+
+ drm_rect_fp_to_int(&src_rect, &new_state->src);
+ src_pos = src_rect.x1 << 16 | src_rect.y1;
+ dst_pos = new_state->dst.x1 << 16 | new_state->dst.y1;
+ src_size = drm_rect_width(&src_rect) << 16 | drm_rect_height(&src_rect);
+ dst_size = drm_rect_width(&new_state->dst) << 16 |
+ drm_rect_height(&new_state->dst);
+ writel(src_pos, adp->be + ADBE_SRC_START);
+ writel(src_size, adp->be + ADBE_SRC_SIZE);
+ writel(dst_pos, adp->be + ADBE_DST_START);
+ writel(dst_size, adp->be + ADBE_DST_SIZE);
+ writel(fb->pitches[0], adp->be + ADBE_STRIDE);
+ obj = drm_fb_dma_get_gem_obj(fb, 0);
+ if (obj)
+ writel(obj->dma_addr + fb->offsets[0], adp->be + ADBE_FB_BASE);
+
+ writel(BIT(0), adp->be + ADBE_LAYER_EN1);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN2);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN3);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN4);
+ writel(ADBE_SCALE_CTL_BYPASS, adp->be + ADBE_SCALE_CTL);
+ writel(ADBE_LAYER_CTL_ENABLE | BIT(0), adp->be + ADBE_LAYER_CTL);
+ writel(ADBE_PIX_FMT_XRGB32, adp->be + ADBE_PIX_FMT);
+}
+
+static void adp_plane_atomic_disable(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = to_adp(plane->dev);
+
+ writel(0x0, adp->be + ADBE_LAYER_EN1);
+ writel(0x0, adp->be + ADBE_LAYER_EN2);
+ writel(0x0, adp->be + ADBE_LAYER_EN3);
+ writel(0x0, adp->be + ADBE_LAYER_EN4);
+ writel(ADBE_LAYER_CTL_ENABLE, adp->be + ADBE_LAYER_CTL);
+}
+
+static const struct drm_plane_helper_funcs adp_plane_helper_funcs = {
+ .atomic_check = adp_plane_atomic_check,
+ .atomic_update = adp_plane_atomic_update,
+ .atomic_disable = adp_plane_atomic_disable,
+ DRM_GEM_SHADOW_PLANE_HELPER_FUNCS
+};
+
+static const struct drm_plane_funcs adp_plane_funcs = {
+ .update_plane = drm_atomic_helper_update_plane,
+ .disable_plane = drm_atomic_helper_disable_plane,
+ DRM_GEM_SHADOW_PLANE_FUNCS
+};
+
+static const u32 plane_formats[] = {
+ DRM_FORMAT_XRGB8888,
+};
+
+#define ALL_CRTCS 1
+
+static struct adp_plane *adp_plane_new(struct adp_drv_private *adp, u8 id)
+{
+ struct drm_device *drm = &adp->drm;
+ struct adp_plane *plane;
+ enum drm_plane_type plane_type;
+
+ plane_type = (id == 0) ? DRM_PLANE_TYPE_PRIMARY :
+ DRM_PLANE_TYPE_OVERLAY;
+
+ plane = drmm_universal_plane_alloc(drm, struct adp_plane, base_plane,
+ ALL_CRTCS, &adp_plane_funcs,
+ plane_formats, ARRAY_SIZE(plane_formats),
+ NULL, plane_type, "plane %d", id);
+ if (!plane) {
+ drm_err(drm, "failed to allocate plane");
+ return ERR_PTR(-ENOMEM);
+ }
+ plane->id = id;
+
+ drm_plane_helper_add(&plane->base_plane, &adp_plane_helper_funcs);
+ return plane;
+}
+
+static void adp_enable_vblank(struct adp_drv_private *adp)
+{
+ u32 cur_ctrl;
+
+ writel(ADP_INT_STATUS_INT_MASK, adp->fe + ADP_INT_STATUS);
+
+ cur_ctrl = readl(adp->fe + ADP_CTRL);
+ writel(cur_ctrl | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+}
+
+static int adp_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+ struct drm_device *dev = crtc->dev;
+ struct adp_drv_private *adp = to_adp(dev);
+
+ adp_enable_vblank(adp);
+
+ return 0;
+}
+
+static void adp_disable_vblank(struct adp_drv_private *adp)
+{
+ u32 cur_ctrl;
+
+ cur_ctrl = readl(adp->fe + ADP_CTRL);
+ writel(cur_ctrl & ~ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+ writel(ADP_INT_STATUS_INT_MASK, adp->fe + ADP_INT_STATUS);
+}
+
+static void adp_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+ struct drm_device *dev = crtc->dev;
+ struct adp_drv_private *adp = to_adp(dev);
+
+ adp_disable_vblank(adp);
+}
+
+static void adp_crtc_atomic_enable(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+
+ writel(BIT(0), adp->be + ADBE_BLEND_EN2);
+ writel(BIT(4), adp->be + ADBE_BLEND_EN1);
+ writel(BIT(0), adp->be + ADBE_BLEND_EN3);
+ writel(BIT(0), adp->be + ADBE_BLEND_BYPASS);
+ writel(BIT(0), adp->be + ADBE_BLEND_EN4);
+}
+
+static void adp_crtc_atomic_disable(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
+
+ drm_atomic_helper_disable_planes_on_crtc(old_state, false);
+
+ writel(0x0, adp->be + ADBE_BLEND_EN2);
+ writel(0x0, adp->be + ADBE_BLEND_EN1);
+ writel(0x0, adp->be + ADBE_BLEND_EN3);
+ writel(0x0, adp->be + ADBE_BLEND_BYPASS);
+ writel(0x0, adp->be + ADBE_BLEND_EN4);
+ drm_crtc_vblank_off(crtc);
+}
+
+static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ u32 frame_num = 1;
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+ struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
+ u64 new_size = ALIGN(new_state->mode.hdisplay *
+ new_state->mode.vdisplay * 4, PAGE_SIZE);
+
+ if (new_size != adp->mask_buf_size) {
+ if (adp->mask_buf)
+ dma_free_coherent(crtc->dev->dev, adp->mask_buf_size,
+ adp->mask_buf, adp->mask_iova);
+ adp->mask_buf = NULL;
+ if (new_size != 0) {
+ adp->mask_buf = dma_alloc_coherent(crtc->dev->dev, new_size,
+ &adp->mask_iova, GFP_KERNEL);
+ memset(adp->mask_buf, 0xFF, new_size);
+ writel(adp->mask_iova, adp->be + ADBE_MASK_BUF);
+ }
+ adp->mask_buf_size = new_size;
+ }
+ writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
+ //FIXME: use adbe flush interrupt
+ spin_lock_irq(&crtc->dev->event_lock);
+ if (crtc->state->event) {
+ drm_crtc_vblank_get(crtc);
+ adp->event = crtc->state->event;
+ }
+ crtc->state->event = NULL;
+ spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_crtc_funcs adp_crtc_funcs = {
+ .destroy = drm_crtc_cleanup,
+ .set_config = drm_atomic_helper_set_config,
+ .page_flip = drm_atomic_helper_page_flip,
+ .reset = drm_atomic_helper_crtc_reset,
+ .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+ .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+ .enable_vblank = adp_crtc_enable_vblank,
+ .disable_vblank = adp_crtc_disable_vblank,
+};
+
+
+static const struct drm_crtc_helper_funcs adp_crtc_helper_funcs = {
+ .atomic_enable = adp_crtc_atomic_enable,
+ .atomic_disable = adp_crtc_atomic_disable,
+ .atomic_flush = adp_crtc_atomic_flush,
+};
+
+static int adp_setup_crtc(struct adp_drv_private *adp)
+{
+ struct drm_device *drm = &adp->drm;
+ struct adp_plane *primary;
+ int ret;
+
+ primary = adp_plane_new(adp, 0);
+ if (IS_ERR(primary))
+ return PTR_ERR(primary);
+
+ ret = drm_crtc_init_with_planes(drm, &adp->crtc, &primary->base_plane,
+ NULL, &adp_crtc_funcs, NULL);
+ if (ret)
+ return ret;
+
+ drm_crtc_helper_add(&adp->crtc, &adp_crtc_helper_funcs);
+ return 0;
+}
+
+static const struct drm_mode_config_funcs adp_mode_config_funcs = {
+ .fb_create = drm_gem_fb_create_with_dirty,
+ .atomic_check = drm_atomic_helper_check,
+ .atomic_commit = drm_atomic_helper_commit,
+};
+
+static int adp_setup_mode_config(struct adp_drv_private *adp)
+{
+ struct drm_device *drm = &adp->drm;
+ int ret;
+ u32 size;
+
+ ret = drmm_mode_config_init(drm);
+ if (ret)
+ return ret;
+
+ /*
+ * Query screen size restrict the frame buffer size to the screen size
+ * aligned to the next multiple of 64. This is not necessary but can be
+ * used as simple check for non-desktop devices.
+ * Xorg's modesetting driver does not care about the connector
+ * "non-desktop" property. The max frame buffer width or height can be
+ * easily checked and a device can be reject if the max width/height is
+ * smaller than 120 for example.
+ * Any touchbar daemon is not limited by this small framebuffer size.
+ */
+ size = readl(adp->fe + ADP_SCREEN_SIZE);
+
+ drm->mode_config.min_width = 32;
+ drm->mode_config.min_height = 32;
+ drm->mode_config.max_width = ALIGN(FIELD_GET(ADP_SCREEN_HSIZE, size), 64);
+ drm->mode_config.max_height = ALIGN(FIELD_GET(ADP_SCREEN_VSIZE, size), 64);
+ drm->mode_config.preferred_depth = 24;
+ drm->mode_config.prefer_shadow = 0;
+ drm->mode_config.funcs = &adp_mode_config_funcs;
+
+ ret = adp_setup_crtc(adp);
+ if (ret) {
+ drm_err(drm, "failed to create crtc");
+ return ret;
+ }
+
+ adp->encoder.possible_crtcs = ALL_CRTCS;
+ ret = drm_simple_encoder_init(drm, &adp->encoder, DRM_MODE_ENCODER_DSI);
+ if (ret) {
+ drm_err(drm, "failed to init encoder");
+ return ret;
+ }
+
+ ret = drm_bridge_attach(&adp->encoder, adp->next_bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ if (ret) {
+ drm_err(drm, "failed to init bridge chain");
+ return ret;
+ }
+
+ adp->connector = drm_bridge_connector_init(drm, &adp->encoder);
+ if (IS_ERR(adp->connector))
+ return PTR_ERR(adp->connector);
+
+ drm_connector_attach_encoder(adp->connector, &adp->encoder);
+
+ ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
+ if (ret < 0) {
+ drm_err(drm, "failed to initialize vblank");
+ return ret;
+ }
+
+ drm_mode_config_reset(drm);
+
+ return 0;
+}
+
+static int adp_parse_of(struct platform_device *pdev, struct adp_drv_private *adp)
+{
+ struct device *dev = &pdev->dev;
+
+ adp->be = devm_platform_ioremap_resource_byname(pdev, "be");
+ if (IS_ERR(adp->be)) {
+ dev_err(dev, "failed to map display backend mmio");
+ return PTR_ERR(adp->be);
+ }
+
+ adp->fe = devm_platform_ioremap_resource_byname(pdev, "fe");
+ if (IS_ERR(adp->fe)) {
+ dev_err(dev, "failed to map display pipe mmio");
+ return PTR_ERR(adp->fe);
+ }
+
+ adp->be_irq = platform_get_irq_byname(pdev, "be");
+ if (adp->be_irq < 0) {
+ dev_err(dev, "failed to find be irq");
+ return adp->be_irq;
+ }
+
+ adp->fe_irq = platform_get_irq_byname(pdev, "fe");
+ if (adp->fe_irq < 0) {
+ dev_err(dev, "failed to find fe irq");
+ return adp->fe_irq;
+ }
+
+ adp->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
+ if (IS_ERR(adp->next_bridge)) {
+ if (PTR_ERR(adp->next_bridge) != EPROBE_DEFER)
+ dev_err(dev, "failed to find next bridge");
+ return PTR_ERR(adp->next_bridge);
+ }
+
+ return 0;
+}
+
+static irqreturn_t adp_fe_irq(int irq, void *arg)
+{
+ struct adp_drv_private *adp = (struct adp_drv_private *)arg;
+ u32 int_status;
+ u32 int_ctl;
+
+ spin_lock(&adp->irq_lock);
+
+ int_status = readl(adp->fe + ADP_INT_STATUS);
+ if (int_status & ADP_INT_STATUS_VBLANK) {
+ drm_crtc_handle_vblank(&adp->crtc);
+ spin_lock(&adp->crtc.dev->event_lock);
+ if (adp->event) {
+ int_ctl = readl(adp->fe + ADP_CTRL);
+ if ((int_ctl & 0xF00) == 0x600) {
+ drm_crtc_send_vblank_event(&adp->crtc, adp->event);
+ adp->event = NULL;
+ drm_crtc_vblank_put(&adp->crtc);
+ }
+ }
+ spin_unlock(&adp->crtc.dev->event_lock);
+ }
+
+ writel(int_status, adp->fe + ADP_INT_STATUS);
+
+ spin_unlock(&adp->irq_lock);
+
+ return IRQ_HANDLED;
+}
+
+static int adp_probe(struct platform_device *pdev)
+{
+ struct adp_drv_private *adp;
+ int err;
+
+ adp = devm_drm_dev_alloc(&pdev->dev, &adp_driver, struct adp_drv_private, drm);
+ if (IS_ERR(adp))
+ return PTR_ERR(adp);
+
+ spin_lock_init(&adp->irq_lock);
+
+ dev_set_drvdata(&pdev->dev, &adp->drm);
+
+ err = adp_parse_of(pdev, adp);
+ if (err < 0)
+ return err;
+
+ adp_disable_vblank(adp);
+ writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+
+ err = adp_setup_mode_config(adp);
+ if (err < 0)
+ return err;
+
+ err = devm_request_irq(&pdev->dev, adp->fe_irq, adp_fe_irq, 0,
+ "adp-fe", adp);
+ if (err)
+ return err;
+
+ err = drm_dev_register(&adp->drm, 0);
+ if (err)
+ return err;
+ return 0;
+}
+
+static void adp_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct drm_device *drm = dev_get_drvdata(dev);
+ struct adp_drv_private *adp = to_adp(drm);
+
+ adp_disable_vblank(adp);
+ drm_dev_unregister(drm);
+ dev_set_drvdata(dev, NULL);
+ drm_atomic_helper_shutdown(drm);
+}
+
+static const struct of_device_id adp_of_match[] = {
+ { .compatible = "apple,h7-display-pipe", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adp_of_match);
+
+static struct platform_driver adp_platform_driver = {
+ .driver = {
+ .name = "adp",
+ .of_match_table = adp_of_match,
+ },
+ .probe = adp_probe,
+ .remove = adp_remove,
+};
+
+module_platform_driver(adp_platform_driver);
+
+MODULE_DESCRIPTION("Apple Display Pipe DRM driver");
+MODULE_LICENSE("GPL");
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 2/5] drm: adp: Add Apple Display Pipe driver
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau
This display controller is present on M-series chips and is used
to drive the touchbar display.
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
drivers/gpu/drm/Kconfig | 2 +
drivers/gpu/drm/Makefile | 1 +
drivers/gpu/drm/adp/Kconfig | 16 ++
drivers/gpu/drm/adp/Makefile | 4 +
drivers/gpu/drm/adp/adp-mipi.c | 251 +++++++++++++++++
drivers/gpu/drm/adp/adp_drv.c | 594 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 868 insertions(+)
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 5504721007cc190e7d768d42aa9633baa0115f5e..acd1111f1773ef044c306c62ad9f850996259ef1 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -499,6 +499,8 @@ source "drivers/gpu/drm/mcde/Kconfig"
source "drivers/gpu/drm/tidss/Kconfig"
+source "drivers/gpu/drm/adp/Kconfig"
+
source "drivers/gpu/drm/xlnx/Kconfig"
source "drivers/gpu/drm/gud/Kconfig"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 463afad1b5ca6275e61223adc8ca036c3d4d6b03..acd8d8943ef2bf85c80db7c218c59a7ec2df56da 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -213,6 +213,7 @@ obj-y += mxsfb/
obj-y += tiny/
obj-$(CONFIG_DRM_PL111) += pl111/
obj-$(CONFIG_DRM_TVE200) += tve200/
+obj-$(CONFIG_DRM_ADP) += adp/
obj-$(CONFIG_DRM_XEN) += xen/
obj-$(CONFIG_DRM_VBOXVIDEO) += vboxvideo/
obj-$(CONFIG_DRM_LIMA) += lima/
diff --git a/drivers/gpu/drm/adp/Kconfig b/drivers/gpu/drm/adp/Kconfig
new file mode 100644
index 0000000000000000000000000000000000000000..7e70b2e26555a2c2ddf71350bce74c97dfe292da
--- /dev/null
+++ b/drivers/gpu/drm/adp/Kconfig
@@ -0,0 +1,16 @@
+# SPDX-License-Identifier: GPL-2.0-only OR MIT
+config DRM_ADP
+ tristate "DRM Support for pre-DCP Apple display controllers"
+ depends on DRM && OF && ARM64
+ depends on ARCH_APPLE || COMPILE_TEST
+ select DRM_KMS_HELPER
+ select DRM_BRIDGE_CONNECTOR
+ select DRM_DISPLAY_HELPER
+ select DRM_KMS_DMA_HELPER
+ select DRM_GEM_DMA_HELPER
+ select VIDEOMODE_HELPERS
+ select DRM_MIPI_DSI
+ help
+ Chose this option if you have an Apple Arm laptop with a touchbar.
+
+ If M is selected, this module will be called adpdrm.
diff --git a/drivers/gpu/drm/adp/Makefile b/drivers/gpu/drm/adp/Makefile
new file mode 100644
index 0000000000000000000000000000000000000000..7531fddfe6706ace716b288739e420379d98a8cc
--- /dev/null
+++ b/drivers/gpu/drm/adp/Makefile
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: GPL-2.0-only OR MIT
+
+adpdrm-y := adp_drv.o adp-mipi.o
+obj-$(CONFIG_DRM_ADP) += adpdrm.o
diff --git a/drivers/gpu/drm/adp/adp-mipi.c b/drivers/gpu/drm/adp/adp-mipi.c
new file mode 100644
index 0000000000000000000000000000000000000000..8ac17ddd0fc84acc63006202df1d8afa1189501f
--- /dev/null
+++ b/drivers/gpu/drm/adp/adp-mipi.c
@@ -0,0 +1,251 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/iopoll.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include <drm/drm_bridge.h>
+#include <drm/drm_mipi_dsi.h>
+
+#define DSI_GEN_HDR 0x6c
+#define DSI_GEN_PLD_DATA 0x70
+
+#define DSI_CMD_PKT_STATUS 0x74
+
+#define GEN_PLD_R_EMPTY BIT(4)
+#define GEN_PLD_W_FULL BIT(3)
+#define GEN_PLD_W_EMPTY BIT(2)
+#define GEN_CMD_FULL BIT(1)
+#define GEN_CMD_EMPTY BIT(0)
+#define GEN_RD_CMD_BUSY BIT(6)
+#define CMD_PKT_STATUS_TIMEOUT_US 20000
+
+struct adp_mipi_drv_private {
+ struct mipi_dsi_host dsi;
+ struct drm_bridge bridge;
+ struct drm_bridge *next_bridge;
+ void __iomem *mipi;
+};
+
+#define mipi_to_adp(x) container_of(x, struct adp_mipi_drv_private, dsi)
+
+static int adp_dsi_gen_pkt_hdr_write(struct adp_mipi_drv_private *adp, u32 hdr_val)
+{
+ int ret;
+ u32 val, mask;
+
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_CMD_FULL), 1000,
+ CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to get available command FIFO\n");
+ return ret;
+ }
+
+ writel(hdr_val, adp->mipi + DSI_GEN_HDR);
+
+ mask = GEN_CMD_EMPTY | GEN_PLD_W_EMPTY;
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, (val & mask) == mask,
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to write command FIFO\n");
+ return ret;
+ }
+
+ return 0;
+}
+
+static int adp_dsi_write(struct adp_mipi_drv_private *adp,
+ const struct mipi_dsi_packet *packet)
+{
+ const u8 *tx_buf = packet->payload;
+ int len = packet->payload_length, pld_data_bytes = sizeof(u32), ret;
+ __le32 word;
+ u32 val;
+
+ while (len) {
+ if (len < pld_data_bytes) {
+ word = 0;
+ memcpy(&word, tx_buf, len);
+ writel(le32_to_cpu(word), adp->mipi + DSI_GEN_PLD_DATA);
+ len = 0;
+ } else {
+ memcpy(&word, tx_buf, pld_data_bytes);
+ writel(le32_to_cpu(word), adp->mipi + DSI_GEN_PLD_DATA);
+ tx_buf += pld_data_bytes;
+ len -= pld_data_bytes;
+ }
+
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_PLD_W_FULL), 1000,
+ CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev,
+ "failed to get available write payload FIFO\n");
+ return ret;
+ }
+ }
+
+ word = 0;
+ memcpy(&word, packet->header, sizeof(packet->header));
+ return adp_dsi_gen_pkt_hdr_write(adp, le32_to_cpu(word));
+}
+
+static int adp_dsi_read(struct adp_mipi_drv_private *adp,
+ const struct mipi_dsi_msg *msg)
+{
+ int i, j, ret, len = msg->rx_len;
+ u8 *buf = msg->rx_buf;
+ u32 val;
+
+ /* Wait end of the read operation */
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_RD_CMD_BUSY),
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "Timeout during read operation\n");
+ return ret;
+ }
+
+ for (i = 0; i < len; i += 4) {
+ /* Read fifo must not be empty before all bytes are read */
+ ret = readl_poll_timeout(adp->mipi + DSI_CMD_PKT_STATUS,
+ val, !(val & GEN_PLD_R_EMPTY),
+ 1000, CMD_PKT_STATUS_TIMEOUT_US);
+ if (ret) {
+ dev_err(adp->dsi.dev, "Read payload FIFO is empty\n");
+ return ret;
+ }
+
+ val = readl(adp->mipi + DSI_GEN_PLD_DATA);
+ for (j = 0; j < 4 && j + i < len; j++)
+ buf[i + j] = val >> (8 * j);
+ }
+
+ return ret;
+}
+
+static ssize_t adp_dsi_host_transfer(struct mipi_dsi_host *host,
+ const struct mipi_dsi_msg *msg)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+ struct mipi_dsi_packet packet;
+ int ret, nb_bytes;
+
+ ret = mipi_dsi_create_packet(&packet, msg);
+ if (ret) {
+ dev_err(adp->dsi.dev, "failed to create packet: %d\n", ret);
+ return ret;
+ }
+
+ ret = adp_dsi_write(adp, &packet);
+ if (ret)
+ return ret;
+
+ if (msg->rx_buf && msg->rx_len) {
+ ret = adp_dsi_read(adp, msg);
+ if (ret)
+ return ret;
+ nb_bytes = msg->rx_len;
+ } else {
+ nb_bytes = packet.size;
+ }
+
+ return nb_bytes;
+}
+
+static int adp_dsi_host_attach(struct mipi_dsi_host *host,
+ struct mipi_dsi_device *dev)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+ struct drm_bridge *next;
+
+ next = devm_drm_of_get_bridge(adp->dsi.dev, adp->dsi.dev->of_node, 1, 0);
+ if (IS_ERR(next))
+ return PTR_ERR(next);
+
+ adp->next_bridge = next;
+
+ drm_bridge_add(&adp->bridge);
+ return 0;
+}
+
+static int adp_dsi_host_detach(struct mipi_dsi_host *host,
+ struct mipi_dsi_device *dev)
+{
+ struct adp_mipi_drv_private *adp = mipi_to_adp(host);
+
+ drm_bridge_remove(&adp->bridge);
+ return 0;
+}
+
+static const struct mipi_dsi_host_ops adp_dsi_host_ops = {
+ .transfer = adp_dsi_host_transfer,
+ .attach = adp_dsi_host_attach,
+ .detach = adp_dsi_host_detach,
+};
+
+static int adp_dsi_bridge_attach(struct drm_bridge *bridge,
+ enum drm_bridge_attach_flags flags)
+{
+ struct adp_mipi_drv_private *adp =
+ container_of(bridge, struct adp_mipi_drv_private, bridge);
+
+ return drm_bridge_attach(bridge->encoder, adp->next_bridge, bridge, flags);
+}
+
+static const struct drm_bridge_funcs adp_dsi_bridge_funcs = {
+ .attach = adp_dsi_bridge_attach,
+};
+
+static int adp_mipi_probe(struct platform_device *pdev)
+{
+ struct adp_mipi_drv_private *adp;
+
+ adp = devm_kzalloc(&pdev->dev, sizeof(*adp), GFP_KERNEL);
+ if (!adp)
+ return -ENOMEM;
+
+ adp->mipi = devm_platform_ioremap_resource_byname(pdev, "mipi");
+ if (IS_ERR(adp->mipi)) {
+ dev_err(&pdev->dev, "failed to map mipi mmio");
+ return PTR_ERR(adp->mipi);
+ }
+
+ adp->dsi.dev = &pdev->dev;
+ adp->dsi.ops = &adp_dsi_host_ops;
+ adp->bridge.funcs = &adp_dsi_bridge_funcs;
+ adp->bridge.of_node = pdev->dev.of_node;
+ adp->bridge.type = DRM_MODE_CONNECTOR_DSI;
+ dev_set_drvdata(&pdev->dev, adp);
+ return mipi_dsi_host_register(&adp->dsi);
+}
+
+static void adp_mipi_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct adp_mipi_drv_private *adp = dev_get_drvdata(dev);
+
+ mipi_dsi_host_unregister(&adp->dsi);
+}
+
+static const struct of_device_id adp_mipi_of_match[] = {
+ { .compatible = "apple,h7-display-pipe-mipi", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adp_mipi_of_match);
+
+static struct platform_driver adp_mipi_platform_driver = {
+ .driver = {
+ .name = "adp-mipi",
+ .of_match_table = adp_mipi_of_match,
+ },
+ .probe = adp_mipi_probe,
+ .remove = adp_mipi_remove,
+};
+
+module_platform_driver(adp_mipi_platform_driver);
+
+MODULE_DESCRIPTION("Apple Display Pipe MIPI driver");
+MODULE_LICENSE("GPL");
diff --git a/drivers/gpu/drm/adp/adp_drv.c b/drivers/gpu/drm/adp/adp_drv.c
new file mode 100644
index 0000000000000000000000000000000000000000..9384490e2895f7808a987b0aec147b52516a2f8c
--- /dev/null
+++ b/drivers/gpu/drm/adp/adp_drv.c
@@ -0,0 +1,594 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/iopoll.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+
+#include <drm/drm_atomic.h>
+#include <drm/drm_atomic_helper.h>
+#include <drm/drm_bridge.h>
+#include <drm/drm_bridge_connector.h>
+#include <drm/drm_drv.h>
+#include <drm/drm_fb_dma_helper.h>
+#include <drm/drm_framebuffer.h>
+#include <drm/drm_gem_atomic_helper.h>
+#include <drm/drm_gem_dma_helper.h>
+#include <drm/drm_gem_framebuffer_helper.h>
+#include <drm/drm_probe_helper.h>
+#include <drm/drm_simple_kms_helper.h>
+#include <drm/drm_vblank.h>
+
+#define ADP_INT_STATUS 0x34
+#define ADP_INT_STATUS_INT_MASK 0x7
+#define ADP_INT_STATUS_VBLANK 0x1
+#define ADP_CTRL 0x100
+#define ADP_CTRL_VBLANK_ON 0x12
+#define ADP_CTRL_FIFO_ON 0x601
+#define ADP_SCREEN_SIZE 0x0c
+#define ADP_SCREEN_HSIZE GENMASK(15, 0)
+#define ADP_SCREEN_VSIZE GENMASK(31, 16)
+
+#define ADBE_FIFO 0x10c0
+#define ADBE_FIFO_SYNC 0xc0000000
+
+#define ADBE_BLEND_BYPASS 0x2020
+#define ADBE_BLEND_EN1 0x2028
+#define ADBE_BLEND_EN2 0x2074
+#define ADBE_BLEND_EN3 0x202c
+#define ADBE_BLEND_EN4 0x2034
+#define ADBE_MASK_BUF 0x2200
+
+#define ADBE_SRC_START 0x4040
+#define ADBE_SRC_SIZE 0x4048
+#define ADBE_DST_START 0x4050
+#define ADBE_DST_SIZE 0x4054
+#define ADBE_STRIDE 0x4038
+#define ADBE_FB_BASE 0x4030
+
+#define ADBE_LAYER_EN1 0x4020
+#define ADBE_LAYER_EN2 0x4068
+#define ADBE_LAYER_EN3 0x40b4
+#define ADBE_LAYER_EN4 0x40f4
+#define ADBE_SCALE_CTL 0x40ac
+#define ADBE_SCALE_CTL_BYPASS 0x100000
+
+#define ADBE_LAYER_CTL 0x1038
+#define ADBE_LAYER_CTL_ENABLE 0x10000
+
+#define ADBE_PIX_FMT 0x402c
+#define ADBE_PIX_FMT_XRGB32 0x53e4001
+
+static int adp_open(struct inode *inode, struct file *filp)
+{
+ /*
+ * The modesetting driver does not check the non-desktop connector
+ * property and keeps the device open and locked. If the touchbar daemon
+ * opens the device first modesetting breaks the whole X session.
+ * Simply refuse to open the device for X11 server processes as
+ * workaround.
+ */
+ if (current->comm[0] == 'X')
+ return -EBUSY;
+
+ return drm_open(inode, filp);
+}
+
+static const struct file_operations adp_fops = {
+ .owner = THIS_MODULE,
+ .open = adp_open,
+ .release = drm_release,
+ .unlocked_ioctl = drm_ioctl,
+ .compat_ioctl = drm_compat_ioctl,
+ .poll = drm_poll,
+ .read = drm_read,
+ .llseek = noop_llseek,
+ .mmap = drm_gem_mmap,
+ .fop_flags = FOP_UNSIGNED_OFFSET,
+ DRM_GEM_DMA_UNMAPPED_AREA_FOPS
+};
+
+static int adp_drm_gem_dumb_create(struct drm_file *file_priv,
+ struct drm_device *drm,
+ struct drm_mode_create_dumb *args)
+{
+ args->height = ALIGN(args->height, 64);
+ args->size = args->pitch * args->height;
+
+ return drm_gem_dma_dumb_create_internal(file_priv, drm, args);
+}
+
+static const struct drm_driver adp_driver = {
+ .driver_features = DRIVER_GEM | DRIVER_MODESET | DRIVER_ATOMIC,
+ .fops = &adp_fops,
+ DRM_GEM_DMA_DRIVER_OPS_VMAP_WITH_DUMB_CREATE(adp_drm_gem_dumb_create),
+ .name = "adp",
+ .desc = "Apple Display Pipe DRM Driver",
+ .date = "20230412",
+ .major = 0,
+ .minor = 1,
+};
+
+struct adp_drv_private {
+ struct drm_device drm;
+ struct drm_crtc crtc;
+ struct drm_encoder encoder;
+ struct drm_connector *connector;
+ struct drm_bridge *next_bridge;
+ void __iomem *be;
+ void __iomem *fe;
+ u32 *mask_buf;
+ u64 mask_buf_size;
+ dma_addr_t mask_iova;
+ int be_irq;
+ int fe_irq;
+ spinlock_t irq_lock;
+ struct drm_pending_vblank_event *event;
+};
+
+struct adp_plane {
+ struct drm_plane base_plane;
+ u8 id;
+};
+
+#define to_adp(x) container_of(x, struct adp_drv_private, drm)
+#define crtc_to_adp(x) container_of(x, struct adp_drv_private, crtc)
+
+static int adp_plane_atomic_check(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct drm_plane_state *new_plane_state;
+ struct drm_crtc_state *crtc_state;
+
+ new_plane_state = drm_atomic_get_new_plane_state(state, plane);
+
+ if (!new_plane_state->crtc)
+ return 0;
+
+ crtc_state = drm_atomic_get_crtc_state(state, new_plane_state->crtc);
+ if (IS_ERR(crtc_state))
+ return PTR_ERR(crtc_state);
+ return drm_atomic_helper_check_plane_state(new_plane_state,
+ crtc_state,
+ DRM_PLANE_NO_SCALING,
+ DRM_PLANE_NO_SCALING,
+ true, true);
+}
+
+static void adp_plane_atomic_update(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp;
+ struct drm_rect src_rect;
+ struct drm_gem_dma_object *obj;
+ struct drm_framebuffer *fb;
+ struct drm_plane_state *new_state = drm_atomic_get_new_plane_state(state, plane);
+ u32 src_pos, src_size, dst_pos, dst_size;
+
+ if (!plane || !new_state)
+ return;
+
+ fb = new_state->fb;
+ if (!fb)
+ return;
+ adp = to_adp(plane->dev);
+
+ drm_rect_fp_to_int(&src_rect, &new_state->src);
+ src_pos = src_rect.x1 << 16 | src_rect.y1;
+ dst_pos = new_state->dst.x1 << 16 | new_state->dst.y1;
+ src_size = drm_rect_width(&src_rect) << 16 | drm_rect_height(&src_rect);
+ dst_size = drm_rect_width(&new_state->dst) << 16 |
+ drm_rect_height(&new_state->dst);
+ writel(src_pos, adp->be + ADBE_SRC_START);
+ writel(src_size, adp->be + ADBE_SRC_SIZE);
+ writel(dst_pos, adp->be + ADBE_DST_START);
+ writel(dst_size, adp->be + ADBE_DST_SIZE);
+ writel(fb->pitches[0], adp->be + ADBE_STRIDE);
+ obj = drm_fb_dma_get_gem_obj(fb, 0);
+ if (obj)
+ writel(obj->dma_addr + fb->offsets[0], adp->be + ADBE_FB_BASE);
+
+ writel(BIT(0), adp->be + ADBE_LAYER_EN1);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN2);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN3);
+ writel(BIT(0), adp->be + ADBE_LAYER_EN4);
+ writel(ADBE_SCALE_CTL_BYPASS, adp->be + ADBE_SCALE_CTL);
+ writel(ADBE_LAYER_CTL_ENABLE | BIT(0), adp->be + ADBE_LAYER_CTL);
+ writel(ADBE_PIX_FMT_XRGB32, adp->be + ADBE_PIX_FMT);
+}
+
+static void adp_plane_atomic_disable(struct drm_plane *plane,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = to_adp(plane->dev);
+
+ writel(0x0, adp->be + ADBE_LAYER_EN1);
+ writel(0x0, adp->be + ADBE_LAYER_EN2);
+ writel(0x0, adp->be + ADBE_LAYER_EN3);
+ writel(0x0, adp->be + ADBE_LAYER_EN4);
+ writel(ADBE_LAYER_CTL_ENABLE, adp->be + ADBE_LAYER_CTL);
+}
+
+static const struct drm_plane_helper_funcs adp_plane_helper_funcs = {
+ .atomic_check = adp_plane_atomic_check,
+ .atomic_update = adp_plane_atomic_update,
+ .atomic_disable = adp_plane_atomic_disable,
+ DRM_GEM_SHADOW_PLANE_HELPER_FUNCS
+};
+
+static const struct drm_plane_funcs adp_plane_funcs = {
+ .update_plane = drm_atomic_helper_update_plane,
+ .disable_plane = drm_atomic_helper_disable_plane,
+ DRM_GEM_SHADOW_PLANE_FUNCS
+};
+
+static const u32 plane_formats[] = {
+ DRM_FORMAT_XRGB8888,
+};
+
+#define ALL_CRTCS 1
+
+static struct adp_plane *adp_plane_new(struct adp_drv_private *adp, u8 id)
+{
+ struct drm_device *drm = &adp->drm;
+ struct adp_plane *plane;
+ enum drm_plane_type plane_type;
+
+ plane_type = (id == 0) ? DRM_PLANE_TYPE_PRIMARY :
+ DRM_PLANE_TYPE_OVERLAY;
+
+ plane = drmm_universal_plane_alloc(drm, struct adp_plane, base_plane,
+ ALL_CRTCS, &adp_plane_funcs,
+ plane_formats, ARRAY_SIZE(plane_formats),
+ NULL, plane_type, "plane %d", id);
+ if (!plane) {
+ drm_err(drm, "failed to allocate plane");
+ return ERR_PTR(-ENOMEM);
+ }
+ plane->id = id;
+
+ drm_plane_helper_add(&plane->base_plane, &adp_plane_helper_funcs);
+ return plane;
+}
+
+static void adp_enable_vblank(struct adp_drv_private *adp)
+{
+ u32 cur_ctrl;
+
+ writel(ADP_INT_STATUS_INT_MASK, adp->fe + ADP_INT_STATUS);
+
+ cur_ctrl = readl(adp->fe + ADP_CTRL);
+ writel(cur_ctrl | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+}
+
+static int adp_crtc_enable_vblank(struct drm_crtc *crtc)
+{
+ struct drm_device *dev = crtc->dev;
+ struct adp_drv_private *adp = to_adp(dev);
+
+ adp_enable_vblank(adp);
+
+ return 0;
+}
+
+static void adp_disable_vblank(struct adp_drv_private *adp)
+{
+ u32 cur_ctrl;
+
+ cur_ctrl = readl(adp->fe + ADP_CTRL);
+ writel(cur_ctrl & ~ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+ writel(ADP_INT_STATUS_INT_MASK, adp->fe + ADP_INT_STATUS);
+}
+
+static void adp_crtc_disable_vblank(struct drm_crtc *crtc)
+{
+ struct drm_device *dev = crtc->dev;
+ struct adp_drv_private *adp = to_adp(dev);
+
+ adp_disable_vblank(adp);
+}
+
+static void adp_crtc_atomic_enable(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+
+ writel(BIT(0), adp->be + ADBE_BLEND_EN2);
+ writel(BIT(4), adp->be + ADBE_BLEND_EN1);
+ writel(BIT(0), adp->be + ADBE_BLEND_EN3);
+ writel(BIT(0), adp->be + ADBE_BLEND_BYPASS);
+ writel(BIT(0), adp->be + ADBE_BLEND_EN4);
+}
+
+static void adp_crtc_atomic_disable(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+ struct drm_crtc_state *old_state = drm_atomic_get_old_crtc_state(state, crtc);
+
+ drm_atomic_helper_disable_planes_on_crtc(old_state, false);
+
+ writel(0x0, adp->be + ADBE_BLEND_EN2);
+ writel(0x0, adp->be + ADBE_BLEND_EN1);
+ writel(0x0, adp->be + ADBE_BLEND_EN3);
+ writel(0x0, adp->be + ADBE_BLEND_BYPASS);
+ writel(0x0, adp->be + ADBE_BLEND_EN4);
+ drm_crtc_vblank_off(crtc);
+}
+
+static void adp_crtc_atomic_flush(struct drm_crtc *crtc,
+ struct drm_atomic_state *state)
+{
+ u32 frame_num = 1;
+ struct adp_drv_private *adp = crtc_to_adp(crtc);
+ struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc);
+ u64 new_size = ALIGN(new_state->mode.hdisplay *
+ new_state->mode.vdisplay * 4, PAGE_SIZE);
+
+ if (new_size != adp->mask_buf_size) {
+ if (adp->mask_buf)
+ dma_free_coherent(crtc->dev->dev, adp->mask_buf_size,
+ adp->mask_buf, adp->mask_iova);
+ adp->mask_buf = NULL;
+ if (new_size != 0) {
+ adp->mask_buf = dma_alloc_coherent(crtc->dev->dev, new_size,
+ &adp->mask_iova, GFP_KERNEL);
+ memset(adp->mask_buf, 0xFF, new_size);
+ writel(adp->mask_iova, adp->be + ADBE_MASK_BUF);
+ }
+ adp->mask_buf_size = new_size;
+ }
+ writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO);
+ //FIXME: use adbe flush interrupt
+ spin_lock_irq(&crtc->dev->event_lock);
+ if (crtc->state->event) {
+ drm_crtc_vblank_get(crtc);
+ adp->event = crtc->state->event;
+ }
+ crtc->state->event = NULL;
+ spin_unlock_irq(&crtc->dev->event_lock);
+}
+
+static const struct drm_crtc_funcs adp_crtc_funcs = {
+ .destroy = drm_crtc_cleanup,
+ .set_config = drm_atomic_helper_set_config,
+ .page_flip = drm_atomic_helper_page_flip,
+ .reset = drm_atomic_helper_crtc_reset,
+ .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
+ .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
+ .enable_vblank = adp_crtc_enable_vblank,
+ .disable_vblank = adp_crtc_disable_vblank,
+};
+
+
+static const struct drm_crtc_helper_funcs adp_crtc_helper_funcs = {
+ .atomic_enable = adp_crtc_atomic_enable,
+ .atomic_disable = adp_crtc_atomic_disable,
+ .atomic_flush = adp_crtc_atomic_flush,
+};
+
+static int adp_setup_crtc(struct adp_drv_private *adp)
+{
+ struct drm_device *drm = &adp->drm;
+ struct adp_plane *primary;
+ int ret;
+
+ primary = adp_plane_new(adp, 0);
+ if (IS_ERR(primary))
+ return PTR_ERR(primary);
+
+ ret = drm_crtc_init_with_planes(drm, &adp->crtc, &primary->base_plane,
+ NULL, &adp_crtc_funcs, NULL);
+ if (ret)
+ return ret;
+
+ drm_crtc_helper_add(&adp->crtc, &adp_crtc_helper_funcs);
+ return 0;
+}
+
+static const struct drm_mode_config_funcs adp_mode_config_funcs = {
+ .fb_create = drm_gem_fb_create_with_dirty,
+ .atomic_check = drm_atomic_helper_check,
+ .atomic_commit = drm_atomic_helper_commit,
+};
+
+static int adp_setup_mode_config(struct adp_drv_private *adp)
+{
+ struct drm_device *drm = &adp->drm;
+ int ret;
+ u32 size;
+
+ ret = drmm_mode_config_init(drm);
+ if (ret)
+ return ret;
+
+ /*
+ * Query screen size restrict the frame buffer size to the screen size
+ * aligned to the next multiple of 64. This is not necessary but can be
+ * used as simple check for non-desktop devices.
+ * Xorg's modesetting driver does not care about the connector
+ * "non-desktop" property. The max frame buffer width or height can be
+ * easily checked and a device can be reject if the max width/height is
+ * smaller than 120 for example.
+ * Any touchbar daemon is not limited by this small framebuffer size.
+ */
+ size = readl(adp->fe + ADP_SCREEN_SIZE);
+
+ drm->mode_config.min_width = 32;
+ drm->mode_config.min_height = 32;
+ drm->mode_config.max_width = ALIGN(FIELD_GET(ADP_SCREEN_HSIZE, size), 64);
+ drm->mode_config.max_height = ALIGN(FIELD_GET(ADP_SCREEN_VSIZE, size), 64);
+ drm->mode_config.preferred_depth = 24;
+ drm->mode_config.prefer_shadow = 0;
+ drm->mode_config.funcs = &adp_mode_config_funcs;
+
+ ret = adp_setup_crtc(adp);
+ if (ret) {
+ drm_err(drm, "failed to create crtc");
+ return ret;
+ }
+
+ adp->encoder.possible_crtcs = ALL_CRTCS;
+ ret = drm_simple_encoder_init(drm, &adp->encoder, DRM_MODE_ENCODER_DSI);
+ if (ret) {
+ drm_err(drm, "failed to init encoder");
+ return ret;
+ }
+
+ ret = drm_bridge_attach(&adp->encoder, adp->next_bridge, NULL,
+ DRM_BRIDGE_ATTACH_NO_CONNECTOR);
+ if (ret) {
+ drm_err(drm, "failed to init bridge chain");
+ return ret;
+ }
+
+ adp->connector = drm_bridge_connector_init(drm, &adp->encoder);
+ if (IS_ERR(adp->connector))
+ return PTR_ERR(adp->connector);
+
+ drm_connector_attach_encoder(adp->connector, &adp->encoder);
+
+ ret = drm_vblank_init(drm, drm->mode_config.num_crtc);
+ if (ret < 0) {
+ drm_err(drm, "failed to initialize vblank");
+ return ret;
+ }
+
+ drm_mode_config_reset(drm);
+
+ return 0;
+}
+
+static int adp_parse_of(struct platform_device *pdev, struct adp_drv_private *adp)
+{
+ struct device *dev = &pdev->dev;
+
+ adp->be = devm_platform_ioremap_resource_byname(pdev, "be");
+ if (IS_ERR(adp->be)) {
+ dev_err(dev, "failed to map display backend mmio");
+ return PTR_ERR(adp->be);
+ }
+
+ adp->fe = devm_platform_ioremap_resource_byname(pdev, "fe");
+ if (IS_ERR(adp->fe)) {
+ dev_err(dev, "failed to map display pipe mmio");
+ return PTR_ERR(adp->fe);
+ }
+
+ adp->be_irq = platform_get_irq_byname(pdev, "be");
+ if (adp->be_irq < 0) {
+ dev_err(dev, "failed to find be irq");
+ return adp->be_irq;
+ }
+
+ adp->fe_irq = platform_get_irq_byname(pdev, "fe");
+ if (adp->fe_irq < 0) {
+ dev_err(dev, "failed to find fe irq");
+ return adp->fe_irq;
+ }
+
+ adp->next_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 0, 0);
+ if (IS_ERR(adp->next_bridge)) {
+ if (PTR_ERR(adp->next_bridge) != EPROBE_DEFER)
+ dev_err(dev, "failed to find next bridge");
+ return PTR_ERR(adp->next_bridge);
+ }
+
+ return 0;
+}
+
+static irqreturn_t adp_fe_irq(int irq, void *arg)
+{
+ struct adp_drv_private *adp = (struct adp_drv_private *)arg;
+ u32 int_status;
+ u32 int_ctl;
+
+ spin_lock(&adp->irq_lock);
+
+ int_status = readl(adp->fe + ADP_INT_STATUS);
+ if (int_status & ADP_INT_STATUS_VBLANK) {
+ drm_crtc_handle_vblank(&adp->crtc);
+ spin_lock(&adp->crtc.dev->event_lock);
+ if (adp->event) {
+ int_ctl = readl(adp->fe + ADP_CTRL);
+ if ((int_ctl & 0xF00) == 0x600) {
+ drm_crtc_send_vblank_event(&adp->crtc, adp->event);
+ adp->event = NULL;
+ drm_crtc_vblank_put(&adp->crtc);
+ }
+ }
+ spin_unlock(&adp->crtc.dev->event_lock);
+ }
+
+ writel(int_status, adp->fe + ADP_INT_STATUS);
+
+ spin_unlock(&adp->irq_lock);
+
+ return IRQ_HANDLED;
+}
+
+static int adp_probe(struct platform_device *pdev)
+{
+ struct adp_drv_private *adp;
+ int err;
+
+ adp = devm_drm_dev_alloc(&pdev->dev, &adp_driver, struct adp_drv_private, drm);
+ if (IS_ERR(adp))
+ return PTR_ERR(adp);
+
+ spin_lock_init(&adp->irq_lock);
+
+ dev_set_drvdata(&pdev->dev, &adp->drm);
+
+ err = adp_parse_of(pdev, adp);
+ if (err < 0)
+ return err;
+
+ adp_disable_vblank(adp);
+ writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL);
+
+ err = adp_setup_mode_config(adp);
+ if (err < 0)
+ return err;
+
+ err = devm_request_irq(&pdev->dev, adp->fe_irq, adp_fe_irq, 0,
+ "adp-fe", adp);
+ if (err)
+ return err;
+
+ err = drm_dev_register(&adp->drm, 0);
+ if (err)
+ return err;
+ return 0;
+}
+
+static void adp_remove(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct drm_device *drm = dev_get_drvdata(dev);
+ struct adp_drv_private *adp = to_adp(drm);
+
+ adp_disable_vblank(adp);
+ drm_dev_unregister(drm);
+ dev_set_drvdata(dev, NULL);
+ drm_atomic_helper_shutdown(drm);
+}
+
+static const struct of_device_id adp_of_match[] = {
+ { .compatible = "apple,h7-display-pipe", },
+ { },
+};
+MODULE_DEVICE_TABLE(of, adp_of_match);
+
+static struct platform_driver adp_platform_driver = {
+ .driver = {
+ .name = "adp",
+ .of_match_table = adp_of_match,
+ },
+ .probe = adp_probe,
+ .remove = adp_remove,
+};
+
+module_platform_driver(adp_platform_driver);
+
+MODULE_DESCRIPTION("Apple Display Pipe DRM driver");
+MODULE_LICENSE("GPL");
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
2024-11-26 16:34 ` Sasha Finkelstein
@ 2024-11-26 16:34 ` Sasha Finkelstein
-1 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Nick Chan
From: Sasha Finkelstein <fnkl.kernel@gmail.com>
This is the display panel used for the touchbar on laptops that have it.
Co-developed-by: Nick Chan <towinchenmi@gmail.com>
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
drivers/gpu/drm/panel/Kconfig | 9 +++
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-summit.c | 143 +++++++++++++++++++++++++++++++++++
3 files changed, 153 insertions(+)
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index d7469c565d1db8b8e974dd6c45d03d9352d99d63..5085a82e4bc695e85cabbc3200859bbe10cb0f91 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -925,6 +925,15 @@ config DRM_PANEL_SIMPLE
that it can be automatically turned off when the panel goes into a
low power state.
+config DRM_PANEL_SUMMIT
+ tristate "Apple Summit display panel"
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ help
+ Say Y if you want to enable support for the "Summit" display panel
+ used as a touchbar on certain Apple laptops.
+
config DRM_PANEL_SYNAPTICS_R63353
tristate "Synaptics R63353-based panels"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7dcf72646cacff11bab90c78e3b8b1f357e5f14a..10ac2e850f5cd6d6546439de75483466e4015d1a 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -89,6 +89,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS060T1SX01) += panel-sharp-ls060t1sx01.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_SUMMIT) += panel-summit.o
obj-$(CONFIG_DRM_PANEL_SYNAPTICS_R63353) += panel-synaptics-r63353.o
obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
obj-$(CONFIG_DRM_PANEL_SONY_TD4353_JDI) += panel-sony-td4353-jdi.o
diff --git a/drivers/gpu/drm/panel/panel-summit.c b/drivers/gpu/drm/panel/panel-summit.c
new file mode 100644
index 0000000000000000000000000000000000000000..16bd9fa1213d7bc3f022b878ea5cfeadbd468995
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-summit.c
@@ -0,0 +1,143 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/backlight.h>
+#include <drm/drm_device.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_mode.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <video/mipi_display.h>
+
+struct summit_data {
+ struct mipi_dsi_device *dsi;
+ struct backlight_device *bl;
+ struct drm_panel panel;
+};
+
+static int summit_set_brightness(struct device *dev)
+{
+ struct summit_data *s_data = dev_get_drvdata(dev);
+ int level = backlight_get_brightness(s_data->bl);
+
+ return mipi_dsi_dcs_set_display_brightness(s_data->dsi, level);
+}
+
+static int summit_bl_update_status(struct backlight_device *dev)
+{
+ return summit_set_brightness(&dev->dev);
+}
+
+static int summit_bl_get_brightness(struct backlight_device *dev)
+{
+ return backlight_get_brightness(dev);
+}
+
+static const struct backlight_ops summit_bl_ops = {
+ .get_brightness = summit_bl_get_brightness,
+ .update_status = summit_bl_update_status,
+};
+
+static int summit_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ struct drm_display_mode *mode = drm_mode_create(connector->dev);
+
+ connector->display_info.non_desktop = true;
+ drm_object_property_set_value(&connector->base,
+ connector->dev->mode_config.non_desktop_property,
+ connector->display_info.non_desktop);
+
+ mode->vdisplay = 2008;
+ mode->hdisplay = 60;
+ mode->hsync_start = mode->hdisplay + 8;
+ mode->hsync_end = mode->hsync_start + 80;
+ mode->htotal = mode->hsync_end + 40;
+ mode->vsync_start = mode->vdisplay + 1;
+ mode->vsync_end = mode->vsync_start + 15;
+ mode->vtotal = mode->vsync_end + 6;
+ mode->clock = (mode->vtotal * mode->htotal * 60) / 1000;
+ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
+ mode->flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC;
+ drm_mode_set_name(mode);
+ drm_mode_probed_add(connector, mode);
+ return 1;
+}
+
+static const struct drm_panel_funcs summit_panel_funcs = {
+ .get_modes = summit_get_modes,
+};
+
+static int summit_probe(struct mipi_dsi_device *dsi)
+{
+ struct backlight_properties props = { 0 };
+ struct device *dev = &dsi->dev;
+ struct summit_data *s_data;
+ int ret;
+
+ s_data = devm_kzalloc(dev, sizeof(*s_data), GFP_KERNEL);
+ if (!s_data)
+ return -ENOMEM;
+
+ mipi_dsi_set_drvdata(dsi, s_data);
+ s_data->dsi = dsi;
+
+ ret = device_property_read_u32(dev, "max-brightness", &props.max_brightness);
+ if (ret)
+ return ret;
+ props.type = BACKLIGHT_RAW;
+
+ s_data->bl = devm_backlight_device_register(dev, dev_name(dev),
+ dev, s_data, &summit_bl_ops, &props);
+ if (IS_ERR(s_data->bl))
+ return PTR_ERR(s_data->bl);
+
+ drm_panel_init(&s_data->panel, dev, &summit_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ drm_panel_add(&s_data->panel);
+
+ return mipi_dsi_attach(dsi);
+}
+
+static void summit_remove(struct mipi_dsi_device *dsi)
+{
+ struct summit_data *s_data = mipi_dsi_get_drvdata(dsi);
+
+ mipi_dsi_detach(dsi);
+ drm_panel_remove(&s_data->panel);
+}
+
+static int summit_resume(struct device *dev)
+{
+ return summit_set_brightness(dev);
+}
+
+static int summit_suspend(struct device *dev)
+{
+ struct summit_data *s_data = dev_get_drvdata(dev);
+
+ return mipi_dsi_dcs_set_display_brightness(s_data->dsi, 0);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(summit_pm_ops, summit_suspend,
+ summit_resume);
+
+static const struct of_device_id summit_of_match[] = {
+ { .compatible = "apple,summit" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, summit_of_match);
+
+static struct mipi_dsi_driver summit_driver = {
+ .probe = summit_probe,
+ .remove = summit_remove,
+ .driver = {
+ .name = "panel-summit",
+ .of_match_table = summit_of_match,
+ .pm = pm_sleep_ptr(&summit_pm_ops),
+ },
+};
+module_mipi_dsi_driver(summit_driver);
+
+MODULE_DESCRIPTION("Summit Display Panel Driver");
+MODULE_LICENSE("GPL");
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Nick Chan
This is the display panel used for the touchbar on laptops that have it.
Co-developed-by: Nick Chan <towinchenmi@gmail.com>
Signed-off-by: Nick Chan <towinchenmi@gmail.com>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
drivers/gpu/drm/panel/Kconfig | 9 +++
drivers/gpu/drm/panel/Makefile | 1 +
drivers/gpu/drm/panel/panel-summit.c | 143 +++++++++++++++++++++++++++++++++++
3 files changed, 153 insertions(+)
diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
index d7469c565d1db8b8e974dd6c45d03d9352d99d63..5085a82e4bc695e85cabbc3200859bbe10cb0f91 100644
--- a/drivers/gpu/drm/panel/Kconfig
+++ b/drivers/gpu/drm/panel/Kconfig
@@ -925,6 +925,15 @@ config DRM_PANEL_SIMPLE
that it can be automatically turned off when the panel goes into a
low power state.
+config DRM_PANEL_SUMMIT
+ tristate "Apple Summit display panel"
+ depends on OF
+ depends on DRM_MIPI_DSI
+ depends on BACKLIGHT_CLASS_DEVICE
+ help
+ Say Y if you want to enable support for the "Summit" display panel
+ used as a touchbar on certain Apple laptops.
+
config DRM_PANEL_SYNAPTICS_R63353
tristate "Synaptics R63353-based panels"
depends on OF
diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
index 7dcf72646cacff11bab90c78e3b8b1f357e5f14a..10ac2e850f5cd6d6546439de75483466e4015d1a 100644
--- a/drivers/gpu/drm/panel/Makefile
+++ b/drivers/gpu/drm/panel/Makefile
@@ -89,6 +89,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS060T1SX01) += panel-sharp-ls060t1sx01.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o
obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
+obj-$(CONFIG_DRM_PANEL_SUMMIT) += panel-summit.o
obj-$(CONFIG_DRM_PANEL_SYNAPTICS_R63353) += panel-synaptics-r63353.o
obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
obj-$(CONFIG_DRM_PANEL_SONY_TD4353_JDI) += panel-sony-td4353-jdi.o
diff --git a/drivers/gpu/drm/panel/panel-summit.c b/drivers/gpu/drm/panel/panel-summit.c
new file mode 100644
index 0000000000000000000000000000000000000000..16bd9fa1213d7bc3f022b878ea5cfeadbd468995
--- /dev/null
+++ b/drivers/gpu/drm/panel/panel-summit.c
@@ -0,0 +1,143 @@
+// SPDX-License-Identifier: GPL-2.0-only
+
+#include <linux/backlight.h>
+#include <drm/drm_device.h>
+#include <drm/drm_mipi_dsi.h>
+#include <drm/drm_mode.h>
+#include <drm/drm_modes.h>
+#include <drm/drm_panel.h>
+#include <video/mipi_display.h>
+
+struct summit_data {
+ struct mipi_dsi_device *dsi;
+ struct backlight_device *bl;
+ struct drm_panel panel;
+};
+
+static int summit_set_brightness(struct device *dev)
+{
+ struct summit_data *s_data = dev_get_drvdata(dev);
+ int level = backlight_get_brightness(s_data->bl);
+
+ return mipi_dsi_dcs_set_display_brightness(s_data->dsi, level);
+}
+
+static int summit_bl_update_status(struct backlight_device *dev)
+{
+ return summit_set_brightness(&dev->dev);
+}
+
+static int summit_bl_get_brightness(struct backlight_device *dev)
+{
+ return backlight_get_brightness(dev);
+}
+
+static const struct backlight_ops summit_bl_ops = {
+ .get_brightness = summit_bl_get_brightness,
+ .update_status = summit_bl_update_status,
+};
+
+static int summit_get_modes(struct drm_panel *panel,
+ struct drm_connector *connector)
+{
+ struct drm_display_mode *mode = drm_mode_create(connector->dev);
+
+ connector->display_info.non_desktop = true;
+ drm_object_property_set_value(&connector->base,
+ connector->dev->mode_config.non_desktop_property,
+ connector->display_info.non_desktop);
+
+ mode->vdisplay = 2008;
+ mode->hdisplay = 60;
+ mode->hsync_start = mode->hdisplay + 8;
+ mode->hsync_end = mode->hsync_start + 80;
+ mode->htotal = mode->hsync_end + 40;
+ mode->vsync_start = mode->vdisplay + 1;
+ mode->vsync_end = mode->vsync_start + 15;
+ mode->vtotal = mode->vsync_end + 6;
+ mode->clock = (mode->vtotal * mode->htotal * 60) / 1000;
+ mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
+ mode->flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC;
+ drm_mode_set_name(mode);
+ drm_mode_probed_add(connector, mode);
+ return 1;
+}
+
+static const struct drm_panel_funcs summit_panel_funcs = {
+ .get_modes = summit_get_modes,
+};
+
+static int summit_probe(struct mipi_dsi_device *dsi)
+{
+ struct backlight_properties props = { 0 };
+ struct device *dev = &dsi->dev;
+ struct summit_data *s_data;
+ int ret;
+
+ s_data = devm_kzalloc(dev, sizeof(*s_data), GFP_KERNEL);
+ if (!s_data)
+ return -ENOMEM;
+
+ mipi_dsi_set_drvdata(dsi, s_data);
+ s_data->dsi = dsi;
+
+ ret = device_property_read_u32(dev, "max-brightness", &props.max_brightness);
+ if (ret)
+ return ret;
+ props.type = BACKLIGHT_RAW;
+
+ s_data->bl = devm_backlight_device_register(dev, dev_name(dev),
+ dev, s_data, &summit_bl_ops, &props);
+ if (IS_ERR(s_data->bl))
+ return PTR_ERR(s_data->bl);
+
+ drm_panel_init(&s_data->panel, dev, &summit_panel_funcs,
+ DRM_MODE_CONNECTOR_DSI);
+ drm_panel_add(&s_data->panel);
+
+ return mipi_dsi_attach(dsi);
+}
+
+static void summit_remove(struct mipi_dsi_device *dsi)
+{
+ struct summit_data *s_data = mipi_dsi_get_drvdata(dsi);
+
+ mipi_dsi_detach(dsi);
+ drm_panel_remove(&s_data->panel);
+}
+
+static int summit_resume(struct device *dev)
+{
+ return summit_set_brightness(dev);
+}
+
+static int summit_suspend(struct device *dev)
+{
+ struct summit_data *s_data = dev_get_drvdata(dev);
+
+ return mipi_dsi_dcs_set_display_brightness(s_data->dsi, 0);
+}
+
+static DEFINE_SIMPLE_DEV_PM_OPS(summit_pm_ops, summit_suspend,
+ summit_resume);
+
+static const struct of_device_id summit_of_match[] = {
+ { .compatible = "apple,summit" },
+ {},
+};
+
+MODULE_DEVICE_TABLE(of, summit_of_match);
+
+static struct mipi_dsi_driver summit_driver = {
+ .probe = summit_probe,
+ .remove = summit_remove,
+ .driver = {
+ .name = "panel-summit",
+ .of_match_table = summit_of_match,
+ .pm = pm_sleep_ptr(&summit_pm_ops),
+ },
+};
+module_mipi_dsi_driver(summit_driver);
+
+MODULE_DESCRIPTION("Summit Display Panel Driver");
+MODULE_LICENSE("GPL");
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes
2024-11-26 16:34 ` Sasha Finkelstein
@ 2024-11-26 16:34 ` Sasha Finkelstein
-1 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau
From: Sasha Finkelstein <fnkl.kernel@gmail.com>
Adds device tree entries for the touchbar screen
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
arch/arm64/boot/dts/apple/t8103-j293.dts | 31 ++++++++++++++++
arch/arm64/boot/dts/apple/t8103.dtsi | 61 +++++++++++++++++++++++++++++++
arch/arm64/boot/dts/apple/t8112-j493.dts | 31 ++++++++++++++++
arch/arm64/boot/dts/apple/t8112.dtsi | 62 ++++++++++++++++++++++++++++++++
4 files changed, 185 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts
index 56b0c67bfcda321b60c621de092643017693ff91..3af8536da779b56bf856cf40befd74d4737baa8f 100644
--- a/arch/arm64/boot/dts/apple/t8103-j293.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j293.dts
@@ -49,3 +49,34 @@ &i2c4 {
&fpwm1 {
status = "okay";
};
+
+&display_dfr {
+ status = "okay";
+};
+
+&dfr_mipi_out {
+ dfr_mipi_out_panel: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_panel_in>;
+ };
+};
+
+&displaydfr_mipi {
+ status = "okay";
+
+ dfr_panel: panel@0 {
+ compatible = "apple,j293-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_mipi_out_panel>;
+ };
+ };
+ };
+};
+
+&displaydfr_dart {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index 9b0dad6b618444ac6b1c9735c50cccfc3965f947..9c27911b3867d1279c133c936b7413c9eafcad8a 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -356,6 +356,67 @@ cpufreq_p: performance-controller@211e20000 {
#performance-domain-cells = <0>;
};
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x2 0x28200000 0x0 0xc000>,
+ <0x2 0x28400000 0x0 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ status = "disabled";
+
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+
+ displaydfr_dart: iommu@228304000 {
+ compatible = "apple,t8103-dart";
+ reg = <0x2 0x28304000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 504 IRQ_TYPE_LEVEL_HIGH>;
+ #iommu-cells = <1>;
+ power-domains = <&ps_dispdfr_fe>;
+ status = "disabled";
+ };
+
+ displaydfr_mipi: dsi@228600000 {
+ compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x2 0x28600000 0x0 0x100000>;
+ power-domains = <&ps_mipi_dsi>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ dfr_mipi_in_adp: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_adp_out_mipi>;
+ };
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+
sio_dart: iommu@235004000 {
compatible = "apple,t8103-dart";
reg = <0x2 0x35004000 0x0 0x4000>;
diff --git a/arch/arm64/boot/dts/apple/t8112-j493.dts b/arch/arm64/boot/dts/apple/t8112-j493.dts
index 0ad908349f55406783942735a2e9dad54cda00ec..372fe69a96f6b84f576221101a4127d68bb54691 100644
--- a/arch/arm64/boot/dts/apple/t8112-j493.dts
+++ b/arch/arm64/boot/dts/apple/t8112-j493.dts
@@ -35,6 +35,37 @@ led-0 {
};
};
+&display_dfr {
+ status = "okay";
+};
+
+&dfr_mipi_out {
+ dfr_mipi_out_panel: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_panel_in>;
+ };
+};
+
+&displaydfr_mipi {
+ status = "okay";
+
+ dfr_panel: panel@0 {
+ compatible = "apple,j493-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_mipi_out_panel>;
+ };
+ };
+ };
+};
+
+&displaydfr_dart {
+ status = "okay";
+};
+
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
diff --git a/arch/arm64/boot/dts/apple/t8112.dtsi b/arch/arm64/boot/dts/apple/t8112.dtsi
index 1666e6ab250bc0be9b8318e3c8fc903ccd3f3760..b8d2d22ab81adfb7642ea362c6a6af4c04a9bf9d 100644
--- a/arch/arm64/boot/dts/apple/t8112.dtsi
+++ b/arch/arm64/boot/dts/apple/t8112.dtsi
@@ -379,6 +379,68 @@ cpufreq_p: cpufreq@211e20000 {
#performance-domain-cells = <0>;
};
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8112-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x2 0x28200000 0x0 0xc000>,
+ <0x2 0x28400000 0x0 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 614 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 618 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ status = "disabled";
+
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+
+ displaydfr_dart: iommu@228304000 {
+ compatible = "apple,t8110-dart";
+ reg = <0x2 0x28304000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 616 IRQ_TYPE_LEVEL_HIGH>;
+ #iommu-cells = <1>;
+ power-domains = <&ps_dispdfr_fe>;
+ status = "disabled";
+ };
+
+ displaydfr_mipi: dsi@228600000 {
+ compatible = "apple,t8112-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x2 0x28600000 0x0 0x100000>;
+ power-domains = <&ps_mipi_dsi>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ dfr_mipi_in_adp: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_adp_out_mipi>;
+ };
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+
sio_dart: iommu@235004000 {
compatible = "apple,t8110-dart";
reg = <0x2 0x35004000 0x0 0x4000>;
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein, Janne Grunau
Adds device tree entries for the touchbar screen
Co-developed-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
arch/arm64/boot/dts/apple/t8103-j293.dts | 31 ++++++++++++++++
arch/arm64/boot/dts/apple/t8103.dtsi | 61 +++++++++++++++++++++++++++++++
arch/arm64/boot/dts/apple/t8112-j493.dts | 31 ++++++++++++++++
arch/arm64/boot/dts/apple/t8112.dtsi | 62 ++++++++++++++++++++++++++++++++
4 files changed, 185 insertions(+)
diff --git a/arch/arm64/boot/dts/apple/t8103-j293.dts b/arch/arm64/boot/dts/apple/t8103-j293.dts
index 56b0c67bfcda321b60c621de092643017693ff91..3af8536da779b56bf856cf40befd74d4737baa8f 100644
--- a/arch/arm64/boot/dts/apple/t8103-j293.dts
+++ b/arch/arm64/boot/dts/apple/t8103-j293.dts
@@ -49,3 +49,34 @@ &i2c4 {
&fpwm1 {
status = "okay";
};
+
+&display_dfr {
+ status = "okay";
+};
+
+&dfr_mipi_out {
+ dfr_mipi_out_panel: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_panel_in>;
+ };
+};
+
+&displaydfr_mipi {
+ status = "okay";
+
+ dfr_panel: panel@0 {
+ compatible = "apple,j293-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_mipi_out_panel>;
+ };
+ };
+ };
+};
+
+&displaydfr_dart {
+ status = "okay";
+};
diff --git a/arch/arm64/boot/dts/apple/t8103.dtsi b/arch/arm64/boot/dts/apple/t8103.dtsi
index 9b0dad6b618444ac6b1c9735c50cccfc3965f947..9c27911b3867d1279c133c936b7413c9eafcad8a 100644
--- a/arch/arm64/boot/dts/apple/t8103.dtsi
+++ b/arch/arm64/boot/dts/apple/t8103.dtsi
@@ -356,6 +356,67 @@ cpufreq_p: performance-controller@211e20000 {
#performance-domain-cells = <0>;
};
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x2 0x28200000 0x0 0xc000>,
+ <0x2 0x28400000 0x0 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ status = "disabled";
+
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+
+ displaydfr_dart: iommu@228304000 {
+ compatible = "apple,t8103-dart";
+ reg = <0x2 0x28304000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 504 IRQ_TYPE_LEVEL_HIGH>;
+ #iommu-cells = <1>;
+ power-domains = <&ps_dispdfr_fe>;
+ status = "disabled";
+ };
+
+ displaydfr_mipi: dsi@228600000 {
+ compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x2 0x28600000 0x0 0x100000>;
+ power-domains = <&ps_mipi_dsi>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ dfr_mipi_in_adp: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_adp_out_mipi>;
+ };
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+
sio_dart: iommu@235004000 {
compatible = "apple,t8103-dart";
reg = <0x2 0x35004000 0x0 0x4000>;
diff --git a/arch/arm64/boot/dts/apple/t8112-j493.dts b/arch/arm64/boot/dts/apple/t8112-j493.dts
index 0ad908349f55406783942735a2e9dad54cda00ec..372fe69a96f6b84f576221101a4127d68bb54691 100644
--- a/arch/arm64/boot/dts/apple/t8112-j493.dts
+++ b/arch/arm64/boot/dts/apple/t8112-j493.dts
@@ -35,6 +35,37 @@ led-0 {
};
};
+&display_dfr {
+ status = "okay";
+};
+
+&dfr_mipi_out {
+ dfr_mipi_out_panel: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_panel_in>;
+ };
+};
+
+&displaydfr_mipi {
+ status = "okay";
+
+ dfr_panel: panel@0 {
+ compatible = "apple,j493-summit", "apple,summit";
+ reg = <0>;
+ max-brightness = <255>;
+
+ port {
+ dfr_panel_in: endpoint {
+ remote-endpoint = <&dfr_mipi_out_panel>;
+ };
+ };
+ };
+};
+
+&displaydfr_dart {
+ status = "okay";
+};
+
/*
* Force the bus number assignments so that we can declare some of the
* on-board devices and properties that are populated by the bootloader
diff --git a/arch/arm64/boot/dts/apple/t8112.dtsi b/arch/arm64/boot/dts/apple/t8112.dtsi
index 1666e6ab250bc0be9b8318e3c8fc903ccd3f3760..b8d2d22ab81adfb7642ea362c6a6af4c04a9bf9d 100644
--- a/arch/arm64/boot/dts/apple/t8112.dtsi
+++ b/arch/arm64/boot/dts/apple/t8112.dtsi
@@ -379,6 +379,68 @@ cpufreq_p: cpufreq@211e20000 {
#performance-domain-cells = <0>;
};
+ display_dfr: display-pipe@228200000 {
+ compatible = "apple,t8112-display-pipe", "apple,h7-display-pipe";
+ reg-names = "be", "fe";
+ reg = <0x2 0x28200000 0x0 0xc000>,
+ <0x2 0x28400000 0x0 0x4000>;
+ power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 614 IRQ_TYPE_LEVEL_HIGH>,
+ <AIC_IRQ 618 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "be", "fe";
+ iommus = <&displaydfr_dart 0>;
+ status = "disabled";
+
+ port {
+ dfr_adp_out_mipi: endpoint {
+ remote-endpoint = <&dfr_mipi_in_adp>;
+ };
+ };
+ };
+
+ displaydfr_dart: iommu@228304000 {
+ compatible = "apple,t8110-dart";
+ reg = <0x2 0x28304000 0x0 0x4000>;
+ interrupt-parent = <&aic>;
+ interrupts = <AIC_IRQ 616 IRQ_TYPE_LEVEL_HIGH>;
+ #iommu-cells = <1>;
+ power-domains = <&ps_dispdfr_fe>;
+ status = "disabled";
+ };
+
+ displaydfr_mipi: dsi@228600000 {
+ compatible = "apple,t8112-display-pipe-mipi", "apple,h7-display-pipe-mipi";
+ reg-names = "mipi";
+ reg = <0x2 0x28600000 0x0 0x100000>;
+ power-domains = <&ps_mipi_dsi>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ ports {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ dfr_mipi_in: port@0 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0>;
+
+ dfr_mipi_in_adp: endpoint@0 {
+ reg = <0>;
+ remote-endpoint = <&dfr_adp_out_mipi>;
+ };
+ };
+
+ dfr_mipi_out: port@1 {
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <1>;
+ };
+ };
+ };
+
sio_dart: iommu@235004000 {
compatible = "apple,t8110-dart";
reg = <0x2 0x35004000 0x0 0x4000>;
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 5/5] MAINTAINERS: Add entries for touchbar display driver
2024-11-26 16:34 ` Sasha Finkelstein
@ 2024-11-26 16:34 ` Sasha Finkelstein
-1 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein via B4 Relay @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein
From: Sasha Finkelstein <fnkl.kernel@gmail.com>
Add the MAINTAINERS entries for the driver
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
MAINTAINERS | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index e7f0170977013889ca7c39b17727ba36d32e92dc..9a2fb7cd80e09f24932b91cd33d0cd2b3514b31c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2164,6 +2164,9 @@ F: Documentation/devicetree/bindings/arm/apple.yaml
F: Documentation/devicetree/bindings/arm/apple/*
F: Documentation/devicetree/bindings/clock/apple,nco.yaml
F: Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml
+F: Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
+F: Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
+F: Documentation/devicetree/bindings/display/panel/apple,summit.yaml
F: Documentation/devicetree/bindings/dma/apple,admac.yaml
F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml
F: Documentation/devicetree/bindings/interrupt-controller/apple,*
@@ -2183,6 +2186,8 @@ F: drivers/bluetooth/hci_bcm4377.c
F: drivers/clk/clk-apple-nco.c
F: drivers/cpufreq/apple-soc-cpufreq.c
F: drivers/dma/apple-admac.c
+F: drivers/gpu/drm/adp/
+F: drivers/gpu/drm/panel/panel-summit.c
F: drivers/pmdomain/apple/
F: drivers/i2c/busses/i2c-pasemi-core.c
F: drivers/i2c/busses/i2c-pasemi-platform.c
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH v2 5/5] MAINTAINERS: Add entries for touchbar display driver
@ 2024-11-26 16:34 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 16:34 UTC (permalink / raw)
To: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Sasha Finkelstein
Add the MAINTAINERS entries for the driver
Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
---
MAINTAINERS | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index e7f0170977013889ca7c39b17727ba36d32e92dc..9a2fb7cd80e09f24932b91cd33d0cd2b3514b31c 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2164,6 +2164,9 @@ F: Documentation/devicetree/bindings/arm/apple.yaml
F: Documentation/devicetree/bindings/arm/apple/*
F: Documentation/devicetree/bindings/clock/apple,nco.yaml
F: Documentation/devicetree/bindings/cpufreq/apple,cluster-cpufreq.yaml
+F: Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
+F: Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
+F: Documentation/devicetree/bindings/display/panel/apple,summit.yaml
F: Documentation/devicetree/bindings/dma/apple,admac.yaml
F: Documentation/devicetree/bindings/i2c/apple,i2c.yaml
F: Documentation/devicetree/bindings/interrupt-controller/apple,*
@@ -2183,6 +2186,8 @@ F: drivers/bluetooth/hci_bcm4377.c
F: drivers/clk/clk-apple-nco.c
F: drivers/cpufreq/apple-soc-cpufreq.c
F: drivers/dma/apple-admac.c
+F: drivers/gpu/drm/adp/
+F: drivers/gpu/drm/panel/panel-summit.c
F: drivers/pmdomain/apple/
F: drivers/i2c/busses/i2c-pasemi-core.c
F: drivers/i2c/busses/i2c-pasemi-platform.c
--
2.47.1
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:34 ` Sasha Finkelstein
(?)
@ 2024-11-26 16:46 ` Krzysztof Kozlowski
2024-11-26 16:54 ` Krzysztof Kozlowski
` (2 more replies)
-1 siblings, 3 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 16:46 UTC (permalink / raw)
To: fnkl.kernel, Hector Martin, Sven Peter, Alyssa Rosenzweig,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel
On 26/11/2024 17:34, Sasha Finkelstein via B4 Relay wrote:
> From: Sasha Finkelstein <fnkl.kernel@gmail.com>
>
> Add bindings for a secondary display controller present on certain
> Apple laptops.
>
A nit, subject: drop second/last, redundant "bindings". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.7-rc8/source/Documentation/devicetree/bindings/submitting-patches.rst#L18
> Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
> ---
> .../display/apple,h7-display-pipe-mipi.yaml | 89 ++++++++++++++++++++++
> .../bindings/display/apple,h7-display-pipe.yaml | 77 +++++++++++++++++++
> .../bindings/display/panel/apple,summit.yaml | 58 ++++++++++++++
> 3 files changed, 224 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..2cf2f50e9fc7329a5b424d5ddf8c34cad2ebb6be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
> @@ -0,0 +1,89 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/apple,h7-display-pipe-mipi.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple pre-DCP display controller MIPI interface.
Drop final stop, that's a title so it could be capitalized, but anyway
it is not a sentence
> +
> +maintainers:
> + - asahi@lists.linux.dev
Drop, maintainer boxes are not allowed for bindings.
> + - Sasha Finkelstein <fnkl.kernel@gmail.com>
> +
> +description:
> + The MIPI controller part of the pre-DCP Apple display controller
> +
> +allOf:
> + - $ref: dsi-controller.yaml#
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - apple,t8112-display-pipe-mipi
> + - apple,t8103-display-pipe-mipi
> + - const: apple,h7-display-pipe-mipi
> +
> + reg:
> + maxItems: 1
> +
> + reg-names:
> + const: mipi
> +
> + power-domains:
> + maxItems: 1
> +
> + ports:
> + $ref: /schemas/graph.yaml#/properties/ports
> +
> + properties:
> + port@0:
> + $ref: /schemas/graph.yaml#/properties/port
> +
> + port@1:
> + $ref: /schemas/graph.yaml#/properties/port
> +
> + required:
> + - port@0
> + - port@1
Please take a look how other bindings define ports. You miss here
several items and more important - description what are these ports for.
> +
> + '#address-cells': true
> +
> + '#size-cells': true
> +
> +patternProperties:
> + "^panel@[0-3]$": true
These look unusual. Is this a DSI controller? If so, then reference
dsi-controller. See other bindings how this is done.
> +
> +required:
> + - compatible
> + - reg
> + - ports
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + display_dfr: dsi@228200000 {
Drop unused label
> + compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
> + reg-names = "mipi";
> + reg = <0x28200000 0xc000>;
Order fields according to DTS coding style.
> + power-domains = <&ps_dispdfr_mipi>;
> +
> + ports {
> + #address-cells = <1>;
Messed indentation. Use 4 spaces for example indentation.
> + #size-cells = <0>;
> +
> + dfr_mipi_in: port@0 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <0>;
> + };
> +
> + dfr_mipi_out: port@1 {
> + #address-cells = <1>;
> + #size-cells = <0>;
> + reg = <1>;
> + };
> + };
> + };
> +...
> diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..98982da9c5f672167d67e4cd3b47e1fbdafc9510
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe.yaml
> @@ -0,0 +1,77 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/apple,h7-display-pipe.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple pre-DCP display controller.
> +
> +maintainers:
> + - asahi@lists.linux.dev
> + - Sasha Finkelstein <fnkl.kernel@gmail.com>
> +
> +description:
> + A secondary display controller used to drive the "touchbar" on certain Apple laptops.
Please wrap code according to coding style (checkpatch is not a coding
style description, but only a tool).
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - apple,t8112-display-pipe
> + - apple,t8103-display-pipe
> + - const: apple,h7-display-pipe
> +
> + reg:
> + maxItems: 2
List and describe the items instead, because be and fe are a bit cryptic.
> +
> + reg-names:
> + items:
> + - const: be
> + - const: fe
> +
> + power-domains:
> + maxItems: 2
Need to list the items instead.
> +
> + interrupts:
> + maxItems: 2
Ditto
> +
> + interrupt-names:
> + items:
> + - const: be
> + - const: fe
> +
> + iommus:
> + maxItems: 1
> +
> + port:
> + $ref: /schemas/graph.yaml#/properties/port
> +
> +required:
> + - compatible
> + - reg
> + - interrupts
> + - port
> +
> +additionalProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/interrupt-controller/apple-aic.h>
> + display_dfr: display-pipe@228200000 {
Drop unused label.
> + compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
> + reg-names = "be", "fe";
> + reg = <0x28200000 0xc000>,
> + <0x28400000 0x4000>;
Messed alignment, in other places as well.
> + power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
> + interrupt-parent = <&aic>;
> + interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
> + <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
> + interrupt-names = "be", "fe";
> + iommus = <&displaydfr_dart 0>;
> + port {
> + dfr_adp_out_mipi: endpoint {
Messed indentation.
> + remote-endpoint = <&dfr_mipi_in_adp>;
> + };
> + };
> + };
> +...
> diff --git a/Documentation/devicetree/bindings/display/panel/apple,summit.yaml b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..db14f7af3787076c84ccdda08fedeb8912d5514d
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/panel/apple,summit.yaml
> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/display/panel/apple,summit.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Apple "Summit" display panel.
> +
> +maintainers:
> + - asahi@lists.linux.dev
> + - Sasha Finkelstein <fnkl.kernel@gmail.com>
> +
> +allOf:
> + - $ref: panel-common.yaml#
> + - $ref: /schemas/leds/backlight/common.yaml#
> +
> +properties:
> + compatible:
> + items:
> + - enum:
> + - apple,j293-summit
> + - apple,j493-summit
> + - const: apple,summit
Summit tells me nothing - no description, title repeats it, so I suggest
using device specific compatible.
> +
> + reg:
> + maxItems: 1
> +
> + max-brightness: true
> +
> + port: true
No, these cannot be true without definition. Again, please open existing
bindings and use them as example. You probably miss here some reference,
but max-brightness for panel is a bit confusing. I asked already and did
not get answer: isn't this backlight property? What is this device -
backlight or panel? If panel, then what bus?
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes
2024-11-26 16:34 ` Sasha Finkelstein
(?)
@ 2024-11-26 16:47 ` Krzysztof Kozlowski
-1 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 16:47 UTC (permalink / raw)
To: fnkl.kernel, Hector Martin, Sven Peter, Alyssa Rosenzweig,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel,
Janne Grunau
On 26/11/2024 17:34, Sasha Finkelstein via B4 Relay wrote:
> /*
> * Force the bus number assignments so that we can declare some of the
> * on-board devices and properties that are populated by the bootloader
> diff --git a/arch/arm64/boot/dts/apple/t8112.dtsi b/arch/arm64/boot/dts/apple/t8112.dtsi
> index 1666e6ab250bc0be9b8318e3c8fc903ccd3f3760..b8d2d22ab81adfb7642ea362c6a6af4c04a9bf9d 100644
> --- a/arch/arm64/boot/dts/apple/t8112.dtsi
> +++ b/arch/arm64/boot/dts/apple/t8112.dtsi
> @@ -379,6 +379,68 @@ cpufreq_p: cpufreq@211e20000 {
> #performance-domain-cells = <0>;
> };
>
> + display_dfr: display-pipe@228200000 {
> + compatible = "apple,t8112-display-pipe", "apple,h7-display-pipe";
> + reg-names = "be", "fe";
> + reg = <0x2 0x28200000 0x0 0xc000>,
> + <0x2 0x28400000 0x0 0x4000>;
Please follow DTS coding style in respect of order of properties and
indentation/alignment.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:46 ` Krzysztof Kozlowski
@ 2024-11-26 16:54 ` Krzysztof Kozlowski
2024-11-26 17:00 ` Sasha Finkelstein
2024-11-26 18:33 ` Sasha Finkelstein
2 siblings, 0 replies; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 16:54 UTC (permalink / raw)
To: fnkl.kernel, Hector Martin, Sven Peter, Alyssa Rosenzweig,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel
On 26/11/2024 17:46, Krzysztof Kozlowski wrote:
>
>> +
>> + reg:
>> + maxItems: 1
>> +
>> + max-brightness: true
>> +
>> + port: true
>
> No, these cannot be true without definition. Again, please open existing
> bindings and use them as example. You probably miss here some reference,
> but max-brightness for panel is a bit confusing. I asked already and did
> not get answer: isn't this backlight property? What is this device -
> backlight or panel? If panel, then what bus?
You responded to my comment in exactly the same moment you sent this
patchset which gives me around 0 seconds to reply to your comment.
Give reviewers some time if you disagree with them, otherwise I find
wrong sending next version immediately.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:46 ` Krzysztof Kozlowski
2024-11-26 16:54 ` Krzysztof Kozlowski
@ 2024-11-26 17:00 ` Sasha Finkelstein
2024-11-26 17:20 ` Krzysztof Kozlowski
2024-11-26 18:33 ` Sasha Finkelstein
2 siblings, 1 reply; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 17:00 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel
On Tue, 26 Nov 2024 at 17:46, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> > +allOf:
> > + - $ref: dsi-controller.yaml#
...
> > +patternProperties:
> > + "^panel@[0-3]$": true
>
> These look unusual. Is this a DSI controller? If so, then reference
> dsi-controller. See other bindings how this is done.
This is a DSI controller, as referenced above. Those properties are from
dsi-controller.yaml
> > +properties:
> > + compatible:
> > + items:
> > + - enum:
> > + - apple,j293-summit
> > + - apple,j493-summit
> > + - const: apple,summit
>
> Summit tells me nothing - no description, title repeats it, so I suggest
> using device specific compatible.
The j293/j493 are the device-specific compatibles, those are chassis names
for the specific laptops the panel is present in.
> No, these cannot be true without definition. Again, please open existing
> bindings and use them as example. You probably miss here some reference,
> but max-brightness for panel is a bit confusing. I asked already and did
> not get answer: isn't this backlight property? What is this device -
> backlight or panel? If panel, then what bus?
Per my response on previous version, it's both, kind of. This is a
self-emissive panel on
a mipi-dsi bus, which can change brightness in response to mipi dcs
backlight commands.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 17:00 ` Sasha Finkelstein
@ 2024-11-26 17:20 ` Krzysztof Kozlowski
2024-11-26 18:24 ` Hector Martin
0 siblings, 1 reply; 26+ messages in thread
From: Krzysztof Kozlowski @ 2024-11-26 17:20 UTC (permalink / raw)
To: Sasha Finkelstein
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel
On 26/11/2024 18:00, Sasha Finkelstein wrote:
> On Tue, 26 Nov 2024 at 17:46, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>> +allOf:
>>> + - $ref: dsi-controller.yaml#
> ...
>>> +patternProperties:
>>> + "^panel@[0-3]$": true
>>
>> These look unusual. Is this a DSI controller? If so, then reference
>> dsi-controller. See other bindings how this is done.
>
> This is a DSI controller, as referenced above. Those properties are from
> dsi-controller.yaml
Ahh, indeed, I missed that and focused on the additionalProperties.
Instead use unevaluatedProperties: false and drop all properties already
in dsi-controller.yaml.
>
>>> +properties:
>>> + compatible:
>>> + items:
>>> + - enum:
>>> + - apple,j293-summit
>>> + - apple,j493-summit
>>> + - const: apple,summit
>>
>> Summit tells me nothing - no description, title repeats it, so I suggest
>> using device specific compatible.
>
> The j293/j493 are the device-specific compatibles, those are chassis names
> for the specific laptops the panel is present in.
This does not address my comment. Use specific compatibles as fallback,
just like we recommend for every device. This should not be different.
If you do not know the hardware details, using generic is even less
appropriate.
>
>
>> No, these cannot be true without definition. Again, please open existing
>> bindings and use them as example. You probably miss here some reference,
>> but max-brightness for panel is a bit confusing. I asked already and did
>> not get answer: isn't this backlight property? What is this device -
>> backlight or panel? If panel, then what bus?
>
> Per my response on previous version, it's both, kind of. This is a
> self-emissive panel on
I see, I think I again totally missed that you have there references to
backlight, so binding is in general fine. Describe the hardware in
description field (see commit for mentioned Samsung panel).
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 17:20 ` Krzysztof Kozlowski
@ 2024-11-26 18:24 ` Hector Martin
0 siblings, 0 replies; 26+ messages in thread
From: Hector Martin @ 2024-11-26 18:24 UTC (permalink / raw)
To: Krzysztof Kozlowski, Sasha Finkelstein
Cc: Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Neil Armstrong, Jessica Zhang,
asahi, linux-arm-kernel, dri-devel, devicetree, linux-kernel
On 2024/11/27 2:20, Krzysztof Kozlowski wrote:
> On 26/11/2024 18:00, Sasha Finkelstein wrote:
>> On Tue, 26 Nov 2024 at 17:46, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>>>> +properties:
>>>> + compatible:
>>>> + items:
>>>> + - enum:
>>>> + - apple,j293-summit
>>>> + - apple,j493-summit
>>>> + - const: apple,summit
>>>
>>> Summit tells me nothing - no description, title repeats it, so I suggest
>>> using device specific compatible.
>>
>> The j293/j493 are the device-specific compatibles, those are chassis names
>> for the specific laptops the panel is present in.
>
> This does not address my comment. Use specific compatibles as fallback,
> just like we recommend for every device. This should not be different.
> If you do not know the hardware details, using generic is even less
> appropriate.
The panel is codenamed "summit", and that tells you everything. It's a
panel sold and marketed by Apple. It is used on two devices, which are
specifically referred to as the device names "j293" and "j493". There is
no further information to be added here, the names chosen already
contain 100% of the available information and are completely and fully
specific as to what devices are involved here. There is no more specific
or appropriate compatible possible. "summit" literally comes from
Apple's own device tree compatible in the macOS world, which is
"lcd,summit". If Apple uses it as a DT compatible, then it's a good bet
it is precisely what it needs to be to identify a device. The
chassis-specific versions are something we added on top of that and
likely aren't even necessary since it's almost certainly precisely the
same exact panel in both laptops, but as you know, it's best to be
specific with DT compatibles just in case.
There is plenty of prior art for compatibles that don't look like random
product code gobbledygook (which I think is what you were expecting?),
e.g. these panels:
ti,nspire-cx-lcd-panel
ste,mcde-dsi
raspberrypi,7inch-touchscreen-panel
olimex,lcd-olinuxino
focaltech,gpt3
So yeah, the correct compatible is in fact "apple,summit". Anything else
would be making things up for no reason. The vendor has chosen to call
this panel "summit", so "summit" it is. We're not in the business of
gratuitously assigning our own product names/codes when a suitable one
already exists here.
- Hector
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:34 ` Sasha Finkelstein
(?)
(?)
@ 2024-11-26 18:25 ` Nick Chan
-1 siblings, 0 replies; 26+ messages in thread
From: Nick Chan @ 2024-11-26 18:25 UTC (permalink / raw)
To: fnkl.kernel, Hector Martin, Sven Peter, Alyssa Rosenzweig,
Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann, David Airlie,
Simona Vetter, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Neil Armstrong, Jessica Zhang, asahi
Cc: linux-arm-kernel, dri-devel, devicetree, linux-kernel
On 27/11/2024 00:34, Sasha Finkelstein via B4 Relay wrote:
[...]
> diff --git a/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..2cf2f50e9fc7329a5b424d5ddf8c34cad2ebb6be
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/display/apple,h7-display-pipe-mipi.yaml
[...]
> +
> + reg:
> + maxItems: 1
> +
> + reg-names:
> + const: mipi
> +
Drop. Not needed as there is only one reg now.
[...]
Nick Chan
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings
2024-11-26 16:46 ` Krzysztof Kozlowski
2024-11-26 16:54 ` Krzysztof Kozlowski
2024-11-26 17:00 ` Sasha Finkelstein
@ 2024-11-26 18:33 ` Sasha Finkelstein
2 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-26 18:33 UTC (permalink / raw)
To: Krzysztof Kozlowski
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel
On Tue, 26 Nov 2024 at 17:46, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> Please take a look how other bindings define ports. You miss here
> several items and more important - description what are these ports for.
Aside from missing descriptions, this definition is copied almost verbatim from
snps,dw-mipi-dsi.
Ack on the rest of the comments, those and the descriptions will be
fixed for v3.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 2/5] drm: adp: Add Apple Display Pipe driver
2024-11-26 16:34 ` Sasha Finkelstein
(?)
@ 2024-11-26 21:00 ` Alyssa Ross
-1 siblings, 0 replies; 26+ messages in thread
From: Alyssa Ross @ 2024-11-26 21:00 UTC (permalink / raw)
To: Sasha Finkelstein
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel, Janne Grunau
[-- Attachment #1: Type: text/plain, Size: 957 bytes --]
On Tue, Nov 26, 2024 at 05:34:21PM +0100, Sasha Finkelstein via B4 Relay wrote:
> +module_platform_driver(adp_mipi_platform_driver);
This is part of the same driver as adp_drv.c, so I don't think there's
supposed to be another module_platform_driver() call here?
/nix/store/hni09p7jhc8szjr2h5j5m0lhi2x0djjg-binutils-2.43.1/bin/ld: drivers/gpu/drm/adp/adp-mipi.o: in function `adp_mipi_platform_driver_init':
adp-mipi.c:(.init.text+0x0): multiple definition of `init_module'; drivers/gpu/drm/adp/adp_drv.o:adp_drv.c:(.init.text+0x0): first defined here
/nix/store/hni09p7jhc8szjr2h5j5m0lhi2x0djjg-binutils-2.43.1/bin/ld: drivers/gpu/drm/adp/adp-mipi.o: in function `adp_mipi_platform_driver_exit':
adp-mipi.c:(.exit.text+0x0): multiple definition of `cleanup_module'; drivers/gpu/drm/adp/adp_drv.o:adp_drv.c:(.exit.text+0x0): first defined here
BTW: would have been nice to have been CCed, given I provided feedback
on the previous version of this patch.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes
@ 2024-11-28 20:36 kernel test robot
0 siblings, 0 replies; 26+ messages in thread
From: kernel test robot @ 2024-11-28 20:36 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown-8bit, Size: 71993 bytes --]
::::::
:::::: Manual check reason: "dtcheck: binding changes may go via different trees"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20241126-adpdrm-v2-4-c90485336c09@gmail.com>
References: <20241126-adpdrm-v2-4-c90485336c09@gmail.com>
TO: Sasha Finkelstein via B4 Relay <devnull+fnkl.kernel.gmail.com@kernel.org>
TO: Hector Martin <marcan@marcan.st>
TO: Sven Peter <sven@svenpeter.dev>
TO: Alyssa Rosenzweig <alyssa@rosenzweig.io>
TO: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
TO: Maxime Ripard <mripard@kernel.org>
TO: Thomas Zimmermann <tzimmermann@suse.de>
TO: David Airlie <airlied@gmail.com>
TO: Simona Vetter <simona@ffwll.ch>
TO: Rob Herring <robh@kernel.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
TO: Conor Dooley <conor+dt@kernel.org>
TO: Neil Armstrong <neil.armstrong@linaro.org>
TO: Jessica Zhang <quic_jesszhan@quicinc.com>
TO: asahi@lists.linux.dev
CC: linux-arm-kernel@lists.infradead.org
CC: dri-devel@lists.freedesktop.org
CC: devicetree@vger.kernel.org
CC: linux-kernel@vger.kernel.org
CC: Sasha Finkelstein <fnkl.kernel@gmail.com>
CC: Janne Grunau <j@jannau.net>
Hi Sasha,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 9f16d5e6f220661f73b36a4be1b21575651d8833]
url: https://github.com/intel-lab-lkp/linux/commits/Sasha-Finkelstein-via-B4-Relay/dt-bindings-display-Add-Apple-pre-DCP-display-controller-bindings/20241128-102147
base: 9f16d5e6f220661f73b36a4be1b21575651d8833
patch link: https://lore.kernel.org/r/20241126-adpdrm-v2-4-c90485336c09%40gmail.com
patch subject: [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes
:::::: branch date: 18 hours ago
:::::: commit date: 18 hours ago
config: arm64-randconfig-002-20241128 (https://download.01.org/0day-ci/archive/20241129/202411290447.QxG3UgvA-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241129/202411290447.QxG3UgvA-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202411290447.QxG3UgvA-lkp@intel.com/
dtcheck warnings: (new ones prefixed by >>)
>> arch/arm64/boot/dts/apple/t8103.dtsi:401.25-410.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@0: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
arch/arm64/boot/dts/apple/t8103.dtsi:412.26-416.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@1: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
--
>> arch/arm64/boot/dts/apple/t8103.dtsi:389.34-418.5: Warning (avoid_unnecessary_addr_size): /soc/dsi@228600000: unnecessary #address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" property
>> arch/arm64/boot/dts/apple/t8103.dtsi:401.25-410.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@0: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
--
>> arch/arm64/boot/dts/apple/t8112.dtsi:425.25-434.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@0: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
arch/arm64/boot/dts/apple/t8112.dtsi:436.26-440.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@1: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
--
>> arch/arm64/boot/dts/apple/t8112.dtsi:412.34-442.5: Warning (avoid_unnecessary_addr_size): /soc/dsi@228600000: unnecessary #address-cells/#size-cells without "ranges", "dma-ranges" or child "reg" property
>> arch/arm64/boot/dts/apple/t8112.dtsi:425.25-434.7: Warning (graph_child_address): /soc/dsi@228600000/ports/port@0: graph node has single child node 'endpoint@0', #address-cells/#size-cells are not necessary
vim +401 arch/arm64/boot/dts/apple/t8103.dtsi
7d2d16ccf15d8e Hector Martin 2021-02-04 14
7d2d16ccf15d8e Hector Martin 2021-02-04 15 / {
7d2d16ccf15d8e Hector Martin 2021-02-04 16 compatible = "apple,t8103", "apple,arm-platform";
7d2d16ccf15d8e Hector Martin 2021-02-04 17
7d2d16ccf15d8e Hector Martin 2021-02-04 18 #address-cells = <2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 19 #size-cells = <2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 20
7d2d16ccf15d8e Hector Martin 2021-02-04 21 cpus {
7d2d16ccf15d8e Hector Martin 2021-02-04 22 #address-cells = <2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 23 #size-cells = <0>;
7d2d16ccf15d8e Hector Martin 2021-02-04 24
3e895a6460ec38 Hector Martin 2022-05-03 25 cpu-map {
3e895a6460ec38 Hector Martin 2022-05-03 26 cluster0 {
3e895a6460ec38 Hector Martin 2022-05-03 27 core0 {
3e895a6460ec38 Hector Martin 2022-05-03 28 cpu = <&cpu_e0>;
3e895a6460ec38 Hector Martin 2022-05-03 29 };
3e895a6460ec38 Hector Martin 2022-05-03 30 core1 {
3e895a6460ec38 Hector Martin 2022-05-03 31 cpu = <&cpu_e1>;
3e895a6460ec38 Hector Martin 2022-05-03 32 };
3e895a6460ec38 Hector Martin 2022-05-03 33 core2 {
3e895a6460ec38 Hector Martin 2022-05-03 34 cpu = <&cpu_e2>;
3e895a6460ec38 Hector Martin 2022-05-03 35 };
3e895a6460ec38 Hector Martin 2022-05-03 36 core3 {
3e895a6460ec38 Hector Martin 2022-05-03 37 cpu = <&cpu_e3>;
3e895a6460ec38 Hector Martin 2022-05-03 38 };
3e895a6460ec38 Hector Martin 2022-05-03 39 };
3e895a6460ec38 Hector Martin 2022-05-03 40
3e895a6460ec38 Hector Martin 2022-05-03 41 cluster1 {
3e895a6460ec38 Hector Martin 2022-05-03 42 core0 {
3e895a6460ec38 Hector Martin 2022-05-03 43 cpu = <&cpu_p0>;
3e895a6460ec38 Hector Martin 2022-05-03 44 };
3e895a6460ec38 Hector Martin 2022-05-03 45 core1 {
3e895a6460ec38 Hector Martin 2022-05-03 46 cpu = <&cpu_p1>;
3e895a6460ec38 Hector Martin 2022-05-03 47 };
3e895a6460ec38 Hector Martin 2022-05-03 48 core2 {
3e895a6460ec38 Hector Martin 2022-05-03 49 cpu = <&cpu_p2>;
3e895a6460ec38 Hector Martin 2022-05-03 50 };
3e895a6460ec38 Hector Martin 2022-05-03 51 core3 {
3e895a6460ec38 Hector Martin 2022-05-03 52 cpu = <&cpu_p3>;
3e895a6460ec38 Hector Martin 2022-05-03 53 };
3e895a6460ec38 Hector Martin 2022-05-03 54 };
3e895a6460ec38 Hector Martin 2022-05-03 55 };
3e895a6460ec38 Hector Martin 2022-05-03 56
3e895a6460ec38 Hector Martin 2022-05-03 57 cpu_e0: cpu@0 {
7d2d16ccf15d8e Hector Martin 2021-02-04 58 compatible = "apple,icestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 59 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 60 reg = <0x0 0x0>;
7d2d16ccf15d8e Hector Martin 2021-02-04 61 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 62 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 63 operating-points-v2 = <&ecluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 64 capacity-dmips-mhz = <714>;
3e895a6460ec38 Hector Martin 2022-05-03 65 performance-domains = <&cpufreq_e>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 66 next-level-cache = <&l2_cache_0>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 67 i-cache-size = <0x20000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 68 d-cache-size = <0x10000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 69 };
7d2d16ccf15d8e Hector Martin 2021-02-04 70
3e895a6460ec38 Hector Martin 2022-05-03 71 cpu_e1: cpu@1 {
7d2d16ccf15d8e Hector Martin 2021-02-04 72 compatible = "apple,icestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 73 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 74 reg = <0x0 0x1>;
7d2d16ccf15d8e Hector Martin 2021-02-04 75 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 76 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 77 operating-points-v2 = <&ecluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 78 capacity-dmips-mhz = <714>;
3e895a6460ec38 Hector Martin 2022-05-03 79 performance-domains = <&cpufreq_e>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 80 next-level-cache = <&l2_cache_0>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 81 i-cache-size = <0x20000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 82 d-cache-size = <0x10000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 83 };
7d2d16ccf15d8e Hector Martin 2021-02-04 84
3e895a6460ec38 Hector Martin 2022-05-03 85 cpu_e2: cpu@2 {
7d2d16ccf15d8e Hector Martin 2021-02-04 86 compatible = "apple,icestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 87 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 88 reg = <0x0 0x2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 89 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 90 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 91 operating-points-v2 = <&ecluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 92 capacity-dmips-mhz = <714>;
3e895a6460ec38 Hector Martin 2022-05-03 93 performance-domains = <&cpufreq_e>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 94 next-level-cache = <&l2_cache_0>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 95 i-cache-size = <0x20000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 96 d-cache-size = <0x10000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 97 };
7d2d16ccf15d8e Hector Martin 2021-02-04 98
3e895a6460ec38 Hector Martin 2022-05-03 99 cpu_e3: cpu@3 {
7d2d16ccf15d8e Hector Martin 2021-02-04 100 compatible = "apple,icestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 101 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 102 reg = <0x0 0x3>;
7d2d16ccf15d8e Hector Martin 2021-02-04 103 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 104 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 105 operating-points-v2 = <&ecluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 106 capacity-dmips-mhz = <714>;
3e895a6460ec38 Hector Martin 2022-05-03 107 performance-domains = <&cpufreq_e>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 108 next-level-cache = <&l2_cache_0>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 109 i-cache-size = <0x20000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 110 d-cache-size = <0x10000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 111 };
7d2d16ccf15d8e Hector Martin 2021-02-04 112
3e895a6460ec38 Hector Martin 2022-05-03 113 cpu_p0: cpu@10100 {
7d2d16ccf15d8e Hector Martin 2021-02-04 114 compatible = "apple,firestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 115 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 116 reg = <0x0 0x10100>;
7d2d16ccf15d8e Hector Martin 2021-02-04 117 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 118 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 119 operating-points-v2 = <&pcluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 120 capacity-dmips-mhz = <1024>;
3e895a6460ec38 Hector Martin 2022-05-03 121 performance-domains = <&cpufreq_p>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 122 next-level-cache = <&l2_cache_1>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 123 i-cache-size = <0x30000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 124 d-cache-size = <0x20000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 125 };
7d2d16ccf15d8e Hector Martin 2021-02-04 126
3e895a6460ec38 Hector Martin 2022-05-03 127 cpu_p1: cpu@10101 {
7d2d16ccf15d8e Hector Martin 2021-02-04 128 compatible = "apple,firestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 129 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 130 reg = <0x0 0x10101>;
7d2d16ccf15d8e Hector Martin 2021-02-04 131 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 132 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 133 operating-points-v2 = <&pcluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 134 capacity-dmips-mhz = <1024>;
3e895a6460ec38 Hector Martin 2022-05-03 135 performance-domains = <&cpufreq_p>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 136 next-level-cache = <&l2_cache_1>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 137 i-cache-size = <0x30000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 138 d-cache-size = <0x20000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 139 };
7d2d16ccf15d8e Hector Martin 2021-02-04 140
3e895a6460ec38 Hector Martin 2022-05-03 141 cpu_p2: cpu@10102 {
7d2d16ccf15d8e Hector Martin 2021-02-04 142 compatible = "apple,firestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 143 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 144 reg = <0x0 0x10102>;
7d2d16ccf15d8e Hector Martin 2021-02-04 145 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 146 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 147 operating-points-v2 = <&pcluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 148 capacity-dmips-mhz = <1024>;
3e895a6460ec38 Hector Martin 2022-05-03 149 performance-domains = <&cpufreq_p>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 150 next-level-cache = <&l2_cache_1>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 151 i-cache-size = <0x30000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 152 d-cache-size = <0x20000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 153 };
7d2d16ccf15d8e Hector Martin 2021-02-04 154
3e895a6460ec38 Hector Martin 2022-05-03 155 cpu_p3: cpu@10103 {
7d2d16ccf15d8e Hector Martin 2021-02-04 156 compatible = "apple,firestorm";
7d2d16ccf15d8e Hector Martin 2021-02-04 157 device_type = "cpu";
7d2d16ccf15d8e Hector Martin 2021-02-04 158 reg = <0x0 0x10103>;
7d2d16ccf15d8e Hector Martin 2021-02-04 159 enable-method = "spin-table";
7d2d16ccf15d8e Hector Martin 2021-02-04 160 cpu-release-addr = <0 0>; /* To be filled by loader */
3e895a6460ec38 Hector Martin 2022-05-03 161 operating-points-v2 = <&pcluster_opp>;
3e895a6460ec38 Hector Martin 2022-05-03 162 capacity-dmips-mhz = <1024>;
3e895a6460ec38 Hector Martin 2022-05-03 163 performance-domains = <&cpufreq_p>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 164 next-level-cache = <&l2_cache_1>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 165 i-cache-size = <0x30000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 166 d-cache-size = <0x20000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 167 };
9ecb7a4b8ac67c Janne Grunau 2022-12-06 168
9ecb7a4b8ac67c Janne Grunau 2022-12-06 169 l2_cache_0: l2-cache-0 {
9ecb7a4b8ac67c Janne Grunau 2022-12-06 170 compatible = "cache";
9ecb7a4b8ac67c Janne Grunau 2022-12-06 171 cache-level = <2>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 172 cache-unified;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 173 cache-size = <0x400000>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 174 };
9ecb7a4b8ac67c Janne Grunau 2022-12-06 175
9ecb7a4b8ac67c Janne Grunau 2022-12-06 176 l2_cache_1: l2-cache-1 {
9ecb7a4b8ac67c Janne Grunau 2022-12-06 177 compatible = "cache";
9ecb7a4b8ac67c Janne Grunau 2022-12-06 178 cache-level = <2>;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 179 cache-unified;
9ecb7a4b8ac67c Janne Grunau 2022-12-06 180 cache-size = <0xc00000>;
3e895a6460ec38 Hector Martin 2022-05-03 181 };
3e895a6460ec38 Hector Martin 2022-05-03 182 };
3e895a6460ec38 Hector Martin 2022-05-03 183
3e895a6460ec38 Hector Martin 2022-05-03 184 ecluster_opp: opp-table-0 {
3e895a6460ec38 Hector Martin 2022-05-03 185 compatible = "operating-points-v2";
3e895a6460ec38 Hector Martin 2022-05-03 186
3e895a6460ec38 Hector Martin 2022-05-03 187 opp01 {
3e895a6460ec38 Hector Martin 2022-05-03 188 opp-hz = /bits/ 64 <600000000>;
3e895a6460ec38 Hector Martin 2022-05-03 189 opp-level = <1>;
3e895a6460ec38 Hector Martin 2022-05-03 190 clock-latency-ns = <7500>;
7d2d16ccf15d8e Hector Martin 2021-02-04 191 };
3e895a6460ec38 Hector Martin 2022-05-03 192 opp02 {
3e895a6460ec38 Hector Martin 2022-05-03 193 opp-hz = /bits/ 64 <972000000>;
3e895a6460ec38 Hector Martin 2022-05-03 194 opp-level = <2>;
3e895a6460ec38 Hector Martin 2022-05-03 195 clock-latency-ns = <22000>;
3e895a6460ec38 Hector Martin 2022-05-03 196 };
3e895a6460ec38 Hector Martin 2022-05-03 197 opp03 {
3e895a6460ec38 Hector Martin 2022-05-03 198 opp-hz = /bits/ 64 <1332000000>;
3e895a6460ec38 Hector Martin 2022-05-03 199 opp-level = <3>;
3e895a6460ec38 Hector Martin 2022-05-03 200 clock-latency-ns = <27000>;
3e895a6460ec38 Hector Martin 2022-05-03 201 };
3e895a6460ec38 Hector Martin 2022-05-03 202 opp04 {
3e895a6460ec38 Hector Martin 2022-05-03 203 opp-hz = /bits/ 64 <1704000000>;
3e895a6460ec38 Hector Martin 2022-05-03 204 opp-level = <4>;
3e895a6460ec38 Hector Martin 2022-05-03 205 clock-latency-ns = <33000>;
3e895a6460ec38 Hector Martin 2022-05-03 206 };
3e895a6460ec38 Hector Martin 2022-05-03 207 opp05 {
3e895a6460ec38 Hector Martin 2022-05-03 208 opp-hz = /bits/ 64 <2064000000>;
3e895a6460ec38 Hector Martin 2022-05-03 209 opp-level = <5>;
3e895a6460ec38 Hector Martin 2022-05-03 210 clock-latency-ns = <50000>;
3e895a6460ec38 Hector Martin 2022-05-03 211 };
3e895a6460ec38 Hector Martin 2022-05-03 212 };
3e895a6460ec38 Hector Martin 2022-05-03 213
3e895a6460ec38 Hector Martin 2022-05-03 214 pcluster_opp: opp-table-1 {
3e895a6460ec38 Hector Martin 2022-05-03 215 compatible = "operating-points-v2";
3e895a6460ec38 Hector Martin 2022-05-03 216
3e895a6460ec38 Hector Martin 2022-05-03 217 opp01 {
3e895a6460ec38 Hector Martin 2022-05-03 218 opp-hz = /bits/ 64 <600000000>;
3e895a6460ec38 Hector Martin 2022-05-03 219 opp-level = <1>;
3e895a6460ec38 Hector Martin 2022-05-03 220 clock-latency-ns = <8000>;
3e895a6460ec38 Hector Martin 2022-05-03 221 };
3e895a6460ec38 Hector Martin 2022-05-03 222 opp02 {
3e895a6460ec38 Hector Martin 2022-05-03 223 opp-hz = /bits/ 64 <828000000>;
3e895a6460ec38 Hector Martin 2022-05-03 224 opp-level = <2>;
3e895a6460ec38 Hector Martin 2022-05-03 225 clock-latency-ns = <19000>;
3e895a6460ec38 Hector Martin 2022-05-03 226 };
3e895a6460ec38 Hector Martin 2022-05-03 227 opp03 {
3e895a6460ec38 Hector Martin 2022-05-03 228 opp-hz = /bits/ 64 <1056000000>;
3e895a6460ec38 Hector Martin 2022-05-03 229 opp-level = <3>;
3e895a6460ec38 Hector Martin 2022-05-03 230 clock-latency-ns = <21000>;
3e895a6460ec38 Hector Martin 2022-05-03 231 };
3e895a6460ec38 Hector Martin 2022-05-03 232 opp04 {
3e895a6460ec38 Hector Martin 2022-05-03 233 opp-hz = /bits/ 64 <1284000000>;
3e895a6460ec38 Hector Martin 2022-05-03 234 opp-level = <4>;
3e895a6460ec38 Hector Martin 2022-05-03 235 clock-latency-ns = <23000>;
3e895a6460ec38 Hector Martin 2022-05-03 236 };
3e895a6460ec38 Hector Martin 2022-05-03 237 opp05 {
3e895a6460ec38 Hector Martin 2022-05-03 238 opp-hz = /bits/ 64 <1500000000>;
3e895a6460ec38 Hector Martin 2022-05-03 239 opp-level = <5>;
3e895a6460ec38 Hector Martin 2022-05-03 240 clock-latency-ns = <24000>;
3e895a6460ec38 Hector Martin 2022-05-03 241 };
3e895a6460ec38 Hector Martin 2022-05-03 242 opp06 {
3e895a6460ec38 Hector Martin 2022-05-03 243 opp-hz = /bits/ 64 <1728000000>;
3e895a6460ec38 Hector Martin 2022-05-03 244 opp-level = <6>;
3e895a6460ec38 Hector Martin 2022-05-03 245 clock-latency-ns = <29000>;
3e895a6460ec38 Hector Martin 2022-05-03 246 };
3e895a6460ec38 Hector Martin 2022-05-03 247 opp07 {
3e895a6460ec38 Hector Martin 2022-05-03 248 opp-hz = /bits/ 64 <1956000000>;
3e895a6460ec38 Hector Martin 2022-05-03 249 opp-level = <7>;
3e895a6460ec38 Hector Martin 2022-05-03 250 clock-latency-ns = <31000>;
3e895a6460ec38 Hector Martin 2022-05-03 251 };
3e895a6460ec38 Hector Martin 2022-05-03 252 opp08 {
3e895a6460ec38 Hector Martin 2022-05-03 253 opp-hz = /bits/ 64 <2184000000>;
3e895a6460ec38 Hector Martin 2022-05-03 254 opp-level = <8>;
3e895a6460ec38 Hector Martin 2022-05-03 255 clock-latency-ns = <34000>;
3e895a6460ec38 Hector Martin 2022-05-03 256 };
3e895a6460ec38 Hector Martin 2022-05-03 257 opp09 {
3e895a6460ec38 Hector Martin 2022-05-03 258 opp-hz = /bits/ 64 <2388000000>;
3e895a6460ec38 Hector Martin 2022-05-03 259 opp-level = <9>;
3e895a6460ec38 Hector Martin 2022-05-03 260 clock-latency-ns = <36000>;
3e895a6460ec38 Hector Martin 2022-05-03 261 };
3e895a6460ec38 Hector Martin 2022-05-03 262 opp10 {
3e895a6460ec38 Hector Martin 2022-05-03 263 opp-hz = /bits/ 64 <2592000000>;
3e895a6460ec38 Hector Martin 2022-05-03 264 opp-level = <10>;
3e895a6460ec38 Hector Martin 2022-05-03 265 clock-latency-ns = <51000>;
3e895a6460ec38 Hector Martin 2022-05-03 266 };
3e895a6460ec38 Hector Martin 2022-05-03 267 opp11 {
3e895a6460ec38 Hector Martin 2022-05-03 268 opp-hz = /bits/ 64 <2772000000>;
3e895a6460ec38 Hector Martin 2022-05-03 269 opp-level = <11>;
3e895a6460ec38 Hector Martin 2022-05-03 270 clock-latency-ns = <54000>;
3e895a6460ec38 Hector Martin 2022-05-03 271 };
3e895a6460ec38 Hector Martin 2022-05-03 272 opp12 {
3e895a6460ec38 Hector Martin 2022-05-03 273 opp-hz = /bits/ 64 <2988000000>;
3e895a6460ec38 Hector Martin 2022-05-03 274 opp-level = <12>;
3e895a6460ec38 Hector Martin 2022-05-03 275 clock-latency-ns = <55000>;
3e895a6460ec38 Hector Martin 2022-05-03 276 };
3e895a6460ec38 Hector Martin 2022-05-03 277 #if 0
3e895a6460ec38 Hector Martin 2022-05-03 278 /* Not available until CPU deep sleep is implemented */
3e895a6460ec38 Hector Martin 2022-05-03 279 opp13 {
3e895a6460ec38 Hector Martin 2022-05-03 280 opp-hz = /bits/ 64 <3096000000>;
3e895a6460ec38 Hector Martin 2022-05-03 281 opp-level = <13>;
3e895a6460ec38 Hector Martin 2022-05-03 282 clock-latency-ns = <55000>;
3e895a6460ec38 Hector Martin 2022-05-03 283 turbo-mode;
3e895a6460ec38 Hector Martin 2022-05-03 284 };
3e895a6460ec38 Hector Martin 2022-05-03 285 opp14 {
3e895a6460ec38 Hector Martin 2022-05-03 286 opp-hz = /bits/ 64 <3144000000>;
3e895a6460ec38 Hector Martin 2022-05-03 287 opp-level = <14>;
3e895a6460ec38 Hector Martin 2022-05-03 288 clock-latency-ns = <56000>;
3e895a6460ec38 Hector Martin 2022-05-03 289 turbo-mode;
3e895a6460ec38 Hector Martin 2022-05-03 290 };
3e895a6460ec38 Hector Martin 2022-05-03 291 opp15 {
3e895a6460ec38 Hector Martin 2022-05-03 292 opp-hz = /bits/ 64 <3204000000>;
3e895a6460ec38 Hector Martin 2022-05-03 293 opp-level = <15>;
3e895a6460ec38 Hector Martin 2022-05-03 294 clock-latency-ns = <56000>;
3e895a6460ec38 Hector Martin 2022-05-03 295 turbo-mode;
3e895a6460ec38 Hector Martin 2022-05-03 296 };
3e895a6460ec38 Hector Martin 2022-05-03 297 #endif
7d2d16ccf15d8e Hector Martin 2021-02-04 298 };
7d2d16ccf15d8e Hector Martin 2021-02-04 299
7d2d16ccf15d8e Hector Martin 2021-02-04 300 timer {
7d2d16ccf15d8e Hector Martin 2021-02-04 301 compatible = "arm,armv8-timer";
7d2d16ccf15d8e Hector Martin 2021-02-04 302 interrupt-parent = <&aic>;
7d2d16ccf15d8e Hector Martin 2021-02-04 303 interrupt-names = "phys", "virt", "hyp-phys", "hyp-virt";
7d2d16ccf15d8e Hector Martin 2021-02-04 304 interrupts = <AIC_FIQ AIC_TMR_GUEST_PHYS IRQ_TYPE_LEVEL_HIGH>,
7d2d16ccf15d8e Hector Martin 2021-02-04 305 <AIC_FIQ AIC_TMR_GUEST_VIRT IRQ_TYPE_LEVEL_HIGH>,
7d2d16ccf15d8e Hector Martin 2021-02-04 306 <AIC_FIQ AIC_TMR_HV_PHYS IRQ_TYPE_LEVEL_HIGH>,
7d2d16ccf15d8e Hector Martin 2021-02-04 307 <AIC_FIQ AIC_TMR_HV_VIRT IRQ_TYPE_LEVEL_HIGH>;
7d2d16ccf15d8e Hector Martin 2021-02-04 308 };
7d2d16ccf15d8e Hector Martin 2021-02-04 309
0f522efcd79634 Marc Zyngier 2021-11-02 310 pmu-e {
0f522efcd79634 Marc Zyngier 2021-11-02 311 compatible = "apple,icestorm-pmu";
0f522efcd79634 Marc Zyngier 2021-11-02 312 interrupt-parent = <&aic>;
0f522efcd79634 Marc Zyngier 2021-11-02 313 interrupts = <AIC_FIQ AIC_CPU_PMU_E IRQ_TYPE_LEVEL_HIGH>;
0f522efcd79634 Marc Zyngier 2021-11-02 314 };
0f522efcd79634 Marc Zyngier 2021-11-02 315
0f522efcd79634 Marc Zyngier 2021-11-02 316 pmu-p {
0f522efcd79634 Marc Zyngier 2021-11-02 317 compatible = "apple,firestorm-pmu";
0f522efcd79634 Marc Zyngier 2021-11-02 318 interrupt-parent = <&aic>;
0f522efcd79634 Marc Zyngier 2021-11-02 319 interrupts = <AIC_FIQ AIC_CPU_PMU_P IRQ_TYPE_LEVEL_HIGH>;
0f522efcd79634 Marc Zyngier 2021-11-02 320 };
0f522efcd79634 Marc Zyngier 2021-11-02 321
57337b25244212 Hector Martin 2021-10-05 322 clkref: clock-ref {
7d2d16ccf15d8e Hector Martin 2021-02-04 323 compatible = "fixed-clock";
7d2d16ccf15d8e Hector Martin 2021-02-04 324 #clock-cells = <0>;
7d2d16ccf15d8e Hector Martin 2021-02-04 325 clock-frequency = <24000000>;
57337b25244212 Hector Martin 2021-10-05 326 clock-output-names = "clkref";
7d2d16ccf15d8e Hector Martin 2021-02-04 327 };
7d2d16ccf15d8e Hector Martin 2021-02-04 328
8a3df85ad87d2e Martin Povišer 2022-09-16 329 /*
8a3df85ad87d2e Martin Povišer 2022-09-16 330 * This is a fabulated representation of the input clock
8a3df85ad87d2e Martin Povišer 2022-09-16 331 * to NCO since we don't know the true clock tree.
8a3df85ad87d2e Martin Povišer 2022-09-16 332 */
8a3df85ad87d2e Martin Povišer 2022-09-16 333 nco_clkref: clock-ref-nco {
8a3df85ad87d2e Martin Povišer 2022-09-16 334 compatible = "fixed-clock";
8a3df85ad87d2e Martin Povišer 2022-09-16 335 #clock-cells = <0>;
8a3df85ad87d2e Martin Povišer 2022-09-16 336 clock-output-names = "nco_ref";
8a3df85ad87d2e Martin Povišer 2022-09-16 337 };
8a3df85ad87d2e Martin Povišer 2022-09-16 338
7d2d16ccf15d8e Hector Martin 2021-02-04 339 soc {
7d2d16ccf15d8e Hector Martin 2021-02-04 340 compatible = "simple-bus";
7d2d16ccf15d8e Hector Martin 2021-02-04 341 #address-cells = <2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 342 #size-cells = <2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 343
7d2d16ccf15d8e Hector Martin 2021-02-04 344 ranges;
7d2d16ccf15d8e Hector Martin 2021-02-04 345 nonposted-mmio;
7d2d16ccf15d8e Hector Martin 2021-02-04 346
3e895a6460ec38 Hector Martin 2022-05-03 347 cpufreq_e: performance-controller@210e20000 {
3e895a6460ec38 Hector Martin 2022-05-03 348 compatible = "apple,t8103-cluster-cpufreq", "apple,cluster-cpufreq";
3e895a6460ec38 Hector Martin 2022-05-03 349 reg = <0x2 0x10e20000 0 0x1000>;
3e895a6460ec38 Hector Martin 2022-05-03 350 #performance-domain-cells = <0>;
3e895a6460ec38 Hector Martin 2022-05-03 351 };
3e895a6460ec38 Hector Martin 2022-05-03 352
3e895a6460ec38 Hector Martin 2022-05-03 353 cpufreq_p: performance-controller@211e20000 {
3e895a6460ec38 Hector Martin 2022-05-03 354 compatible = "apple,t8103-cluster-cpufreq", "apple,cluster-cpufreq";
3e895a6460ec38 Hector Martin 2022-05-03 355 reg = <0x2 0x11e20000 0 0x1000>;
3e895a6460ec38 Hector Martin 2022-05-03 356 #performance-domain-cells = <0>;
3e895a6460ec38 Hector Martin 2022-05-03 357 };
3e895a6460ec38 Hector Martin 2022-05-03 358
3cd147b8495e1f Sasha Finkelstein 2024-11-26 359 display_dfr: display-pipe@228200000 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 360 compatible = "apple,t8103-display-pipe", "apple,h7-display-pipe";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 361 reg-names = "be", "fe";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 362 reg = <0x2 0x28200000 0x0 0xc000>,
3cd147b8495e1f Sasha Finkelstein 2024-11-26 363 <0x2 0x28400000 0x0 0x4000>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 364 power-domains = <&ps_dispdfr_fe>, <&ps_dispdfr_be>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 365 interrupt-parent = <&aic>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 366 interrupts = <AIC_IRQ 502 IRQ_TYPE_LEVEL_HIGH>,
3cd147b8495e1f Sasha Finkelstein 2024-11-26 367 <AIC_IRQ 506 IRQ_TYPE_LEVEL_HIGH>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 368 interrupt-names = "be", "fe";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 369 iommus = <&displaydfr_dart 0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 370 status = "disabled";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 371
3cd147b8495e1f Sasha Finkelstein 2024-11-26 372 port {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 373 dfr_adp_out_mipi: endpoint {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 374 remote-endpoint = <&dfr_mipi_in_adp>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 375 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 376 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 377 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 378
3cd147b8495e1f Sasha Finkelstein 2024-11-26 379 displaydfr_dart: iommu@228304000 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 380 compatible = "apple,t8103-dart";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 381 reg = <0x2 0x28304000 0x0 0x4000>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 382 interrupt-parent = <&aic>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 383 interrupts = <AIC_IRQ 504 IRQ_TYPE_LEVEL_HIGH>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 384 #iommu-cells = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 385 power-domains = <&ps_dispdfr_fe>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 386 status = "disabled";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 387 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 388
3cd147b8495e1f Sasha Finkelstein 2024-11-26 @389 displaydfr_mipi: dsi@228600000 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 390 compatible = "apple,t8103-display-pipe-mipi", "apple,h7-display-pipe-mipi";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 391 reg-names = "mipi";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 392 reg = <0x2 0x28600000 0x0 0x100000>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 393 power-domains = <&ps_mipi_dsi>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 394 #address-cells = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 395 #size-cells = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 396 status = "disabled";
3cd147b8495e1f Sasha Finkelstein 2024-11-26 397 ports {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 398 #address-cells = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 399 #size-cells = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 400
3cd147b8495e1f Sasha Finkelstein 2024-11-26 @401 dfr_mipi_in: port@0 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 402 #address-cells = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 403 #size-cells = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 404 reg = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 405
3cd147b8495e1f Sasha Finkelstein 2024-11-26 406 dfr_mipi_in_adp: endpoint@0 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 407 reg = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 408 remote-endpoint = <&dfr_adp_out_mipi>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 409 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 410 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 411
3cd147b8495e1f Sasha Finkelstein 2024-11-26 412 dfr_mipi_out: port@1 {
3cd147b8495e1f Sasha Finkelstein 2024-11-26 413 #address-cells = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 414 #size-cells = <0>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 415 reg = <1>;
3cd147b8495e1f Sasha Finkelstein 2024-11-26 416 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 417 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 418 };
3cd147b8495e1f Sasha Finkelstein 2024-11-26 419
63bf0b66ddfa67 Hector Martin 2022-12-05 420 sio_dart: iommu@235004000 {
8a3df85ad87d2e Martin Povišer 2022-09-16 421 compatible = "apple,t8103-dart";
8a3df85ad87d2e Martin Povišer 2022-09-16 422 reg = <0x2 0x35004000 0x0 0x4000>;
8a3df85ad87d2e Martin Povišer 2022-09-16 423 interrupt-parent = <&aic>;
8a3df85ad87d2e Martin Povišer 2022-09-16 424 interrupts = <AIC_IRQ 635 IRQ_TYPE_LEVEL_HIGH>;
8a3df85ad87d2e Martin Povišer 2022-09-16 425 #iommu-cells = <1>;
8a3df85ad87d2e Martin Povišer 2022-09-16 426 power-domains = <&ps_sio_cpu>;
8a3df85ad87d2e Martin Povišer 2022-09-16 427 };
8a3df85ad87d2e Martin Povišer 2022-09-16 428
90458f6eec42aa Janne Grunau 2021-11-23 429 i2c0: i2c@235010000 {
90458f6eec42aa Janne Grunau 2021-11-23 430 compatible = "apple,t8103-i2c", "apple,i2c";
90458f6eec42aa Janne Grunau 2021-11-23 431 reg = <0x2 0x35010000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 432 clocks = <&clkref>;
90458f6eec42aa Janne Grunau 2021-11-23 433 interrupt-parent = <&aic>;
90458f6eec42aa Janne Grunau 2021-11-23 434 interrupts = <AIC_IRQ 627 IRQ_TYPE_LEVEL_HIGH>;
90458f6eec42aa Janne Grunau 2021-11-23 435 pinctrl-0 = <&i2c0_pins>;
90458f6eec42aa Janne Grunau 2021-11-23 436 pinctrl-names = "default";
90458f6eec42aa Janne Grunau 2021-11-23 437 #address-cells = <0x1>;
90458f6eec42aa Janne Grunau 2021-11-23 438 #size-cells = <0x0>;
106ba3b48a35dd Hector Martin 2021-11-24 439 power-domains = <&ps_i2c0>;
90458f6eec42aa Janne Grunau 2021-11-23 440 };
90458f6eec42aa Janne Grunau 2021-11-23 441
90458f6eec42aa Janne Grunau 2021-11-23 442 i2c1: i2c@235014000 {
90458f6eec42aa Janne Grunau 2021-11-23 443 compatible = "apple,t8103-i2c", "apple,i2c";
90458f6eec42aa Janne Grunau 2021-11-23 444 reg = <0x2 0x35014000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 445 clocks = <&clkref>;
90458f6eec42aa Janne Grunau 2021-11-23 446 interrupt-parent = <&aic>;
90458f6eec42aa Janne Grunau 2021-11-23 447 interrupts = <AIC_IRQ 628 IRQ_TYPE_LEVEL_HIGH>;
90458f6eec42aa Janne Grunau 2021-11-23 448 pinctrl-0 = <&i2c1_pins>;
90458f6eec42aa Janne Grunau 2021-11-23 449 pinctrl-names = "default";
90458f6eec42aa Janne Grunau 2021-11-23 450 #address-cells = <0x1>;
90458f6eec42aa Janne Grunau 2021-11-23 451 #size-cells = <0x0>;
106ba3b48a35dd Hector Martin 2021-11-24 452 power-domains = <&ps_i2c1>;
90458f6eec42aa Janne Grunau 2021-11-23 453 };
90458f6eec42aa Janne Grunau 2021-11-23 454
90458f6eec42aa Janne Grunau 2021-11-23 455 i2c2: i2c@235018000 {
90458f6eec42aa Janne Grunau 2021-11-23 456 compatible = "apple,t8103-i2c", "apple,i2c";
90458f6eec42aa Janne Grunau 2021-11-23 457 reg = <0x2 0x35018000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 458 clocks = <&clkref>;
90458f6eec42aa Janne Grunau 2021-11-23 459 interrupt-parent = <&aic>;
90458f6eec42aa Janne Grunau 2021-11-23 460 interrupts = <AIC_IRQ 629 IRQ_TYPE_LEVEL_HIGH>;
90458f6eec42aa Janne Grunau 2021-11-23 461 pinctrl-0 = <&i2c2_pins>;
90458f6eec42aa Janne Grunau 2021-11-23 462 pinctrl-names = "default";
90458f6eec42aa Janne Grunau 2021-11-23 463 #address-cells = <0x1>;
90458f6eec42aa Janne Grunau 2021-11-23 464 #size-cells = <0x0>;
90458f6eec42aa Janne Grunau 2021-11-23 465 status = "disabled"; /* not used in all devices */
106ba3b48a35dd Hector Martin 2021-11-24 466 power-domains = <&ps_i2c2>;
90458f6eec42aa Janne Grunau 2021-11-23 467 };
90458f6eec42aa Janne Grunau 2021-11-23 468
90458f6eec42aa Janne Grunau 2021-11-23 469 i2c3: i2c@23501c000 {
90458f6eec42aa Janne Grunau 2021-11-23 470 compatible = "apple,t8103-i2c", "apple,i2c";
90458f6eec42aa Janne Grunau 2021-11-23 471 reg = <0x2 0x3501c000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 472 clocks = <&clkref>;
90458f6eec42aa Janne Grunau 2021-11-23 473 interrupt-parent = <&aic>;
90458f6eec42aa Janne Grunau 2021-11-23 474 interrupts = <AIC_IRQ 630 IRQ_TYPE_LEVEL_HIGH>;
90458f6eec42aa Janne Grunau 2021-11-23 475 pinctrl-0 = <&i2c3_pins>;
90458f6eec42aa Janne Grunau 2021-11-23 476 pinctrl-names = "default";
90458f6eec42aa Janne Grunau 2021-11-23 477 #address-cells = <0x1>;
90458f6eec42aa Janne Grunau 2021-11-23 478 #size-cells = <0x0>;
106ba3b48a35dd Hector Martin 2021-11-24 479 power-domains = <&ps_i2c3>;
90458f6eec42aa Janne Grunau 2021-11-23 480 };
90458f6eec42aa Janne Grunau 2021-11-23 481
90458f6eec42aa Janne Grunau 2021-11-23 482 i2c4: i2c@235020000 {
90458f6eec42aa Janne Grunau 2021-11-23 483 compatible = "apple,t8103-i2c", "apple,i2c";
90458f6eec42aa Janne Grunau 2021-11-23 484 reg = <0x2 0x35020000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 485 clocks = <&clkref>;
90458f6eec42aa Janne Grunau 2021-11-23 486 interrupt-parent = <&aic>;
90458f6eec42aa Janne Grunau 2021-11-23 487 interrupts = <AIC_IRQ 631 IRQ_TYPE_LEVEL_HIGH>;
90458f6eec42aa Janne Grunau 2021-11-23 488 pinctrl-0 = <&i2c4_pins>;
90458f6eec42aa Janne Grunau 2021-11-23 489 pinctrl-names = "default";
90458f6eec42aa Janne Grunau 2021-11-23 490 #address-cells = <0x1>;
90458f6eec42aa Janne Grunau 2021-11-23 491 #size-cells = <0x0>;
106ba3b48a35dd Hector Martin 2021-11-24 492 power-domains = <&ps_i2c4>;
90458f6eec42aa Janne Grunau 2021-11-23 493 status = "disabled"; /* only used in J293 */
90458f6eec42aa Janne Grunau 2021-11-23 494 };
90458f6eec42aa Janne Grunau 2021-11-23 495
348981c783b985 Sasha Finkelstein 2023-04-03 496 fpwm1: pwm@235044000 {
348981c783b985 Sasha Finkelstein 2023-04-03 497 compatible = "apple,t8103-fpwm", "apple,s5l-fpwm";
348981c783b985 Sasha Finkelstein 2023-04-03 498 reg = <0x2 0x35044000 0x0 0x4000>;
348981c783b985 Sasha Finkelstein 2023-04-03 499 power-domains = <&ps_fpwm1>;
348981c783b985 Sasha Finkelstein 2023-04-03 500 clocks = <&clkref>;
348981c783b985 Sasha Finkelstein 2023-04-03 501 #pwm-cells = <2>;
348981c783b985 Sasha Finkelstein 2023-04-03 502 status = "disabled";
348981c783b985 Sasha Finkelstein 2023-04-03 503 };
348981c783b985 Sasha Finkelstein 2023-04-03 504
7d2d16ccf15d8e Hector Martin 2021-02-04 505 serial0: serial@235200000 {
7d2d16ccf15d8e Hector Martin 2021-02-04 506 compatible = "apple,s5l-uart";
7d2d16ccf15d8e Hector Martin 2021-02-04 507 reg = <0x2 0x35200000 0x0 0x1000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 508 reg-io-width = <4>;
7d2d16ccf15d8e Hector Martin 2021-02-04 509 interrupt-parent = <&aic>;
7d2d16ccf15d8e Hector Martin 2021-02-04 510 interrupts = <AIC_IRQ 605 IRQ_TYPE_LEVEL_HIGH>;
7d2d16ccf15d8e Hector Martin 2021-02-04 511 /*
7d2d16ccf15d8e Hector Martin 2021-02-04 512 * TODO: figure out the clocking properly, there may
7d2d16ccf15d8e Hector Martin 2021-02-04 513 * be a third selectable clock.
7d2d16ccf15d8e Hector Martin 2021-02-04 514 */
57337b25244212 Hector Martin 2021-10-05 515 clocks = <&clkref>, <&clkref>;
7d2d16ccf15d8e Hector Martin 2021-02-04 516 clock-names = "uart", "clk_uart_baud0";
106ba3b48a35dd Hector Martin 2021-11-24 517 power-domains = <&ps_uart0>;
7d2d16ccf15d8e Hector Martin 2021-02-04 518 status = "disabled";
7d2d16ccf15d8e Hector Martin 2021-02-04 519 };
7d2d16ccf15d8e Hector Martin 2021-02-04 520
2ba22cfeda4456 Hector Martin 2021-09-20 521 serial2: serial@235208000 {
2ba22cfeda4456 Hector Martin 2021-09-20 522 compatible = "apple,s5l-uart";
2ba22cfeda4456 Hector Martin 2021-09-20 523 reg = <0x2 0x35208000 0x0 0x1000>;
2ba22cfeda4456 Hector Martin 2021-09-20 524 reg-io-width = <4>;
2ba22cfeda4456 Hector Martin 2021-09-20 525 interrupt-parent = <&aic>;
2ba22cfeda4456 Hector Martin 2021-09-20 526 interrupts = <AIC_IRQ 607 IRQ_TYPE_LEVEL_HIGH>;
57337b25244212 Hector Martin 2021-10-05 527 clocks = <&clkref>, <&clkref>;
7d2d16ccf15d8e Hector Martin 2021-02-04 528 clock-names = "uart", "clk_uart_baud0";
2ba22cfeda4456 Hector Martin 2021-09-20 529 power-domains = <&ps_uart2>;
7d2d16ccf15d8e Hector Martin 2021-02-04 530 status = "disabled";
7d2d16ccf15d8e Hector Martin 2021-02-04 531 };
7d2d16ccf15d8e Hector Martin 2021-02-04 532
8a3df85ad87d2e Martin Povišer 2022-09-16 533 admac: dma-controller@238200000 {
8a3df85ad87d2e Martin Povišer 2022-09-16 534 compatible = "apple,t8103-admac", "apple,admac";
8a3df85ad87d2e Martin Povišer 2022-09-16 535 reg = <0x2 0x38200000 0x0 0x34000>;
8a3df85ad87d2e Martin Povišer 2022-09-16 536 dma-channels = <24>;
8a3df85ad87d2e Martin Povišer 2022-09-16 537 interrupts-extended = <0>,
8a3df85ad87d2e Martin Povišer 2022-09-16 538 <&aic AIC_IRQ 626 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 539 <0>,
8a3df85ad87d2e Martin Povišer 2022-09-16 540 <0>;
8a3df85ad87d2e Martin Povišer 2022-09-16 541 #dma-cells = <1>;
63bf0b66ddfa67 Hector Martin 2022-12-05 542 iommus = <&sio_dart 2>;
8a3df85ad87d2e Martin Povišer 2022-09-16 543 power-domains = <&ps_sio_adma>;
56fed763f6b2dc Martin Povišer 2022-09-18 544 resets = <&ps_audio_p>;
8a3df85ad87d2e Martin Povišer 2022-09-16 545 };
8a3df85ad87d2e Martin Povišer 2022-09-16 546
8a3df85ad87d2e Martin Povišer 2022-09-16 547 mca: i2s@238400000 {
8a3df85ad87d2e Martin Povišer 2022-09-16 548 compatible = "apple,t8103-mca", "apple,mca";
8a3df85ad87d2e Martin Povišer 2022-09-16 549 reg = <0x2 0x38400000 0x0 0x18000>,
8a3df85ad87d2e Martin Povišer 2022-09-16 550 <0x2 0x38300000 0x0 0x30000>;
8a3df85ad87d2e Martin Povišer 2022-09-16 551
8a3df85ad87d2e Martin Povišer 2022-09-16 552 interrupt-parent = <&aic>;
8a3df85ad87d2e Martin Povišer 2022-09-16 553 interrupts = <AIC_IRQ 619 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 554 <AIC_IRQ 620 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 555 <AIC_IRQ 621 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 556 <AIC_IRQ 622 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 557 <AIC_IRQ 623 IRQ_TYPE_LEVEL_HIGH>,
8a3df85ad87d2e Martin Povišer 2022-09-16 558 <AIC_IRQ 624 IRQ_TYPE_LEVEL_HIGH>;
8a3df85ad87d2e Martin Povišer 2022-09-16 559
8a3df85ad87d2e Martin Povišer 2022-09-16 560 resets = <&ps_audio_p>;
8a3df85ad87d2e Martin Povišer 2022-09-16 561 clocks = <&nco 0>, <&nco 1>, <&nco 2>,
8a3df85ad87d2e Martin Povišer 2022-09-16 562 <&nco 3>, <&nco 4>, <&nco 4>;
8a3df85ad87d2e Martin Povišer 2022-09-16 563 power-domains = <&ps_audio_p>, <&ps_mca0>, <&ps_mca1>,
8a3df85ad87d2e Martin Povišer 2022-09-16 564 <&ps_mca2>, <&ps_mca3>, <&ps_mca4>, <&ps_mca5>;
8a3df85ad87d2e Martin Povišer 2022-09-16 565 dmas = <&admac 0>, <&admac 1>, <&admac 2>, <&admac 3>,
8a3df85ad87d2e Martin Povišer 2022-09-16 566 <&admac 4>, <&admac 5>, <&admac 6>, <&admac 7>,
8a3df85ad87d2e Martin Povišer 2022-09-16 567 <&admac 8>, <&admac 9>, <&admac 10>, <&admac 11>,
8a3df85ad87d2e Martin Povišer 2022-09-16 568 <&admac 12>, <&admac 13>, <&admac 14>, <&admac 15>,
8a3df85ad87d2e Martin Povišer 2022-09-16 569 <&admac 16>, <&admac 17>, <&admac 18>, <&admac 19>,
8a3df85ad87d2e Martin Povišer 2022-09-16 570 <&admac 20>, <&admac 21>, <&admac 22>, <&admac 23>;
8a3df85ad87d2e Martin Povišer 2022-09-16 571 dma-names = "tx0a", "rx0a", "tx0b", "rx0b",
8a3df85ad87d2e Martin Povišer 2022-09-16 572 "tx1a", "rx1a", "tx1b", "rx1b",
8a3df85ad87d2e Martin Povišer 2022-09-16 573 "tx2a", "rx2a", "tx2b", "rx2b",
8a3df85ad87d2e Martin Povišer 2022-09-16 574 "tx3a", "rx3a", "tx3b", "rx3b",
8a3df85ad87d2e Martin Povišer 2022-09-16 575 "tx4a", "rx4a", "tx4b", "rx4b",
8a3df85ad87d2e Martin Povišer 2022-09-16 576 "tx5a", "rx5a", "tx5b", "rx5b";
8a3df85ad87d2e Martin Povišer 2022-09-16 577
8a3df85ad87d2e Martin Povišer 2022-09-16 578 #sound-dai-cells = <1>;
8a3df85ad87d2e Martin Povišer 2022-09-16 579 };
8a3df85ad87d2e Martin Povišer 2022-09-16 580
8a3df85ad87d2e Martin Povišer 2022-09-16 581 nco: clock-controller@23b044000 {
8a3df85ad87d2e Martin Povišer 2022-09-16 582 compatible = "apple,t8103-nco", "apple,nco";
8a3df85ad87d2e Martin Povišer 2022-09-16 583 reg = <0x2 0x3b044000 0x0 0x14000>;
8a3df85ad87d2e Martin Povišer 2022-09-16 584 clocks = <&nco_clkref>;
8a3df85ad87d2e Martin Povišer 2022-09-16 585 #clock-cells = <1>;
8a3df85ad87d2e Martin Povišer 2022-09-16 586 };
8a3df85ad87d2e Martin Povišer 2022-09-16 587
7d2d16ccf15d8e Hector Martin 2021-02-04 588 aic: interrupt-controller@23b100000 {
7d2d16ccf15d8e Hector Martin 2021-02-04 589 compatible = "apple,t8103-aic", "apple,aic";
7d2d16ccf15d8e Hector Martin 2021-02-04 590 #interrupt-cells = <3>;
7d2d16ccf15d8e Hector Martin 2021-02-04 591 interrupt-controller;
7d2d16ccf15d8e Hector Martin 2021-02-04 592 reg = <0x2 0x3b100000 0x0 0x8000>;
106ba3b48a35dd Hector Martin 2021-11-24 593 power-domains = <&ps_aic>;
1852e22b318b8d Marc Zyngier 2021-12-14 594
1852e22b318b8d Marc Zyngier 2021-12-14 595 affinities {
1852e22b318b8d Marc Zyngier 2021-12-14 596 e-core-pmu-affinity {
1852e22b318b8d Marc Zyngier 2021-12-14 597 apple,fiq-index = <AIC_CPU_PMU_E>;
3e895a6460ec38 Hector Martin 2022-05-03 598 cpus = <&cpu_e0 &cpu_e1 &cpu_e2 &cpu_e3>;
1852e22b318b8d Marc Zyngier 2021-12-14 599 };
1852e22b318b8d Marc Zyngier 2021-12-14 600
1852e22b318b8d Marc Zyngier 2021-12-14 601 p-core-pmu-affinity {
1852e22b318b8d Marc Zyngier 2021-12-14 602 apple,fiq-index = <AIC_CPU_PMU_P>;
3e895a6460ec38 Hector Martin 2022-05-03 603 cpus = <&cpu_p0 &cpu_p1 &cpu_p2 &cpu_p3>;
1852e22b318b8d Marc Zyngier 2021-12-14 604 };
1852e22b318b8d Marc Zyngier 2021-12-14 605 };
106ba3b48a35dd Hector Martin 2021-11-24 606 };
106ba3b48a35dd Hector Martin 2021-11-24 607
106ba3b48a35dd Hector Martin 2021-11-24 608 pmgr: power-management@23b700000 {
106ba3b48a35dd Hector Martin 2021-11-24 609 compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
106ba3b48a35dd Hector Martin 2021-11-24 610 #address-cells = <1>;
106ba3b48a35dd Hector Martin 2021-11-24 611 #size-cells = <1>;
106ba3b48a35dd Hector Martin 2021-11-24 612 reg = <0x2 0x3b700000 0 0x14000>;
7d2d16ccf15d8e Hector Martin 2021-02-04 613 };
0a8282b831196b Mark Kettenis 2021-10-25 614
0a8282b831196b Mark Kettenis 2021-10-25 615 pinctrl_ap: pinctrl@23c100000 {
0a8282b831196b Mark Kettenis 2021-10-25 616 compatible = "apple,t8103-pinctrl", "apple,pinctrl";
0a8282b831196b Mark Kettenis 2021-10-25 617 reg = <0x2 0x3c100000 0x0 0x100000>;
106ba3b48a35dd Hector Martin 2021-11-24 618 power-domains = <&ps_gpio>;
0a8282b831196b Mark Kettenis 2021-10-25 619
0a8282b831196b Mark Kettenis 2021-10-25 620 gpio-controller;
0a8282b831196b Mark Kettenis 2021-10-25 621 #gpio-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 622 gpio-ranges = <&pinctrl_ap 0 0 212>;
0a8282b831196b Mark Kettenis 2021-10-25 623 apple,npins = <212>;
0a8282b831196b Mark Kettenis 2021-10-25 624
0a8282b831196b Mark Kettenis 2021-10-25 625 interrupt-controller;
0668639eaf1481 Janne Grunau 2021-11-22 626 #interrupt-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 627 interrupt-parent = <&aic>;
0a8282b831196b Mark Kettenis 2021-10-25 628 interrupts = <AIC_IRQ 190 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 629 <AIC_IRQ 191 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 630 <AIC_IRQ 192 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 631 <AIC_IRQ 193 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 632 <AIC_IRQ 194 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 633 <AIC_IRQ 195 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 634 <AIC_IRQ 196 IRQ_TYPE_LEVEL_HIGH>;
0a8282b831196b Mark Kettenis 2021-10-25 635
90458f6eec42aa Janne Grunau 2021-11-23 636 i2c0_pins: i2c0-pins {
90458f6eec42aa Janne Grunau 2021-11-23 637 pinmux = <APPLE_PINMUX(192, 1)>,
90458f6eec42aa Janne Grunau 2021-11-23 638 <APPLE_PINMUX(188, 1)>;
0a8282b831196b Mark Kettenis 2021-10-25 639 };
90458f6eec42aa Janne Grunau 2021-11-23 640
90458f6eec42aa Janne Grunau 2021-11-23 641 i2c1_pins: i2c1-pins {
90458f6eec42aa Janne Grunau 2021-11-23 642 pinmux = <APPLE_PINMUX(201, 1)>,
90458f6eec42aa Janne Grunau 2021-11-23 643 <APPLE_PINMUX(199, 1)>;
0a8282b831196b Mark Kettenis 2021-10-25 644 };
0a8282b831196b Mark Kettenis 2021-10-25 645
90458f6eec42aa Janne Grunau 2021-11-23 646 i2c2_pins: i2c2-pins {
90458f6eec42aa Janne Grunau 2021-11-23 647 pinmux = <APPLE_PINMUX(163, 1)>,
90458f6eec42aa Janne Grunau 2021-11-23 648 <APPLE_PINMUX(162, 1)>;
90458f6eec42aa Janne Grunau 2021-11-23 649 };
0a8282b831196b Mark Kettenis 2021-10-25 650
90458f6eec42aa Janne Grunau 2021-11-23 651 i2c3_pins: i2c3-pins {
90458f6eec42aa Janne Grunau 2021-11-23 652 pinmux = <APPLE_PINMUX(73, 1)>,
90458f6eec42aa Janne Grunau 2021-11-23 653 <APPLE_PINMUX(72, 1)>;
90458f6eec42aa Janne Grunau 2021-11-23 654 };
0a8282b831196b Mark Kettenis 2021-10-25 655
90458f6eec42aa Janne Grunau 2021-11-23 656 i2c4_pins: i2c4-pins {
90458f6eec42aa Janne Grunau 2021-11-23 657 pinmux = <APPLE_PINMUX(135, 1)>,
90458f6eec42aa Janne Grunau 2021-11-23 658 <APPLE_PINMUX(134, 1)>;
90458f6eec42aa Janne Grunau 2021-11-23 659 };
90458f6eec42aa Janne Grunau 2021-11-23 660
0a8282b831196b Mark Kettenis 2021-10-25 661 pcie_pins: pcie-pins {
0a8282b831196b Mark Kettenis 2021-10-25 662 pinmux = <APPLE_PINMUX(150, 1)>,
0a8282b831196b Mark Kettenis 2021-10-25 663 <APPLE_PINMUX(151, 1)>,
0a8282b831196b Mark Kettenis 2021-10-25 664 <APPLE_PINMUX(32, 1)>;
0a8282b831196b Mark Kettenis 2021-10-25 665 };
0a8282b831196b Mark Kettenis 2021-10-25 666 };
0a8282b831196b Mark Kettenis 2021-10-25 667
0a8282b831196b Mark Kettenis 2021-10-25 668 pinctrl_nub: pinctrl@23d1f0000 {
0a8282b831196b Mark Kettenis 2021-10-25 669 compatible = "apple,t8103-pinctrl", "apple,pinctrl";
0a8282b831196b Mark Kettenis 2021-10-25 670 reg = <0x2 0x3d1f0000 0x0 0x4000>;
106ba3b48a35dd Hector Martin 2021-11-24 671 power-domains = <&ps_nub_gpio>;
0a8282b831196b Mark Kettenis 2021-10-25 672
0a8282b831196b Mark Kettenis 2021-10-25 673 gpio-controller;
0a8282b831196b Mark Kettenis 2021-10-25 674 #gpio-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 675 gpio-ranges = <&pinctrl_nub 0 0 23>;
0a8282b831196b Mark Kettenis 2021-10-25 676 apple,npins = <23>;
0a8282b831196b Mark Kettenis 2021-10-25 677
0a8282b831196b Mark Kettenis 2021-10-25 678 interrupt-controller;
0668639eaf1481 Janne Grunau 2021-11-22 679 #interrupt-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 680 interrupt-parent = <&aic>;
0a8282b831196b Mark Kettenis 2021-10-25 681 interrupts = <AIC_IRQ 330 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 682 <AIC_IRQ 331 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 683 <AIC_IRQ 332 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 684 <AIC_IRQ 333 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 685 <AIC_IRQ 334 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 686 <AIC_IRQ 335 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 687 <AIC_IRQ 336 IRQ_TYPE_LEVEL_HIGH>;
0a8282b831196b Mark Kettenis 2021-10-25 688 };
0a8282b831196b Mark Kettenis 2021-10-25 689
8adf987ce08275 Hector Martin 2021-12-12 690 pmgr_mini: power-management@23d280000 {
8adf987ce08275 Hector Martin 2021-12-12 691 compatible = "apple,t8103-pmgr", "apple,pmgr", "syscon", "simple-mfd";
8adf987ce08275 Hector Martin 2021-12-12 692 #address-cells = <1>;
8adf987ce08275 Hector Martin 2021-12-12 693 #size-cells = <1>;
8adf987ce08275 Hector Martin 2021-12-12 694 reg = <0x2 0x3d280000 0 0x4000>;
8adf987ce08275 Hector Martin 2021-12-12 695 };
8adf987ce08275 Hector Martin 2021-12-12 696
b4d11106d751a4 Sven Peter 2021-12-11 697 wdt: watchdog@23d2b0000 {
b4d11106d751a4 Sven Peter 2021-12-11 698 compatible = "apple,t8103-wdt", "apple,wdt";
b4d11106d751a4 Sven Peter 2021-12-11 699 reg = <0x2 0x3d2b0000 0x0 0x4000>;
57337b25244212 Hector Martin 2021-10-05 700 clocks = <&clkref>;
b4d11106d751a4 Sven Peter 2021-12-11 701 interrupt-parent = <&aic>;
b4d11106d751a4 Sven Peter 2021-12-11 702 interrupts = <AIC_IRQ 338 IRQ_TYPE_LEVEL_HIGH>;
b4d11106d751a4 Sven Peter 2021-12-11 703 };
b4d11106d751a4 Sven Peter 2021-12-11 704
0a8282b831196b Mark Kettenis 2021-10-25 705 pinctrl_smc: pinctrl@23e820000 {
0a8282b831196b Mark Kettenis 2021-10-25 706 compatible = "apple,t8103-pinctrl", "apple,pinctrl";
0a8282b831196b Mark Kettenis 2021-10-25 707 reg = <0x2 0x3e820000 0x0 0x4000>;
0a8282b831196b Mark Kettenis 2021-10-25 708
0a8282b831196b Mark Kettenis 2021-10-25 709 gpio-controller;
0a8282b831196b Mark Kettenis 2021-10-25 710 #gpio-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 711 gpio-ranges = <&pinctrl_smc 0 0 16>;
0a8282b831196b Mark Kettenis 2021-10-25 712 apple,npins = <16>;
0a8282b831196b Mark Kettenis 2021-10-25 713
0a8282b831196b Mark Kettenis 2021-10-25 714 interrupt-controller;
0668639eaf1481 Janne Grunau 2021-11-22 715 #interrupt-cells = <2>;
0a8282b831196b Mark Kettenis 2021-10-25 716 interrupt-parent = <&aic>;
0a8282b831196b Mark Kettenis 2021-10-25 717 interrupts = <AIC_IRQ 391 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 718 <AIC_IRQ 392 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 719 <AIC_IRQ 393 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 720 <AIC_IRQ 394 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 721 <AIC_IRQ 395 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 722 <AIC_IRQ 396 IRQ_TYPE_LEVEL_HIGH>,
0a8282b831196b Mark Kettenis 2021-10-25 723 <AIC_IRQ 397 IRQ_TYPE_LEVEL_HIGH>;
0a8282b831196b Mark Kettenis 2021-10-25 724 };
ff2a8d91d80c54 Mark Kettenis 2021-10-25 725
8adf987ce08275 Hector Martin 2021-12-12 726 pinctrl_aop: pinctrl@24a820000 {
8adf987ce08275 Hector Martin 2021-12-12 727 compatible = "apple,t8103-pinctrl", "apple,pinctrl";
8adf987ce08275 Hector Martin 2021-12-12 728 reg = <0x2 0x4a820000 0x0 0x4000>;
8adf987ce08275 Hector Martin 2021-12-12 729
8adf987ce08275 Hector Martin 2021-12-12 730 gpio-controller;
8adf987ce08275 Hector Martin 2021-12-12 731 #gpio-cells = <2>;
8adf987ce08275 Hector Martin 2021-12-12 732 gpio-ranges = <&pinctrl_aop 0 0 42>;
8adf987ce08275 Hector Martin 2021-12-12 733 apple,npins = <42>;
8adf987ce08275 Hector Martin 2021-12-12 734
8adf987ce08275 Hector Martin 2021-12-12 735 interrupt-controller;
8adf987ce08275 Hector Martin 2021-12-12 736 #interrupt-cells = <2>;
8adf987ce08275 Hector Martin 2021-12-12 737 interrupt-parent = <&aic>;
8adf987ce08275 Hector Martin 2021-12-12 738 interrupts = <AIC_IRQ 268 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 739 <AIC_IRQ 269 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 740 <AIC_IRQ 270 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 741 <AIC_IRQ 271 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 742 <AIC_IRQ 272 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 743 <AIC_IRQ 273 IRQ_TYPE_LEVEL_HIGH>,
8adf987ce08275 Hector Martin 2021-12-12 744 <AIC_IRQ 274 IRQ_TYPE_LEVEL_HIGH>;
8adf987ce08275 Hector Martin 2021-12-12 745 };
8adf987ce08275 Hector Martin 2021-12-12 746
5316d73ba81b5d Sven Peter 2022-06-02 747 ans_mbox: mbox@277408000 {
5316d73ba81b5d Sven Peter 2022-06-02 748 compatible = "apple,t8103-asc-mailbox", "apple,asc-mailbox-v4";
5316d73ba81b5d Sven Peter 2022-06-02 749 reg = <0x2 0x77408000 0x0 0x4000>;
5316d73ba81b5d Sven Peter 2022-06-02 750 interrupt-parent = <&aic>;
5316d73ba81b5d Sven Peter 2022-06-02 751 interrupts = <AIC_IRQ 583 IRQ_TYPE_LEVEL_HIGH>,
5316d73ba81b5d Sven Peter 2022-06-02 752 <AIC_IRQ 584 IRQ_TYPE_LEVEL_HIGH>,
5316d73ba81b5d Sven Peter 2022-06-02 753 <AIC_IRQ 585 IRQ_TYPE_LEVEL_HIGH>,
5316d73ba81b5d Sven Peter 2022-06-02 754 <AIC_IRQ 586 IRQ_TYPE_LEVEL_HIGH>;
5316d73ba81b5d Sven Peter 2022-06-02 755 interrupt-names = "send-empty", "send-not-empty",
5316d73ba81b5d Sven Peter 2022-06-02 756 "recv-empty", "recv-not-empty";
5316d73ba81b5d Sven Peter 2022-06-02 757 #mbox-cells = <0>;
5316d73ba81b5d Sven Peter 2022-06-02 758 power-domains = <&ps_ans2>;
5316d73ba81b5d Sven Peter 2022-06-02 759 };
5316d73ba81b5d Sven Peter 2022-06-02 760
5316d73ba81b5d Sven Peter 2022-06-02 761 sart: iommu@27bc50000 {
5316d73ba81b5d Sven Peter 2022-06-02 762 compatible = "apple,t8103-sart";
5316d73ba81b5d Sven Peter 2022-06-02 763 reg = <0x2 0x7bc50000 0x0 0x10000>;
5316d73ba81b5d Sven Peter 2022-06-02 764 power-domains = <&ps_ans2>;
5316d73ba81b5d Sven Peter 2022-06-02 765 };
5316d73ba81b5d Sven Peter 2022-06-02 766
5316d73ba81b5d Sven Peter 2022-06-02 767 nvme@27bcc0000 {
5316d73ba81b5d Sven Peter 2022-06-02 768 compatible = "apple,t8103-nvme-ans2", "apple,nvme-ans2";
5316d73ba81b5d Sven Peter 2022-06-02 769 reg = <0x2 0x7bcc0000 0x0 0x40000>,
5316d73ba81b5d Sven Peter 2022-06-02 770 <0x2 0x77400000 0x0 0x4000>;
5316d73ba81b5d Sven Peter 2022-06-02 771 reg-names = "nvme", "ans";
5316d73ba81b5d Sven Peter 2022-06-02 772 interrupt-parent = <&aic>;
5316d73ba81b5d Sven Peter 2022-06-02 773 interrupts = <AIC_IRQ 590 IRQ_TYPE_LEVEL_HIGH>;
5316d73ba81b5d Sven Peter 2022-06-02 774 mboxes = <&ans_mbox>;
5316d73ba81b5d Sven Peter 2022-06-02 775 apple,sart = <&sart>;
5316d73ba81b5d Sven Peter 2022-06-02 776 power-domains = <&ps_ans2>, <&ps_apcie_st>;
5316d73ba81b5d Sven Peter 2022-06-02 777 power-domain-names = "ans", "apcie0";
5316d73ba81b5d Sven Peter 2022-06-02 778 resets = <&ps_ans2>;
5316d73ba81b5d Sven Peter 2022-06-02 779 };
5316d73ba81b5d Sven Peter 2022-06-02 780
56d32c51dffac8 Janne Grunau 2022-12-06 781 pcie0_dart_0: iommu@681008000 {
3c866bb79577ed Marc Zyngier 2021-10-25 782 compatible = "apple,t8103-dart";
3c866bb79577ed Marc Zyngier 2021-10-25 783 reg = <0x6 0x81008000 0x0 0x4000>;
3c866bb79577ed Marc Zyngier 2021-10-25 784 #iommu-cells = <1>;
3c866bb79577ed Marc Zyngier 2021-10-25 785 interrupt-parent = <&aic>;
3c866bb79577ed Marc Zyngier 2021-10-25 786 interrupts = <AIC_IRQ 696 IRQ_TYPE_LEVEL_HIGH>;
106ba3b48a35dd Hector Martin 2021-11-24 787 power-domains = <&ps_apcie_gp>;
3c866bb79577ed Marc Zyngier 2021-10-25 788 };
3c866bb79577ed Marc Zyngier 2021-10-25 789
56d32c51dffac8 Janne Grunau 2022-12-06 790 pcie0_dart_1: iommu@682008000 {
3c866bb79577ed Marc Zyngier 2021-10-25 791 compatible = "apple,t8103-dart";
3c866bb79577ed Marc Zyngier 2021-10-25 792 reg = <0x6 0x82008000 0x0 0x4000>;
3c866bb79577ed Marc Zyngier 2021-10-25 793 #iommu-cells = <1>;
3c866bb79577ed Marc Zyngier 2021-10-25 794 interrupt-parent = <&aic>;
3c866bb79577ed Marc Zyngier 2021-10-25 795 interrupts = <AIC_IRQ 699 IRQ_TYPE_LEVEL_HIGH>;
106ba3b48a35dd Hector Martin 2021-11-24 796 power-domains = <&ps_apcie_gp>;
a0189fdfb73dac Janne Grunau 2023-02-14 797 status = "disabled";
3c866bb79577ed Marc Zyngier 2021-10-25 798 };
3c866bb79577ed Marc Zyngier 2021-10-25 799
56d32c51dffac8 Janne Grunau 2022-12-06 800 pcie0_dart_2: iommu@683008000 {
3c866bb79577ed Marc Zyngier 2021-10-25 801 compatible = "apple,t8103-dart";
3c866bb79577ed Marc Zyngier 2021-10-25 802 reg = <0x6 0x83008000 0x0 0x4000>;
3c866bb79577ed Marc Zyngier 2021-10-25 803 #iommu-cells = <1>;
3c866bb79577ed Marc Zyngier 2021-10-25 804 interrupt-parent = <&aic>;
3c866bb79577ed Marc Zyngier 2021-10-25 805 interrupts = <AIC_IRQ 702 IRQ_TYPE_LEVEL_HIGH>;
106ba3b48a35dd Hector Martin 2021-11-24 806 power-domains = <&ps_apcie_gp>;
a0189fdfb73dac Janne Grunau 2023-02-14 807 status = "disabled";
3c866bb79577ed Marc Zyngier 2021-10-25 808 };
3c866bb79577ed Marc Zyngier 2021-10-25 809
ff2a8d91d80c54 Mark Kettenis 2021-10-25 810 pcie0: pcie@690000000 {
ff2a8d91d80c54 Mark Kettenis 2021-10-25 811 compatible = "apple,t8103-pcie", "apple,pcie";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 812 device_type = "pci";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 813
ff2a8d91d80c54 Mark Kettenis 2021-10-25 814 reg = <0x6 0x90000000 0x0 0x1000000>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 815 <0x6 0x80000000 0x0 0x100000>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 816 <0x6 0x81000000 0x0 0x4000>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 817 <0x6 0x82000000 0x0 0x4000>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 818 <0x6 0x83000000 0x0 0x4000>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 819 reg-names = "config", "rc", "port0", "port1", "port2";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 820
ff2a8d91d80c54 Mark Kettenis 2021-10-25 821 interrupt-parent = <&aic>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 822 interrupts = <AIC_IRQ 695 IRQ_TYPE_LEVEL_HIGH>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 823 <AIC_IRQ 698 IRQ_TYPE_LEVEL_HIGH>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 824 <AIC_IRQ 701 IRQ_TYPE_LEVEL_HIGH>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 825
ff2a8d91d80c54 Mark Kettenis 2021-10-25 826 msi-controller;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 827 msi-parent = <&pcie0>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 828 msi-ranges = <&aic AIC_IRQ 704 IRQ_TYPE_EDGE_RISING 32>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 829
3c866bb79577ed Marc Zyngier 2021-10-25 830
3c866bb79577ed Marc Zyngier 2021-10-25 831 iommu-map = <0x100 &pcie0_dart_0 1 1>,
3c866bb79577ed Marc Zyngier 2021-10-25 832 <0x200 &pcie0_dart_1 1 1>,
3c866bb79577ed Marc Zyngier 2021-10-25 833 <0x300 &pcie0_dart_2 1 1>;
3c866bb79577ed Marc Zyngier 2021-10-25 834 iommu-map-mask = <0xff00>;
3c866bb79577ed Marc Zyngier 2021-10-25 835
ff2a8d91d80c54 Mark Kettenis 2021-10-25 836 bus-range = <0 3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 837 #address-cells = <3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 838 #size-cells = <2>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 839 ranges = <0x43000000 0x6 0xa0000000 0x6 0xa0000000 0x0 0x20000000>,
ff2a8d91d80c54 Mark Kettenis 2021-10-25 840 <0x02000000 0x0 0xc0000000 0x6 0xc0000000 0x0 0x40000000>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 841
106ba3b48a35dd Hector Martin 2021-11-24 842 power-domains = <&ps_apcie_gp>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 843 pinctrl-0 = <&pcie_pins>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 844 pinctrl-names = "default";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 845
128888a6fdb695 Marc Zyngier 2021-10-25 846 port00: pci@0,0 {
ff2a8d91d80c54 Mark Kettenis 2021-10-25 847 device_type = "pci";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 848 reg = <0x0 0x0 0x0 0x0 0x0>;
5b970dfcfee9e0 Marc Zyngier 2021-11-23 849 reset-gpios = <&pinctrl_ap 152 GPIO_ACTIVE_LOW>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 850
ff2a8d91d80c54 Mark Kettenis 2021-10-25 851 #address-cells = <3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 852 #size-cells = <2>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 853 ranges;
128888a6fdb695 Marc Zyngier 2021-10-25 854
128888a6fdb695 Marc Zyngier 2021-10-25 855 interrupt-controller;
128888a6fdb695 Marc Zyngier 2021-10-25 856 #interrupt-cells = <1>;
128888a6fdb695 Marc Zyngier 2021-10-25 857
128888a6fdb695 Marc Zyngier 2021-10-25 858 interrupt-map-mask = <0 0 0 7>;
128888a6fdb695 Marc Zyngier 2021-10-25 859 interrupt-map = <0 0 0 1 &port00 0 0 0 0>,
128888a6fdb695 Marc Zyngier 2021-10-25 860 <0 0 0 2 &port00 0 0 0 1>,
128888a6fdb695 Marc Zyngier 2021-10-25 861 <0 0 0 3 &port00 0 0 0 2>,
128888a6fdb695 Marc Zyngier 2021-10-25 862 <0 0 0 4 &port00 0 0 0 3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 863 };
ff2a8d91d80c54 Mark Kettenis 2021-10-25 864
128888a6fdb695 Marc Zyngier 2021-10-25 865 port01: pci@1,0 {
ff2a8d91d80c54 Mark Kettenis 2021-10-25 866 device_type = "pci";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 867 reg = <0x800 0x0 0x0 0x0 0x0>;
5b970dfcfee9e0 Marc Zyngier 2021-11-23 868 reset-gpios = <&pinctrl_ap 153 GPIO_ACTIVE_LOW>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 869
ff2a8d91d80c54 Mark Kettenis 2021-10-25 870 #address-cells = <3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 871 #size-cells = <2>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 872 ranges;
128888a6fdb695 Marc Zyngier 2021-10-25 873
128888a6fdb695 Marc Zyngier 2021-10-25 874 interrupt-controller;
128888a6fdb695 Marc Zyngier 2021-10-25 875 #interrupt-cells = <1>;
128888a6fdb695 Marc Zyngier 2021-10-25 876
128888a6fdb695 Marc Zyngier 2021-10-25 877 interrupt-map-mask = <0 0 0 7>;
128888a6fdb695 Marc Zyngier 2021-10-25 878 interrupt-map = <0 0 0 1 &port01 0 0 0 0>,
128888a6fdb695 Marc Zyngier 2021-10-25 879 <0 0 0 2 &port01 0 0 0 1>,
128888a6fdb695 Marc Zyngier 2021-10-25 880 <0 0 0 3 &port01 0 0 0 2>,
128888a6fdb695 Marc Zyngier 2021-10-25 881 <0 0 0 4 &port01 0 0 0 3>;
a0189fdfb73dac Janne Grunau 2023-02-14 882 status = "disabled";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 883 };
ff2a8d91d80c54 Mark Kettenis 2021-10-25 884
128888a6fdb695 Marc Zyngier 2021-10-25 885 port02: pci@2,0 {
ff2a8d91d80c54 Mark Kettenis 2021-10-25 886 device_type = "pci";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 887 reg = <0x1000 0x0 0x0 0x0 0x0>;
5b970dfcfee9e0 Marc Zyngier 2021-11-23 888 reset-gpios = <&pinctrl_ap 33 GPIO_ACTIVE_LOW>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 889
ff2a8d91d80c54 Mark Kettenis 2021-10-25 890 #address-cells = <3>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 891 #size-cells = <2>;
ff2a8d91d80c54 Mark Kettenis 2021-10-25 892 ranges;
128888a6fdb695 Marc Zyngier 2021-10-25 893
128888a6fdb695 Marc Zyngier 2021-10-25 894 interrupt-controller;
128888a6fdb695 Marc Zyngier 2021-10-25 895 #interrupt-cells = <1>;
128888a6fdb695 Marc Zyngier 2021-10-25 896
128888a6fdb695 Marc Zyngier 2021-10-25 897 interrupt-map-mask = <0 0 0 7>;
128888a6fdb695 Marc Zyngier 2021-10-25 898 interrupt-map = <0 0 0 1 &port02 0 0 0 0>,
128888a6fdb695 Marc Zyngier 2021-10-25 899 <0 0 0 2 &port02 0 0 0 1>,
128888a6fdb695 Marc Zyngier 2021-10-25 900 <0 0 0 3 &port02 0 0 0 2>,
128888a6fdb695 Marc Zyngier 2021-10-25 901 <0 0 0 4 &port02 0 0 0 3>;
a0189fdfb73dac Janne Grunau 2023-02-14 902 status = "disabled";
ff2a8d91d80c54 Mark Kettenis 2021-10-25 903 };
ff2a8d91d80c54 Mark Kettenis 2021-10-25 904 };
7d2d16ccf15d8e Hector Martin 2021-02-04 905 };
7d2d16ccf15d8e Hector Martin 2021-02-04 906 };
106ba3b48a35dd Hector Martin 2021-11-24 907
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
2024-11-26 16:34 ` Sasha Finkelstein
(?)
@ 2024-11-30 9:29 ` Dmitry Baryshkov
2024-11-30 11:15 ` Sasha Finkelstein
-1 siblings, 1 reply; 26+ messages in thread
From: Dmitry Baryshkov @ 2024-11-30 9:29 UTC (permalink / raw)
To: fnkl.kernel
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel, Nick Chan
On Tue, Nov 26, 2024 at 05:34:22PM +0100, Sasha Finkelstein via B4 Relay wrote:
> From: Sasha Finkelstein <fnkl.kernel@gmail.com>
>
> This is the display panel used for the touchbar on laptops that have it.
>
> Co-developed-by: Nick Chan <towinchenmi@gmail.com>
> Signed-off-by: Nick Chan <towinchenmi@gmail.com>
> Signed-off-by: Sasha Finkelstein <fnkl.kernel@gmail.com>
> ---
> drivers/gpu/drm/panel/Kconfig | 9 +++
> drivers/gpu/drm/panel/Makefile | 1 +
> drivers/gpu/drm/panel/panel-summit.c | 143 +++++++++++++++++++++++++++++++++++
> 3 files changed, 153 insertions(+)
>
> diff --git a/drivers/gpu/drm/panel/Kconfig b/drivers/gpu/drm/panel/Kconfig
> index d7469c565d1db8b8e974dd6c45d03d9352d99d63..5085a82e4bc695e85cabbc3200859bbe10cb0f91 100644
> --- a/drivers/gpu/drm/panel/Kconfig
> +++ b/drivers/gpu/drm/panel/Kconfig
> @@ -925,6 +925,15 @@ config DRM_PANEL_SIMPLE
> that it can be automatically turned off when the panel goes into a
> low power state.
>
> +config DRM_PANEL_SUMMIT
> + tristate "Apple Summit display panel"
> + depends on OF
> + depends on DRM_MIPI_DSI
> + depends on BACKLIGHT_CLASS_DEVICE
> + help
> + Say Y if you want to enable support for the "Summit" display panel
> + used as a touchbar on certain Apple laptops.
> +
> config DRM_PANEL_SYNAPTICS_R63353
> tristate "Synaptics R63353-based panels"
> depends on OF
> diff --git a/drivers/gpu/drm/panel/Makefile b/drivers/gpu/drm/panel/Makefile
> index 7dcf72646cacff11bab90c78e3b8b1f357e5f14a..10ac2e850f5cd6d6546439de75483466e4015d1a 100644
> --- a/drivers/gpu/drm/panel/Makefile
> +++ b/drivers/gpu/drm/panel/Makefile
> @@ -89,6 +89,7 @@ obj-$(CONFIG_DRM_PANEL_SHARP_LS060T1SX01) += panel-sharp-ls060t1sx01.o
> obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7701) += panel-sitronix-st7701.o
> obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7703) += panel-sitronix-st7703.o
> obj-$(CONFIG_DRM_PANEL_SITRONIX_ST7789V) += panel-sitronix-st7789v.o
> +obj-$(CONFIG_DRM_PANEL_SUMMIT) += panel-summit.o
> obj-$(CONFIG_DRM_PANEL_SYNAPTICS_R63353) += panel-synaptics-r63353.o
> obj-$(CONFIG_DRM_PANEL_SONY_ACX565AKM) += panel-sony-acx565akm.o
> obj-$(CONFIG_DRM_PANEL_SONY_TD4353_JDI) += panel-sony-td4353-jdi.o
> diff --git a/drivers/gpu/drm/panel/panel-summit.c b/drivers/gpu/drm/panel/panel-summit.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..16bd9fa1213d7bc3f022b878ea5cfeadbd468995
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-summit.c
> @@ -0,0 +1,143 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +
> +#include <linux/backlight.h>
> +#include <drm/drm_device.h>
> +#include <drm/drm_mipi_dsi.h>
> +#include <drm/drm_mode.h>
> +#include <drm/drm_modes.h>
> +#include <drm/drm_panel.h>
> +#include <video/mipi_display.h>
> +
> +struct summit_data {
> + struct mipi_dsi_device *dsi;
> + struct backlight_device *bl;
> + struct drm_panel panel;
> +};
> +
> +static int summit_set_brightness(struct device *dev)
> +{
> + struct summit_data *s_data = dev_get_drvdata(dev);
> + int level = backlight_get_brightness(s_data->bl);
> +
> + return mipi_dsi_dcs_set_display_brightness(s_data->dsi, level);
> +}
Inline this function.
> +
> +static int summit_bl_update_status(struct backlight_device *dev)
> +{
> + return summit_set_brightness(&dev->dev);
> +}
> +
> +static int summit_bl_get_brightness(struct backlight_device *dev)
> +{
> + return backlight_get_brightness(dev);
> +}
Should not be necessary, please drop. Moreover
backlight_get_brightness() uses blanking information to override
brightness. As such it is not suitable for the .get_brightness()
callback.
> +
> +static const struct backlight_ops summit_bl_ops = {
> + .get_brightness = summit_bl_get_brightness,
> + .update_status = summit_bl_update_status,
> +};
> +
> +static int summit_get_modes(struct drm_panel *panel,
> + struct drm_connector *connector)
> +{
> + struct drm_display_mode *mode = drm_mode_create(connector->dev);
> +
> + connector->display_info.non_desktop = true;
> + drm_object_property_set_value(&connector->base,
> + connector->dev->mode_config.non_desktop_property,
> + connector->display_info.non_desktop);
> +
> + mode->vdisplay = 2008;
> + mode->hdisplay = 60;
> + mode->hsync_start = mode->hdisplay + 8;
> + mode->hsync_end = mode->hsync_start + 80;
> + mode->htotal = mode->hsync_end + 40;
> + mode->vsync_start = mode->vdisplay + 1;
> + mode->vsync_end = mode->vsync_start + 15;
> + mode->vtotal = mode->vsync_end + 6;
> + mode->clock = (mode->vtotal * mode->htotal * 60) / 1000;
> + mode->type = DRM_MODE_TYPE_DRIVER | DRM_MODE_TYPE_PREFERRED;
> + mode->flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_NVSYNC;
> + drm_mode_set_name(mode);
> + drm_mode_probed_add(connector, mode);
> + return 1;
> +}
> +
> +static const struct drm_panel_funcs summit_panel_funcs = {
> + .get_modes = summit_get_modes,
> +};
> +
> +static int summit_probe(struct mipi_dsi_device *dsi)
> +{
> + struct backlight_properties props = { 0 };
> + struct device *dev = &dsi->dev;
> + struct summit_data *s_data;
> + int ret;
> +
> + s_data = devm_kzalloc(dev, sizeof(*s_data), GFP_KERNEL);
> + if (!s_data)
> + return -ENOMEM;
> +
> + mipi_dsi_set_drvdata(dsi, s_data);
> + s_data->dsi = dsi;
> +
> + ret = device_property_read_u32(dev, "max-brightness", &props.max_brightness);
> + if (ret)
> + return ret;
> + props.type = BACKLIGHT_RAW;
> +
> + s_data->bl = devm_backlight_device_register(dev, dev_name(dev),
> + dev, s_data, &summit_bl_ops, &props);
> + if (IS_ERR(s_data->bl))
> + return PTR_ERR(s_data->bl);
> +
> + drm_panel_init(&s_data->panel, dev, &summit_panel_funcs,
> + DRM_MODE_CONNECTOR_DSI);
> + drm_panel_add(&s_data->panel);
> +
> + return mipi_dsi_attach(dsi);
> +}
> +
> +static void summit_remove(struct mipi_dsi_device *dsi)
> +{
> + struct summit_data *s_data = mipi_dsi_get_drvdata(dsi);
> +
> + mipi_dsi_detach(dsi);
> + drm_panel_remove(&s_data->panel);
> +}
> +
> +static int summit_resume(struct device *dev)
> +{
> + return summit_set_brightness(dev);
Doesn't the generic code already handle that for you?
> +}
> +
> +static int summit_suspend(struct device *dev)
> +{
> + struct summit_data *s_data = dev_get_drvdata(dev);
> +
> + return mipi_dsi_dcs_set_display_brightness(s_data->dsi, 0);
And here too.
> +}
> +
> +static DEFINE_SIMPLE_DEV_PM_OPS(summit_pm_ops, summit_suspend,
> + summit_resume);
> +
> +static const struct of_device_id summit_of_match[] = {
> + { .compatible = "apple,summit" },
> + {},
> +};
> +
> +MODULE_DEVICE_TABLE(of, summit_of_match);
> +
> +static struct mipi_dsi_driver summit_driver = {
> + .probe = summit_probe,
> + .remove = summit_remove,
> + .driver = {
> + .name = "panel-summit",
> + .of_match_table = summit_of_match,
> + .pm = pm_sleep_ptr(&summit_pm_ops),
> + },
> +};
> +module_mipi_dsi_driver(summit_driver);
> +
> +MODULE_DESCRIPTION("Summit Display Panel Driver");
> +MODULE_LICENSE("GPL");
>
> --
> 2.47.1
>
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
2024-11-30 9:29 ` Dmitry Baryshkov
@ 2024-11-30 11:15 ` Sasha Finkelstein
2024-11-30 11:36 ` Dmitry Baryshkov
0 siblings, 1 reply; 26+ messages in thread
From: Sasha Finkelstein @ 2024-11-30 11:15 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel, Nick Chan
On Sat, 30 Nov 2024 at 10:29, Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
> > +
> > +static int summit_resume(struct device *dev)
> > +{
> > + return summit_set_brightness(dev);
>
> Doesn't the generic code already handle that for you?
Apparently not, I have commented out the pm ops, entered sleep
and the display stayed on.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
2024-11-30 11:15 ` Sasha Finkelstein
@ 2024-11-30 11:36 ` Dmitry Baryshkov
2025-01-12 20:27 ` Sasha Finkelstein
0 siblings, 1 reply; 26+ messages in thread
From: Dmitry Baryshkov @ 2024-11-30 11:36 UTC (permalink / raw)
To: Sasha Finkelstein
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel, Nick Chan
On Sat, Nov 30, 2024 at 12:15:25PM +0100, Sasha Finkelstein wrote:
> On Sat, 30 Nov 2024 at 10:29, Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
> > > +
> > > +static int summit_resume(struct device *dev)
> > > +{
> > > + return summit_set_brightness(dev);
> >
> > Doesn't the generic code already handle that for you?
>
> Apparently not, I have commented out the pm ops, entered sleep
> and the display stayed on.
Please add BL_CORE_SUSPENDRESUME option to the backlight device.
But interestingly enough, none of the panels set that flag.
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display
2024-11-30 11:36 ` Dmitry Baryshkov
@ 2025-01-12 20:27 ` Sasha Finkelstein
0 siblings, 0 replies; 26+ messages in thread
From: Sasha Finkelstein @ 2025-01-12 20:27 UTC (permalink / raw)
To: Dmitry Baryshkov
Cc: Hector Martin, Sven Peter, Alyssa Rosenzweig, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Neil Armstrong,
Jessica Zhang, asahi, linux-arm-kernel, dri-devel, devicetree,
linux-kernel, Nick Chan
On Sat, 30 Nov 2024 at 12:36, Dmitry Baryshkov
<dmitry.baryshkov@linaro.org> wrote:
> Please add BL_CORE_SUSPENDRESUME option to the backlight device.
> But interestingly enough, none of the panels set that flag.
It appears that setting that option re-orders something in the resume process
in such a way that the entire display locks up and becomes unusable until
the machine is rebooted. I will be sending v3 without this change.
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2025-01-12 20:27 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-26 16:34 [PATCH v2 0/5] Driver for pre-DCP apple display controller Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
2024-11-26 16:34 ` [PATCH v2 1/5] dt-bindings: display: Add Apple pre-DCP display controller bindings Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
2024-11-26 16:46 ` Krzysztof Kozlowski
2024-11-26 16:54 ` Krzysztof Kozlowski
2024-11-26 17:00 ` Sasha Finkelstein
2024-11-26 17:20 ` Krzysztof Kozlowski
2024-11-26 18:24 ` Hector Martin
2024-11-26 18:33 ` Sasha Finkelstein
2024-11-26 18:25 ` Nick Chan
2024-11-26 16:34 ` [PATCH v2 2/5] drm: adp: Add Apple Display Pipe driver Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
2024-11-26 21:00 ` Alyssa Ross
2024-11-26 16:34 ` [PATCH v2 3/5] drm: panel: Add a panel driver for the Summit display Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
2024-11-30 9:29 ` Dmitry Baryshkov
2024-11-30 11:15 ` Sasha Finkelstein
2024-11-30 11:36 ` Dmitry Baryshkov
2025-01-12 20:27 ` Sasha Finkelstein
2024-11-26 16:34 ` [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
2024-11-26 16:47 ` Krzysztof Kozlowski
2024-11-26 16:34 ` [PATCH v2 5/5] MAINTAINERS: Add entries for touchbar display driver Sasha Finkelstein via B4 Relay
2024-11-26 16:34 ` Sasha Finkelstein
-- strict thread matches above, loose matches on Subject: below --
2024-11-28 20:36 [PATCH v2 4/5] arm64: dts: apple: Add touchbar screen nodes kernel test robot
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.