Commit e761e9ff authored by David Mosberger's avatar David Mosberger

ia64: Switch over to using ACPI PCI support routines. This gets rid of much of the

	code-duplication that existed between ACPI and the ia64 IOSAPIC code.
	To make this work, the Makefiles had to be re-organized to ensure that
	the ACPI subsystem is initialized before PCI (even though both are called
	via subsys-initcalls).
parent 18a2add4
...@@ -86,11 +86,10 @@ endif ...@@ -86,11 +86,10 @@ endif
HEAD := arch/$(ARCH)/kernel/head.o arch/ia64/kernel/init_task.o HEAD := arch/$(ARCH)/kernel/head.o arch/ia64/kernel/init_task.o
SUBDIRS := arch/$(ARCH)/tools arch/$(ARCH)/kernel arch/$(ARCH)/mm arch/$(ARCH)/lib $(SUBDIRS) libs-y += arch/$(ARCH)/lib/
CORE_FILES := arch/$(ARCH)/kernel/kernel.o arch/$(ARCH)/mm/mm.o $(CORE_FILES) core-y += arch/$(ARCH)/kernel/ arch/$(ARCH)/mm/
drivers-$(CONFIG_PCI) += arch/$(ARCH)/pci/
LIBS := $(TOPDIR)/arch/$(ARCH)/lib/lib.a $(LIBS) \ drivers-$(CONFIG_IA64_HP_ZX1) += arch/$(ARCH)/hp/common/ arch/$(ARCH)/hp/zx1/
$(TOPDIR)/arch/$(ARCH)/lib/lib.a
MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
......
...@@ -68,6 +68,7 @@ if [ "$CONFIG_IA64_GENERIC" = "y" -o "$CONFIG_IA64_DIG" = "y" -o "$CONFIG_IA64_H ...@@ -68,6 +68,7 @@ if [ "$CONFIG_IA64_GENERIC" = "y" -o "$CONFIG_IA64_DIG" = "y" -o "$CONFIG_IA64_H
then then
bool ' Enable IA-64 Machine Check Abort' CONFIG_IA64_MCA bool ' Enable IA-64 Machine Check Abort' CONFIG_IA64_MCA
define_bool CONFIG_PM y define_bool CONFIG_PM y
define_bool CONFIG_IOSAPIC y
fi fi
if [ "$CONFIG_IA64_SGI_SN1" = "y" -o "$CONFIG_IA64_SGI_SN2" = "y" ]; then if [ "$CONFIG_IA64_SGI_SN1" = "y" -o "$CONFIG_IA64_SGI_SN2" = "y" ]; then
......
...@@ -7,7 +7,6 @@ O_TARGET := hp.o ...@@ -7,7 +7,6 @@ O_TARGET := hp.o
subdir-$(CONFIG_IA64_GENERIC) += $(ALL_SUB_DIRS) subdir-$(CONFIG_IA64_GENERIC) += $(ALL_SUB_DIRS)
subdir-$(CONFIG_IA64_HP_SIM) += sim subdir-$(CONFIG_IA64_HP_SIM) += sim
subdir-$(CONFIG_IA64_HP_ZX1) += zx1 common
SUB_DIRS := $(subdir-y) SUB_DIRS := $(subdir-y)
obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o)) obj-y += $(join $(subdir-y),$(subdir-y:%=/%.o))
......
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
# Copyright (C) Alex Williamson (alex_williamson@hp.com) # Copyright (C) Alex Williamson (alex_williamson@hp.com)
# #
O_TARGET := common.o
export-objs := sba_iommu.o export-objs := sba_iommu.o
obj-y := sba_iommu.o obj-y := sba_iommu.o
......
# #
# ia64/platform/hp/zx1/Makefile # ia64/hp/zx1/Makefile
# #
# Copyright (C) 2002 Hewlett Packard # Copyright (C) 2002 Hewlett Packard
# Copyright (C) Alex Williamson (alex_williamson@hp.com) # Copyright (C) Alex Williamson (alex_williamson@hp.com)
# #
O_TARGET := zx1.o
obj-y := hpzx1_misc.o obj-y := hpzx1_misc.o
obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o obj-$(CONFIG_IA64_GENERIC) += hpzx1_machvec.o
......
...@@ -335,19 +335,14 @@ hpzx1_acpi_dev_init(void) ...@@ -335,19 +335,14 @@ hpzx1_acpi_dev_init(void)
extern void sba_init(void); extern void sba_init(void);
void static void
hpzx1_pci_fixup (int phase) hpzx1_init (void)
{ {
iosapic_pci_fixup(phase);
switch (phase) {
case 0:
/* zx1 has a hardware I/O TLB which lets us DMA from any device to any address */ /* zx1 has a hardware I/O TLB which lets us DMA from any device to any address */
MAX_DMA_ADDRESS = ~0UL; MAX_DMA_ADDRESS = ~0UL;
break;
case 1:
hpzx1_acpi_dev_init(); hpzx1_acpi_dev_init();
sba_init(); sba_init();
break;
}
} }
subsys_initcall(hpzx1_init);
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
# Makefile for the linux kernel. # Makefile for the linux kernel.
# #
O_TARGET := kernel.o
EXTRA_TARGETS := head.o init_task.o EXTRA_TARGETS := head.o init_task.o
export-objs := ia64_ksyms.o export-objs := ia64_ksyms.o
...@@ -10,12 +9,9 @@ export-objs := ia64_ksyms.o ...@@ -10,12 +9,9 @@ export-objs := ia64_ksyms.o
obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \ obj-y := acpi.o entry.o gate.o efi.o efi_stub.o ia64_ksyms.o irq.o irq_ia64.o irq_lsapic.o ivt.o \
machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \ machvec.o pal.o process.o perfmon.o ptrace.o sal.o semaphore.o setup.o \
signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o signal.o sys_ia64.o traps.o time.o unaligned.o unwind.o
obj-$(CONFIG_IA64_GENERIC) += iosapic.o obj-$(CONFIG_IOSAPIC) += iosapic.o
obj-$(CONFIG_IA64_HP_ZX1) += iosapic.o
obj-$(CONFIG_IA64_DIG) += iosapic.o
obj-$(CONFIG_IA64_PALINFO) += palinfo.o obj-$(CONFIG_IA64_PALINFO) += palinfo.o
obj-$(CONFIG_EFI_VARS) += efivars.o obj-$(CONFIG_EFI_VARS) += efivars.o
obj-$(CONFIG_PCI) += pci.o
obj-$(CONFIG_SMP) += smp.o smpboot.o obj-$(CONFIG_SMP) += smp.o smpboot.o
obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o obj-$(CONFIG_IA64_MCA) += mca.o mca_asm.o
obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o obj-$(CONFIG_IA64_BRL_EMU) += brl_emu.o
......
This diff is collapsed.
...@@ -208,6 +208,8 @@ ia64_mca_check_errors (void) ...@@ -208,6 +208,8 @@ ia64_mca_check_errors (void)
ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA); ia64_mca_log_sal_error_record(SAL_INFO_TYPE_MCA);
} }
device_initcall(ia64_mca_check_errors);
/* /*
* ia64_mca_register_cpev * ia64_mca_register_cpev
* *
......
...@@ -7,8 +7,6 @@ ...@@ -7,8 +7,6 @@
# #
# Note 2! The CFLAGS definition is now in the main makefile... # Note 2! The CFLAGS definition is now in the main makefile...
O_TARGET := mm.o
obj-y := init.o fault.o tlb.o extable.o obj-y := init.o fault.o tlb.o extable.o
obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o obj-$(CONFIG_HUGETLB_PAGE) += hugetlbpage.o
......
obj-y := pci.o
include $(TOPDIR)/Rules.make
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
*/ */
#include <linux/config.h> #include <linux/config.h>
#include <linux/acpi.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -100,16 +101,29 @@ pci_sal_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 ...@@ -100,16 +101,29 @@ pci_sal_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32
struct pci_ops pci_sal_ops = { struct pci_ops pci_sal_ops = {
.read = pci_sal_read, .read = pci_sal_read,
.write = pci_sal_write, .write = pci_sal_write
}; };
struct pci_ops *pci_root_ops = &pci_sal_ops; /* default to SAL */ struct pci_ops *pci_root_ops = &pci_sal_ops; /* default to SAL */
static int __init
pci_acpi_init (void)
{
if (!acpi_pci_irq_init())
printk(KERN_INFO "PCI: Using ACPI for IRQ routing\n");
else
printk(KERN_WARNING "PCI: Invalid ACPI-PCI IRQ routing table\n");
return 0;
}
subsys_initcall(pci_acpi_init);
/* Called by ACPI when it finds a new root bus. */
struct pci_bus * struct pci_bus *
pcibios_scan_root (int bus) pcibios_scan_root (int bus)
{ {
struct list_head *list = NULL; struct list_head *list;
struct pci_bus *pci_bus = NULL; struct pci_bus *pci_bus;
list_for_each(list, &pci_root_buses) { list_for_each(list, &pci_root_buses) {
pci_bus = pci_bus_b(list); pci_bus = pci_bus_b(list);
...@@ -124,33 +138,8 @@ pcibios_scan_root (int bus) ...@@ -124,33 +138,8 @@ pcibios_scan_root (int bus)
return pci_scan_bus(bus, pci_root_ops, NULL); return pci_scan_bus(bus, pci_root_ops, NULL);
} }
static int __init
pcibios_init (void)
{
# define PCI_BUSES_TO_SCAN 255
int i = 0;
acpi_init(); /* hackedy hack hack... */
#ifdef CONFIG_IA64_MCA
ia64_mca_check_errors(); /* For post-failure MCA error logging */
#endif
platform_pci_fixup(0); /* phase 0 fixups (before buses scanned) */
printk("PCI: Probing PCI hardware\n");
for (i = 0; i < PCI_BUSES_TO_SCAN; i++)
pci_scan_bus(i, pci_root_ops, NULL);
platform_pci_fixup(1); /* phase 1 fixups (after buses scanned) */
return 0;
}
subsys_initcall(pcibios_init);
/* /*
* Called after each bus is probed, but before its children * Called after each bus is probed, but before its children are examined.
* are examined.
*/ */
void __init void __init
pcibios_fixup_bus (struct pci_bus *b) pcibios_fixup_bus (struct pci_bus *b)
...@@ -235,7 +224,7 @@ pcibios_enable_device (struct pci_dev *dev, int mask) ...@@ -235,7 +224,7 @@ pcibios_enable_device (struct pci_dev *dev, int mask)
return ret; return ret;
printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", dev->irq, dev->slot_name); printk(KERN_INFO "PCI: Found IRQ %d for device %s\n", dev->irq, dev->slot_name);
return 0; return acpi_pci_irq_enable(dev);
} }
void void
......
...@@ -86,12 +86,10 @@ extern void machvec_noop (void); ...@@ -86,12 +86,10 @@ extern void machvec_noop (void);
# define platform_setup ia64_mv.setup # define platform_setup ia64_mv.setup
# define platform_cpu_init ia64_mv.cpu_init # define platform_cpu_init ia64_mv.cpu_init
# define platform_irq_init ia64_mv.irq_init # define platform_irq_init ia64_mv.irq_init
# define platform_map_nr ia64_mv.map_nr
# define platform_mca_init ia64_mv.mca_init # define platform_mca_init ia64_mv.mca_init
# define platform_mca_handler ia64_mv.mca_handler # define platform_mca_handler ia64_mv.mca_handler
# define platform_cmci_handler ia64_mv.cmci_handler # define platform_cmci_handler ia64_mv.cmci_handler
# define platform_log_print ia64_mv.log_print # define platform_log_print ia64_mv.log_print
# define platform_pci_fixup ia64_mv.pci_fixup
# define platform_send_ipi ia64_mv.send_ipi # define platform_send_ipi ia64_mv.send_ipi
# define platform_global_tlb_purge ia64_mv.global_tlb_purge # define platform_global_tlb_purge ia64_mv.global_tlb_purge
# define platform_pci_dma_init ia64_mv.dma_init # define platform_pci_dma_init ia64_mv.dma_init
...@@ -159,8 +157,6 @@ struct ia64_machine_vector { ...@@ -159,8 +157,6 @@ struct ia64_machine_vector {
platform_setup, \ platform_setup, \
platform_cpu_init, \ platform_cpu_init, \
platform_irq_init, \ platform_irq_init, \
platform_pci_fixup, \
platform_map_nr, \
platform_mca_init, \ platform_mca_init, \
platform_mca_handler, \ platform_mca_handler, \
platform_cmci_handler, \ platform_cmci_handler, \
...@@ -237,9 +233,6 @@ extern ia64_mv_pci_dma_supported swiotlb_pci_dma_supported; ...@@ -237,9 +233,6 @@ extern ia64_mv_pci_dma_supported swiotlb_pci_dma_supported;
#ifndef platform_log_print #ifndef platform_log_print
# define platform_log_print ((ia64_mv_log_print_t *) machvec_noop) # define platform_log_print ((ia64_mv_log_print_t *) machvec_noop)
#endif #endif
#ifndef platform_pci_fixup
# define platform_pci_fixup ((ia64_mv_pci_fixup_t *) machvec_noop)
#endif
#ifndef platform_send_ipi #ifndef platform_send_ipi
# define platform_send_ipi ia64_send_ipi /* default to architected version */ # define platform_send_ipi ia64_send_ipi /* default to architected version */
#endif #endif
......
...@@ -16,7 +16,5 @@ extern ia64_mv_map_nr_t map_nr_dense; ...@@ -16,7 +16,5 @@ extern ia64_mv_map_nr_t map_nr_dense;
#define platform_name "dig" #define platform_name "dig"
#define platform_setup dig_setup #define platform_setup dig_setup
#define platform_irq_init dig_irq_init #define platform_irq_init dig_irq_init
#define platform_pci_fixup iosapic_pci_fixup
#define platform_map_nr map_nr_dense
#endif /* _ASM_IA64_MACHVEC_DIG_h */ #endif /* _ASM_IA64_MACHVEC_DIG_h */
...@@ -15,6 +15,5 @@ extern ia64_mv_map_nr_t map_nr_dense; ...@@ -15,6 +15,5 @@ extern ia64_mv_map_nr_t map_nr_dense;
#define platform_name "hpsim" #define platform_name "hpsim"
#define platform_setup hpsim_setup #define platform_setup hpsim_setup
#define platform_irq_init hpsim_irq_init #define platform_irq_init hpsim_irq_init
#define platform_map_nr map_nr_dense
#endif /* _ASM_IA64_MACHVEC_HPSIM_h */ #endif /* _ASM_IA64_MACHVEC_HPSIM_h */
...@@ -22,8 +22,6 @@ extern ia64_mv_pci_dma_supported sba_dma_supported; ...@@ -22,8 +22,6 @@ extern ia64_mv_pci_dma_supported sba_dma_supported;
*/ */
#define platform_name "hpzx1" #define platform_name "hpzx1"
#define platform_setup dig_setup #define platform_setup dig_setup
#define platform_pci_fixup hpzx1_pci_fixup
#define platform_map_nr map_nr_dense
#define platform_pci_dma_init ((ia64_mv_pci_dma_init *) machvec_noop) #define platform_pci_dma_init ((ia64_mv_pci_dma_init *) machvec_noop)
#define platform_pci_alloc_consistent sba_alloc_consistent #define platform_pci_alloc_consistent sba_alloc_consistent
#define platform_pci_free_consistent sba_free_consistent #define platform_pci_free_consistent sba_free_consistent
......
...@@ -68,10 +68,8 @@ extern ia64_mv_pci_dma_address sn1_dma_address; ...@@ -68,10 +68,8 @@ extern ia64_mv_pci_dma_address sn1_dma_address;
#define platform_setup sn1_setup #define platform_setup sn1_setup
#define platform_cpu_init sn_cpu_init #define platform_cpu_init sn_cpu_init
#define platform_irq_init sn1_irq_init #define platform_irq_init sn1_irq_init
#define platform_map_nr sn1_map_nr
#define platform_send_ipi sn1_send_IPI #define platform_send_ipi sn1_send_IPI
#define platform_global_tlb_purge sn1_global_tlb_purge #define platform_global_tlb_purge sn1_global_tlb_purge
#define platform_pci_fixup sn1_pci_fixup
#define platform_inb sn1_inb #define platform_inb sn1_inb
#define platform_inw sn1_inw #define platform_inw sn1_inw
#define platform_inl sn1_inl #define platform_inl sn1_inl
......
...@@ -73,10 +73,8 @@ extern ia64_mv_pci_dma_address sn1_dma_address; ...@@ -73,10 +73,8 @@ extern ia64_mv_pci_dma_address sn1_dma_address;
#define platform_setup sn1_setup #define platform_setup sn1_setup
#define platform_cpu_init sn_cpu_init #define platform_cpu_init sn_cpu_init
#define platform_irq_init sn1_irq_init #define platform_irq_init sn1_irq_init
#define platform_map_nr sn2_map_nr
#define platform_send_ipi sn2_send_IPI #define platform_send_ipi sn2_send_IPI
#define platform_global_tlb_purge sn2_global_tlb_purge #define platform_global_tlb_purge sn2_global_tlb_purge
#define platform_pci_fixup sn1_pci_fixup
#ifdef Colin /* We are using the same is Generic IA64 calls defined in io.h */ #ifdef Colin /* We are using the same is Generic IA64 calls defined in io.h */
#define platform_inb sn1_inb #define platform_inb sn1_inb
#define platform_inw sn1_inw #define platform_inw sn1_inw
......
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