From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pawel Moll Subject: [PATCH v3 1/2] video: ARM CLCD: Add DT support Date: Mon, 16 Sep 2013 18:18:53 +0100 Message-ID: <1379351934-25415-1-git-send-email-pawel.moll@arm.com> Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Return-path: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Cc: Rob Herring , Mark Rutland , Stephen Warren , Ian Campbell , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Russell King , Arnd Bergmann , Sylwester Nawrocki , Pawel Moll List-Id: devicetree@vger.kernel.org This patch adds basic DT bindings for the PL11x CLCD controllers and make their fbdev driver use them (initially only TFT panels are supported). Signed-off-by: Pawel Moll --- Changes since v2: - replaced video-ram phandle with arm,pl11x,framebuffer-base - replaced panel-* properties with arm,pl11x,panel-data-pads - replaced max-framebuffer-size with max-memory-bandwidth - modified clcdfb_of_init_tft_panel() to use the pads data and take differences between PL110 and PL110 into account Changes since v1: - minor code cleanups as suggested by Sylwester Nawrocki .../devicetree/bindings/video/arm,pl11x.txt | 145 +++++++++++ drivers/video/Kconfig | 1 + drivers/video/amba-clcd.c | 268 +++++++++++++++++= ++++ 3 files changed, 414 insertions(+) create mode 100644 Documentation/devicetree/bindings/video/arm,pl11x.txt diff --git a/Documentation/devicetree/bindings/video/arm,pl11x.txt b/Docume= ntation/devicetree/bindings/video/arm,pl11x.txt new file mode 100644 index 0000000..418ee06 --- /dev/null +++ b/Documentation/devicetree/bindings/video/arm,pl11x.txt @@ -0,0 +1,145 @@ +* ARM PrimeCell Color LCD Controller PL110/PL111 + +See also Documentation/devicetree/bindings/arm/primecell.txt + +Required properties: + +- compatible: must be one of: +=09=09=09"arm,pl110", "arm,primecell" +=09=09=09"arm,pl111", "arm,primecell" +- reg: base address and size of the control registers block +- interrupts: either a single interrupt specifier representing the +=09=09combined interrupt output (CLCDINTR) or an array of +=09=09four interrupt specifiers for CLCDMBEINTR, +=09=09CLCDVCOMPINTR, CLCDLNBUINTR, CLCDFUFINTR; in the +=09=09latter case interrupt names must be specified +=09=09(see below) +- interrupt-names: when four interrupts are specified, their names: +=09=09=09"mbe", "vcomp", "lnbu", "fuf" +=09=09=09must be specified in order respective to the +=09=09=09interrupt specifiers +- clocks: contains phandle and clock specifier pairs for the entries +=09=09in the clock-names property. See +=09=09Documentation/devicetree/binding/clock/clock-bindings.txt +- clocks names: should contain "clcdclk" and "apb_pclk" +- arm,pl11x,panel-data-pads: array of 24 cells, each of them describing +=09=09=09=09a function of one of the CLD pads, +=09=09=09=09starting from 0 up to 23; each pad can +=09=09=09=09be described by one of the following values: +=09- 0: reserved (not connected) +=09- 0x100-0x107: color upper STN panel data 0 to 7 +=09- 0x110-0x117: color lower STN panel data 0 to 7 +=09- 0x200-0x207: mono upper STN panel data 0 to 7 +=09- 0x210-0x217: mono lower STN panel data 0 to 7 +=09- 0x300-0x307: red component bit 0 to 7 of TFT panel data +=09- 0x310-0x317: green component bit 0 to 7 of TFT panel data +=09- 0x320-0x327: blue component bit 0 to 7 of TFT panel data +=09- 0x330: intensity bit of TFT panel data +=09=09=09=09Example sets of values for standard +=09=09=09=09panel interfaces: +=09- PL110 single colour STN panel: +=09=09=09<0x107 0x106 0x105 0x104 0x103 0x102 0x101 0x100>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL110 dual colour STN panel: +=09=09=09<0x107 0x106 0x105 0x104 0x103 0x102 0x101 0x100>, +=09=09=09<0x117 0x116 0x115 0x114 0x113 0x112 0x111 0x110>, +=09=09=09<0 0 0 0 0 0 0 0>; +=09- PL110 single mono 4-bit STN panel: +=09=09=09<0x203 0x202 0x201 0x200>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL110 dual mono 4-bit STN panel: +=09=09=09<0x203 0x202 0x201 0x200>, <0 0 0 0>, +=09=09=09<0x213 0x212 0x211 0x210>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL110 single mono 8-bit STN panel: +=09=09=09<0x207 0x206 0x205 0x204 0x203 0x202 0x201 0x200>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL110 dual mono 8-bit STN panel: +=09=09=09<0x207 0x206 0x205 0x204 0x203 0x202 0x201 0x200>, +=09=09=09<0x217 0x216 0x215 0x214 0x213 0x212 0x211 0x210>, +=09=09=09<0 0 0 0 0 0 0 0>; +=09- PL110 TFT (1:)5:5:5 panel: +=09=09=09<0x330 0x300 0x301 0x302 0x303 0x304>, +=09=09=09<0x330 0x310 0x311 0x312 0x313 0x314>, +=09=09=09<0x330 0x320 0x321 0x322 0x323 0x324>, +=09=09=09<0 0 0 0 0 0> +=09- PL110 and PL111 TFT RGB 888 panel: +=09=09=09<0x300 0x301 0x302 0x303 0x304 0x305 0x306 0x307>, +=09=09=09<0x310 0x311 0x312 0x313 0x314 0x315 0x316 0x317>, +=09=09=09<0x320 0x321 0x322 0x323 0x324 0x325 0x326 0x327>; +=09- PL111 single colour STN panel: +=09=09=09<0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL111 dual colour STN panel: +=09=09=09<0x100 0x101 0x102 0x103 0x104 0x105 0x106 0x107>, +=09=09=09<0x110 0x111 0x112 0x113 0x114 0x115 0x116 0x117>, +=09=09=09<0 0 0 0 0 0 0 0>; +=09- PL111 single mono 4-bit STN panel: +=09=09=09<0x200 0x201 0x202 0x203>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL111 dual mono 4-bit STN panel: +=09=09=09<0x200 0x201 0x202 0x203>, <0 0 0 0>, +=09=09=09<0x210 0x211 0x212 0x213>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL111 single mono 8-bit STN panel: +=09=09=09<0x200 0x201 0x202 0x203 0x204 0x205 0x206 0x207>, +=09=09=09<0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0>; +=09- PL111 dual mono 8-bit STN panel: +=09=09=09<0x200 0x201 0x202 0x203 0x204 0x205 0x206 0x207>, +=09=09=09<0x210 0x211 0x212 0x213 0x214 0x215 0x216 0x217>, +=09=09=09<0 0 0 0 0 0 0 0>; +=09- PL111 TFT 4:4:4 panel: +=09=09=09<0 0 0 0>, <0x300 0x301 0x302 0x303>, +=09=09=09<0 0 0 0>, <0x310 0x311 0x312 0x313>, +=09=09=09<0 0 0 0>, <0x320 0x321 0x322 0x323>; +=09- PL111 TFT 5:6:5 panel: +=09=09=09<0 0 0>, <0x300 0x301 0x302 0x303 0x304>, +=09=09=09<0 0>, <0x310 0x311 0x312 0x313 0x314 0x315>, +=09=09=09<0 0 0>, <0x320 0x321 0x322 0x323 0x324>; +=09- PL111 TFT (1):5:5:5 panel: +=09=09=09<0 0 0>, <0x300 0x301 0x302 0x303 0x304>, +=09=09=09<0 0>, <0x330 0x310 0x311 0x312 0x313 0x314>, +=09=09=09<0 0 0>, <0x320 0x321 0x322 0x323 0x324>; + +Optional properties: + +- arm,pl11x,framebuffer-base: a pair of two values, address and size, +=09=09=09=09defining the framebuffer to be used; +=09=09=09=09to be used only if it is *not* +=09=09=09=09part of normal memory, as described +=09=09=09=09in /memory node +- max-memory-bandwidth: maximum bandwidth in bytes per second that the +=09=09=09cell's memory interface can handle +- display-timings: standard display timings sub-node, defining possible +=09=09=09video modes of a connected panel; for details see +=09=09=09Documentation/devicetree/bindings/video/display-timing.txt + +Example: + +=09=09=09clcd@1f0000 { +=09=09=09=09compatible =3D "arm,pl111", "arm,primecell"; +=09=09=09=09reg =3D <0x1f0000 0x1000>; +=09=09=09=09interrupts =3D <14>; +=09=09=09=09clocks =3D <&v2m_oscclk1>, <&smbclk>; +=09=09=09=09clock-names =3D "clcdclk", "apb_pclk"; + +=09=09=09=09arm,pl11x,panel-data-pads =3D <0x300 0x301 0x302 0x303 0x304 0= x305 0x306 0x307>, +=09=09=09=09=09=09=09 <0x310 0x311 0x312 0x313 0x314 0x315 0x316 0x317>= , +=09=09=09=09=09=09=09 <0x320 0x321 0x322 0x323 0x324 0x325 0x326 0x327>= ; +=09=09=09=09arm,pl11x,framebuffer-base =3D <0x18000000 0x00800000>; +=09=09=09=09max-memory-bandwidth =3D <36864000>; /* bps, 640x480@60 16bpp = */ +=09=09=09=09display-timings { +=09=09=09=09=09native-mode =3D <&v2m_clcd_timing0>; +=09=09=09=09=09v2m_clcd_timing0: vga { +=09=09=09=09=09=09clock-frequency =3D <25175000>; +=09=09=09=09=09=09hactive =3D <640>; +=09=09=09=09=09=09hback-porch =3D <40>; +=09=09=09=09=09=09hfront-porch =3D <24>; +=09=09=09=09=09=09hsync-len =3D <96>; +=09=09=09=09=09=09vactive =3D <480>; +=09=09=09=09=09=09vback-porch =3D <32>; +=09=09=09=09=09=09vfront-porch =3D <11>; +=09=09=09=09=09=09vsync-len =3D <2>; +=09=09=09=09=09}; +=09=09=09=09}; +=09=09=09}; diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 4cf1e1d..375bf63 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -316,6 +316,7 @@ config FB_ARMCLCD =09select FB_CFB_FILLRECT =09select FB_CFB_COPYAREA =09select FB_CFB_IMAGEBLIT +=09select VIDEOMODE_HELPERS if OF =09help =09 This framebuffer device driver is for the ARM PrimeCell PL110 =09 Colour LCD controller. ARM PrimeCells provide the building diff --git a/drivers/video/amba-clcd.c b/drivers/video/amba-clcd.c index 0a2cce7..03420d1 100644 --- a/drivers/video/amba-clcd.c +++ b/drivers/video/amba-clcd.c @@ -25,6 +25,11 @@ #include #include #include +#include +#include +#include +#include