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