[U-Boot-Users] [PATCH/review] Blackfin: resurrect BF533-STAMP video splash driver

Jean-Christophe PLAGNIOL-VILLARD plagnioj at jcrosoft.com
Thu Apr 10 13:16:25 CEST 2008


On 02:33 Wed 09 Apr     , Mike Frysinger wrote:
> This video driver used to live in the Blackfin cpu directory, but it was
> lost during the unification process.  This brings it back.
> 
> Signed-off-by: Mike Frysinger <vapier at gentoo.org>
> ---
>  board/bf533-stamp/Makefile |    4 +-
>  board/bf533-stamp/video.c  |  276 ++++++++++++++++++++++++++++++++++++++++++++
>  board/bf533-stamp/video.h  |   25 ++++
>  3 files changed, 303 insertions(+), 2 deletions(-)
>  create mode 100644 board/bf533-stamp/video.c
>  create mode 100644 board/bf533-stamp/video.h
> 
> diff --git a/board/bf533-stamp/Makefile b/board/bf533-stamp/Makefile
> index 1115df8..a759d9a 100644
> --- a/board/bf533-stamp/Makefile
> +++ b/board/bf533-stamp/Makefile
> @@ -1,7 +1,7 @@
>  #
>  # U-boot - Makefile
>  #
> -# Copyright (c) 2005-2007 Analog Device Inc.
> +# Copyright (c) 2005-2008 Analog Device Inc.
>  #
>  # (C) Copyright 2000-2006
>  # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
> @@ -29,7 +29,7 @@ include $(TOPDIR)/config.mk
>  
>  LIB	= $(obj)lib$(BOARD).a
>  
> -COBJS	:= $(BOARD).o spi_flash.o
> +COBJS	:= $(BOARD).o spi_flash.o video.o
>  
>  SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
>  OBJS	:= $(addprefix $(obj),$(COBJS))
> diff --git a/board/bf533-stamp/video.c b/board/bf533-stamp/video.c
> new file mode 100644
> index 0000000..6899930
> --- /dev/null
> +++ b/board/bf533-stamp/video.c
> @@ -0,0 +1,276 @@
> +/*
> + * (C) Copyright 2000
> + * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio at tin.it
> + * (C) Copyright 2002
> + * Wolfgang Denk, wd at denx.de
> + * (C) Copyright 2006
> + * Aubrey Li, aubrey.li at analog.com
> + *
> + * 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 <stdarg.h>
> +#include <common.h>
> +#include <config.h>
> +#include <malloc.h>
> +#include <asm/blackfin.h>
> +#include <asm/mach-common/bits/dma.h>
> +#include <i2c.h>
> +#include <linux/types.h>
> +#include <devices.h>
> +
> +int gunzip(void *, int, unsigned char *, unsigned long *);
> +
> +#ifdef CONFIG_VIDEO
Plese move to Makefile
> +
> +#define DMA_SIZE16	2
> +			for (i = 0; i < u_boot_logo.width / 2; i++) {
> +				/* enlarge one pixel to m x n */
> +				for (n = 0; n < HORIZONTAL; n++) {
> +					*OddPtr32++ = *data;
> +					*EvenPtr32++ = *data;
> +				}
> +				data++;
> +			}
> +		}
> +	}
> +}
> +
> +static int video_init(void)
> +{
> +	char *NTSCFrame;
> +	NTSCFrame = (char *)NTSC_FRAME_ADDR;
> +	NTSC_framebuffer_init(NTSCFrame);
> +	fill_frame(NTSCFrame, BLUE);
> +
> +	*pPPI_CONTROL = 0x0082;
> +	*pPPI_FRAME = 0x020D;
> +
> +	*pDMA0_START_ADDR = NTSCFrame;
> +	*pDMA0_X_COUNT = 0x035A;
> +	*pDMA0_X_MODIFY = 0x0002;
> +	*pDMA0_Y_COUNT = 0x020D;
> +	*pDMA0_Y_MODIFY = 0x0002;
> +	*pDMA0_CONFIG = 0x1015;
> +	*pPPI_CONTROL = 0x0083;
> +	return 0;
> +}
> +
> +	error = device_register(&videodev);
> +
> +	return (error == 0) ? devices : error;
> +}
> +
> +#endif
> diff --git a/board/bf533-stamp/video.h b/board/bf533-stamp/video.h
> new file mode 100644
> index 0000000..d5a8bc8
> --- /dev/null
> +++ b/board/bf533-stamp/video.h
> @@ -0,0 +1,25 @@
> +#include <video_logo.h>
> +#define write_dest_byte(val) {*dest++=val;}
> +#define BLACK   (0x01800180)	/* black pixel pattern   */
> +#define BLUE    (0x296E29F0)	/* blue pixel pattern    */
> +#define RED     (0x51F0515A)	/* red pixel pattern     */
> +#define MAGENTA (0x6ADE6ACA)	/* magenta pixel pattern */
> +#define GREEN   (0x91229136)	/* green pixel pattern   */
> +#define CYAN    (0xAA10AAA6)	/* cyan pixel pattern    */
> +#define YELLOW  (0xD292D210)	/* yellow pixel pattern  */
> +#define WHITE   (0xFE80FE80)	/* white pixel pattern   */
> +
> +#define true 	1
WhiteSpace     ^
> +#define false	0
> +
> +typedef struct {
> +	unsigned int SAV;
> +	unsigned int EAV;
> +} SystemCodeType;
> +
> +const SystemCodeType SystemCodeMap[4] = {
> +	{0xFF000080, 0xFF00009D},
> +	{0xFF0000AB, 0xFF0000B6},
> +	{0xFF0000C7, 0xFF0000DA},
> +	{0xFF0000EC, 0xFF0000F1}
> +};
> -- 
Personnaly, I do not like var name that strart with UPPERCASE

Best Regards,
J.




More information about the U-Boot mailing list