1 /* 2 * U-Boot JzRISC lcd controller definitions 3 * 4 * (C) Copyright 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de. 5 * (C) Copyright Xiangfu Liu <xiangfu@sharism.cc> 6 * (C) Copyright 2015 Paul Boddie <paul@boddie.org.uk> 7 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License as 10 * published by the Free Software Foundation; either version 2 of 11 * the License, or (at your option) any later version. 12 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * GNU General Public License for more details. 17 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, 21 * MA 02111-1307 USA 22 */ 23 24 #ifndef _LCD_H_ 25 #define _LCD_H_ 26 27 /* 28 * LCD controller stucture for JZSOC: JZ4740 29 */ 30 struct jz_fb_dma_descriptor { 31 unsigned long fdadr; /* Frame descriptor address register */ 32 unsigned long fsadr; /* Frame source address register */ 33 unsigned long fidr; /* Frame ID register */ 34 unsigned long ldcmd; /* Command register */ 35 }; 36 37 /* 38 * Jz LCD info 39 */ 40 struct jz_fb_info { 41 42 unsigned long fdadr0; /* physical address of frame/palette descriptor */ 43 unsigned long fdadr1; /* physical address of frame descriptor */ 44 45 /* DMA descriptors */ 46 struct jz_fb_dma_descriptor * dmadesc_fblow; 47 struct jz_fb_dma_descriptor * dmadesc_fbhigh; 48 struct jz_fb_dma_descriptor * dmadesc_palette; 49 unsigned long screen; /* address of frame buffer */ 50 unsigned long palette; /* address of palette memory */ 51 unsigned int palette_size; 52 }; 53 54 typedef struct vidinfo { 55 unsigned short vl_col; /* Number of columns (i.e. 640) */ 56 unsigned short vl_row; /* Number of rows (i.e. 480) */ 57 unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ 58 59 struct jz_fb_info jz_fb; 60 } vidinfo_t; 61 62 extern vidinfo_t panel_info; 63 64 #define LCD_MONOCHROME 0 65 #define LCD_COLOR2 1 66 #define LCD_COLOR4 2 67 #define LCD_COLOR8 3 68 #define LCD_COLOR16 4 69 #define LCD_COLOR32 5 70 71 /* Default to 8bpp if bit depth not specified */ 72 #ifndef LCD_BPP 73 #define LCD_BPP LCD_COLOR8 74 #endif 75 76 #ifndef PAGE_SIZE 77 #define PAGE_SIZE 4096 78 #endif 79 80 /* Calculate nr. of bits per pixel and nr. of colors */ 81 #define NBITS(bit_code) (1 << (bit_code)) 82 #define NCOLORS(bit_code) (1 << NBITS(bit_code)) 83 84 #endif /* _LCD_H_ */