[PATCH 1/4 v2] drm: Add support of ARC PGU display controller

2016-03-03 Thread Alexey Brodkin
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.

Signed-off-by: Alexey Brodkin 
Cc: David Airlie 
Cc: dri-devel at lists.freedesktop.org
Cc: linux-snps-arc at lists.infradead.org
---

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

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 08706f0..654a9cb 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 6eb94fc..c338d04 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -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/
diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig
new file mode 100644
index 000..f9a13b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/Kconfig
@@ -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.
diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile
new file mode 100644
index 000..d48fda7
--- /dev/null
+++ b/drivers/gpu/drm/arc/Makefile
@@ -0,0 +1,2 @@
+arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
+obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
new file mode 100644
index 000..d6a5cf5
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu.h
@@ -0,0 +1,47 @@
+/*
+ * 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_headevent_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);
+
+#endif
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
b/drivers/gpu/drm/arc/arcpgu_crtc.c
new file mode 100644
index 000..0fe5c8a
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -0,0 +1,274 @@
+/*
+ * 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 imp

[PATCH 0/4 v2] drm: Add support of ARC PGU display controller

2016-03-03 Thread Alexey Brodkin
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

Cc: David Airlie 
Cc: devicetree at vger.kernel.org
Cc: dri-devel at lists.freedesktop.org
Cc: Ian Campbell 
Cc: Kumar Gala 
Cc: linux-snps-arc at lists.infradead.org
Cc: Mark Rutland 
Cc: Pawel Moll 
Cc: Rob Herring 
Cc: Vineet Gupta 

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

-- 
2.5.0



[PATCH 2/4 RESEND] ARC: axs10x: Update defconfigs so that audio is enabled

2016-02-24 Thread Alexey Brodkin
Hi Vineet,

On Wed, 2016-02-24 at 04:36 +, Vineet Gupta wrote:
> On Tuesday 23 February 2016 07:22 PM, Jose Abreu wrote:
> > The defconfigs for the AXS boards were updated so that
> > ALSA SoC is enabled and also the audio for the ADV7511
> > HDMI transmitter.
> > 
> > Signed-off-by: Jose Abreu 
> > ---
> >  arch/arc/configs/axs101_defconfig     | 3 +++
> >  arch/arc/configs/axs103_defconfig     | 5 +
> >  arch/arc/configs/axs103_smp_defconfig | 5 +
> 
> @Alexey, has this been tested on AXS103. Do we have the right PLL / clocks to 
> get
> the audio rates - given the lower master clk.

I think I tried first version of these patches on axs103 as well.
But may assume Jose have no access to axs103 and so this particular
implementation may lack tests on axs103 platform. Still this is easy to
fix - I'll try it myself now.

> Further per out off-list discussion - let us have a seperate config for ARC 
> HS SDP
> which supports the shipping single hardware configuration and add these fancy
> things there as well as bumping the clk rate to 100 MHz . Current axs103* 
> configs
> are more of developer configs and I don't want to bloat their code with 
> things we
> don't build / download 10 times a day !

Agree but first we need to introduce those additional configs.
Let me draft those.

In the meantime it would be helpful if you take a look at existing 
axs10x_defconfigs
and check which option you do want to keep and what are those extra once that 
should
go to new configs with all bells and whistles.


-Alexey


[PATCH 1/4] drm: Add support of ARC PGU display controller

2016-02-19 Thread Alexey Brodkin
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.

Signed-off-by: Alexey Brodkin 
Cc: David Airlie 
Cc: dri-devel at lists.freedesktop.org
Cc: linux-snps-arc at lists.infradead.org
---
 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

diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig
index 08706f0..654a9cb 100644
--- a/drivers/gpu/drm/Kconfig
+++ b/drivers/gpu/drm/Kconfig
@@ -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"
diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile
index 6eb94fc..c338d04 100644
--- a/drivers/gpu/drm/Makefile
+++ b/drivers/gpu/drm/Makefile
@@ -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/
diff --git a/drivers/gpu/drm/arc/Kconfig b/drivers/gpu/drm/arc/Kconfig
new file mode 100644
index 000..f9a13b6
--- /dev/null
+++ b/drivers/gpu/drm/arc/Kconfig
@@ -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.
diff --git a/drivers/gpu/drm/arc/Makefile b/drivers/gpu/drm/arc/Makefile
new file mode 100644
index 000..d48fda7
--- /dev/null
+++ b/drivers/gpu/drm/arc/Makefile
@@ -0,0 +1,2 @@
+arcpgu-y := arcpgu_crtc.o arcpgu_hdmi.o arcpgu_drv.o
+obj-$(CONFIG_DRM_ARCPGU) += arcpgu.o
diff --git a/drivers/gpu/drm/arc/arcpgu.h b/drivers/gpu/drm/arc/arcpgu.h
new file mode 100644
index 000..d6a5cf5
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu.h
@@ -0,0 +1,47 @@
+/*
+ * 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_headevent_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);
+
+#endif
diff --git a/drivers/gpu/drm/arc/arcpgu_crtc.c 
b/drivers/gpu/drm/arc/arcpgu_crtc.c
new file mode 100644
index 000..0fe5c8a
--- /dev/null
+++ b/drivers/gpu/drm/arc/arcpgu_crtc.c
@@ -0,0 +1,274 @@
+/*
+ * 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
+ * MERCH

Whats missing in my new FB DRM driver in ARC... waiting for console_lock to return

2016-01-28 Thread Alexey Brodkin
Hi Carlos,

On Thu, 2016-01-21 at 18:30 +, Carlos Palminha wrote:
> hi...
> 
> i just found that its blocking waiting for console_lock...
> @vineet, alexey: i think that console_lock is architecture dependent right? 
> Do you know any issue with console_lock
> for ARC?

I'm not really sure "console_lock" has something to do with ARC architecture.
At least "git grep bconsole_lock" doesn't find anything in "arch/arc".

So I'd assume this is a generic thing.

-Alexey


<    1   2   3