From: Rob Clark <robdclark@gmail.com>
To: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Jason Cooper <jason@lakedaemon.net>,
David Airlie <airlied@linux.ie>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
Daniel Vetter <daniel@ffwll.ch>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Subject: Re: [PATCH 4/5] DRM: Armada: start of MMP2/MMP3 support
Date: Thu, 17 Oct 2013 20:11:35 -0400 [thread overview]
Message-ID: <CAF6AEGtTdmdTE_qeojTkPY8WYv86TRuzX-ms3Nb3UQHfvoWRwg@mail.gmail.com> (raw)
In-Reply-To: <E1VSwXQ-0000iL-8N@rmk-PC.arm.linux.org.uk>
On Sun, Oct 6, 2013 at 6:10 PM, Russell King
<rmk+kernel@arm.linux.org.uk> wrote:
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> drivers/gpu/drm/armada/Makefile | 1 +
> drivers/gpu/drm/armada/armada_610.c | 49 ++++++++++++++++++++++++++++++++++
> drivers/gpu/drm/armada/armada_crtc.c | 1 +
> drivers/gpu/drm/armada/armada_drm.h | 1 +
> drivers/gpu/drm/armada/armada_drv.c | 6 ++++
> drivers/gpu/drm/armada/armada_hw.h | 8 +++++
> 6 files changed, 66 insertions(+), 0 deletions(-)
> create mode 100644 drivers/gpu/drm/armada/armada_610.c
>
> diff --git a/drivers/gpu/drm/armada/Makefile b/drivers/gpu/drm/armada/Makefile
> index d6f43e0..088db4a 100644
> --- a/drivers/gpu/drm/armada/Makefile
> +++ b/drivers/gpu/drm/armada/Makefile
> @@ -2,6 +2,7 @@ armada-y := armada_crtc.o armada_drv.o armada_fb.o armada_fbdev.o \
> armada_gem.o armada_output.o armada_overlay.o \
> armada_slave.o
> armada-y += armada_510.o
> +armada-y += armada_610.o
> armada-$(CONFIG_DEBUG_FS) += armada_debugfs.o
>
> obj-$(CONFIG_DRM_ARMADA) := armada.o
> diff --git a/drivers/gpu/drm/armada/armada_610.c b/drivers/gpu/drm/armada/armada_610.c
> new file mode 100644
> index 0000000..36a10e3
> --- /dev/null
> +++ b/drivers/gpu/drm/armada/armada_610.c
> @@ -0,0 +1,49 @@
> +/*
> + * Copyright (C) 2012 Russell King
> + *
> + * 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.
> + *
> + * Armada 610/MMP2/MMP3 variant support
> + */
> +#include <linux/clk.h>
> +#include <linux/io.h>
> +#include <drm/drmP.h>
> +#include <drm/drm_crtc_helper.h>
> +#include "armada_crtc.h"
> +#include "armada_drm.h"
> +#include "armada_hw.h"
> +
> +static int mmp23_init(struct armada_private *priv, struct device *dev)
> +{
> + priv->extclk[0] = devm_clk_get(dev, NULL);
> +
> + if (IS_ERR(priv->extclk[0]) && PTR_ERR(priv->extclk[0]) == -ENOENT)
> + priv->extclk[0] = ERR_PTR(-EPROBE_DEFER);
> +
> + return PTR_RET(priv->extclk[0]);
> +}
> +
> +/*
> + * This gets called with sclk = NULL to test whether the mode is
> + * supportable, and again with sclk != NULL to set the clocks up for
> + * that. The former can return an error, but the latter is expected
> + * not to.
> + */
> +static int mmp23_crtc_compute_clock(struct armada_crtc *dcrtc,
> + const struct drm_display_mode *mode, uint32_t *sclk)
> +{
> + /*
> + * on MMP3 bits 31:29 select the clock, OLPC wants 0x1 here, LCD clock 1
> + * on MMP2 bits 31:30 select the clock, OLPC wants 0x1 here, LCD clock 1
> + */
> + *sclk = 0x20001100; // FIXME hardcoded mmp3 value
> +
maybe fix this? Or comment out for now mmp2 below in armada_drm_platform_ids?
BR,
-R
> + return 0;
> +}
> +
> +const struct armada_variant mmp23_ops = {
> + .init = mmp23_init,
> + .crtc_compute_clock = mmp23_crtc_compute_clock,
> +};
> diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c
> index e8605bf..b5877ee 100644
> --- a/drivers/gpu/drm/armada/armada_crtc.c
> +++ b/drivers/gpu/drm/armada/armada_crtc.c
> @@ -1054,6 +1054,7 @@ int armada_drm_crtc_create(struct drm_device *dev, unsigned num,
> dcrtc->clk = ERR_PTR(-EINVAL);
> dcrtc->csc_yuv_mode = CSC_AUTO;
> dcrtc->csc_rgb_mode = CSC_AUTO;
> + /* FIXME: MMP2/MMP3: OLPC panel is RGB666 */
> dcrtc->cfg_dumb_ctrl = DUMB24_RGB888_0;
> dcrtc->spu_iopad_ctrl = CFG_VSCALE_LN_EN | CFG_IOPAD_DUMB24;
> spin_lock_init(&dcrtc->irq_lock);
> diff --git a/drivers/gpu/drm/armada/armada_drm.h b/drivers/gpu/drm/armada/armada_drm.h
> index eef09ec..f52fccb 100644
> --- a/drivers/gpu/drm/armada/armada_drm.h
> +++ b/drivers/gpu/drm/armada/armada_drm.h
> @@ -70,6 +70,7 @@ struct armada_variant {
>
> /* Variant ops */
> extern const struct armada_variant armada510_ops;
> +extern const struct armada_variant mmp23_ops;
>
> struct armada_private {
> const struct armada_variant *variant;
> diff --git a/drivers/gpu/drm/armada/armada_drv.c b/drivers/gpu/drm/armada/armada_drv.c
> index 7bfab9a..db62f1b 100644
> --- a/drivers/gpu/drm/armada/armada_drv.c
> +++ b/drivers/gpu/drm/armada/armada_drv.c
> @@ -344,6 +344,12 @@ static const struct platform_device_id armada_drm_platform_ids[] = {
> .name = "armada-drm",
> .driver_data = (unsigned long)&armada510_ops,
> }, {
> + .name = "armada-610-drm", /* aka MMP2 */
> + .driver_data = (unsigned long)&mmp23_ops,
> + }, {
> + .name = "mmp3-drm",
> + .driver_data = (unsigned long)&mmp23_ops,
> + }, {
> .name = "armada-510-drm",
> .driver_data = (unsigned long)&armada510_ops,
> },
> diff --git a/drivers/gpu/drm/armada/armada_hw.h b/drivers/gpu/drm/armada/armada_hw.h
> index 27319a8..1688716 100644
> --- a/drivers/gpu/drm/armada/armada_hw.h
> +++ b/drivers/gpu/drm/armada/armada_hw.h
> @@ -74,6 +74,7 @@ enum {
> LCD_SPU_IOPAD_CONTROL = 0x01bc,
> LCD_SPU_IRQ_ENA = 0x01c0,
> LCD_SPU_IRQ_ISR = 0x01c4,
> + LCD_MISC_CNTL = 0x01c8, /* Armada 168 */
> };
>
> /* For LCD_SPU_ADV_REG */
> @@ -211,6 +212,13 @@ enum {
> SCLK_16X_PLL = 0x8 << 28,
> SCLK_16X_FRAC_DIV_MASK = 0xfff << 16,
> SCLK_16X_INT_DIV_MASK = 0xffff << 0,
> +
> + /* PXA910 / MMP2 (Armada 610) / MMP3 / PXA988 */
> + SCLK_MMP_SRC_SEL = 1 << 31,
> + SCLK_MMP_DISABLE = 1 << 28,
> + SCLK_MMP_FRAC_DIV_MASK = 0xfff << 16,
> + SCLK_MMP_DSI_DIV_MASK = 0xf << 8,
> + SCLK_MMP_INT_DIV_MASK = 0xff << 0,
> };
>
> /* For LCD_SPU_DUMB_CTRL */
> --
> 1.7.4.4
>
next prev parent reply other threads:[~2013-10-18 0:11 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-06 22:07 [PATCH 0/5] Armada DRM stuff Russell King - ARM Linux
2013-10-06 22:07 ` [PATCH 1/5] drm/i2c: tda998x: set VIF for full range, underscanned display Russell King
2013-10-07 8:59 ` Jean-Francois Moine
2013-10-18 15:00 ` Rob Clark
2013-10-06 22:08 ` [PATCH 2/5] DRM: Armada: Add Armada DRM driver Russell King
2013-10-10 21:25 ` Rob Clark
2013-10-10 21:59 ` Russell King - ARM Linux
2013-10-10 22:23 ` Rob Clark
2013-10-10 22:53 ` Russell King - ARM Linux
2013-10-11 0:10 ` Rob Clark
2013-10-06 22:09 ` [PATCH 3/5] DRM: Armada: Add support for ARGB 32x64 or 64x32 hardware cursors Russell King
2013-10-07 9:01 ` Jean-Francois Moine
2013-10-07 9:40 ` Russell King - ARM Linux
2013-10-07 10:09 ` Jean-Francois Moine
2013-10-07 10:32 ` Russell King - ARM Linux
2013-10-07 12:29 ` Siarhei Siamashka
2013-10-07 12:50 ` Russell King - ARM Linux
2013-10-17 23:58 ` Rob Clark
2013-10-18 14:31 ` Alex Deucher
2013-10-06 22:10 ` [PATCH 4/5] DRM: Armada: start of MMP2/MMP3 support Russell King
2013-10-18 0:11 ` Rob Clark [this message]
2013-10-06 22:11 ` [PATCH 5/5] DRM: Armada: add support for drm tda19988 driver Russell King
2013-10-07 9:18 ` Jean-Francois Moine
2013-10-07 9:44 ` Russell King - ARM Linux
2013-10-07 10:48 ` Jean-Francois Moine
2013-10-07 11:09 ` Russell King - ARM Linux
2013-10-07 11:29 ` Sebastian Hesselbarth
2013-10-07 15:53 ` Mark Brown
2013-10-07 16:08 ` Sebastian Hesselbarth
2013-10-07 17:05 ` Mark Brown
2013-10-07 12:03 ` Jean-Francois Moine
2013-10-07 12:36 ` Russell King - ARM Linux
2013-10-07 14:59 ` Rob Clark
2013-10-08 9:19 ` Jean-Francois Moine
2013-10-08 9:49 ` Russell King - ARM Linux
2013-10-08 15:34 ` Jean-Francois Moine
2013-10-18 0:20 ` Rob Clark
2013-10-08 12:07 ` Rob Clark
2013-10-07 21:47 ` [PATCH 0/5] Armada DRM stuff Sebastian Hesselbarth
2013-10-09 14:31 ` Russell King - ARM Linux
2013-10-09 14:48 ` Rob Clark
2013-10-18 15:15 ` [GIT PULL] Armada DRM support Russell King - ARM Linux
2013-10-22 13:36 ` Russell King - ARM Linux
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAF6AEGtTdmdTE_qeojTkPY8WYv86TRuzX-ms3Nb3UQHfvoWRwg@mail.gmail.com \
--to=robdclark@gmail.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=jason@lakedaemon.net \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=sebastian.hesselbarth@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).