Commit 946b9243 authored by Linus Torvalds's avatar Linus Torvalds

Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart

* master.kernel.org:/pub/scm/linux/kernel/git/davej/agpgart:
  [AGPGART] uninorth: Add module param 'aperture' for aperture size
parents 5d6aaf3f 18088748
...@@ -27,32 +27,42 @@ ...@@ -27,32 +27,42 @@
static int uninorth_rev; static int uninorth_rev;
static int is_u3; static int is_u3;
static char __devinitdata *aperture = NULL;
static int uninorth_fetch_size(void) static int uninorth_fetch_size(void)
{ {
int i; int i, size = 0;
u32 temp; struct aper_size_info_32 *values =
struct aper_size_info_32 *values; A_SIZE_32(agp_bridge->driver->aperture_sizes);
pci_read_config_dword(agp_bridge->dev, UNI_N_CFG_GART_BASE, &temp); if (aperture) {
temp &= ~(0xfffff000); char *save = aperture;
values = A_SIZE_32(agp_bridge->driver->aperture_sizes);
for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++) { size = memparse(aperture, &aperture) >> 20;
if (temp == values[i].size_value) { aperture = save;
agp_bridge->previous_size =
agp_bridge->current_size = (void *) (values + i); for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
agp_bridge->aperture_size_idx = i; if (size == values[i].size)
return values[i].size; break;
if (i == agp_bridge->driver->num_aperture_sizes) {
printk(KERN_ERR PFX "Invalid aperture size, using"
" default\n");
size = 0;
aperture = NULL;
} }
} }
agp_bridge->previous_size = if (!size) {
agp_bridge->current_size = (void *) (values + 1); for (i = 0; i < agp_bridge->driver->num_aperture_sizes; i++)
agp_bridge->aperture_size_idx = 1; if (values[i].size == 32)
return values[1].size; break;
}
return 0; agp_bridge->previous_size =
agp_bridge->current_size = (void *)(values + i);
agp_bridge->aperture_size_idx = i;
return values[i].size;
} }
static void uninorth_tlbflush(struct agp_memory *mem) static void uninorth_tlbflush(struct agp_memory *mem)
...@@ -683,5 +693,11 @@ static void __exit agp_uninorth_cleanup(void) ...@@ -683,5 +693,11 @@ static void __exit agp_uninorth_cleanup(void)
module_init(agp_uninorth_init); module_init(agp_uninorth_init);
module_exit(agp_uninorth_cleanup); module_exit(agp_uninorth_cleanup);
module_param(aperture, charp, 0);
MODULE_PARM_DESC(aperture,
"Aperture size, must be power of two between 4MB and an\n"
"\t\tupper limit specific to the UniNorth revision.\n"
"\t\tDefault: 32M");
MODULE_AUTHOR("Ben Herrenschmidt & Paul Mackerras"); MODULE_AUTHOR("Ben Herrenschmidt & Paul Mackerras");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment