Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
162d1fd2
Commit
162d1fd2
authored
Sep 04, 2003
by
Linus Torvalds
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://linux-dj.bkbits.net/agpgart
into home.osdl.org:/home/torvalds/v2.5/linux
parents
bcf41bfd
0d0823fc
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
44 additions
and
45 deletions
+44
-45
arch/i386/defconfig
arch/i386/defconfig
+1
-1
arch/x86_64/defconfig
arch/x86_64/defconfig
+1
-1
arch/x86_64/kernel/pci-gart.c
arch/x86_64/kernel/pci-gart.c
+2
-2
drivers/char/agp/Kconfig
drivers/char/agp/Kconfig
+1
-2
drivers/char/agp/Makefile
drivers/char/agp/Makefile
+1
-1
drivers/char/agp/amd64-agp.c
drivers/char/agp/amd64-agp.c
+37
-37
drivers/char/agp/i460-agp.c
drivers/char/agp/i460-agp.c
+1
-1
No files found.
arch/i386/defconfig
View file @
162d1fd2
...
...
@@ -718,7 +718,7 @@ CONFIG_AGP=y
# CONFIG_AGP_ALI is not set
# CONFIG_AGP_ATI is not set
# CONFIG_AGP_AMD is not set
# CONFIG_AGP_AMD
_8151
is not set
# CONFIG_AGP_AMD
64
is not set
CONFIG_AGP_INTEL=y
# CONFIG_AGP_NVIDIA is not set
# CONFIG_AGP_SIS is not set
...
...
arch/x86_64/defconfig
View file @
162d1fd2
...
...
@@ -561,7 +561,7 @@ CONFIG_RTC=y
#
# CONFIG_FTAPE is not set
CONFIG_AGP=y
CONFIG_AGP_AMD
_8151
=y
CONFIG_AGP_AMD
64
=y
# CONFIG_DRM is not set
# CONFIG_MWAVE is not set
CONFIG_RAW_DRIVER=y
...
...
arch/x86_64/kernel/pci-gart.c
View file @
162d1fd2
...
...
@@ -675,7 +675,7 @@ static __init int init_k8_gatt(struct agp_kern_info *info)
return
-
1
;
}
extern
int
agp_amd
k8
_init
(
void
);
extern
int
agp_amd
64
_init
(
void
);
static
int
__init
pci_iommu_init
(
void
)
{
...
...
@@ -690,7 +690,7 @@ static int __init pci_iommu_init(void)
/* Makefile puts PCI initialization via subsys_initcall first. */
/* Add other K8 AGP bridge drivers here */
no_agp
=
no_agp
||
(
agp_amd
k8
_init
()
<
0
)
||
(
agp_amd
64
_init
()
<
0
)
||
(
agp_copy_info
(
&
info
)
<
0
);
#endif
...
...
drivers/char/agp/Kconfig
View file @
162d1fd2
...
...
@@ -63,8 +63,7 @@ config AGP_AMD
You should say Y here if you use XFree86 3.3.6 or 4.x and want to
use GLX or DRI. If unsure, say N.
# RED-PEN this option is misnamed, it's not 8151 specific
config AGP_AMD_8151
config AGP_AMD64
tristate "AMD Opteron/Athlon64 on-CPU GART support" if !GART_IOMMU
depends on AGP && X86
default y if GART_IOMMU
...
...
drivers/char/agp/Makefile
View file @
162d1fd2
...
...
@@ -4,7 +4,7 @@ obj-$(CONFIG_AGP) += agpgart.o
obj-$(CONFIG_AGP_ALI)
+=
ali-agp.o
obj-$(CONFIG_AGP_ATI)
+=
ati-agp.o
obj-$(CONFIG_AGP_AMD)
+=
amd-k7-agp.o
obj-$(CONFIG_AGP_AMD
_8151)
+=
amd-k8
-agp.o
obj-$(CONFIG_AGP_AMD
64)
+=
amd64
-agp.o
obj-$(CONFIG_AGP_ALPHA_CORE)
+=
alpha-agp.o
obj-$(CONFIG_AGP_HP_ZX1)
+=
hp-agp.o
obj-$(CONFIG_AGP_I460)
+=
i460-agp.o
...
...
drivers/char/agp/amd
-k8
-agp.c
→
drivers/char/agp/amd
64
-agp.c
View file @
162d1fd2
...
...
@@ -14,7 +14,7 @@
#include <linux/agp_backend.h>
#include "agp.h"
/* Will need to be increased if
hammer
ever goes >8-way. */
/* Will need to be increased if
AMD64
ever goes >8-way. */
#ifdef CONFIG_SMP
#define MAX_HAMMER_GARTS 8
#else
...
...
@@ -42,7 +42,7 @@ static int __initdata agp_try_unsupported;
static
int
gart_iterator
;
#define for_each_nb() for(gart_iterator=0;gart_iterator<nr_garts;gart_iterator++)
static
void
flush_
x86_
64_tlb
(
struct
pci_dev
*
dev
)
static
void
flush_
amd
64_tlb
(
struct
pci_dev
*
dev
)
{
u32
tmp
;
...
...
@@ -51,13 +51,13 @@ static void flush_x86_64_tlb(struct pci_dev *dev)
pci_write_config_dword
(
dev
,
AMD64_GARTCACHECTL
,
tmp
);
}
static
void
amd
_x86_
64_tlbflush
(
struct
agp_memory
*
temp
)
static
void
amd64_tlbflush
(
struct
agp_memory
*
temp
)
{
for_each_nb
()
flush_
x86_
64_tlb
(
hammers
[
gart_iterator
]);
flush_
amd
64_tlb
(
hammers
[
gart_iterator
]);
}
static
int
x86_
64_insert_memory
(
struct
agp_memory
*
mem
,
off_t
pg_start
,
int
type
)
static
int
amd
64_insert_memory
(
struct
agp_memory
*
mem
,
off_t
pg_start
,
int
type
)
{
int
i
,
j
,
num_entries
;
long
tmp
;
...
...
@@ -97,7 +97,7 @@ static int x86_64_insert_memory(struct agp_memory *mem, off_t pg_start, int type
agp_bridge
->
gatt_table
[
j
]
=
pte
;
}
amd
_x86_
64_tlbflush
(
mem
);
amd64_tlbflush
(
mem
);
return
0
;
}
...
...
@@ -106,7 +106,7 @@ static int x86_64_insert_memory(struct agp_memory *mem, off_t pg_start, int type
* to the size of a long. It sucks. I totally disown this, even
* though it does appear to work for the most part.
*/
static
struct
aper_size_info_32
x86_
64_aperture_sizes
[
7
]
=
static
struct
aper_size_info_32
amd
64_aperture_sizes
[
7
]
=
{
{
32
,
8192
,
3
+
(
sizeof
(
long
)
/
8
),
0
},
{
64
,
16384
,
4
+
(
sizeof
(
long
)
/
8
),
1
<<
1
},
...
...
@@ -124,7 +124,7 @@ static struct aper_size_info_32 x86_64_aperture_sizes[7] =
* the value from the first one we find. The set_size functions
* keep the rest coherent anyway. Or at least should do.
*/
static
int
amd
_x86_
64_fetch_size
(
void
)
static
int
amd64_fetch_size
(
void
)
{
struct
pci_dev
*
dev
;
int
i
;
...
...
@@ -137,7 +137,7 @@ static int amd_x86_64_fetch_size(void)
pci_read_config_dword
(
dev
,
AMD64_GARTAPERTURECTL
,
&
temp
);
temp
=
(
temp
&
0xe
);
values
=
A_SIZE_32
(
x86_
64_aperture_sizes
);
values
=
A_SIZE_32
(
amd
64_aperture_sizes
);
for
(
i
=
0
;
i
<
agp_bridge
->
driver
->
num_aperture_sizes
;
i
++
)
{
if
(
temp
==
values
[
i
].
size_value
)
{
...
...
@@ -155,7 +155,7 @@ static int amd_x86_64_fetch_size(void)
* In a multiprocessor x86-64 system, this function gets
* called once for each CPU.
*/
static
u64
amd
_x86_
64_configure
(
struct
pci_dev
*
hammer
,
u64
gatt_table
)
static
u64
amd64_configure
(
struct
pci_dev
*
hammer
,
u64
gatt_table
)
{
u64
aperturebase
;
u32
tmp
;
...
...
@@ -180,7 +180,7 @@ static u64 amd_x86_64_configure (struct pci_dev *hammer, u64 gatt_table)
pci_write_config_dword
(
hammer
,
AMD64_GARTAPERTURECTL
,
tmp
);
/* keep CPU's coherent. */
flush_
x86_
64_tlb
(
hammer
);
flush_
amd
64_tlb
(
hammer
);
return
aper_base
;
}
...
...
@@ -204,13 +204,13 @@ static int amd_8151_configure(void)
/* Configure AGP regs in each x86-64 host bridge. */
for_each_nb
()
{
agp_bridge
->
gart_bus_addr
=
amd
_x86_
64_configure
(
hammers
[
gart_iterator
],
gatt_bus
);
amd64_configure
(
hammers
[
gart_iterator
],
gatt_bus
);
}
return
0
;
}
static
void
amd
_8151
_cleanup
(
void
)
static
void
amd
64
_cleanup
(
void
)
{
u32
tmp
;
...
...
@@ -229,16 +229,16 @@ struct agp_bridge_driver amd_8151_driver = {
.
size_type
=
U32_APER_SIZE
,
.
num_aperture_sizes
=
7
,
.
configure
=
amd_8151_configure
,
.
fetch_size
=
amd
_x86_
64_fetch_size
,
.
cleanup
=
amd
_8151
_cleanup
,
.
tlb_flush
=
amd
_x86_
64_tlbflush
,
.
fetch_size
=
amd64_fetch_size
,
.
cleanup
=
amd
64
_cleanup
,
.
tlb_flush
=
amd64_tlbflush
,
.
mask_memory
=
agp_generic_mask_memory
,
.
masks
=
NULL
,
.
agp_enable
=
agp_generic_enable
,
.
cache_flush
=
global_cache_flush
,
.
create_gatt_table
=
agp_generic_create_gatt_table
,
.
free_gatt_table
=
agp_generic_free_gatt_table
,
.
insert_memory
=
x86_
64_insert_memory
,
.
insert_memory
=
amd
64_insert_memory
,
.
remove_memory
=
agp_generic_remove_memory
,
.
alloc_by_type
=
agp_generic_alloc_by_type
,
.
free_by_type
=
agp_generic_free_by_type
,
...
...
@@ -364,13 +364,13 @@ static __init int cache_nbs (struct pci_dev *pdev, u32 cap_ptr)
return
i
==
0
?
-
1
:
0
;
}
static
int
__init
agp_amd
k8
_probe
(
struct
pci_dev
*
pdev
,
static
int
__init
agp_amd
64
_probe
(
struct
pci_dev
*
pdev
,
const
struct
pci_device_id
*
ent
)
{
struct
agp_bridge_data
*
bridge
;
u8
rev_id
;
u8
cap_ptr
;
char
*
revstring
=
" "
;
char
*
revstring
=
NULL
;
cap_ptr
=
pci_find_capability
(
pdev
,
PCI_CAP_ID_AGP
);
if
(
!
cap_ptr
)
...
...
@@ -431,17 +431,17 @@ static int __init agp_amdk8_probe(struct pci_dev *pdev,
return
agp_add_bridge
(
bridge
);
}
static
void
__devexit
agp_amd
k8
_remove
(
struct
pci_dev
*
pdev
)
static
void
__devexit
agp_amd
64
_remove
(
struct
pci_dev
*
pdev
)
{
struct
agp_bridge_data
*
bridge
=
pci_get_drvdata
(
pdev
);
release_mem_region
(
virt_to_phys
(
bridge
->
gatt_table_real
),
x86_
64_aperture_sizes
[
bridge
->
aperture_size_idx
].
size
);
amd
64_aperture_sizes
[
bridge
->
aperture_size_idx
].
size
);
agp_remove_bridge
(
bridge
);
agp_put_bridge
(
bridge
);
}
static
struct
pci_device_id
agp_amd
k8
_pci_table
[]
=
{
static
struct
pci_device_id
agp_amd
64
_pci_table
[]
=
{
{
.
class
=
(
PCI_CLASS_BRIDGE_HOST
<<
8
),
.
class_mask
=
~
0
,
...
...
@@ -479,23 +479,23 @@ static struct pci_device_id agp_amdk8_pci_table[] = {
{
}
};
MODULE_DEVICE_TABLE
(
pci
,
agp_amd
k8
_pci_table
);
MODULE_DEVICE_TABLE
(
pci
,
agp_amd
64
_pci_table
);
static
struct
pci_driver
agp_amd
k8
_pci_driver
=
{
.
name
=
"agpgart-amd
-k8
"
,
.
id_table
=
agp_amd
k8
_pci_table
,
.
probe
=
agp_amd
k8
_probe
,
.
remove
=
agp_amd
k8
_remove
,
static
struct
pci_driver
agp_amd
64
_pci_driver
=
{
.
name
=
"agpgart-amd
64
"
,
.
id_table
=
agp_amd
64
_pci_table
,
.
probe
=
agp_amd
64
_probe
,
.
remove
=
agp_amd
64
_remove
,
};
/* Not static due to IOMMU code calling it early. */
int
__init
agp_amd
k8
_init
(
void
)
int
__init
agp_amd
64
_init
(
void
)
{
int
err
=
0
;
if
(
agp_off
)
return
-
EINVAL
;
if
(
pci_module_init
(
&
agp_amd
k8
_pci_driver
)
==
0
)
{
if
(
pci_module_init
(
&
agp_amd
64
_pci_driver
)
==
0
)
{
struct
pci_dev
*
dev
;
if
(
!
agp_try_unsupported
&&
!
agp_try_unsupported_boot
)
{
printk
(
KERN_INFO
"No supported AGP bridge found.
\n
"
);
...
...
@@ -507,7 +507,7 @@ int __init agp_amdk8_init(void)
return
-
ENODEV
;
}
/* First check that we have at least one
K8
NB */
/* First check that we have at least one
AMD64
NB */
if
(
!
pci_find_device
(
PCI_VENDOR_ID_AMD
,
0x1103
,
NULL
))
return
-
ENODEV
;
...
...
@@ -518,7 +518,7 @@ int __init agp_amdk8_init(void)
if
(
!
pci_find_capability
(
dev
,
PCI_CAP_ID_AGP
))
continue
;
/* Only one bridge supported right now */
if
(
agp_amd
k8
_probe
(
dev
,
NULL
)
==
0
)
{
if
(
agp_amd
64
_probe
(
dev
,
NULL
)
==
0
)
{
err
=
0
;
break
;
}
...
...
@@ -527,16 +527,16 @@ int __init agp_amdk8_init(void)
return
err
;
}
static
void
__exit
agp_amd
k8
_cleanup
(
void
)
static
void
__exit
agp_amd
64
_cleanup
(
void
)
{
pci_unregister_driver
(
&
agp_amd
k8
_pci_driver
);
pci_unregister_driver
(
&
agp_amd
64
_pci_driver
);
}
/* On
x86-
64 the PCI driver needs to initialize this driver early
/* On
AMD
64 the PCI driver needs to initialize this driver early
for the IOMMU, so it has to be called via a backdoor. */
#ifndef CONFIG_GART_IOMMU
module_init
(
agp_amd
k8
_init
);
module_exit
(
agp_amd
k8
_cleanup
);
module_init
(
agp_amd
64
_init
);
module_exit
(
agp_amd
64
_cleanup
);
#endif
MODULE_AUTHOR
(
"Dave Jones <davej@codemonkey.org.uk>, Andi Kleen"
);
...
...
drivers/char/agp/i460-agp.c
View file @
162d1fd2
...
...
@@ -128,7 +128,7 @@ static int i460_fetch_size (void)
if
(
temp
&
I460_BAPBASE_ENABLE
)
i460
.
dynamic_apbase
=
INTEL_I460_BAPBASE
;
else
i460
.
dynamic_apbase
=
INTEL_I460
_APBASE
;
i460
.
dynamic_apbase
=
AGP
_APBASE
;
for
(
i
=
0
;
i
<
agp_bridge
->
driver
->
num_aperture_sizes
;
i
++
)
{
/*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment