drm: Add support for IPK DSI Host Driver
Subsystems (3)
cover drm: Add support for IPK DSI Host Driver
This patch series adds support for the display subsystem in the Synopsys DesignWare IPK devices.
The display pipeline is limited and does not have access to memory, the validation is done using a VPG (Video Pattern Generator), as DPI stimulus for the DW MIPI DSI Host.
A Synopsys DesignWare MIPI DSI Host v1.40 is used in the IPK device, that so far, is fully compatible with the driver dw-mipi-dsi.
To activate the VPG use the sysfs pattern variable, assigning values from 0 (shutdown) to 4. The usage of the VPG and the Synopsys DesignWare MIPI DSI Host internal video generator is mutually exclusive.
The submission of this driver aims to be used as a work base for the submission of enhancements over the Synopsys DesignWare MIPI DSI Host.
Angelo Ribeiro (4):
dt-bindings: display: Add IPK DSI subsystem bindings
drm: ipk: Add DRM driver for DesignWare IPK DSI
drm: ipk: Add extensions for DW MIPI DSI Host driver
MAINTAINERS: Add IPK MIPI DSI Host driver entry
.../bindings/display/snps,dw-ipk-dsi.yaml | 163 ++++++ .../bindings/display/snps,dw-ipk-vpg.yaml | 77 +++ MAINTAINERS | 8 + drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/ipk/Kconfig | 22 + drivers/gpu/drm/ipk/Makefile | 8 + drivers/gpu/drm/ipk/dw-drv.c | 189 +++++++ drivers/gpu/drm/ipk/dw-ipk.h | 30 ++ drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c | 556 ++++++++++++++++++++ drivers/gpu/drm/ipk/dw-vpg.c | 559 +++++++++++++++++++++ drivers/gpu/drm/ipk/dw-vpg.h | 55 ++ 12 files changed, 1670 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.yaml create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml create mode 100644 drivers/gpu/drm/ipk/Kconfig create mode 100644 drivers/gpu/drm/ipk/Makefile create mode 100644 drivers/gpu/drm/ipk/dw-drv.c create mode 100644 drivers/gpu/drm/ipk/dw-ipk.h create mode 100644 drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c create mode 100644 drivers/gpu/drm/ipk/dw-vpg.c create mode 100644 drivers/gpu/drm/ipk/dw-vpg.h
Signature · 1 line
2.7.4
PATCH 1/4 dt-bindings: display: Add IPK DSI subsystem bindings
Add dt-bindings for Synopsys DesignWare MIPI DSI Host and VPG (Video Pattern Generator) support in the IPK display subsystem.
The Synopsys DesignWare IPK display video pipeline is composed by a DSI controller (snps,dw-ipk-dsi) and a VPG (snps,dw-ipk-vpg) as DPI stimulus. Typically is used the Raspberry Pi (raspberrypi,7inch-touchscreen-panel) as DSI panel that requires a I2C controller (snps,designware-i2c).
--- .../bindings/display/snps,dw-ipk-dsi.yaml | 163 +++++++++++++++++++++ .../bindings/display/snps,dw-ipk-vpg.yaml | 77 ++++++++++ 2 files changed, 240 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.yaml create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml
Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.yaml new file +163 -0
@@ -0,0 +1,163 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/display/snps,dw-ipk-dsi.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Synopsys DesignWare IPK specific extensions for the Synopsys DSI host + controller. + +maintainers: + - Angelo Ribeiro <[email protected]> + +description: + The Synopsys DesignWare IPK DSI controller uses the Synopsys DesignWare MIPI + DSI host controller. + For more info please refer to + Documentation/devicetree/bindings/display/bridge/dw_mipi_dsi.txt. + +properties: + compatible: + const: snps,dw-ipk-dsi + + reg: + minItems: 2 + maxItems: 2 + items: + - description: DW MIPI DSI Host registers + - description: DW Phy registers + + reg-names: + items: + - const: dsi + - const: phy + + clocks: + minItems: 2 + maxItems: 3 + items: + - description: Peripheral clock + - description: PLL clock + - description: Pixel clock + + clock-names: + items: + - const: pclk + - const: ref + - const: px_clk + + resets: + maxItems: 1 + items: + - description: APB reset line + + reset-names: + items: + - const: apb + + ports: + type: object + description: + A port node as defined in + Documentation/devicetree/bindings/media/video-interfaces.txt and + Documentation/devicetree/bindings/graph.txt. + properties: + port@0: + type: object + description: + Input endpoint of the controller, connects to a DPI source. + + port@1: + type: object + description: + Output endpoint of the controller, connects to a panel or a bridge + input port. + +patternProperties: + "^(panel|panel-dsi)@[0-9]$": + type: object + description: + A node containing the panel or bridge description as defined in + Documentation/devicetree/bindings/display/mipi-dsi-bus.txt. + properties: + port: + type: object + description: + Panel or bridge port node connected to the DSI output port (port@1). + + "#address-cells": + const: 1 + + "#size-cells": + const: 0 + +required: + - "#address-cells" + - "#size-cells" + - compatible + - reg + - reg-names + - clocks + - clock-names + - reset + - reset-names + - ports + +additionalProperties: false + +examples: + - | + dsi1: dw-ipk-dsi@0x02000 { + compatible = "snps,dw-ipk-dsi"; + reg = <0x02000 0xfff>, <0x05000 0xfff>; + reg-names = "dsi", "phy"; + clocks = <&apb_clk>, <&pll_clk>; + clock-names = "pclk", "ref"; + resets = <&ipk_rst 1>; + reset-names = "apb"; + + #address-cells = <1>; + #size-cells = <0>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dsi1_in: endpoint@0 { + remote-endpoint = <&vbridge_out>; + }; + }; + + port@1 { + reg = <1>; + dsi_out_port: endpoint { + remote-endpoint = <&panel_dsi_port>; + }; + }; + }; + }; + + i2c@0x01000 { + compatible = "snps,designware-i2c"; + reg = <0x01000 0x100>; + clock-frequency = <400000>; + clocks = <&i2cclk>; + interrupts = <0>; + resets = <&ipk_rst 0>; + reset-names = "i2c"; + + lcd@45 { + compatible = "raspberrypi,7inch-touchscreen-panel"; + reg = <0x45>; + + port { + panel_dsi_port: endpoint { + remote-endpoint = <&dsi_out_port>; + }; + }; + }; + }; + +...
Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml new file +77 -0
77 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 3/4 drm: ipk: Add extensions for DW MIPI DSI Host driver
In reply to Angelo RibeiroAdd Synopsys DesignWare IPK specific extensions for Synopsys DesignWare MIPI DSI Host driver.
--- drivers/gpu/drm/ipk/Kconfig | 9 + drivers/gpu/drm/ipk/Makefile | 2 + drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c | 556 ++++++++++++++++++++++++++++++++++ 3 files changed, 567 insertions(+) create mode 100644 drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c
drivers/gpu/drm/ipk/Kconfig +9 -0
@@ -11,3 +11,12 @@ config DRM_IPK Enable support for the Synopsys DesignWare DRM DSI. To compile this driver as a module, choose M here: the module will be called ipk-drm. + +config DRM_IPK_DSI + tristate "Synopsys DesignWare IPK specific extensions for MIPI DSI" + depends on DRM_IPK + select DRM_DW_MIPI_DSI + help + Choose this option for Synopsys DesignWare IPK MIPI DSI support. + To compile this driver as a module, choose M here: the module + will be called dw-mipi-dsi-ipk.
drivers/gpu/drm/ipk/Makefile +2 -0
@@ -4,3 +4,5 @@ ipk-drm-y := \ dw-vpg.o obj-$(CONFIG_DRM_IPK) += ipk-drm.o + +obj-$(CONFIG_DRM_IPK_DSI) += dw-mipi-dsi-ipk.o
drivers/gpu/drm/ipk/dw-mipi-dsi-ipk.c new file +556 -0
556 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 2/4 drm: ipk: Add DRM driver for DesignWare IPK DSI
In reply to Angelo RibeiroAdd support for Synopsys DesignWare VPG (Video Pattern Generator) and DRM driver for Synopsys DesignWare DSI Host IPK solution.
--- drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/ipk/Kconfig | 13 + drivers/gpu/drm/ipk/Makefile | 6 + drivers/gpu/drm/ipk/dw-drv.c | 189 +++++++++++++++ drivers/gpu/drm/ipk/dw-ipk.h | 30 +++ drivers/gpu/drm/ipk/dw-vpg.c | 559 +++++++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/ipk/dw-vpg.h | 55 +++++ 8 files changed, 855 insertions(+) create mode 100644 drivers/gpu/drm/ipk/Kconfig create mode 100644 drivers/gpu/drm/ipk/Makefile create mode 100644 drivers/gpu/drm/ipk/dw-drv.c create mode 100644 drivers/gpu/drm/ipk/dw-ipk.h create mode 100644 drivers/gpu/drm/ipk/dw-vpg.c create mode 100644 drivers/gpu/drm/ipk/dw-vpg.h
drivers/gpu/drm/Kconfig +2 -0
@@ -388,6 +388,8 @@ source "drivers/gpu/drm/mcde/Kconfig" source "drivers/gpu/drm/tidss/Kconfig" +source "drivers/gpu/drm/ipk/Kconfig" + # Keep legacy drivers last menuconfig DRM_LEGACY
drivers/gpu/drm/Makefile +1 -0
@@ -124,3 +124,4 @@ obj-$(CONFIG_DRM_PANFROST) += panfrost/ obj-$(CONFIG_DRM_ASPEED_GFX) += aspeed/ obj-$(CONFIG_DRM_MCDE) += mcde/ obj-$(CONFIG_DRM_TIDSS) += tidss/ +obj-$(CONFIG_DRM_IPK) += ipk/
drivers/gpu/drm/ipk/Kconfig new file +13 -0
@@ -0,0 +1,13 @@ +# SPDX-License-Identifier: GPL-2.0-only +config DRM_IPK + tristate "DRM Support for Synopsys DesignWare IPK DSI" + depends on DRM + select DRM_KMS_HELPER + select DRM_GEM_CMA_HELPER + select DRM_KMS_CMA_HELPER + select DRM_PANEL_BRIDGE + select VIDEOMODE_HELPERS + help + Enable support for the Synopsys DesignWare DRM DSI. + To compile this driver as a module, choose M here: the module + will be called ipk-drm.
drivers/gpu/drm/ipk/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# SPDX-License-Identifier: GPL-2.0-only +ipk-drm-y := \ + dw-drv.o \ + dw-vpg.o + +obj-$(CONFIG_DRM_IPK) += ipk-drm.o
drivers/gpu/drm/ipk/dw-drv.c new file +189 -0
189 lines not on this page · raw message
drivers/gpu/drm/ipk/dw-ipk.h new file +30 -0
@@ -0,0 +1,30 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* +* Copyright (c) 2019-2020 Synopsys, Inc. and/or its affiliates. +* Synopsys DesignWare MIPI DSI Controller +*/ + +#ifndef _DW_IPK_H +#define _DW_IPK_H + +#include "drm/drm_device.h" +#include <drm/bridge/dw_mipi_dsi.h> + +struct ipk_pipeline { +struct drm_framebuffer *fb; +struct drm_crtc crtc; +struct drm_plane *plane; +struct drm_bridge *bridge; +}; + +struct ipk_device { +struct drm_device drm; +struct platform_device *platform; +struct ipk_pipeline pipeline; +struct vpg_device *vpg; +}; + +#define drm_device_to_ipk_device (target) \ + container_of(target, struct ipk_device, drm) + +#endif /* _DW_IPK_H */
drivers/gpu/drm/ipk/dw-vpg.c new file +559 -0
559 lines not on this page · raw message
drivers/gpu/drm/ipk/dw-vpg.h new file +55 -0
55 lines not on this page · raw message
Signature · 1 line
2.7.4
PATCH 4/4 MAINTAINERS: Add IPK MIPI DSI Host driver entry
In reply to Angelo RibeiroCreates entry for Synopsys DesignWare IPK MIPI DSI host driver and adds myself as maintainer.
--- MAINTAINERS | 8 ++++++++ 1 file changed, 8 insertions(+)
MAINTAINERS +8 -0
@@ -5445,6 +5445,14 @@ S: Maintained F: drivers/gpu/drm/mcde/ F: Documentation/devicetree/bindings/display/ste,mcde.txt +DRM DRIVER FOR SYNOPSYS DESIGNWARE IPK +M: Angelo Ribeiro <[email protected]> +L: [email protected] +S: Maintained +F: drivers/gpu/drm/ipk/ +F: Documentation/devicetree/bindings/display/ipk/ +T: git git://anongit.freedesktop.org/drm/drm-misc + DRM DRIVER FOR TDFX VIDEO CARDS S: Orphan / Obsolete F: drivers/gpu/drm/tdfx/
Signature · 1 line
2.7.4
Rob Herring
maintainerRe: [PATCH 1/4] dt-bindings: display: Add IPK DSI subsystem bindings
In reply to Angelo RibeiroQuoted 14 lines · Angelo Ribeiro
Add dt-bindings for Synopsys DesignWare MIPI DSI Host and VPG (Video Pattern Generator) support in the IPK display subsystem.
The Synopsys DesignWare IPK display video pipeline is composed by a DSI controller (snps,dw-ipk-dsi) and a VPG (snps,dw-ipk-vpg) as DPI stimulus. Typically is used the Raspberry Pi (raspberrypi,7inch-touchscreen-panel) as DSI panel that requires a I2C controller (snps,designware-i2c).
Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Rob Herring <[email protected]>Cc Mark Rutland <[email protected]>Signed-off-by Angelo Ribeiro <[email protected]>
Quoted 7 lines
--- .../bindings/display/snps,dw-ipk-dsi.yaml | 163 +++++++++++++++++++++ .../bindings/display/snps,dw-ipk-vpg.yaml | 77 ++++++++++ 2 files changed, 240 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-dsi.yaml create mode 100644 Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml
My bot found errors running 'make dt_binding_check' on your patch:
/builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml: properties:reg:minItems: False schema does not allow 2 /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml: properties:reg:maxItems: False schema does not allow 2 /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml: properties:resets:minItems: False schema does not allow 2 /builds/robherring/linux-dt-review/Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.yaml: properties:resets:maxItems: False schema does not allow 2 Documentation/devicetree/bindings/Makefile:12: recipe for target 'Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.example.dts' failed make[1]: *** [Documentation/devicetree/bindings/display/snps,dw-ipk-vpg.example.dts] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1262: recipe for target 'dt_binding_check' failed
make: *** [dt_binding_check] Error 2
See https://patchwork.ozlabs.org/patch/1260819
If you already ran 'make dt_binding_check' and didn't see the above error(s), then make sure dt-schema is up to date:
pip3 install git+https://github.com/devicetree-org/dt-schema.git@master --upgrade
Please check and re-submit.