aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/pci
diff options
context:
space:
mode:
authorRobert Richter <robert.richter@amd.com>2008-06-12 14:19:23 -0400
committerIngo Molnar <mingo@elte.hu>2008-07-08 01:47:39 -0400
commit3a27dd1ce5de08e21e0266ddf00e6f1f843bfe8b (patch)
treeb72316cfbe10d1f955a0cb9553879fb2bb14344b /arch/x86/pci
parent24bfdca7b7da971ef9a483303a096ac6d4b3a02c (diff)
x86: Move PCI IO ECS code to x86/pci
"Form follows function". Code is now where it belongs to. Signed-off-by: Robert Richter <robert.richter@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/pci')
-rw-r--r--arch/x86/pci/Makefile_321
-rw-r--r--arch/x86/pci/amd_bus.c32
-rw-r--r--arch/x86/pci/direct.c16
-rw-r--r--arch/x86/pci/pci.h1
4 files changed, 43 insertions, 7 deletions
diff --git a/arch/x86/pci/Makefile_32 b/arch/x86/pci/Makefile_32
index 89ec35d00efd..f647e7e56da4 100644
--- a/arch/x86/pci/Makefile_32
+++ b/arch/x86/pci/Makefile_32
@@ -22,3 +22,4 @@ pci-$(CONFIG_X86_NUMAQ) := numa.o irq.o
22pci-$(CONFIG_NUMA) += mp_bus_to_node.o 22pci-$(CONFIG_NUMA) += mp_bus_to_node.o
23 23
24obj-y += $(pci-y) common.o early.o 24obj-y += $(pci-y) common.o early.o
25obj-y += amd_bus.o
diff --git a/arch/x86/pci/amd_bus.c b/arch/x86/pci/amd_bus.c
index 5c2799c20e47..15f505d3a78e 100644
--- a/arch/x86/pci/amd_bus.c
+++ b/arch/x86/pci/amd_bus.c
@@ -1,5 +1,9 @@
1#include <linux/init.h> 1#include <linux/init.h>
2#include <linux/pci.h> 2#include <linux/pci.h>
3#include "pci.h"
4
5#ifdef CONFIG_X86_64
6
3#include <asm/pci-direct.h> 7#include <asm/pci-direct.h>
4#include <asm/mpspec.h> 8#include <asm/mpspec.h>
5#include <linux/cpumask.h> 9#include <linux/cpumask.h>
@@ -526,3 +530,31 @@ static int __init early_fill_mp_bus_info(void)
526} 530}
527 531
528postcore_initcall(early_fill_mp_bus_info); 532postcore_initcall(early_fill_mp_bus_info);
533
534#endif
535
536/* common 32/64 bit code */
537
538#define ENABLE_CF8_EXT_CFG (1ULL << 46)
539
540static void enable_pci_io_ecs_per_cpu(void *unused)
541{
542 u64 reg;
543 rdmsrl(MSR_AMD64_NB_CFG, reg);
544 if (!(reg & ENABLE_CF8_EXT_CFG)) {
545 reg |= ENABLE_CF8_EXT_CFG;
546 wrmsrl(MSR_AMD64_NB_CFG, reg);
547 }
548}
549
550static int __init enable_pci_io_ecs(void)
551{
552 /* assume all cpus from fam10h have IO ECS */
553 if (boot_cpu_data.x86 < 0x10)
554 return 0;
555 on_each_cpu(enable_pci_io_ecs_per_cpu, NULL, 1, 1);
556 pci_probe |= PCI_HAS_IO_ECS;
557 return 0;
558}
559
560postcore_initcall(enable_pci_io_ecs);
diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c
index 27d61b63def6..9915293500fb 100644
--- a/arch/x86/pci/direct.c
+++ b/arch/x86/pci/direct.c
@@ -265,14 +265,16 @@ void __init pci_direct_init(int type)
265 type); 265 type);
266 if (type == 1) { 266 if (type == 1) {
267 raw_pci_ops = &pci_direct_conf1; 267 raw_pci_ops = &pci_direct_conf1;
268 if (!raw_pci_ext_ops && cpu_has_pci_ext_cfg) { 268 if (raw_pci_ext_ops)
269 printk(KERN_INFO "PCI: Using configuration type 1 " 269 return;
270 "for extended access\n"); 270 if (!(pci_probe & PCI_HAS_IO_ECS))
271 raw_pci_ext_ops = &pci_direct_conf1; 271 return;
272 } 272 printk(KERN_INFO "PCI: Using configuration type 1 "
273 } else { 273 "for extended access\n");
274 raw_pci_ops = &pci_direct_conf2; 274 raw_pci_ext_ops = &pci_direct_conf1;
275 return;
275 } 276 }
277 raw_pci_ops = &pci_direct_conf2;
276} 278}
277 279
278int __init pci_direct_probe(void) 280int __init pci_direct_probe(void)
diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h
index f3972b12c60a..fd53db50eeeb 100644
--- a/arch/x86/pci/pci.h
+++ b/arch/x86/pci/pci.h
@@ -27,6 +27,7 @@
27#define PCI_CAN_SKIP_ISA_ALIGN 0x8000 27#define PCI_CAN_SKIP_ISA_ALIGN 0x8000
28#define PCI_USE__CRS 0x10000 28#define PCI_USE__CRS 0x10000
29#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000 29#define PCI_CHECK_ENABLE_AMD_MMCONF 0x20000
30#define PCI_HAS_IO_ECS 0x40000
30 31
31extern unsigned int pci_probe; 32extern unsigned int pci_probe;
32extern unsigned long pirq_table_addr; 33extern unsigned long pirq_table_addr;