Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * linux/drivers/video/amifb.c -- Amiga builtin chipset frame buffer device | |
3 | * | |
4 | * Copyright (C) 1995-2003 Geert Uytterhoeven | |
5 | * | |
6 | * with work by Roman Zippel | |
7 | * | |
8 | * | |
9 | * This file is based on the Atari frame buffer device (atafb.c): | |
10 | * | |
11 | * Copyright (C) 1994 Martin Schaller | |
12 | * Roman Hodek | |
13 | * | |
14 | * with work by Andreas Schwab | |
15 | * Guenther Kelleter | |
16 | * | |
17 | * and on the original Amiga console driver (amicon.c): | |
18 | * | |
19 | * Copyright (C) 1993 Hamish Macdonald | |
20 | * Greg Harp | |
21 | * Copyright (C) 1994 David Carter [carter@compsci.bristol.ac.uk] | |
22 | * | |
23 | * with work by William Rucklidge (wjr@cs.cornell.edu) | |
24 | * Geert Uytterhoeven | |
25 | * Jes Sorensen (jds@kom.auc.dk) | |
26 | * | |
27 | * | |
28 | * History: | |
29 | * | |
30 | * - 24 Jul 96: Copper generates now vblank interrupt and | |
31 | * VESA Power Saving Protocol is fully implemented | |
32 | * - 14 Jul 96: Rework and hopefully last ECS bugs fixed | |
33 | * - 7 Mar 96: Hardware sprite support by Roman Zippel | |
34 | * - 18 Feb 96: OCS and ECS support by Roman Zippel | |
35 | * Hardware functions completely rewritten | |
36 | * - 2 Dec 95: AGA version by Geert Uytterhoeven | |
37 | * | |
38 | * This file is subject to the terms and conditions of the GNU General Public | |
39 | * License. See the file COPYING in the main directory of this archive | |
40 | * for more details. | |
41 | */ | |
42 | ||
43 | #include <linux/module.h> | |
44 | #include <linux/kernel.h> | |
45 | #include <linux/errno.h> | |
46 | #include <linux/string.h> | |
47 | #include <linux/mm.h> | |
1da177e4 LT |
48 | #include <linux/slab.h> |
49 | #include <linux/delay.h> | |
1da177e4 LT |
50 | #include <linux/interrupt.h> |
51 | #include <linux/fb.h> | |
52 | #include <linux/init.h> | |
53 | #include <linux/ioport.h> | |
54 | ||
55 | #include <asm/uaccess.h> | |
56 | #include <asm/system.h> | |
57 | #include <asm/irq.h> | |
58 | #include <asm/amigahw.h> | |
59 | #include <asm/amigaints.h> | |
60 | #include <asm/setup.h> | |
61 | ||
62 | #include "c2p.h" | |
63 | ||
64 | ||
65 | #define DEBUG | |
66 | ||
67 | #if !defined(CONFIG_FB_AMIGA_OCS) && !defined(CONFIG_FB_AMIGA_ECS) && !defined(CONFIG_FB_AMIGA_AGA) | |
68 | #define CONFIG_FB_AMIGA_OCS /* define at least one fb driver, this will change later */ | |
69 | #endif | |
70 | ||
71 | #if !defined(CONFIG_FB_AMIGA_OCS) | |
72 | # define IS_OCS (0) | |
73 | #elif defined(CONFIG_FB_AMIGA_ECS) || defined(CONFIG_FB_AMIGA_AGA) | |
74 | # define IS_OCS (chipset == TAG_OCS) | |
75 | #else | |
76 | # define CONFIG_FB_AMIGA_OCS_ONLY | |
77 | # define IS_OCS (1) | |
78 | #endif | |
79 | ||
80 | #if !defined(CONFIG_FB_AMIGA_ECS) | |
81 | # define IS_ECS (0) | |
82 | #elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_AGA) | |
83 | # define IS_ECS (chipset == TAG_ECS) | |
84 | #else | |
85 | # define CONFIG_FB_AMIGA_ECS_ONLY | |
86 | # define IS_ECS (1) | |
87 | #endif | |
88 | ||
89 | #if !defined(CONFIG_FB_AMIGA_AGA) | |
90 | # define IS_AGA (0) | |
91 | #elif defined(CONFIG_FB_AMIGA_OCS) || defined(CONFIG_FB_AMIGA_ECS) | |
92 | # define IS_AGA (chipset == TAG_AGA) | |
93 | #else | |
94 | # define CONFIG_FB_AMIGA_AGA_ONLY | |
95 | # define IS_AGA (1) | |
96 | #endif | |
97 | ||
98 | #ifdef DEBUG | |
99 | # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args) | |
100 | #else | |
101 | # define DPRINTK(fmt, args...) | |
102 | #endif | |
103 | ||
104 | /******************************************************************************* | |
105 | ||
106 | ||
107 | Generic video timings | |
108 | --------------------- | |
109 | ||
110 | Timings used by the frame buffer interface: | |
111 | ||
112 | +----------+---------------------------------------------+----------+-------+ | |
113 | | | ^ | | | | |
114 | | | |upper_margin | | | | |
115 |