# HG changeset patch # User Paul Boddie # Date 1433884023 -7200 # Node ID ae273a827f2024b52133b5d09bd16269e6d21694 # Parent dcbd2f63f9a2b084a1f0a64a074c003a4d9f88a3 Merged LCD-related header files. diff -r dcbd2f63f9a2 -r ae273a827f20 include/jz4740_lcd.h --- a/include/jz4740_lcd.h Tue Jun 09 23:06:11 2015 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* - * U-Boot JzRISC lcd controller definitions - * - * (C) Copyright 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de. - * (C) Copyright Xiangfu Liu - * (C) Copyright 2015 Paul Boddie - * - * 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 __JZ4740_LCD_H__ -#define __JZ4740_LCD_H__ - -/* - * LCD controller stucture for JZSOC: JZ4740 - */ -struct jz_fb_dma_descriptor { - unsigned long fdadr; /* Frame descriptor address register */ - unsigned long fsadr; /* Frame source address register */ - unsigned long fidr; /* Frame ID register */ - unsigned long ldcmd; /* Command register */ -}; - -/* - * Jz LCD info - */ -struct jz_fb_info { - - unsigned long fdadr0; /* physical address of frame/palette descriptor */ - unsigned long fdadr1; /* physical address of frame descriptor */ - - /* DMA descriptors */ - struct jz_fb_dma_descriptor *dmadesc_fblow; - struct jz_fb_dma_descriptor *dmadesc_fbhigh; - struct jz_fb_dma_descriptor *dmadesc_palette; - unsigned long screen; /* address of frame buffer */ - unsigned long palette; /* address of palette memory */ - unsigned int palette_size; -}; - -typedef struct vidinfo { - unsigned short vl_col; /* Number of columns (i.e. 640) */ - unsigned short vl_row; /* Number of rows (i.e. 480) */ - unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ - - struct jz_fb_info jz_fb; -} vidinfo_t; - -extern vidinfo_t panel_info; - -/* General values for colour depths and framebuffer characteristics. */ - -#define LCD_MONOCHROME 0 -#define LCD_COLOR2 1 -#define LCD_COLOR4 2 -#define LCD_COLOR8 3 -#define LCD_COLOR16 4 -#define LCD_COLOR32 5 - -/* Calculate nr. of bits per pixel and nr. of colors */ -#define NBITS(bit_code) (1 << (bit_code)) -#define NCOLORS(bit_code) (1 << NBITS(bit_code)) - -#endif /* __JZ4740_LCD_H__ */ diff -r dcbd2f63f9a2 -r ae273a827f20 stage2/jzlcd.c --- a/stage2/jzlcd.c Tue Jun 09 23:06:11 2015 +0200 +++ b/stage2/jzlcd.c Tue Jun 09 23:07:03 2015 +0200 @@ -1,5 +1,5 @@ /* - * JzRISC lcd controller + * JzRISC LCD controller * * Copyright (C) Xiangfu Liu * Copyright (C) 2015 Paul Boddie @@ -20,7 +20,6 @@ * MA 02111-1307 USA */ -#include "jz4740_lcd.h" #include "sdram.h" #include "jzlcd.h" #include "board.h" diff -r dcbd2f63f9a2 -r ae273a827f20 stage2/jzlcd.h --- a/stage2/jzlcd.h Tue Jun 09 23:06:11 2015 +0200 +++ b/stage2/jzlcd.h Tue Jun 09 23:07:03 2015 +0200 @@ -1,7 +1,10 @@ /* - * JzRISC lcd controller + * U-Boot and JzRISC LCD controller definitions * + * Copyright (C) 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de. * Copyright (C) 2005-2007, Ingenic Semiconductor Inc. + * Copyright (C) Xiangfu Liu + * Copyright (C) 2015 Paul Boddie * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -27,13 +30,9 @@ void lcd_enable(void); void lcd_disable(void); -struct lcd_desc{ - unsigned int next_desc; /* LCDDAx */ - unsigned int databuf; /* LCDSAx */ - unsigned int frame_id; /* LCDFIDx */ - unsigned int cmd; /* LCDCMDx */ -}; - +/* + * Framebuffer characteristics + */ struct jzfb_info { unsigned int cfg; /* panel mode and pin usage etc. */ unsigned int w; @@ -48,6 +47,60 @@ unsigned int bfw; /* begin of frame, in line count */ }; +/* + * LCD controller stucture for JZSOC: JZ4740 + */ +struct jz_fb_dma_descriptor { + unsigned long fdadr; /* Frame descriptor address register */ + unsigned long fsadr; /* Frame source address register */ + unsigned long fidr; /* Frame ID register */ + unsigned long ldcmd; /* Command register */ +}; + +/* + * Jz LCD info + */ +struct jz_fb_info { + + unsigned long fdadr0; /* physical address of frame/palette descriptor */ + unsigned long fdadr1; /* physical address of frame descriptor */ + + /* DMA descriptors */ + struct jz_fb_dma_descriptor *dmadesc_fblow; + struct jz_fb_dma_descriptor *dmadesc_fbhigh; + struct jz_fb_dma_descriptor *dmadesc_palette; + unsigned long screen; /* address of frame buffer */ + unsigned long palette; /* address of palette memory */ + unsigned int palette_size; +}; + +/* + * Concise display characteristics with low-level structure reference + */ +typedef struct vidinfo { + unsigned short vl_col; /* Number of columns (i.e. 640) */ + unsigned short vl_row; /* Number of rows (i.e. 480) */ + unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */ + + struct jz_fb_info jz_fb; +} vidinfo_t; + +/* General values for colour depths and framebuffer characteristics. */ + +#define LCD_MONOCHROME 0 +#define LCD_COLOR2 1 +#define LCD_COLOR4 2 +#define LCD_COLOR8 3 +#define LCD_COLOR16 4 +#define LCD_COLOR32 5 + +/* Calculate number of bits per pixel and number of colours. */ + +#define NBITS(bit_code) (1 << (bit_code)) +#define NCOLORS(bit_code) (1 << NBITS(bit_code)) + +/* Transfer and display types. */ + #define MODE_MASK 0x0f #define MODE_TFT_GEN 0x00 #define MODE_TFT_SHARP 0x01 @@ -92,12 +145,4 @@ #define DATA_NORMAL (0 << 17) #define DATA_INVERSE (1 << 17) - -/* Jz LCDFB supported I/O controls. */ -#define FBIOSETBACKLIGHT 0x4688 -#define FBIODISPON 0x4689 -#define FBIODISPOFF 0x468a -#define FBIORESET 0x468b -#define FBIOPRINT_REG 0x468c - #endif /* __JZLCD_H__ */