Skip to contentSkip to conversation

new video driver for bus vcxk framebuffers

PATCH Superseded Jens Scharsig 4 participants 12 messages Apr 22, 2009 – Aug 9, 2009 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 new video driver for bus vcxk framebuffers

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

---

doc/README.bus_vcxk new file +95 -0
new file mode 100644
index 0000000..44e1238
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2008-2009
+ * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
+ * Jens Scharsig <[email protected]>
+ *
+ * Configuation settings for the EB+CPUx9K2 board.
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+U-Boot vcxk video controller driver
+======================================
+
+The driver can use with VC2K, VC4K and VC8K devices on following boards:
+
+board			| ARCH			| Vendor
+-----------------------------------------------------------------------
+EB+CPU5282-T1	| MCF5282		| BuS Elektronik GmbH & Co. KG
+EB+MCF-EVB123	| MCF5282		| BuS Elektronik GmbH & Co. KG
+EB+CPUx9K2		| AT91RM9200	| BuS Elektronik GmbH & Co. KG
+ZLSA			| AT91RM9200	| Ruf Telematik AG
+
+by define CONFIG_VIDEO_VCXK
+
+Driver configuration
+--------------------
+
+The driver needs some defines to descrip the target hardware:
+
+CONFIG_SYS_VCXK_BASE
+
+base address of VCxK hardware memory
+
+CONFIG_SYS_VCXK_DEFAULT_LINEALIGN
+
+defines the physical alignment of a pixel row
+
+CONFIG_SYS_VCXK_DOUBLEBUFFERED
+
+some boards that use vcxk prevent read from framebuffer memory.
+define this option to enable double buffering (needs 16KiB RAM)
+
+CONFIG_SYS_VCXK_ACKNOWLEDGE_INIT
+
+initialize the acknowledge line from vcxk hardware
+
+#define CONFIG_SYS_VCXK_ACKNOWLEDGE
+
+should return true (1), if vcxk hardware acknowledges a viewing reqest
+
+CONFIG_SYS_VCXK_ENABLE_INIT
+
+initialize the enable line to vcxk hardware
+
+CONFIG_SYS_VCXK_DISABLE
+
+set	vcxk enable line to disable level / display off
+
+CONFIG_SYS_VCXK_ENABLE
+
+set	vcxk enable line enable level / display on
+
+CONFIG_SYS_VCXK_REQUEST_INIT
+
+initialize the request line to vcxk hardware
+
+CONFIG_SYS_VCXK_REQUEST
+
+should be send an request impulse to vcxk hardware
+
+CONFIG_SYS_VCXK_INVERT_INIT
+
+should initialize the invert line to vcxk hardware and set it to
+non invers mode
+
+CONFIG_SYS_VCXK_RESET_INIT
+
+initialize the reset line to vcxk hardware and release it from reset
+
drivers/video/Makefile +1 -0
index bc00852..bb6b5a0 100644
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
 COBJS-$(CONFIG_SED156X) += sed156x.o
 COBJS-$(CONFIG_VIDEO_SM501) += sm501.o
 COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o
+COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 COBJS-y += videomodes.o
 
 COBJS	:= $(COBJS-y)
drivers/video/bus_vcxk.c new file +469 -0

469 lines not on this page · raw message

include/bus_vcxk.h new file +36 -0
new file mode 100644
index 0000000..8d6a25c
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2005-2009
+ * Jens Scharsig @ BuS Elektronik GmbH & Co. KG, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __BUS_VCXK_H_
+#define __BUS_VCXK_H_
+
+extern int vcxk_init(unsigned long width, unsigned long height);
+extern void vcxk_setpixel (int x, int y, unsigned long color);
+extern int vcxk_acknowledge_wait(void);
+extern int vcxk_request(void);
+extern void	vcxk_loadimage(ulong source);
+extern int vcxk_display_bitmap (ulong addr, int x, int y);
+extern void vcxk_setbrightness(unsigned int side, short brightness);
+extern int video_display_bitmap (ulong addr, int x, int y);
+
+#endif
#1 lore raw

PATCH 1/2 new video driver for bus vcxk framebuffers

Dear Anatolij,

Quoted 6 lines · In message <[email protected]> Jens Scharsig wrote:

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

---

AFAICT this has neither been applied nor rejected yet. Please check.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Wagner's music is better than it sounds."               - Mark Twain
#2 lore raw

PATCH 1/2 new video driver for bus vcxk framebuffers

In reply to Jens Scharsig
Quoted 6 lines · Jens Scharsig

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

---

Sorry it took so long to review/comment. We need to resolve some issues before this patch can be applied, then it can go in for coming release.

doc/README.bus_vcxk line 6

Quoted 12 lines
doc/README.bus_vcxk new file +6 -0
new file mode 100644
index 0000000..44e1238
@@ -0,0 +1,95 @@
+/*
+ * (C) Copyright 2008-2009
+ * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
+ * Jens Scharsig <[email protected]>
+ *
+ * Configuation settings for the EB+CPUx9K2 board.

Typo in Configuration, please fix.

Quoted 22 lines
doc/README.bus_vcxk new file +22 -0
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+U-Boot vcxk video controller driver
+======================================

doc/README.bus_vcxk line 37

Quoted 10 lines
doc/README.bus_vcxk new file +9 -0
+
+The driver can use with VC2K, VC4K and VC8K devices on following boards:
 
+
+board			| ARCH			| Vendor
+-----------------------------------------------------------------------
+EB+CPU5282-T1	| MCF5282		| BuS Elektronik GmbH & Co. KG
+EB+MCF-EVB123	| MCF5282		| BuS Elektronik GmbH & Co. KG
+EB+CPUx9K2		| AT91RM9200	| BuS Elektronik GmbH & Co. KG
+ZLSA			| AT91RM9200	| Ruf Telematik AG

Please fix indentation/alignment in lines above, so it will look like initially intended.

doc/README.bus_vcxk

Quoted 2 lines
doc/README.bus_vcxk new file +2 -0
+
+by define CONFIG_VIDEO_VCXK

I suggest to move this to the beginning of the sentence, e.g.:
"By defining CONFIG_VIDEO_VCXK this driver can be used with VC2K, VC4K ..."

doc/README.bus_vcxk line 44

Quoted 5 lines
doc/README.bus_vcxk new file +5 -0
+
+Driver configuration
+--------------------
+
+The driver needs some defines to descrip the target hardware:

s/descrip/describe

doc/README.bus_vcxk line 57

Quoted 13 lines
doc/README.bus_vcxk new file +13 -0
+
+CONFIG_SYS_VCXK_BASE
+
+base address of VCxK hardware memory
+
+CONFIG_SYS_VCXK_DEFAULT_LINEALIGN
+
+defines the physical alignment of a pixel row
+
+CONFIG_SYS_VCXK_DOUBLEBUFFERED
+
+some boards that use vcxk prevent read from framebuffer memory.
+define this option to enable double buffering (needs 16KiB RAM)

It is more readable if you indent the lines describing the CONFIG_SYS_ option by tab, please fix, also in appropriate lines below, e.g.:

CONFIG_SYS_VCXK_BASE

base address of VCxK hardware memory

CONFIG_SYS_VCXK_DEFAULT_LINEALIGN

defines the physical alignment of a pixel row

and so on.

doc/README.bus_vcxk line 63

Quoted 6 lines
doc/README.bus_vcxk new file +6 -0
+
+CONFIG_SYS_VCXK_ACKNOWLEDGE_INIT
+
+initialize the acknowledge line from vcxk hardware
+
+#define CONFIG_SYS_VCXK_ACKNOWLEDGE

please remove "#define" before CONFIG_SYS_VCXK_ACKNOWLEDGE

doc/README.bus_vcxk

Quoted 2 lines
doc/README.bus_vcxk new file +2 -0
+
+should return true (1), if vcxk hardware acknowledges a viewing reqest

please fix a typo, s/reqest/request

Quoted 19 lines
doc/README.bus_vcxk new file +19 -0
+
+CONFIG_SYS_VCXK_ENABLE_INIT
+
+initialize the enable line to vcxk hardware
+
+CONFIG_SYS_VCXK_DISABLE
+
+set	vcxk enable line to disable level / display off
+
+CONFIG_SYS_VCXK_ENABLE
+
+set	vcxk enable line enable level / display on
+
+CONFIG_SYS_VCXK_REQUEST_INIT
+
+initialize the request line to vcxk hardware
+
+CONFIG_SYS_VCXK_REQUEST
+

doc/README.bus_vcxk line 94

Quoted 10 lines
doc/README.bus_vcxk new file +10 -0
+should be send an request impulse to vcxk hardware
+
+CONFIG_SYS_VCXK_INVERT_INIT
+
+should initialize the invert line to vcxk hardware and set it to
+non invers mode
+
+CONFIG_SYS_VCXK_RESET_INIT
+
+initialize the reset line to vcxk hardware and release it from reset

Looking on the changes to board configuration file "include/configs/EB+MCF-EV123.h" in the second patch of this series I now realize that most of these CONFIG_SYS_ macros above expand to C code, so these are not configuration options any more.
I tend to reject all this. CONFIG_SYS_ options are supposed to be options and not board specific code. VCxK.c driver you removed by this patch series did it in more correct way, I think.
What about moving this code to functions which use board specific macros? These functions should be placed in this new video driver then.

Quoted 52 lines
doc/README.bus_vcxk new file +1 -0
+
drivers/video/Makefile +1 -0
index bc00852..bb6b5a0 100644
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
 COBJS-$(CONFIG_SED156X) += sed156x.o
 COBJS-$(CONFIG_VIDEO_SM501) += sm501.o
 COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o
+COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 COBJS-y += videomodes.o
 
 COBJS	:= $(COBJS-y)
drivers/video/bus_vcxk.c new file +33 -0
new file mode 100644
index 0000000..db49c83
@@ -0,0 +1,469 @@
+/*
+ * (C) Copyright 2005-2009
+ * Jens Scharsig @ BuS Elektronik GmbH & Co. KG, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#include <common.h>
+#include <bmp_layout.h>
+#include <asm/io.h>
+
+vu_char  *vcxk_bws      = ((vu_char *) (CONFIG_SYS_VCXK_BASE));
+vu_short *vcxk_bws_word = ((vu_short *)(CONFIG_SYS_VCXK_BASE));
+vu_long  *vcxk_bws_long = ((vu_long *) (CONFIG_SYS_VCXK_BASE));
+
+#ifdef CONFIG_AT91RM9200
+	#include <asm/arch/hardware.h>

drivers/video/bus_vcxk.c line 43

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+	#ifndef VCBITMASK
+		#define VCBITMASK(bitno) 	(0x0001 << (bitno % 16))
+	#endif
+#elif defined(CONFIG_MCF52x2)
+	#include <asm/m5282.h>
+	#ifndef VCBITMASK
+		#define VCBITMASK(bitno) 	(0x8000 >> (bitno % 16))
+	#endif
+#else
+ 	#error not vcxk support for selected ARCH

s/not/no

Quoted 5 lines
drivers/video/bus_vcxk.c new file +5 -0
+#endif
+
+#ifndef CONFIG_SYS_VCXK_DOUBLEBUFFERED
+	#define VCXK_BWS(x,data)			vcxk_bws[x] = data;
+	#define VCXK_BWS_WORD_SET(x,mask) 	vcxk_bws_word[x] |= mask;

drivers/video/bus_vcxk.c line 58

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+	#define VCXK_BWS_WORD_CLEAR(x,mask) vcxk_bws_word[x] &= ~mask;
+	#define VCXK_BWS_LONG(x,data)		vcxk_bws_long[x] = data;
+#else
+	u_char double_bws[16384];
+	u_short *double_bws_word;
+	u_long  *double_bws_long;
+	#define VCXK_BWS(x,data)	\
+		double_bws[x] = data; vcxk_bws[x] = data;
+	#define VCXK_BWS_WORD_SET(x,mask) \
+ 		double_bws_word[x] |= mask;   vcxk_bws_word[x] = double_bws_word[x];

line too long, please fix to max. 80 characters.

drivers/video/bus_vcxk.c line 60

Quoted 2 lines
drivers/video/bus_vcxk.c new file +2 -0
+	#define VCXK_BWS_WORD_CLEAR(x,mask) \
+		double_bws_word[x] &= ~mask; vcxk_bws_word[x] = double_bws_word[x];

line too long, too.

drivers/video/bus_vcxk.c line 67

Quoted 7 lines
drivers/video/bus_vcxk.c new file +7 -0
+	#define VCXK_BWS_LONG(x,data) \
+		double_bws_long[x] = data;	 vcxk_bws_long[x] = data;
+#endif
+
+#define VC4K16_Bright1	vcxk_bws_word[0x20004 / 2]
+#define VC4K16_Bright2 	vcxk_bws_word[0x20006 / 2]
+#define VC2K_Bright		vcxk_bws[0x8000]

please remove one tab in the above line.

...

Quoted 14 lines
drivers/video/bus_vcxk.c new file +14 -0
+
+static vu_long vcxk_driver;
+vu_char VC4K16;
+
+u_long display_width;
+u_long display_height;
+u_long display_bwidth;
+
+ulong search_vcxk_driver(void);
+void vcxk_cls(void);
+void vcxk_setbrightness(unsigned int side, short brightness);
+int vcxk_request(void);
+int vcxk_acknowledge_wait(void);
+void vcxk_clear(void);

drivers/video/bus_vcxk.c line 93

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+
+/*----------------------------------------------------------------------------
+ ****f* bus_vcxk/vcxk_init
+ * FUNCTION
+ * initialalize Video Controller
+ * PARAMETERS
+ * width	visible display width in pixel
+ * height	visible display height  in pixel
+ ***
+----------------------------------------------------------------------------*/

please use this style for multi-line comments:

/*
* multi-line
* comment
*/

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+
+int vcxk_init(unsigned long width, unsigned long height)
+{
+	CONFIG_SYS_VCXK_RESET_INIT;
+
+#ifdef CONFIG_SYS_VCXK_DOUBLEBUFFERED
+	double_bws_word  = (u_short *) double_bws;
+	double_bws_long  = (u_long *)double_bws;
+	debug("%lx %lx %lx \n",double_bws,double_bws_word,double_bws_long);
+#endif

drivers/video/bus_vcxk.c line 113

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+
+	display_width  = width;
+	display_height = height;
+	#if (CONFIG_SYS_VCXK_DEFAULT_LINEALIGN==4)
+		display_bwidth =((width+31) / 8) & ~0x3;
+	#elif (CONFIG_SYS_VCXK_DEFAULT_LINEALIGN==2)
+		display_bwidth =((width+15) / 8) & ~0x1;
+	#else
+		#error CONFIG_SYS_VCXK_DEFAULT_LINEALIGN is invalid
+	#endif

do not indent these 7 lines above please. Also add spaces around "+".

drivers/video/bus_vcxk.c line 114

Quoted 1 line
drivers/video/bus_vcxk.c new file +1 -0
+	debug("linesize ((%d + 15)/8 & ~0x1) = %d\n",display_width,display_bwidth);

line too long. Add spaces around "/", before display_width and display_bwidth please.

drivers/video/bus_vcxk.c line 124

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+
+	#ifdef CONFIG_SYS_VCXK_AUTODETECT
+		VC4K16 = 0;
+		vcxk_bws_long[1] = 0x0;
+		vcxk_bws_long[1] = 0x55AAAA55;
+		vcxk_bws_long[5] = 0x0;
+		if (vcxk_bws_long[1] == 0x55AAAA55)
+		{
+			VC4K16 = 1;
+		}

no braces here for single line if statement, please:

	if (vcxk_bws_long[1] == 0x55AAAA55)
		VC4K16 = 1;

Also do not indent here, too.

drivers/video/bus_vcxk.c line 137

Quoted 13 lines
drivers/video/bus_vcxk.c new file +13 -0
+	#else
+		VC4K16 = 1;
+		debug("No autodetect: use vc4k\n");
+	#endif
+
+	CONFIG_SYS_VCXK_INVERT_INIT;
+
+	CONFIG_SYS_VCXK_REQUEST_INIT;
+
+	CONFIG_SYS_VCXK_ACKNOWLEDGE_INIT;
+
+	CONFIG_SYS_VCXK_DISABLE;
+	CONFIG_SYS_VCXK_ENABLE_INIT;

CONFIG_SYS_* expand to code, please place board dependent code here or in inline functions.

drivers/video/bus_vcxk.c line 148

Quoted 11 lines
drivers/video/bus_vcxk.c new file +11 -0
+
+	vcxk_driver = search_vcxk_driver();
+	if (vcxk_driver)
+	{
+		/* use flash resist driver */
+	}
+	else
+	{
+		vcxk_cls();
+		vcxk_cls();
+	}

Use this style here:

	if (vcxk_driver) {
		/* use flash resident driver */
	} else {
		vcxk_cls();
		vcxk_cls();
	}

Are two vcxk_cls() calls really needed? If not, then remove. Also, will search_vcxk_driver() ever be extended to return not 0? If not, remove these checks from the driver.

drivers/video/bus_vcxk.c line 151

Quoted 3 lines
drivers/video/bus_vcxk.c new file +3 -0
+
+	vcxk_setbrightness(3,1000);
+	CONFIG_SYS_VCXK_ENABLE;

CONFIG_SYS_VCXK_ENABLE expands to code, just place the code here or move to a function.

Quoted 4 lines
drivers/video/bus_vcxk.c new file +4 -0
+	return 1;
+}
+
+/*----------------------------------------------------------------------------

drivers/video/bus_vcxk.c line 165

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+ ****f* bus_vcxk/vcxk_setpixel
+ * FUNCTION
+ * set the pixel[x,y] with the given color
+ * PARAMETER
+ * x		pixel colum
+ * y		pixel row
+ * color	<0x40 off/black
+ *			>0x40 on
+ ***
+----------------------------------------------------------------------------*/

Fix multi-line comment style, please.

Quoted 19 lines
drivers/video/bus_vcxk.c new file +19 -0
+void vcxk_setpixel (int x, int y, unsigned long color)
+{
+	vu_short dataptr;
+
+	if (vcxk_driver)
+	{
+		/* use flash resist driver */
+	}
+	else
+	{
+		if ((x<display_width) && (y<display_height))
+		{
+
+			dataptr = ((x / 16)) + (y * (display_bwidth>>1));
+
+			color = ((color >> 16) & 0xFF) |
+				    ((color >> 8) & 0xFF) | (color & 0xFF);
+
+			if (color > 0x40)

drivers/video/bus_vcxk.c line 195

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+			{
+				VCXK_BWS_WORD_SET(dataptr,VCBITMASK(x));
+			}
+			else
+			{
+				VCXK_BWS_WORD_CLEAR(dataptr,VCBITMASK(x));
+			}
+		}
+    }
+}

Check for coding style issues here, too. E.g.: if statements, spaces around "<", ">", ">>", etc. Fix it anywhere in the code, please.

Best regards,
Anatolij

#3 lore raw

PATCH 1/2 new video driver for bus vcxk framebuffers

Hello Anatolij,

Quoted 12 lines
Quoted 1 line

+initialize the reset line to vcxk hardware and release it from reset

Looking on the changes to board configuration file "include/configs/EB+MCF-EV123.h" in the second patch of this series I now realize that most of these CONFIG_SYS_ macros above expand to C code, so these are not configuration options any more.
I tend to reject all this. CONFIG_SYS_ options are supposed to be options and not board specific code. VCxK.c driver you removed by this patch series did it in more correct way, I think.
What about moving this code to functions which use board specific macros? These functions should be placed in this new video driver then.

I will complete review the code.
I think, i can sent a new patch set within one week

Best regards,

Jens Scharsig

#4 lore raw

PATCH v2 1/2 new video driver for bus vcxk framebuffers

In reply to Jens Scharsig

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

---

doc/README.bus_vcxk new file +85 -0
new file mode 100644
index 0000000..4eb8fe8
@@ -0,0 +1,85 @@
+/*
+ * (C) Copyright 2008-2009
+ * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
+ * Jens Scharsig <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+U-Boot vcxk video controller driver
+======================================
+
+By defining CONFIG_VIDEO_VCXK this driver can be used with VC2K, VC4K and
+VC8K devices on following boards:
+
+board           | ARCH          | Vendor
+-----------------------------------------------------------------------
+EB+CPU5282-T1   | MCF5282       | BuS Elektronik GmbH & Co. KG
+EB+MCF-EVB123   | MCF5282       | BuS Elektronik GmbH & Co. KG
+EB+CPUx9K2      | AT91RM9200    | BuS Elektronik GmbH & Co. KG
+ZLSA            | AT91RM9200    | Ruf Telematik AG
+
+Driver configuration
+--------------------
+
+The driver needs some defines to describe the target hardware:
+
+CONFIG_SYS_VCXK_BASE
+
+	base address of VCxK hardware memory
+
+CONFIG_SYS_VCXK_DEFAULT_LINEALIGN
+
+	defines the physical alignment of a pixel row
+
+CONFIG_SYS_VCXK_DOUBLEBUFFERED
+
+	some boards that use vcxk prevent read from framebuffer memory.
+	define this option to enable double buffering (needs 16KiB RAM)
+
+CONFIG_SYS_VCXK_<xxxx>_PIN
+
+	defines the number of the I/O line PIN in the port
+	valid values for <xxxx> are:
+
+		ACKNOWLEDGE
+			describes the acknowledge line from vcxk hardware
+
+		ENABLE
+			describes the enable line to vcxk hardware
+
+		INVERT
+			describes the invert line to vcxk hardware
+
+		RESET
+			describes the reset line to vcxk hardware
+
+		REQUEST
+			describes the request line to vcxk hardware
+
+CONFIG_SYS_VCXK_<xxxx>_PORT
+
+	defines the I/O port which is connected with the line
+	for valid values for <xxxx> see CONFIG_SYS_VCXK_<xxxx>_PIN
+
+CONFIG_SYS_VCXK_<xxxx>_DDR
+
+	defines the register which configures the direction
+	for valid values for <xxxx> see CONFIG_SYS_VCXK_<xxxx>_PIN
+
drivers/video/Makefile +1 -0
index bc00852..bb6b5a0 100644
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
 COBJS-$(CONFIG_SED156X) += sed156x.o
 COBJS-$(CONFIG_VIDEO_SM501) += sm501.o
 COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o
+COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 COBJS-y += videomodes.o
 
 COBJS	:= $(COBJS-y)
drivers/video/bus_vcxk.c new file +436 -0

436 lines not on this page · raw message

include/bus_vcxk.h new file +36 -0
new file mode 100644
index 0000000..8d6a25c
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2005-2009
+ * Jens Scharsig @ BuS Elektronik GmbH & Co. KG, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __BUS_VCXK_H_
+#define __BUS_VCXK_H_
+
+extern int vcxk_init(unsigned long width, unsigned long height);
+extern void vcxk_setpixel (int x, int y, unsigned long color);
+extern int vcxk_acknowledge_wait(void);
+extern int vcxk_request(void);
+extern void	vcxk_loadimage(ulong source);
+extern int vcxk_display_bitmap (ulong addr, int x, int y);
+extern void vcxk_setbrightness(unsigned int side, short brightness);
+extern int video_display_bitmap (ulong addr, int x, int y);
+
+#endif
#5 lore raw

PATCH v2 1/2 new video driver for bus vcxk framebuffers

Dear Jens Scharsig,

Quoted 1 line · In message <[email protected]> you wrote:

This patch adds a new video driver

...

Quoted 2 lines
(quoted diff) +2 -0
+int vcxk_display_bitmap (ulong addr, int x, int y)
+{

...

Quoted 17 lines
drivers/video/bus_vcxk.c new file +17 -0
+	if ((bmp->header.signature[0] == 'B') &&
+   	    (bmp->header.signature[1] == 'M'))
+	{
+		compression  = le32_to_cpu (bmp->header.compression);
+		width        = le32_to_cpu (bmp->header.width);
+		height       = le32_to_cpu (bmp->header.height);
+		bpp          = le16_to_cpu (bmp->header.bit_count);
+
+		dataptr = (unsigned char *) bmp +
+				le32_to_cpu(bmp->header.data_offset);
+
+		if (display_width < (width + x))
+		{
+			cp_width = display_width - x;
+		}
+		else
+		{

drivers/video/bus_vcxk.c line 378

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+			cp_width = width;
+		}
+		if (display_height < (height + y))
+		{
+			cp_height = display_height - y;
+		}
+		else
+		{
+			cp_height = height;
+		}

...

Incorrect brace style.
...

Quoted 7 lines
drivers/video/bus_vcxk.c new file +7 -0
+		switch (bpp)
+		{
+			case 1:
+				for (ycnt = cp_height;ycnt > 0; ycnt--)
+				{
+					lineptr	= dataptr;
+					for (xcnt = 0;xcnt < cp_width; xcnt++)

drivers/video/bus_vcxk.c line 400

Quoted 10 lines
drivers/video/bus_vcxk.c new file +10 -0
+					{
+						if ((*lineptr << (xcnt % 8))
+							 & 0x80) {
+							vcxk_setpixel(xcnt,
+								ycnt - 1,
+								0xFFFFFF);
+						} else {
+							vcxk_setpixel(xcnt,
+								ycnt-1,0);
+						}

Quoting the CodingStyle:

Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.

Please clean up and resubmit.

Best regards,

Wolfgang Denk

Signature · 6 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Shakespeare's Law of Prototyping: (Hamlet III, iv, 156-160)
        O, throw away the worser part of it,
        And live the purer with the other half.
#6 lore raw

PATCH v2 1/2 new video driver for bus vcxk framebuffers

Quoted 5 lines · Wolfgang Denk

Incorrect brace style.
...

Quoting the CodingStyle:

Quoted 8 lines

Now, some people will claim that having 8-character indentations makes the code move too far to the right, and makes it hard to read on a 80-character terminal screen. The answer to that is that if you need more than 3 levels of indentation, you're screwed anyway, and should fix your program.

Please clean up and resubmit.

Fixed

Please see [PATCH 1/2 V3] new video driver for bus vcxk framebuffers

Best regards,
Jens Scharsig

#7 lore raw

PATCH v3 1/2 new video driver for bus vcxk framebuffers

In reply to Jens Scharsig

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

---

doc/README.bus_vcxk new file +85 -0
new file mode 100644
index 0000000..4eb8fe8
@@ -0,0 +1,85 @@
+/*
+ * (C) Copyright 2008-2009
+ * BuS Elektronik GmbH & Co. KG <www.bus-elektronik.de>
+ * Jens Scharsig <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+U-Boot vcxk video controller driver
+======================================
+
+By defining CONFIG_VIDEO_VCXK this driver can be used with VC2K, VC4K and
+VC8K devices on following boards:
+
+board           | ARCH          | Vendor
+-----------------------------------------------------------------------
+EB+CPU5282-T1   | MCF5282       | BuS Elektronik GmbH & Co. KG
+EB+MCF-EVB123   | MCF5282       | BuS Elektronik GmbH & Co. KG
+EB+CPUx9K2      | AT91RM9200    | BuS Elektronik GmbH & Co. KG
+ZLSA            | AT91RM9200    | Ruf Telematik AG
+
+Driver configuration
+--------------------
+
+The driver needs some defines to describe the target hardware:
+
+CONFIG_SYS_VCXK_BASE
+
+	base address of VCxK hardware memory
+
+CONFIG_SYS_VCXK_DEFAULT_LINEALIGN
+
+	defines the physical alignment of a pixel row
+
+CONFIG_SYS_VCXK_DOUBLEBUFFERED
+
+	some boards that use vcxk prevent read from framebuffer memory.
+	define this option to enable double buffering (needs 16KiB RAM)
+
+CONFIG_SYS_VCXK_<xxxx>_PIN
+
+	defines the number of the I/O line PIN in the port
+	valid values for <xxxx> are:
+
+		ACKNOWLEDGE
+			describes the acknowledge line from vcxk hardware
+
+		ENABLE
+			describes the enable line to vcxk hardware
+
+		INVERT
+			describes the invert line to vcxk hardware
+
+		RESET
+			describes the reset line to vcxk hardware
+
+		REQUEST
+			describes the request line to vcxk hardware
+
+CONFIG_SYS_VCXK_<xxxx>_PORT
+
+	defines the I/O port which is connected with the line
+	for valid values for <xxxx> see CONFIG_SYS_VCXK_<xxxx>_PIN
+
+CONFIG_SYS_VCXK_<xxxx>_DDR
+
+	defines the register which configures the direction
+	for valid values for <xxxx> see CONFIG_SYS_VCXK_<xxxx>_PIN
+
drivers/video/Makefile +1 -0
index bc00852..bb6b5a0 100644
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_VIDEO_SED13806) += sed13806.o
 COBJS-$(CONFIG_SED156X) += sed156x.o
 COBJS-$(CONFIG_VIDEO_SM501) += sm501.o
 COBJS-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o
+COBJS-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o
 COBJS-y += videomodes.o
 
 COBJS	:= $(COBJS-y)
drivers/video/bus_vcxk.c new file +436 -0

436 lines not on this page · raw message

include/bus_vcxk.h new file +36 -0
new file mode 100644
index 0000000..8d6a25c
@@ -0,0 +1,36 @@
+/*
+ * (C) Copyright 2005-2009
+ * Jens Scharsig @ BuS Elektronik GmbH & Co. KG, <[email protected]>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * 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.
+ *
+ * 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.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef __BUS_VCXK_H_
+#define __BUS_VCXK_H_
+
+extern int vcxk_init(unsigned long width, unsigned long height);
+extern void vcxk_setpixel (int x, int y, unsigned long color);
+extern int vcxk_acknowledge_wait(void);
+extern int vcxk_request(void);
+extern void	vcxk_loadimage(ulong source);
+extern int vcxk_display_bitmap (ulong addr, int x, int y);
+extern void vcxk_setbrightness(unsigned int side, short brightness);
+extern int video_display_bitmap (ulong addr, int x, int y);
+
+#endif
#8 lore raw

PATCH v3 1/2 new video driver for bus vcxk framebuffers

Quoted 5 lines · Jens Scharsig

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

Applied to u-boot-video. Thanks! Note that I had to fix lots of style issues before applying. Next time please use scripts/checkpatch.pl from the Linux source tree to check your patches before submitting them and resolve reported issues were it makes sence. Thanks.

Best regards,
Anatolij

#9 lore raw

PATCH v3 1/2 new video driver for bus vcxkframebuffers

On Sun 26 Jul 2009 07:46, Anatolij Gustschin pondered:

Quoted 5 lines
Quoted 4 lines · Jens Scharsig

This patch adds a new video driver

* adds common bus_vcxk framebuffer driver

Quoted 7 lines
Quoted 1 line

Applied to u-boot-video. Thanks! Note that I had to fix lots of style issues before applying. Next time please use scripts/checkpatch.pl from the Linux source tree to check your patches before submitting them and resolve reported issues were it makes sence. Thanks.

Is there a reason not to include the checkpatch.pl in
http://www.denx.de/wiki/U-Boot/Patches or in the README (in the Submitting Patches section) if it is going to be a requirement?

#10 lore raw

PATCH v3 1/2 new video driver for bus vcxkframebuffers

Quoted 1 line · Robin Getz

On Sun 26 Jul 2009 07:46, Anatolij Gustschin pondered:

...

Quoted 9 lines
Quoted 5 lines

Applied to u-boot-video. Thanks! Note that I had to fix lots of style issues before applying. Next time please use scripts/checkpatch.pl from the Linux source tree to check your patches before submitting them and resolve reported issues were it makes sence. Thanks.

Is there a reason not to include the checkpatch.pl in
http://www.denx.de/wiki/U-Boot/Patches or in the README (in the Submitting Patches section) if it is going to be a requirement?

It is not a requirement, but would make submitter's and our life easier. Some errors/warnings reported by checkpatch.pl might cause additional confusion as they apply only for Linux patches. In this case I suggested to use checkpatch because v3 of the patch still had style issues pointed out in the comments to the first version.

Best regards,
Anatolij

#11 lore raw

PATCH v3 1/2 new video driver for bus vcxkframebuffers

In reply to Robin Getz

Dear Robin Getz,

Quoted 4 lines · In message <[email protected]> you wrote:

Is there a reason not to include the checkpatch.pl in
http://www.denx.de/wiki/U-Boot/Patches or in the README (in the Submitting Patches section) if it is going to be a requirement?

No, there is not (except lack of idle resources, maybe). Please feel free to add it.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Be kind to unkind people - they need it the most.