2 * Support for the w100 frame buffer.
4 * Copyright (c) 2004-2005 Richard Purdie
5 * Copyright (c) 2005 Ian Molton
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
12 #define W100_GPIO_PORT_A 0
13 #define W100_GPIO_PORT_B 1
15 #define CLK_SRC_XTAL 0
20 unsigned long w100fb_gpio_read(int port);
21 void w100fb_gpio_write(int port, unsigned long value);
23 /* LCD Specific Routines and Config */
25 void (*change)(struct w100fb_par*);
26 void (*suspend)(struct w100fb_par*);
27 void (*resume)(struct w100fb_par*);
30 /* General Platform Specific w100 Register Values */
31 struct w100_gen_regs {
32 unsigned long lcd_format;
33 unsigned long lcdd_cntl1;
34 unsigned long lcdd_cntl2;
35 unsigned long genlcd_cntl1;
36 unsigned long genlcd_cntl2;
37 unsigned long genlcd_cntl3;
40 struct w100_gpio_regs {
41 unsigned long init_data1;
42 unsigned long init_data2;
43 unsigned long gpio_dir1;
44 unsigned long gpio_oe1;
45 unsigned long gpio_dir2;
46 unsigned long gpio_oe2;
49 /* Optional External Memory Configuration */
50 struct w100_mem_info {
51 unsigned long ext_cntl;
52 unsigned long sdram_mode_reg;
53 unsigned long ext_timing_cntl;
54 unsigned long io_cntl;
58 struct w100_bm_mem_info {
59 unsigned long ext_mem_bw;
61 unsigned long ext_timing_ctl;
62 unsigned long ext_cntl;
63 unsigned long mode_reg;
64 unsigned long io_cntl;
68 /* LCD Mode definition */
72 unsigned short left_margin;
73 unsigned short right_margin;
74 unsigned short upper_margin;
75 unsigned short lower_margin;
76 unsigned long crtc_ss;
77 unsigned long crtc_ls;
78 unsigned long crtc_gs;
79 unsigned long crtc_vpos_gs;
80 unsigned long crtc_rev;
81 unsigned long crtc_dclk;
82 unsigned long crtc_gclk;
83 unsigned long crtc_goe;
84 unsigned long crtc_ps1_active;
91 int pixclk_divider_rotated;
94 struct w100_pll_info {
95 uint16_t freq; /* desired Fout for PLL (Mhz) */
96 uint8_t M; /* input divider */
97 uint8_t N_int; /* VCO multiplier */
98 uint8_t N_fac; /* VCO multiplier fractional part */
103 /* Initial Video mode orientation flags */
104 #define INIT_MODE_ROTATED 0x1
105 #define INIT_MODE_FLIPPED 0x2
108 * This structure describes the machine which we are running on.
109 * It is set by machine specific code and used in the probe routine
110 * of drivers/video/w100fb.c
112 struct w100fb_mach_info {
113 /* General Platform Specific Registers */
114 struct w100_gen_regs *regs;
115 /* Table of modes the LCD is capable of */
116 struct w100_mode *modelist;
117 unsigned int num_modes;
118 /* Hooks for any platform specific tg/lcd code (optional) */
119 struct w100_tg_info *tg;
120 /* External memory definition (if present) */
121 struct w100_mem_info *mem;
122 /* Additional External memory definition (if present) */
123 struct w100_bm_mem_info *bm_mem;
124 /* GPIO definitions (optional) */
125 struct w100_gpio_regs *gpio;
126 /* Initial Mode flags */
127 unsigned int init_mode;
129 unsigned int xtal_freq;
130 /* Enable Xtal input doubler (1 == enable) */
131 unsigned int xtal_dbl;
134 /* General frame buffer data structure */
136 unsigned int chip_id;
139 unsigned int extmem_active;
141 unsigned int blanked;
142 unsigned int fastpll_mode;
143 unsigned long hsync_len;
144 struct w100_mode *mode;
145 struct w100_pll_info *pll_table;
146 struct w100fb_mach_info *mach;
147 uint32_t *saved_intmem;
148 uint32_t *saved_extmem;