drm: Add support of ARC PGU display controller
Subsystems (6)
v2 cover drm: Add support of ARC PGU display controller
This series add support of ARC PGU display controller.
ARC PGU is a quite simple byte streamer that gets data from the framebuffer and pushes it to hte connected encoder (DP or HDMI).
It was tested on ARC SDP boards (axs101 in particular).
Changes v1 -> v2:
* Clean-up of DT bindings documentation
* Added missing "pxlclk" clock in axs10x_mb.dtsi
Alexey Brodkin (4):
drm: Add support of ARC PGU display controller
drm: Add DT bindings documentation for ARC PGU display controller
arc: axs10x - add support of ARC PGU
MAINTAINERS: Add maintainer for ARC PGU display controller
.../devicetree/bindings/display/snps,arcpgu.txt | 33 +++ MAINTAINERS | 6 + arch/arc/boot/dts/axs10x_mb.dtsi | 61 +++++ drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/arc/Kconfig | 10 + drivers/gpu/drm/arc/Makefile | 2 + drivers/gpu/drm/arc/arcpgu.h | 47 ++++ drivers/gpu/drm/arc/arcpgu_crtc.c | 274 +++++++++++++++++++++ drivers/gpu/drm/arc/arcpgu_drv.c | 239 ++++++++++++++++++ drivers/gpu/drm/arc/arcpgu_hdmi.c | 204 +++++++++++++++ drivers/gpu/drm/arc/arcpgu_regs.h | 36 +++ 12 files changed, 915 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt create mode 100644 drivers/gpu/drm/arc/Kconfig create mode 100644 drivers/gpu/drm/arc/Makefile create mode 100644 drivers/gpu/drm/arc/arcpgu.h create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h
Signature · 6 lines
2.5.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 1/4 drm: Add support of ARC PGU display controller
ARC PGU could be found on some development boards from Synopsys. This is a simple byte streamer that reads data from a framebuffer and sends data to the single encoder.
---
No changes since v1.
drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/arc/Kconfig | 10 ++ drivers/gpu/drm/arc/Makefile | 2 + drivers/gpu/drm/arc/arcpgu.h | 47 +++++++ drivers/gpu/drm/arc/arcpgu_crtc.c | 274 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/arc/arcpgu_drv.c | 239 +++++++++++++++++++++++++++++++++ drivers/gpu/drm/arc/arcpgu_hdmi.c | 204 ++++++++++++++++++++++++++++ drivers/gpu/drm/arc/arcpgu_regs.h | 36 +++++ 9 files changed, 815 insertions(+) create mode 100644 drivers/gpu/drm/arc/Kconfig create mode 100644 drivers/gpu/drm/arc/Makefile create mode 100644 drivers/gpu/drm/arc/arcpgu.h create mode 100644 drivers/gpu/drm/arc/arcpgu_crtc.c create mode 100644 drivers/gpu/drm/arc/arcpgu_drv.c create mode 100644 drivers/gpu/drm/arc/arcpgu_hdmi.c create mode 100644 drivers/gpu/drm/arc/arcpgu_regs.h
drivers/gpu/drm/Kconfig +2 -0
@@ -279,3 +279,5 @@ source "drivers/gpu/drm/imx/Kconfig" source "drivers/gpu/drm/vc4/Kconfig" source "drivers/gpu/drm/etnaviv/Kconfig" + +source "drivers/gpu/drm/arc/Kconfig"
drivers/gpu/drm/Makefile +1 -0
@@ -78,3 +78,4 @@ obj-y += panel/ obj-y += bridge/ obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/ obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/ +obj-$(CONFIG_DRM_ARCPGU)+= arc/
drivers/gpu/drm/arc/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +config DRM_ARCPGU + tristate "ARC PGU" + depends on DRM && OF + select DRM_KMS_CMA_HELPER + select DRM_KMS_FB_HELPER + select DRM_KMS_HELPER + help + Choose this option if you have an ARC PGU controller. + + If M is selected the module will be called arcpgu.
drivers/gpu/drm/arc/Makefile new file +2 -0
@@ -0,0 +1,2 @@ +arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o +obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
drivers/gpu/drm/arc/arcpgu.h new file +47 -0
47 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_crtc.c new file +274 -0
274 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_drv.c new file +239 -0
239 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_hdmi.c new file +204 -0
204 lines not on this page · raw message
drivers/gpu/drm/arc/arcpgu_regs.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* ARC PGU DRM driver. +* +* Copyright (C) 2016 Synopsys, Inc. (www.synopsys.com) +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +*/ + +#ifndef _ARC_PGU_REGS_H_ +#define _ARC_PGU_REGS_H_ + +#define ARCPGU_REG_CTRL 0x00 +#define ARCPGU_REG_STAT 0x04 +#define ARCPGU_REG_FMT 0x10 +#define ARCPGU_REG_HSYNC 0x14 +#define ARCPGU_REG_VSYNC 0x18 +#define ARCPGU_REG_ACTIVE 0x1c +#define ARCPGU_REG_BUF0_ADDR 0x40 +#define ARCPGU_REG_STRIDE 0x50 +#define ARCPGU_REG_START_SET 0x84 + +#define ARCPGU_REG_ID 0x3FC + +#define ARCPGU_CTRL_ENABLE_MASK 0x02 +#define ARCPGU_MODE_RGB888_MASK 0x04 +#define ARCPGU_STAT_BUSY_MASK 0x02 + +#endif
Signature · 1 line
2.5.0
kbuild test robot
build botreproduce:
Hi Alexey,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.5-rc6 next-20160303]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Alexey-Brodkin/drm-Add-support-of-ARC-PGU-display-controller/20160303-224311 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: i386-allmodconfig (attached as .config) reproduce: # save the attached .config to linux build tree make ARCH=i386
All error/warnings (new ones prefixed by >>):
In file included from include/drm/drm_vma_manager.h:29:0,
from include/drm/drmP.h:75,
from include/drm/drm_gem_cma_helper.h:4,
from drivers/gpu/drm/arc/arcpgu_drv.c:20:
>> drivers/gpu/drm/arc/arcpgu_drv.c:223:25: error: 'arcpgu_drm_of_table' undeclared here (not in a function)
MODULE_DEVICE_TABLE(of, arcpgu_drm_of_table);
^
>> drivers/gpu/drm/arc/arcpgu_drv.c:223:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, arcpgu_drm_of_table);
^
>> include/linux/module.h:223:27: error: '__mod_of__arcpgu_drm_of_table_device_table' aliased to undefined symbol 'arcpgu_drm_of_table'
extern const typeof(name) __mod_##type##__##name##_device_table \
^
>> drivers/gpu/drm/arc/arcpgu_drv.c:223:1: note: in expansion of macro 'MODULE_DEVICE_TABLE'
MODULE_DEVICE_TABLE(of, arcpgu_drm_of_table);
^vim +/arcpgu_drm_of_table +223 drivers/gpu/drm/arc/arcpgu_drv.c
217
218 static const struct of_device_id arcpgu_of_table[] = {
219 {.compatible = "snps,arcpgu"},
220 {}
221 };
222
> 223 MODULE_DEVICE_TABLE(of, arcpgu_drm_of_table);
224
225 static struct platform_driver arcpgu_platform_driver = {
226 .probe = arcpgu_probe,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 53493 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20160304/55457f60/attachment-0001.obj>
kbuild test robot
build botreproduce: wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # save the attached .config to linux build tree…
Hi Alexey,
[auto build test ERROR on drm/drm-next]
[also build test ERROR on v4.5-rc6 next-20160303]
[if your patch is applied to the wrong git tree, please drop us a note to help improving the system]
url: https://github.com/0day-ci/linux/commits/Alexey-Brodkin/drm-Add-support-of-ARC-PGU-display-controller/20160303-224311 base: git://people.freedesktop.org/~airlied/linux.git drm-next config: openrisc-allmodconfig (attached as .config)
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=openrisc
All errors (new ones prefixed by >>):
drivers/gpu/drm/arc/arcpgu_drv.c:223:1: error: 'arcpgu_drm_of_table' undeclared here (not in a function)
>> drivers/gpu/drm/arc/arcpgu_drv.c:223:1: error: type defaults to 'int' in declaration of '__mod_of__arcpgu_drm_of_table_device_table' >> drivers/gpu/drm/arc/arcpgu_drv.c:223:1: error: '__mod_of__arcpgu_drm_of_table_device_table' aliased to undefined symbol 'arcpgu_drm_of_table' >> drivers/gpu/drm/arc/arcpgu_drv.c:223:1: error: '__mod_of__arcpgu_drm_of_table_device_table' aliased to undefined symbol 'arcpgu_drm_of_table'
vim +223 drivers/gpu/drm/arc/arcpgu_drv.c
217
218 static const struct of_device_id arcpgu_of_table[] = {
219 {.compatible = "snps,arcpgu"},
220 {}
221 };
222
> 223 MODULE_DEVICE_TABLE(of, arcpgu_drm_of_table);
224
225 static struct platform_driver arcpgu_platform_driver = {
226 .probe = arcpgu_probe,
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/octet-stream
Size: 36576 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-snps-arc/attachments/20160304/4dc3b527/attachment-0001.obj>
PATCH v2 2/4 drm: Add DT bindings documentation for ARC PGU display controller
In reply to Alexey BrodkinThis add DT bindings documentation for ARC PGU display controller.
---
Changes v1 -> v2:
* Clean-up
.../devicetree/bindings/display/snps,arcpgu.txt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txt
Documentation/devicetree/bindings/display/snps,arcpgu.txt new file +33 -0
@@ -0,0 +1,33 @@ +ARC PGU + +This is a display controller found on several development boards produced +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a +framebuffer and sends it to a single digital encoder (usually HDMI). + +Required properties: + - compatible: "snps,arcpgu" + - reg: Physical base address and length of the controller's registers. + - clocks: A list of phandle + clock-specifier pairs, one for each + entry in 'clock-names'. + - clock-names: A list of clock names. For ARC PGU it should contain: + - "pxlclk" for the clock feeding the output PLL of the controller. + +Required sub-nodes: + - port: The PGU connection to an encoder chip. The connection is modelled + using the OF graph bindings specified in + Documentation/devicetree/bindings/graph.txt. + +Example: + +/ { + ... + + pgu@XXXXXXXX { + compatible = "snps,arcpgu"; + reg = <0xXXXXXXXX 0x400>; + clocks = <&clock_node>; + clock-names = "pxlclk"; + }; + + ... +};
Signature · 1 line
2.5.0
Rob Herring
maintainerRe: [PATCH 2/4 v2] drm: Add DT bindings documentation for ARC PGU display controller
Quoted 10 lines · Alexey Brodkin
This add DT bindings documentation for ARC PGU display controller.
Signed-off-by Alexey Brodkin <[email protected]>Cc Rob Herring <[email protected]>Cc Pawel Moll <[email protected]>Cc Mark Rutland <[email protected]>Cc Ian Campbell <[email protected]>Cc Kumar Gala <[email protected]>
Quoted 4 lines
---
Changes v1 -> v2:
* Clean-up
Not really useful. What we like to see is what changed. Maintainers have short memories and don't remember what they said previously (unless comments are ignored).
Quoted 30 lines
.../devicetree/bindings/display/snps,arcpgu.txt | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Documentation/devicetree/bindings/display/snps,arcpgu.txtDocumentation/devicetree/bindings/display/snps,arcpgu.txt new file +19
-0@@ -0,0 +1,33 @@ +ARC PGU + +This is a display controller found on several development boards produced +by Synopsys. The ARC PGU is an RGB streamer that reads the data from a +framebuffer and sends it to a single digital encoder (usually HDMI). + +Required properties: + - compatible: "snps,arcpgu" + - reg: Physical base address and length of the controller's registers. + - clocks: A list of phandle + clock-specifier pairs, one for each + entry in 'clock-names'. + - clock-names: A list of clock names. For ARC PGU it should contain: + - "pxlclk" for the clock feeding the output PLL of the controller. + +Required sub-nodes: + - port: The PGU connection to an encoder chip. The connection is modelled + using the OF graph bindings specified in + Documentation/devicetree/bindings/graph.txt. +
Documentation/devicetree/bindings/display/snps,arcpgu.txt line 29
Quoted 10 lines
Documentation/devicetree/bindings/display/snps,arcpgu.txt new file +10
-0+Example: + +/ { + ... + + pgu@XXXXXXXX { + compatible = "snps,arcpgu"; + reg = <0xXXXXXXXX 0x400>; + clocks = <&clock_node>; + clock-names = "pxlclk";
Where's the port? Didn't you previously say it was optional?
Quoted 7 lines
Documentation/devicetree/bindings/display/snps,arcpgu.txt new file +4
-0+ }; + + ... +};Signature · 1 line
2.5.0
Re: [PATCH 2/4 v2] drm: Add DT bindings documentation for ARC PGU display controller
Hi Rob,
Quoted 14 lines · Rob Herring
Quoted 13 lines · Alexey Brodkin
This add DT bindings documentation for ARC PGU display controller.
Signed-off-by Alexey Brodkin <[email protected]>Cc Rob Herring <[email protected]>Cc Pawel Moll <[email protected]>Cc Mark Rutland <[email protected]>Cc Ian Campbell <[email protected]>Cc Kumar Gala <[email protected]>---
Quoted 5 lines
Quoted 2 lines
Changes v1 -> v2:
* Clean-upNot really useful. What we like to see is what changed. Maintainers have short memories and don't remember what they said previously (unless comments are ignored).
That's understood :)
Quoted 35 lines
Quoted 35 lines
.../devicetree/bindings/display/snps,arcpgu.txt | 33 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
1 file changed, 33 insertions(+-)create mode 100644
Documentation/devicetree/bindings/display/snps,arcpgu.txtDocumentation/devicetree/bindings/display/snps,arcpgu.txt new file +1
-1--- /dev/null +-+-+- b/Documentation/devicetree/bindings/display/snps,arcpgu.txt@@ -0,0 +-1,33 @@
+-ARC PGU +- +-This is a display controller found on several development boards produced +-by Synopsys. The ARC PGU is an RGB streamer that reads the data from a +-framebuffer and sends it to a single digital encoder (usually HDMI). +- +-Required properties: +- - compatible: "snps,arcpgu" +- - reg: Physical base address and length of the controller's registers. +- - clocks: A list of phandle +- clock-specifier pairs, one for each +- entry in 'clock-names'. +- - clock-names: A list of clock names. For ARC PGU it should contain: +- - "pxlclk" for the clock feeding the output PLL of the controller. +- +-Required sub-nodes: +- - port: The PGU connection to an encoder chip. The connection is modelled +- using the OF graph bindings specified in +- Documentation/devicetree/bindings/graph.txt. +- +-Example: +- +-/ {
Quoted 8 lines
Quoted 7 lines
+- ... +- +- pgu@XXXXXXXX { +- compatible = "snps,arcpgu"; +- reg = <0xXXXXXXXX 0x400>; +- clocks = <&clock_node>; +- clock-names = "pxlclk";Where's the port? Didn't you previously say it was optional?
Well I wanted to get rid of anything except bare minimal that is required for that driver.
What I did miss in that clean-up is description above. In particular "Required subnodes" section that still lists "port".
And frankly now I'm a bit lost with what should I put in that binding description and what should not. Any comments here are much appreciated.
-Alexey--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
PATCH v2 3/4 arc: axs10x - add support of ARC PGU
In reply to Alexey BrodkinSynopsys DesignWare ARC SDP boards sport ARC SDP display controller attached to ADV7511 HDMI encoder.
That change adds desctiption of both ARC PGU and ADV7511 in ARC SDP'd base-board Device Tree.
---
Changes v1 -> v2:
* Added missing "pxlclk" clock in axs10x_mb.dtsi
arch/arc/boot/dts/axs10x_mb.dtsi | 61 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+)
arch/arc/boot/dts/axs10x_mb.dtsi +61 -0
@@ -34,6 +34,12 @@ clock-frequency = <50000000>; #clock-cells = <0>; }; + + pguclk: pguclk { + #clock-cells = <0>; + compatible = "fixed-clock"; + clock-frequency = <74440000>; + }; }; ethernet@0x18000 {
@@ -147,6 +153,37 @@ clocks = <&i2cclk>; interrupts = <16>; + adv7511:adv7511@0x39{ + compatible="adi,adv7511"; + reg = <0x39>; + interrupts = <23>; + adi,input-depth = <8>; + adi,input-colorspace = "rgb"; + adi,input-clock = "1x"; + adi,clock-delay = <0x03>; + + ports { + #address-cells = <1>; + #size-cells = <0>; + + /* RGB/YUV input */ + port@0 { + reg = <0>; + adv7511_input:endpoint { + remote-endpoint = <&pgu_output>; + }; + }; + + /* HDMI output */ + port@1 { + reg = <1>; + adv7511_output: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; + eeprom@0x54{ compatible = "24c01"; reg = <0x54>;
@@ -160,6 +197,16 @@ }; }; + hdmi0: connector { + compatible = "hdmi-connector"; + type = "a"; + port { + hdmi_connector_in: endpoint { + remote-endpoint = <&adv7511_output>; + }; + }; + }; + gpio0:gpio@13000 { compatible = "snps,dw-apb-gpio"; reg = <0x13000 0x1000>;
@@ -221,5 +268,19 @@ reg = <2>; }; }; + + pgu@0x17000 { + compatible = "snps,arcpgu"; + reg = <0x17000 0x400>; + encoder-slave = <&adv7511>; + clocks = <&pguclk>; + clock-names = "pxlclk"; + + port { + pgu_output: endpoint { + remote-endpoint = <&adv7511_input>; + }; + }; + }; }; };
Signature · 1 line
2.5.0
PATCH v2 4/4 MAINTAINERS: Add maintainer for ARC PGU display controller
In reply to Alexey BrodkinThis updates MAINTEINERS file with information about maintainer of ARC PGU display controller driver.
---
No changes since v1.
MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+)
MAINTAINERS +6 -0
@@ -847,6 +847,12 @@ S: Maintained F: drivers/net/arcnet/ F: include/uapi/linux/if_arcnet.h +ARC PGU DRM DRIVER +M: Alexey Brodkin <abrodkin at synopsys.com> +S: Supported +F: drivers/gpu/drm/arc/ +F: Documentation/devicetree/bindings/display/snps,arcpgu.txt + ARM HDLCD DRM DRIVER M: Liviu Dudau <liviu.dudau at arm.com> S: Supported
Signature · 1 line
2.5.0