15 #include <linux/module.h>
16 #include <linux/pci.h>
17 #include <linux/slab.h>
20 #include <asm/sn/addrs.h>
21 #include <asm/sn/io.h>
66 tioca_tlbflush(mem->
bridge->dev_private_data);
77 return tioca_physpage_to_gart(addr);
90 static int sgi_tioca_configure(
void)
100 static int sgi_tioca_fetch_size(
void)
108 return sgi_tioca_sizes[0].
size;
146 switch (bridge->
driver->size_type) {
148 num_entries =
A_SIZE_8(temp)->num_entries;
151 num_entries =
A_SIZE_16(temp)->num_entries;
154 num_entries =
A_SIZE_32(temp)->num_entries;
170 if (type != 0 || mem->
type != 0) {
174 if ((pg_start + mem->
page_count) > num_entries)
186 bridge->
driver->cache_flush();
190 for (i = 0, j = pg_start; i < mem->
page_count; i++, j++) {
192 bridge->
driver->mask_memory(bridge,
197 bridge->
driver->tlb_flush(mem);
201 static int sgi_tioca_remove_memory(
struct agp_memory *mem,
off_t pg_start,
212 if (type != 0 || mem->
type != 0) {
222 bridge->
driver->tlb_flush(mem);
226 static void sgi_tioca_cache_flush(
void)
234 static void sgi_tioca_cleanup(
void)
243 if (bridge->
dev->bus == pdev->
bus)
252 .configure = sgi_tioca_configure,
253 .fetch_size = sgi_tioca_fetch_size,
254 .cleanup = sgi_tioca_cleanup,
255 .tlb_flush = sgi_tioca_tlbflush,
256 .mask_memory = sgi_tioca_mask_memory,
257 .agp_enable = sgi_tioca_agp_enable,
258 .cache_flush = sgi_tioca_cache_flush,
259 .create_gatt_table = sgi_tioca_create_gatt_table,
260 .free_gatt_table = sgi_tioca_free_gatt_table,
261 .insert_memory = sgi_tioca_insert_memory,
262 .remove_memory = sgi_tioca_remove_memory,
265 .agp_alloc_page = sgi_tioca_alloc_page,
268 .cant_use_aperture =
true,
269 .needs_scratch_page =
false,
270 .num_aperture_sizes = 1,
287 if (!sgi_tioca_agp_bridges)
305 sgi_tioca_agp_bridges[j]);
306 if (sgi_tioca_agp_bridges[j]) {
307 sgi_tioca_agp_bridges[
j]->
dev = pdev;
312 sgi_tioca_agp_bridges[
j]->
mode = (0x7D << 24) |
320 (
void *)&sgi_tioca_sizes[0];
330 static void __devexit agp_sgi_cleanup(
void)
332 kfree(sgi_tioca_agp_bridges);
333 sgi_tioca_agp_bridges =
NULL;