1.1 --- a/include/jz4740_lcd.h Tue Jun 09 23:06:11 2015 +0200
1.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
1.3 @@ -1,77 +0,0 @@
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 __JZ4740_LCD_H__
1.28 -#define __JZ4740_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 -/* General values for colour depths and framebuffer characteristics. */
1.68 -
1.69 -#define LCD_MONOCHROME 0
1.70 -#define LCD_COLOR2 1
1.71 -#define LCD_COLOR4 2
1.72 -#define LCD_COLOR8 3
1.73 -#define LCD_COLOR16 4
1.74 -#define LCD_COLOR32 5
1.75 -
1.76 -/* Calculate nr. of bits per pixel and nr. of colors */
1.77 -#define NBITS(bit_code) (1 << (bit_code))
1.78 -#define NCOLORS(bit_code) (1 << NBITS(bit_code))
1.79 -
1.80 -#endif /* __JZ4740_LCD_H__ */
2.1 --- a/stage2/jzlcd.c Tue Jun 09 23:06:11 2015 +0200
2.2 +++ b/stage2/jzlcd.c Tue Jun 09 23:07:03 2015 +0200
2.3 @@ -1,5 +1,5 @@
2.4 /*
2.5 - * JzRISC lcd controller
2.6 + * JzRISC LCD controller
2.7 *
2.8 * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
2.9 * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
2.10 @@ -20,7 +20,6 @@
2.11 * MA 02111-1307 USA
2.12 */
2.13
2.14 -#include "jz4740_lcd.h"
2.15 #include "sdram.h"
2.16 #include "jzlcd.h"
2.17 #include "board.h"
3.1 --- a/stage2/jzlcd.h Tue Jun 09 23:06:11 2015 +0200
3.2 +++ b/stage2/jzlcd.h Tue Jun 09 23:07:03 2015 +0200
3.3 @@ -1,7 +1,10 @@
3.4 /*
3.5 - * JzRISC lcd controller
3.6 + * U-Boot and JzRISC LCD controller definitions
3.7 *
3.8 + * Copyright (C) 2001 Wolfgang Denk, DENX Software Engineering, wd@denx.de.
3.9 * Copyright (C) 2005-2007, Ingenic Semiconductor Inc.
3.10 + * Copyright (C) Xiangfu Liu <xiangfu@sharism.cc>
3.11 + * Copyright (C) 2015 Paul Boddie <paul@boddie.org.uk>
3.12 *
3.13 * This program is free software; you can redistribute it and/or
3.14 * modify it under the terms of the GNU General Public License as
3.15 @@ -27,13 +30,9 @@
3.16 void lcd_enable(void);
3.17 void lcd_disable(void);
3.18
3.19 -struct lcd_desc{
3.20 - unsigned int next_desc; /* LCDDAx */
3.21 - unsigned int databuf; /* LCDSAx */
3.22 - unsigned int frame_id; /* LCDFIDx */
3.23 - unsigned int cmd; /* LCDCMDx */
3.24 -};
3.25 -
3.26 +/*
3.27 + * Framebuffer characteristics
3.28 + */
3.29 struct jzfb_info {
3.30 unsigned int cfg; /* panel mode and pin usage etc. */
3.31 unsigned int w;
3.32 @@ -48,6 +47,60 @@
3.33 unsigned int bfw; /* begin of frame, in line count */
3.34 };
3.35
3.36 +/*
3.37 + * LCD controller stucture for JZSOC: JZ4740
3.38 + */
3.39 +struct jz_fb_dma_descriptor {
3.40 + unsigned long fdadr; /* Frame descriptor address register */
3.41 + unsigned long fsadr; /* Frame source address register */
3.42 + unsigned long fidr; /* Frame ID register */
3.43 + unsigned long ldcmd; /* Command register */
3.44 +};
3.45 +
3.46 +/*
3.47 + * Jz LCD info
3.48 + */
3.49 +struct jz_fb_info {
3.50 +
3.51 + unsigned long fdadr0; /* physical address of frame/palette descriptor */
3.52 + unsigned long fdadr1; /* physical address of frame descriptor */
3.53 +
3.54 + /* DMA descriptors */
3.55 + struct jz_fb_dma_descriptor *dmadesc_fblow;
3.56 + struct jz_fb_dma_descriptor *dmadesc_fbhigh;
3.57 + struct jz_fb_dma_descriptor *dmadesc_palette;
3.58 + unsigned long screen; /* address of frame buffer */
3.59 + unsigned long palette; /* address of palette memory */
3.60 + unsigned int palette_size;
3.61 +};
3.62 +
3.63 +/*
3.64 + * Concise display characteristics with low-level structure reference
3.65 + */
3.66 +typedef struct vidinfo {
3.67 + unsigned short vl_col; /* Number of columns (i.e. 640) */
3.68 + unsigned short vl_row; /* Number of rows (i.e. 480) */
3.69 + unsigned char vl_bpix; /* Bits per pixel, 0 = 1, 1 = 2, 2 = 4, 3 = 8 */
3.70 +
3.71 + struct jz_fb_info jz_fb;
3.72 +} vidinfo_t;
3.73 +
3.74 +/* General values for colour depths and framebuffer characteristics. */
3.75 +
3.76 +#define LCD_MONOCHROME 0
3.77 +#define LCD_COLOR2 1
3.78 +#define LCD_COLOR4 2
3.79 +#define LCD_COLOR8 3
3.80 +#define LCD_COLOR16 4
3.81 +#define LCD_COLOR32 5
3.82 +
3.83 +/* Calculate number of bits per pixel and number of colours. */
3.84 +
3.85 +#define NBITS(bit_code) (1 << (bit_code))
3.86 +#define NCOLORS(bit_code) (1 << NBITS(bit_code))
3.87 +
3.88 +/* Transfer and display types. */
3.89 +
3.90 #define MODE_MASK 0x0f
3.91 #define MODE_TFT_GEN 0x00
3.92 #define MODE_TFT_SHARP 0x01
3.93 @@ -92,12 +145,4 @@
3.94 #define DATA_NORMAL (0 << 17)
3.95 #define DATA_INVERSE (1 << 17)
3.96
3.97 -
3.98 -/* Jz LCDFB supported I/O controls. */
3.99 -#define FBIOSETBACKLIGHT 0x4688
3.100 -#define FBIODISPON 0x4689
3.101 -#define FBIODISPOFF 0x468a
3.102 -#define FBIORESET 0x468b
3.103 -#define FBIOPRINT_REG 0x468c
3.104 -
3.105 #endif /* __JZLCD_H__ */