1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/include/jz4740_lcd.h Sun Jun 07 02:20:54 2015 +0200
1.3 @@ -0,0 +1,84 @@
1.4 +/*
1.5 + * U-Boot JzRISC lcd controller definitions
1.6 + *
1.7 + * (C) Copyright 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de.
1.8 + * (C) Copyright Xiangfu Liu <xiangfu@sharism.cc>
1.9 + * (C) Copyright 2015 Paul Boddie <paul@boddie.org.uk>
1.10 + *
1.11 + * This program is free software; you can redistribute it and/or
1.12 + * modify it under the terms of the GNU General Public License as
1.13 + * published by the Free Software Foundation; either version 2 of
1.14 + * the License, or (at your option) any later version.
1.15 + *
1.16 + * This program is distributed in the hope that it will be useful,
1.17 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.18 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.19 + * GNU General Public License for more details.
1.20 + *
1.21 + * You should have received a copy of the GNU General Public License
1.22 + * along with this program; if not, write to the Free Software
1.23 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
1.24 + * MA 02111-1307 USA
1.25 + */
1.26 +
1.27 +#ifndef _LCD_H_
1.28 +#define _LCD_H_
1.29 +
1.30 +/*
1.31 + * LCD controller stucture for JZSOC: JZ4740
1.32 + */
1.33 +struct jz_fb_dma_descriptor {
1.34 + unsigned long fdadr; /* Frame descriptor address register */
1.35 + unsigned long fsadr; /* Frame source address register */
1.36 + unsigned long fidr; /* Frame ID register */
1.37 + unsigned long ldcmd; /* Command register */
1.38 +};
1.39 +
1.40 +/*
1.41 + * Jz LCD info
1.42 + */
1.43 +struct jz_fb_info {
1.44 +
1.45 + unsigned long fdadr0; /* physical address of frame/palette descriptor */
1.46 + unsigned long fdadr1; /* physical address of frame descriptor */
1.47 +
1.48 + /* DMA descriptors */
1.49 + struct jz_fb_dma_descriptor *dmadesc_fblow;
1.50 + struct jz_fb_dma_descriptor *dmadesc_fbhigh;
1.51 + struct jz_fb_dma_descriptor *dmadesc_palette;
1.52 + unsigned long screen; /* address of frame buffer */
1.53 + unsigned long palette; /* address of palette memory */
1.54 + unsigned int palette_size;
1.55 +};
1.56 +
1.57 +typedef struct vidinfo {
1.58 + unsigned short vl_col; /* Number of columns (i.e. 640) */
1.59 + unsigned short vl_row; /* Number of rows (i.e. 480) */
1.60 + unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */
1.61 +
1.62 + struct jz_fb_info jz_fb;
1.63 +} vidinfo_t;
1.64 +
1.65 +extern vidinfo_t panel_info;
1.66 +
1.67 +#define LCD_MONOCHROME 0
1.68 +#define LCD_COLOR2 1
1.69 +#define LCD_COLOR4 2
1.70 +#define LCD_COLOR8 3
1.71 +#define LCD_COLOR16 4
1.72 +#define LCD_COLOR32 5
1.73 +
1.74 +/* Default to 8bpp if bit depth not specified */
1.75 +#ifndef LCD_BPP
1.76 +#define LCD_BPP LCD_COLOR8
1.77 +#endif
1.78 +
1.79 +#ifndef PAGE_SIZE
1.80 +#define PAGE_SIZE 4096
1.81 +#endif
1.82 +
1.83 +/* Calculate nr. of bits per pixel and nr. of colors */
1.84 +#define NBITS(bit_code) (1 << (bit_code))
1.85 +#define NCOLORS(bit_code) (1 << NBITS(bit_code))
1.86 +
1.87 +#endif /* _LCD_H_ */