From 3579676a1a33380e958fd06e5089bc9397759fe0 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 24 Sep 2014 15:27:31 +0800 Subject: fb: Add DCU framebuffer driver for LS1021A platform The Display Controller Unit (DCU) module is a system master that fetches graphics stored in internal or external memory and displays them on a TFT LCD panel. A wide range of panel sizes is supported and the timing of the interface signals is highly configurable. Graphics are read directly from memory and then blended in real-time, which allows for dynamic content creation with minimal CPU intervention. The features: (1) Full RGB888 output to TFT LCD panel. (2) For the current LCD panel, WQVGA "480x272" is supported. (3) Blending of each pixel using up to 4 source layers dependent on size of panel. (4) Each graphic layer can be placed with one pixel resolution in either axis. (5) Each graphic layer support RGB565 and RGB888 direct colors without alpha channel and BGRA8888 direct colors with an alpha channel. (6) Each graphic layer support alpha blending with 8-bit resolution. Signed-off-by: Alison Wang Signed-off-by: Xiubo Li The maintainer and many other people all have strong opinions to add DCU driver based the DRM framework. The mails URL: http://lists.infradead.org/pipermail/linux-arm-kernel/2013-September/197863.html The first DRM version of DCU will be send out to the community before 30 November 2014. Change-Id: I9feb7c9b975431a1bb3906eb955dcf6ae09654eb Reviewed-on: http://git.am.freescale.net:8181/19647 Tested-by: Review Code-CDREVIEW Reviewed-by: Chao Fu Reviewed-by: Huan Wang Reviewed-by: Zhengxiong Jin diff --git a/Documentation/devicetree/bindings/video/fsl-dcu-fb.txt b/Documentation/devicetree/bindings/video/fsl-dcu-fb.txt new file mode 100644 index 0000000..20fc74c --- /dev/null +++ b/Documentation/devicetree/bindings/video/fsl-dcu-fb.txt @@ -0,0 +1,69 @@ +* Freescale Display Control Unit (DCU) + +=== For dcu node === +Required properties: +- compatible: Should be one of "fsl,vf610-dcu" and "fsl,ls1021a-dcu". +- reg: Address and length of the register set for DCU. +- interrupts: Should contain DCU interrupts. +- clocks: From common clock binding: handle to DCU clock. +- clock-names: From common clock binding: Shall be "dcu". +- display: The phandle to display node. + +Optional properties: +- tcon-controller: The phandle of TCON controller. +- scfg-controller: The phandle of scfg node. + +=== For display sub-node === +Required properties: +- bits-per-pixel: <24> for RGB888. + +Required timing node for dispplay sub-node: +- display-timings: Refer to binding doc display-timing.txt for details. + +=== For TCON node === +Required properties: +- compatible: Should be "fsl,tcon". +- reg: Address and length of the register set for TCON. +- clocks: From common clock binding: handle to TCON clock. +- clock-names: From common clock binding: Shall be "tcon". + +Examples: + +dcu0: dcu@40058000 { + compatible = "fsl,vf610-dcu"; + reg = <0x40058000 0x1200>; + interrupts = <0 30 0x04>; + clocks = <&clks VF610_CLK_DCU0>; + clock-names = "dcu"; + tcon-controller = <&tcon0>; + scfg-controller = <&scfg>; + display = <&display>; + + display: display@0 { + bits-per-pixel = <24>; + + display-timings { + native-mode = <&timing0>; + timing0: nl4827hc19 { + clock-frequency = <10870000>; + hactive = <480>; + vactive = <272>; + hback-porch = <2>; + hfront-porch = <2>; + vback-porch = <1>; + vfront-porch = <1>; + hsync-len = <41>; + vsync-len = <2>; + hsync-active = <1>; + vsync-active = <1>; + }; + }; + }; +}; + +tcon0: tcon@4003d000 { + compatible = "fsl,vf610-tcon"; + reg = <0x4003d000 0x1000>; + clocks = <&clks VF610_CLK_TCON0>; + clock-names = "tcon"; +}; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4ce7204..2aadb06 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -1965,6 +1965,24 @@ config FB_MBX_DEBUG If unsure, say N. +config FB_FSL_DCU + tristate "Freescale DCU framebuffer support" + depends on FB + select FB_CFB_FILLRECT + select FB_CFB_COPYAREA + select FB_CFB_IMAGEBLIT + select FB_MODE_HELPERS + select VIDEOMODE_HELPERS + ---help--- + Framebuffer driver for the Freescale SoC DCU. + + This driver is also available as a module ( = code which can be + inserted and removed from the running kernel whenever you want). + If you want to compile it as a module, say M here and read + . + + If unsure, say N. + config FB_FSL_DIU tristate "Freescale DIU framebuffer support" depends on FB && FSL_SOC diff --git a/drivers/video/Makefile b/drivers/video/Makefile index f5ef0ed..2c6bcf6 100644 --- a/drivers/video/Makefile +++ b/drivers/video/Makefile @@ -129,6 +129,7 @@ obj-$(CONFIG_FB_IMX) += imxfb.o obj-$(CONFIG_FB_S3C) += s3c-fb.o obj-$(CONFIG_FB_S3C2410) += s3c2410fb.o obj-$(CONFIG_FB_FSL_DIU) += fsl-diu-fb.o +obj-$(CONFIG_FB_FSL_DCU) += fsl-dcu-fb.o obj-$(CONFIG_FB_COBALT) += cobalt_lcdfb.o obj-$(CONFIG_FB_IBM_GXT4500) += gxt4500.o obj-$(CONFIG_FB_PS3) += ps3fb.o diff --git a/drivers/video/fsl-dcu-fb.c b/drivers/video/fsl-dcu-fb.c new file mode 100644 index 0000000..2fc9994 --- /dev/null +++ b/drivers/video/fsl-dcu-fb.c @@ -0,0 +1,1194 @@ +/* + * Copyright 2012-2014 Freescale Semiconductor, Inc. + * + * Freescale DCU framebuffer device driver + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include