Skip to content

Commit

Permalink
Merge branch 'topic-arcpgu-v6' of https://github.com/foss-for-synopsy…
Browse files Browse the repository at this point in the history
…s-dwc-arc-processors/linux into drm-next

This is DRM driver for ARC PGU - simple bitstreamer used on
Synopsys ARC SDP boards (both AXS101 and AXS103).

* 'topic-arcpgu-v6' of https://github.com/foss-for-synopsys-dwc-arc-processors/linux:
  arc: axs10x - add support of ARC PGU
  MAINTAINERS: Add maintainer for ARC PGU display controller
  drm: Add DT bindings documentation for ARC PGU display controller
  drm: Add support of ARC PGU display controller
  • Loading branch information
Dave Airlie committed Apr 26, 2016
2 parents 33f0fca + b8c1eca commit 944a3f3
Show file tree
Hide file tree
Showing 12 changed files with 947 additions and 0 deletions.
35 changes: 35 additions & 0 deletions Documentation/devicetree/bindings/display/snps,arcpgu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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.

Example:

/ {
...

pgu@XXXXXXXX {
compatible = "snps,arcpgu";
reg = <0xXXXXXXXX 0x400>;
clocks = <&clock_node>;
clock-names = "pxlclk";

port {
pgu_output: endpoint {
remote-endpoint = <&hdmi_enc_input>;
};
};
};
};
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -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@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@arm.com>
S: Supported
Expand Down
61 changes: 61 additions & 0 deletions arch/arc/boot/dts/axs10x_mb.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
clock-frequency = <50000000>;
#clock-cells = <0>;
};

pguclk: pguclk {
#clock-cells = <0>;
compatible = "fixed-clock";
clock-frequency = <74440000>;
};
};

ethernet@0x18000 {
Expand Down Expand Up @@ -155,6 +161,37 @@
clocks = <&i2cclk>;
interrupts = <16>;

adv7511:adv7511@39{
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>;
Expand All @@ -168,6 +205,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>;
Expand Down Expand Up @@ -229,5 +276,19 @@
reg = <2>;
};
};

pgu@17000 {
compatible = "snps,arcpgu";
reg = <0x17000 0x400>;
encoder-slave = <&adv7511>;
clocks = <&pguclk>;
clock-names = "pxlclk";

port {
pgu_output: endpoint {
remote-endpoint = <&adv7511_input>;
};
};
};
};
};
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -281,3 +281,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"
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
10 changes: 10 additions & 0 deletions drivers/gpu/drm/arc/Kconfig
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions drivers/gpu/drm/arc/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
50 changes: 50 additions & 0 deletions drivers/gpu/drm/arc/arcpgu.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/*
* 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 _ARCPGU_H_
#define _ARCPGU_H_

struct arcpgu_drm_private {
void __iomem *regs;
struct clk *clk;
struct drm_fbdev_cma *fbdev;
struct drm_framebuffer *fb;
struct list_head event_list;
struct drm_crtc crtc;
struct drm_plane *plane;
};

#define crtc_to_arcpgu_priv(x) container_of(x, struct arcpgu_drm_private, crtc)

static inline void arc_pgu_write(struct arcpgu_drm_private *arcpgu,
unsigned int reg, u32 value)
{
iowrite32(value, arcpgu->regs + reg);
}

static inline u32 arc_pgu_read(struct arcpgu_drm_private *arcpgu,
unsigned int reg)
{
return ioread32(arcpgu->regs + reg);
}

int arc_pgu_setup_crtc(struct drm_device *dev);
int arcpgu_drm_hdmi_init(struct drm_device *drm, struct device_node *np);
struct drm_fbdev_cma *arcpgu_fbdev_cma_init(struct drm_device *dev,
unsigned int preferred_bpp, unsigned int num_crtc,
unsigned int max_conn_count);

#endif
Loading

0 comments on commit 944a3f3

Please sign in to comment.