diff options
Diffstat (limited to 'drivers/char/agp/uninorth-agp.c')
-rw-r--r-- | drivers/char/agp/uninorth-agp.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c index 6f48931ac1ce..95db71360d24 100644 --- a/drivers/char/agp/uninorth-agp.c +++ b/drivers/char/agp/uninorth-agp.c | |||
@@ -28,6 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | static int uninorth_rev; | 29 | static int uninorth_rev; |
30 | static int is_u3; | 30 | static int is_u3; |
31 | static u32 scratch_value; | ||
31 | 32 | ||
32 | #define DEFAULT_APERTURE_SIZE 256 | 33 | #define DEFAULT_APERTURE_SIZE 256 |
33 | #define DEFAULT_APERTURE_STRING "256" | 34 | #define DEFAULT_APERTURE_STRING "256" |
@@ -172,7 +173,7 @@ static int uninorth_insert_memory(struct agp_memory *mem, off_t pg_start, int ty | |||
172 | 173 | ||
173 | gp = (u32 *) &agp_bridge->gatt_table[pg_start]; | 174 | gp = (u32 *) &agp_bridge->gatt_table[pg_start]; |
174 | for (i = 0; i < mem->page_count; ++i) { | 175 | for (i = 0; i < mem->page_count; ++i) { |
175 | if (gp[i]) { | 176 | if (gp[i] != scratch_value) { |
176 | dev_info(&agp_bridge->dev->dev, | 177 | dev_info(&agp_bridge->dev->dev, |
177 | "uninorth_insert_memory: entry 0x%x occupied (%x)\n", | 178 | "uninorth_insert_memory: entry 0x%x occupied (%x)\n", |
178 | i, gp[i]); | 179 | i, gp[i]); |
@@ -214,8 +215,9 @@ int uninorth_remove_memory(struct agp_memory *mem, off_t pg_start, int type) | |||
214 | return 0; | 215 | return 0; |
215 | 216 | ||
216 | gp = (u32 *) &agp_bridge->gatt_table[pg_start]; | 217 | gp = (u32 *) &agp_bridge->gatt_table[pg_start]; |
217 | for (i = 0; i < mem->page_count; ++i) | 218 | for (i = 0; i < mem->page_count; ++i) { |
218 | gp[i] = 0; | 219 | gp[i] = scratch_value; |
220 | } | ||
219 | mb(); | 221 | mb(); |
220 | uninorth_tlbflush(mem); | 222 | uninorth_tlbflush(mem); |
221 | 223 | ||
@@ -421,8 +423,13 @@ static int uninorth_create_gatt_table(struct agp_bridge_data *bridge) | |||
421 | 423 | ||
422 | bridge->gatt_bus_addr = virt_to_phys(table); | 424 | bridge->gatt_bus_addr = virt_to_phys(table); |
423 | 425 | ||
426 | if (is_u3) | ||
427 | scratch_value = (page_to_phys(agp_bridge->scratch_page_page) >> PAGE_SHIFT) | 0x80000000UL; | ||
428 | else | ||
429 | scratch_value = cpu_to_le32((page_to_phys(agp_bridge->scratch_page_page) & 0xFFFFF000UL) | | ||
430 | 0x1UL); | ||
424 | for (i = 0; i < num_entries; i++) | 431 | for (i = 0; i < num_entries; i++) |
425 | bridge->gatt_table[i] = 0; | 432 | bridge->gatt_table[i] = scratch_value; |
426 | 433 | ||
427 | return 0; | 434 | return 0; |
428 | 435 | ||
@@ -519,6 +526,7 @@ const struct agp_bridge_driver uninorth_agp_driver = { | |||
519 | .agp_destroy_pages = agp_generic_destroy_pages, | 526 | .agp_destroy_pages = agp_generic_destroy_pages, |
520 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, | 527 | .agp_type_to_mask_type = agp_generic_type_to_mask_type, |
521 | .cant_use_aperture = true, | 528 | .cant_use_aperture = true, |
529 | .needs_scratch_page = true, | ||
522 | }; | 530 | }; |
523 | 531 | ||
524 | const struct agp_bridge_driver u3_agp_driver = { | 532 | const struct agp_bridge_driver u3_agp_driver = { |