Commit 1411a5ad authored by Dave Jones's avatar Dave Jones Committed by Dave Jones

[AGP] Hopefully get the KT400 working in AGP3.0 mode.

parent e4059995
...@@ -33,6 +33,7 @@ extern struct agp_bridge_data agp_bridge; ...@@ -33,6 +33,7 @@ extern struct agp_bridge_data agp_bridge;
/* Generic routines. */ /* Generic routines. */
void agp_generic_agp_enable(u32 mode); void agp_generic_agp_enable(u32 mode);
int agp_generic_agp_3_0_enable(u32 mode);
int agp_generic_create_gatt_table(void); int agp_generic_create_gatt_table(void);
int agp_generic_free_gatt_table(void); int agp_generic_free_gatt_table(void);
agp_memory *agp_create_memory(int scratch_pages); agp_memory *agp_create_memory(int scratch_pages);
......
#include <linux/list.h> #include <linux/list.h>
#include <linux/pci.h> #include <linux/pci.h>
//#include <linux/pagemap.h>
//#include <linux/miscdevice.h>
//#include <linux/pm.h>
#include <linux/agp_backend.h> #include <linux/agp_backend.h>
#include "agp.h" #include "agp.h"
...@@ -529,7 +524,7 @@ static int agp_3_0_node_enable(u32 mode, u32 minor) ...@@ -529,7 +524,7 @@ static int agp_3_0_node_enable(u32 mode, u32 minor)
* (AGP 3.0 devices are required to operate as AGP 2.0 devices * (AGP 3.0 devices are required to operate as AGP 2.0 devices
* when not using 3.0 electricals. * when not using 3.0 electricals.
*/ */
void agp_generic_agp_3_0_enable(u32 mode) int agp_generic_agp_3_0_enable(u32 mode)
{ {
u32 ncapid, major, minor, agp_3_0; u32 ncapid, major, minor, agp_3_0;
...@@ -548,9 +543,9 @@ void agp_generic_agp_3_0_enable(u32 mode) ...@@ -548,9 +543,9 @@ void agp_generic_agp_3_0_enable(u32 mode)
*/ */
if((agp_3_0 >> 3) & 0x1) { if((agp_3_0 >> 3) & 0x1) {
agp_3_0_node_enable(mode, minor); agp_3_0_node_enable(mode, minor);
return; return TRUE;
} }
} }
agp_generic_agp_enable(mode); return FALSE;
} }
...@@ -87,6 +87,11 @@ static aper_size_info_16 intel_7505_sizes[7] = ...@@ -87,6 +87,11 @@ static aper_size_info_16 intel_7505_sizes[7] =
{4, 1024, 0, 0xf3f} {4, 1024, 0, 0xf3f}
}; };
static void i7505_setup (u32 mode)
{
if ((agp_generic_agp_3_0_enable)==FALSE)
agp_generic_agp_enable(mode);
}
static int __init intel_7505_setup (struct pci_dev *pdev) static int __init intel_7505_setup (struct pci_dev *pdev)
{ {
...@@ -102,7 +107,7 @@ static int __init intel_7505_setup (struct pci_dev *pdev) ...@@ -102,7 +107,7 @@ static int __init intel_7505_setup (struct pci_dev *pdev)
agp_bridge.cleanup = intel_7505_cleanup; agp_bridge.cleanup = intel_7505_cleanup;
agp_bridge.tlb_flush = intel_7505_tlbflush; agp_bridge.tlb_flush = intel_7505_tlbflush;
agp_bridge.mask_memory = intel_mask_memory; agp_bridge.mask_memory = intel_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_3_0_enable; agp_bridge.agp_enable = i7505_enable;
agp_bridge.cache_flush = global_cache_flush; agp_bridge.cache_flush = global_cache_flush;
agp_bridge.create_gatt_table = agp_generic_create_gatt_table; agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
agp_bridge.free_gatt_table = agp_generic_free_gatt_table; agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
......
...@@ -94,7 +94,7 @@ static struct gatt_mask via_generic_masks[] = ...@@ -94,7 +94,7 @@ static struct gatt_mask via_generic_masks[] =
{.mask = 0x00000000, .type = 0} {.mask = 0x00000000, .type = 0}
}; };
int __init via_generic_setup (struct pci_dev *pdev) static int __init via_generic_setup (struct pci_dev *pdev)
{ {
agp_bridge.masks = via_generic_masks; agp_bridge.masks = via_generic_masks;
agp_bridge.num_of_masks = 1; agp_bridge.num_of_masks = 1;
...@@ -124,7 +124,44 @@ int __init via_generic_setup (struct pci_dev *pdev) ...@@ -124,7 +124,44 @@ int __init via_generic_setup (struct pci_dev *pdev)
return 0; return 0;
} }
struct agp_device_ids via_agp_device_ids[] __initdata =
static void via_kt400_enable(u32 mode)
{
if ((agp_generic_agp_3_0_enable)==FALSE)
agp_generic_agp_enable(mode);
}
static int __init via_kt400_setup(struct pci_dev *pdev)
{
agp_bridge.masks = via_generic_masks;
agp_bridge.num_of_masks = 1;
agp_bridge.aperture_sizes = (void *) via_generic_sizes;
agp_bridge.size_type = U8_APER_SIZE;
agp_bridge.num_aperture_sizes = 7;
agp_bridge.dev_private_data = NULL;
agp_bridge.needs_scratch_page = FALSE;
agp_bridge.configure = via_configure;
agp_bridge.fetch_size = via_fetch_size;
agp_bridge.cleanup = via_cleanup;
agp_bridge.tlb_flush = via_tlbflush;
agp_bridge.mask_memory = via_mask_memory;
agp_bridge.agp_enable = agp_generic_agp_enable;
agp_bridge.cache_flush = global_cache_flush;
agp_bridge.create_gatt_table = agp_generic_create_gatt_table;
agp_bridge.free_gatt_table = agp_generic_free_gatt_table;
agp_bridge.insert_memory = agp_generic_insert_memory;
agp_bridge.remove_memory = agp_generic_remove_memory;
agp_bridge.alloc_by_type = agp_generic_alloc_by_type;
agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.suspend = agp_generic_suspend;
agp_bridge.resume = agp_generic_resume;
agp_bridge.cant_use_aperture = 0;
return 0;
}
static struct agp_device_ids via_agp_device_ids[] __initdata =
{ {
{ {
.device_id = PCI_DEVICE_ID_VIA_8501_0, .device_id = PCI_DEVICE_ID_VIA_8501_0,
...@@ -170,6 +207,7 @@ struct agp_device_ids via_agp_device_ids[] __initdata = ...@@ -170,6 +207,7 @@ struct agp_device_ids via_agp_device_ids[] __initdata =
.device_id = PCI_DEVICE_ID_VIA_8377_0, .device_id = PCI_DEVICE_ID_VIA_8377_0,
.chipset = VIA_APOLLO_KT400, .chipset = VIA_APOLLO_KT400,
.chipset_name = "Apollo Pro KT400", .chipset_name = "Apollo Pro KT400",
.chipset_setup = via_kt400_setup,
}, },
{ {
.device_id = PCI_DEVICE_ID_VIA_8653_0, .device_id = PCI_DEVICE_ID_VIA_8653_0,
......
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