linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
To: linuc-fbdev <Linux-fbdev-devel@lists.sourceforge.net>
Cc: Paul Mundt <lethal@linux-sh.org>, Linux-sh <linux-sh@vger.kernel.org>
Subject: [RESEND][PATCH v2 4/4] video: sh7760fb: SH7760/SH7763 LCDC framebuffer driver's document
Date: Thu, 26 Jun 2008 15:12:18 +0900	[thread overview]
Message-ID: <48633342.1050102@renesas.com> (raw)

Document for the LCDC interface on the SH7760 and SH7763 SoCs.

Signed-off-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
---
 Documentation/fb/sh7760fb.txt |  129 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 129 insertions(+), 0 deletions(-)
 create mode 100644 Documentation/fb/sh7760fb.txt

diff --git a/Documentation/fb/sh7760fb.txt b/Documentation/fb/sh7760fb.txt
new file mode 100644
index 0000000..b8bf844
--- /dev/null
+++ b/Documentation/fb/sh7760fb.txt
@@ -0,0 +1,129 @@
+SH7760 integrated LCDC Framebuffer driver
+=========================================
+
+0. Overwiew
+-----------
+The SH7760/SH7763 have an integrated LCD Display controller (LCDC) which
+supports (in theory) resolutions ranging from 1x1 to 1024x1024,
+with color depths ranging from 1 to 16 bit.
+Supports STN, DSTN and TFT Panels.
+
+* Framebuffer memory must be a large chunk allocated at the top
+  of Area3 (HW requirement). Because of this requirement you should NOT
+  make the driver a module since at runtime it may become impossible to
+  get a large enough contiguous chunk of memory.
+
+* The driver does not support changing resolution while loaded
+  (LCD's aren't hotpluggable anyway)
+
+* Heavy flickering may be observed
+  a) if you're using 15/16bit color modes at >= 640x480 px resolutions,
+  b) during PCMCIA (or any other slow bus) activity.
+
+* Rotation works only 90degress clockwise, and only if horizontal
+  resolution is <= 320 pixels.
+
+files:   drivers/video/sh7760fb.c
+	 include/asm-sh/sh7760fb.h
+	 Documentation/fb/sh7760fb.txt
+
+1. Platform setup
+-----------------
+Video data is fetched via the DMABRG DMA engine, so you have to
+configure the SH DMAC for DMABRG mode (write 0x94808080 to the
+DMARSRA register somewhere at boot).
+
+PFC registers PCCR and PCDR must be set to peripheral mode.
+(write zeros to both).
+
+The driver does NOT do the above for you (since board setup is, well, job
+of the board setup code).
+
+2. Panel definitions
+--------------------
+The LCDC must explicitly be told about the type of LCD panel
+attached. Data must be wrapped in a "struct sh7760fb_platdata" and
+passed to the driver as platform_data.
+
+Suggest you take a closer look at the SH7760 Manual, Section 30.
+(http://documentation.renesas.com/eng/products/mpumcu/e602291_sh7760.pdf)
+
+The following code illustrates what needs to be done to
+get the framebuffer working on a 640x480 TFT:
+
+====================== cut here ======================================
+
+#include <linux/fb.h>
+#include <asm/sh7760fb.h>
+
+/*
+ * NEC NL6440bc26-01 640x480 TFT
+ * dotclock 25175 kHz
+ * Xres		640	Yres		480
+ * Htotal	800	Vtotal		525
+ * HsynStart	656	VsynStart	490
+ * HsynLenn	30	VsynLenn	2
+ *
+ * The linux framebuffer layer does not use the syncstart/synclen
+ * values but right/left/upper/lower margin values. The comments
+ * for the x_margin explain how to calculate those from given
+ * panel sync timings.
+ */
+static struct fb_videomode nl6448bc26 = {
+/*	.name		= "NL6448BC26",*/
+/*	.refresh	= 60,	*/
+	.xres		= 640,
+	.yres		= 480,
+	.pixclock	= 39683,	/* in picoseconds! */
+	.hsync_len	= 30,
+	.vsync_len	= 2,
+	.left_margin	= 114,	/* HTOT - (HSYNSLEN + HSYNSTART) */
+	.right_margin	= 16,	/* HSYNSTART - XRES */
+	.upper_margin	= 33,	/* VTOT - (VSYNLEN + VSYNSTART) */
+	.lower_margin	= 10,	/* VSYNSTART - YRES */
+	.sync		= FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
+	.vmode		= FB_VMODE_NONINTERLACED,
+	.flag		= 0,
+};
+
+static struct sh7760fb_platdata sh7760fb_nl6448 = {
+	.def_mode	= &nl6448bc26,
+	.ldmtr		= LDMTR_TFT_COLOR_16,	/* 16bit TFT panel */
+	.lddfr		= LDDFR_8BPP,		/* we want 8bit output */
+	.ldpmmr		= 0x0070,
+	.ldpspr		= 0x0500,
+	.ldaclnr	= 0,
+	.ldickr		= LDICKR_CLKSRC(LCDC_CLKSRC_EXTERNAL) |
+			  LDICKR_CLKDIV(1),
+	.rotate		= 0,
+	.novsync	= 1,
+	.blank		= NULL,
+};
+
+/* 0xFE300800: 256 * 4byte xRGB palette ram
+ * 0xFE300C00: 42 bytes ctrl registers
+ */
+static struct resource sh7760_lcdc_res[] = {
+	[0] = {
+		.start	= 0xFE300800,
+		.end	= 0xFE300CFF,
+		.flags	= IORESOURCE_MEM,
+	},
+	[1] = {
+		.start	= 65,
+		.end	= 65,
+		.flags	= IORESOURCE_IRQ,
+	},
+};
+
+static struct platform_device sh7760_lcdc_dev = {
+	.dev	= {
+		.platform_data = &sh7760fb_nl6448,
+	},
+	.name		= "sh7760-lcdc",
+	.id		= -1,
+	.resource	= sh7760_lcdc_res,
+	.num_resources	= ARRAY_SIZE(sh7760_lcdc_res),
+};
+
+====================== cut here ======================================
-- 
1.5.5.1



-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

                 reply	other threads:[~2008-06-26  6:12 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=48633342.1050102@renesas.com \
    --to=iwamatsu.nobuhiro@renesas.com \
    --cc=Linux-fbdev-devel@lists.sourceforge.net \
    --cc=lethal@linux-sh.org \
    --cc=linux-sh@vger.kernel.org \
    /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).