added 2.6.29.6 aldebaran kernel
[nao-ulib.git] / kernel / 2.6.29.6-aldebaran-rt / lib / cimarron / cim / cimarron.c
blob0cb12407ffb0ffdab87bebdf0cb53093eaef2752
1 /*
2 * <LIC_AMD_STD>
3 * Copyright (C) 2005 Advanced Micro Devices, Inc. All Rights Reserved.
4 * </LIC_AMD_STD>
6 * <CTL_AMD_STD>
7 * </CTL_AMD_STD>
9 * <DOC_AMD_STD>
10 * Base include file for the Cimarron library. This file should be modified
11 * and included in any Cimarron-based project.
12 * </DOC_AMD_STD>
16 /*----------------------------------------------------------------------*/
17 /* MODULE SETTINGS */
18 /* The following #defines affect which modules are included in the */
19 /* project. */
20 /*----------------------------------------------------------------------*/
22 #define CIMARRON_INCLUDE_GP 1
23 #define CIMARRON_INCLUDE_VG 1
24 #define CIMARRON_INCLUDE_VIP 1
25 #define CIMARRON_INCLUDE_VOP 1
26 #define CIMARRON_INCLUDE_VIDEO 1
27 #define CIMARRON_INCLUDE_INIT 1
29 #define CIMARRON_INCLUDE_VG_READ_ROUTINES 1
30 #define CIMARRON_INCLUDE_DF_READ_ROUTINES 1
31 #define CIMARRON_INCLUDE_VIP_READ_ROUTINES 1
32 #define CIMARRON_INCLUDE_VOP_READ_ROUTINES 1
34 /*----------------------------------------------------------------------*/
35 /* HARDWARE ACCESS SETTINGS */
36 /* The following #defines affect how the Cimarron macros access the */
37 /* hardware. The hardware access macros are broken up into groups. */
38 /* Each group includes an enabling #define as well as several #define */
39 /* options that modify the macro configuration that is included. */
40 /* If the enabling define is deleted or all options are set to 0, the */
41 /* corresponding macros must be implemented by the user. The */
42 /* combinations are explained as follows: */
43 /* must be manually defined by the user. This allows a user to use the */
44 /* cim_defs.h file for only those macros that suit the needs of his/her */
45 /* project. For example, a user may need custom implementations of the */
46 /* I/O and MSR macros, but may still want to use the default macros to */
47 /* read and write hardware registers. The combinations are explained as */
48 /* follows: */
49 /* */
50 /* Register Group: */
51 /* Disabling define: */
52 /* CIMARRON_EXCLUDE_REGISTER_ACCESS_MACROS */
53 /* Define this setting to exclude the register access macros. */
54 /* This setting is the inverse of the other group settings in */
55 /* that these macros are included by default. This allows the */
56 /* cim_defs.h file to be included outside of cimarron.c for */
57 /* basic operations. */
58 /* */
59 /* Memory Group: */
60 /* Enabling define: */
61 /* CIMARRON_INCLUDE_STRING_MACROS */
62 /* Options: */
63 /* CIMARRON_OPTIMIZE_ASSEMBLY */
64 /* Set to 1 to allow the use of inline assembly when writing */
65 /* large chunks of data to memory. Essentially, this allows */
66 /* a rep movsd in place of a slower C for-loop. */
67 /* CIMARRON_OPTIMIZE_FORLOOP */
68 /* Define for C only data writes. */
69 /* */
70 /* MSR Group: */
71 /* Enabling define: */
72 /* CIMARRON_INCLUDE_MSR_MACROS */
73 /* Options: */
74 /* CIMARRON_MSR_DIRECT_ASM */
75 /* Set to 1 to allow the use of the rdmsr and wrmsr opcodes in */
76 /* inline assembly. */
77 /* CIMARRON_MSR_VSA_IO */
78 /* Set to 1 to access MSRs using a VSAII virtual register. */
79 /* CIMARRON_MSR_KERNEL_ROUTINE */
80 /* Set to 1 to access MSRs using a wrapper routine in the */
81 /* Linux kernel. */
82 /* */
83 /* IO Group: */
84 /* Enabling define: */
85 /* CIMARRON_INCLUDE_IO_MACROS */
86 /* Options: */
87 /* CIMARRON_IO_DIRECT_ACCESS */
88 /* Set to 1 to perform IO accesses using inline assembly. */
89 /* CIMARRON_IO_ABSTRACTED_ASM */
90 /* Set to 1 to perform IO using abstracted IO in Linux. */
91 /* */
92 /* Custom Group: */
93 /* Disabling define: */
94 /* CIMARRON_EXCLUDE_CUSTOM_MACROS */
95 /* By default, the custom macros (the macros used by */
96 /* gp_custom_convert_blt) are mapped to the normal command */
97 /* string macros. Setting this to 1 allows the user to */
98 /* create a custom implementation. */
99 /*----------------------------------------------------------------------*/
101 /* UNCOMMENT THE FOLLOWING LINE TO EXCLUDE BASIC REGISTER ACCESS MACROS */
103 /* #define CIMARRON_EXCLUDE_REGISTER_ACCESS_MACROS */
105 #define CIMARRON_INCLUDE_STRING_MACROS
106 #define CIMARRON_OPTIMIZE_ASSEMBLY 1
107 #define CIMARRON_OPTIMIZE_FORLOOP 0
108 #define CIMARRON_OPTIMIZE_ABSTRACTED_ASM 0
110 #define CIMARRON_INCLUDE_MSR_MACROS
111 #define CIMARRON_MSR_DIRECT_ASM 0
112 #define CIMARRON_MSR_VSA_IO 1
113 #define CIMARRON_MSR_ABSTRACTED_ASM 0
114 #define CIMARRON_MSR_KERNEL_ROUTINE 0
116 #define CIMARRON_INCLUDE_IO_MACROS
117 #define CIMARRON_IO_DIRECT_ACCESS 1
118 #define CIMARRON_IO_ABSTRACTED_ASM 0
120 /* UNCOMMENT THE FOLLOWING LINE TO IMPLEMENT CUSTOM MACROS FOR GP_CUSTOM_CONVERT_BLT */
122 /* #define CIMARRON_EXCLUDE_CUSTOM_MACROS */
124 /*----------------------------------------------------------------------*/
125 /* MODULE VARIABLES */
126 /* The following #defines affect how global variables in each Cimarron */
127 /* module are defined. These variables can be made static (to prevent */
128 /* naming conflicts) or they can be defined without the static keyword */
129 /* (to allow extern references). */
130 /*----------------------------------------------------------------------*/
132 #if 1
133 #define CIMARRON_STATIC static
134 #else
135 #define CIMARRON_STATIC
136 #endif
138 /*----------------------------------------------------------------------*/
139 /* CIMARRON GLOBAL VARIABLES */
140 /* These globals are used by the hardware access macros. They must be */
141 /* initialized by the application to point to the memory-mapped */
142 /* registers of their respective blocks. */
143 /*----------------------------------------------------------------------*/
145 unsigned char *cim_gp_ptr = (unsigned char *)0;
146 unsigned char *cim_fb_ptr = (unsigned char *)0;
147 unsigned char *cim_cmd_base_ptr = (unsigned char *)0;
148 unsigned char *cim_cmd_ptr = (unsigned char *)0;
149 unsigned char *cim_vid_ptr = (unsigned char *)0;
150 unsigned char *cim_vip_ptr = (unsigned char *)0;
151 unsigned char *cim_vg_ptr = (unsigned char *)0;
153 /*----------------------------------------------------------------------*/
154 /* INCLUDE RELEVANT CIMARRON HEADERS */
155 /*----------------------------------------------------------------------*/
157 /* HARDWARE REGISTER DEFINITIONS */
159 #include "cim_regs.h"
161 /* ROUTINE DEFINITIONS */
162 /* All routines have a prototype, even those that are not included */
163 /* via #ifdefs. This prevents the user from having to include the */
164 /* correct #defines anywhere he/she wants to call a Cimarron routine. */
166 #include "cim_rtns.h"
168 /* HARDWARE ACCESS MACROS */
170 #include "cim_defs.h"
172 /*----------------------------------------------------------------------*/
173 /* CIMARRON MODULES */
174 /* Modules and sub-modules are included based on user settings. Note */
175 /* that excluding one or more modules may result in functionality */
176 /* holes. */
177 /*----------------------------------------------------------------------*/
179 /* GRAPHICS PROCESSOR */
181 #if CIMARRON_INCLUDE_GP
182 #include "cim_gp.c"
183 #endif
185 /* VIDEO GENERATOR */
187 #if CIMARRON_INCLUDE_VG
188 #include "cim_modes.c"
189 #include "cim_vg.c"
190 #endif
192 /* DISPLAY FILTER */
194 #if CIMARRON_INCLUDE_VIDEO
195 #include "cim_filter.c"
196 #include "cim_df.c"
197 #endif
199 /* INITIALIZATION AND DETECTION */
201 #if CIMARRON_INCLUDE_INIT
202 #include "cim_init.c"
203 #endif
205 /* VIP SUPPORT */
207 #if CIMARRON_INCLUDE_VIP
208 #include "cim_vip.c"
209 #endif
211 /* VOP SUPPORT */
213 #if CIMARRON_INCLUDE_VOP
214 #include "cim_vop.c"
215 #endif
217 /* MSR ACCESS */
218 /* This module is used to access machine-specific registers. */
219 /* It cannot be excluded from a project. */
221 #include "cim_msr.c"