powerpc: Move iSeries_pci.c to powerpc/platform/iseries

and rename it to pci.c.  This also required moving
arch/ppc64/kernel/pci.h into include/asm-powerpc (called
ppc-pci.h.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
This commit is contained in:
Stephen Rothwell
2005-09-28 02:50:25 +10:00
parent cc14d43083
commit d387899f3f
19 changed files with 52 additions and 61 deletions

View File

@@ -1,2 +1,3 @@
obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \ obj-y += hvlog.o hvlpconfig.o lpardata.o setup.o mf.o lpevents.o \
hvcall.o proc.o htab.o iommu.o hvcall.o proc.o htab.o iommu.o
obj-$(CONFIG_PCI) += pci.o

View File

@@ -1,6 +1,4 @@
/* /*
* iSeries_pci.c
*
* Copyright (C) 2001 Allan Trautman, IBM Corporation * Copyright (C) 2001 Allan Trautman, IBM Corporation
* *
* iSeries specific routines for PCI. * iSeries specific routines for PCI.
@@ -43,7 +41,7 @@
#include <asm/iSeries/iSeries_pci.h> #include <asm/iSeries/iSeries_pci.h>
#include <asm/iSeries/mf.h> #include <asm/iSeries/mf.h>
#include "pci.h" #include <asm/ppc-pci.h>
extern unsigned long io_page_mask; extern unsigned long io_page_mask;
@@ -179,7 +177,7 @@ static void allocate_device_bars(struct pci_dev *dev)
for (bar_num = 0; bar_num <= PCI_ROM_RESOURCE; ++bar_num) { for (bar_num = 0; bar_num <= PCI_ROM_RESOURCE; ++bar_num) {
bar_res = &dev->resource[bar_num]; bar_res = &dev->resource[bar_num];
iomm_table_allocate_entry(dev, bar_num); iomm_table_allocate_entry(dev, bar_num);
} }
} }
/* /*
@@ -297,7 +295,7 @@ void __init iSeries_pci_final_fixup(void)
{ {
struct pci_dev *pdev = NULL; struct pci_dev *pdev = NULL;
struct iSeries_Device_Node *node; struct iSeries_Device_Node *node;
int DeviceCount = 0; int DeviceCount = 0;
PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n"); PPCDBG(PPCDBG_BUSWALK, "iSeries_pcibios_fixup Entry.\n");
@@ -361,7 +359,7 @@ static void scan_PHB_slots(struct pci_controller *Phb)
* Probe for EADs Bridges * Probe for EADs Bridges
*/ */
for (IdSel = 1; IdSel < MaxAgents; ++IdSel) { for (IdSel = 1; IdSel < MaxAgents; ++IdSel) {
HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel, HvRc = HvCallPci_getDeviceInfo(bus, SubBus, IdSel,
ISERIES_HV_ADDR(DevInfo), ISERIES_HV_ADDR(DevInfo),
sizeof(struct HvCallPci_DeviceInfo)); sizeof(struct HvCallPci_DeviceInfo));
if (HvRc == 0) { if (HvRc == 0) {
@@ -393,19 +391,19 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
/* Note: hvSubBus and irq is always be 0 at this level! */ /* Note: hvSubBus and irq is always be 0 at this level! */
for (Function = 0; Function < 8; ++Function) { for (Function = 0; Function < 8; ++Function) {
AgentId = ISERIES_PCI_AGENTID(IdSel, Function); AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
HvRc = HvCallXm_connectBusUnit(bus, SubBus, AgentId, 0); HvRc = HvCallXm_connectBusUnit(bus, SubBus, AgentId, 0);
if (HvRc == 0) { if (HvRc == 0) {
printk("found device at bus %d idsel %d func %d (AgentId %x)\n", printk("found device at bus %d idsel %d func %d (AgentId %x)\n",
bus, IdSel, Function, AgentId); bus, IdSel, Function, AgentId);
/* Connect EADs: 0x18.00.12 = 0x00 */ /* Connect EADs: 0x18.00.12 = 0x00 */
PPCDBG(PPCDBG_BUSWALK, PPCDBG(PPCDBG_BUSWALK,
"PCI:Connect EADs: 0x%02X.%02X.%02X\n", "PCI:Connect EADs: 0x%02X.%02X.%02X\n",
bus, SubBus, AgentId); bus, SubBus, AgentId);
HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId, HvRc = HvCallPci_getBusUnitInfo(bus, SubBus, AgentId,
ISERIES_HV_ADDR(BridgeInfo), ISERIES_HV_ADDR(BridgeInfo),
sizeof(struct HvCallPci_BridgeInfo)); sizeof(struct HvCallPci_BridgeInfo));
if (HvRc == 0) { if (HvRc == 0) {
printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n", printk("bridge info: type %x subbus %x maxAgents %x maxsubbus %x logslot %x\n",
BridgeInfo->busUnitInfo.deviceType, BridgeInfo->busUnitInfo.deviceType,
BridgeInfo->subBusNumber, BridgeInfo->subBusNumber,
@@ -428,7 +426,7 @@ static void scan_EADS_bridge(HvBusNumber bus, HvSubBusNumber SubBus,
printk("PCI: Invalid Bridge Configuration(0x%02X)", printk("PCI: Invalid Bridge Configuration(0x%02X)",
BridgeInfo->busUnitInfo.deviceType); BridgeInfo->busUnitInfo.deviceType);
} }
} else if (HvRc != 0x000B) } else if (HvRc != 0x000B)
pci_Log_Error("EADs Connect", pci_Log_Error("EADs Connect",
bus, SubBus, AgentId, HvRc); bus, SubBus, AgentId, HvRc);
} }
@@ -451,7 +449,7 @@ static int scan_bridge_slot(HvBusNumber Bus,
HvAgentId EADsIdSel = ISERIES_PCI_AGENTID(IdSel, Function); HvAgentId EADsIdSel = ISERIES_PCI_AGENTID(IdSel, Function);
/* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */ /* iSeries_allocate_IRQ.: 0x18.00.12(0xA3) */
Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel); Irq = iSeries_allocate_IRQ(Bus, 0, EADsIdSel);
PPCDBG(PPCDBG_BUSWALK, PPCDBG(PPCDBG_BUSWALK,
"PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n", "PCI:- allocate and assign IRQ 0x%02X.%02X.%02X = 0x%02X\n",
Bus, 0, EADsIdSel, Irq); Bus, 0, EADsIdSel, Irq);
@@ -459,8 +457,8 @@ static int scan_bridge_slot(HvBusNumber Bus,
/* /*
* Connect all functions of any device found. * Connect all functions of any device found.
*/ */
for (IdSel = 1; IdSel <= BridgeInfo->maxAgents; ++IdSel) { for (IdSel = 1; IdSel <= BridgeInfo->maxAgents; ++IdSel) {
for (Function = 0; Function < 8; ++Function) { for (Function = 0; Function < 8; ++Function) {
HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function); HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
HvRc = HvCallXm_connectBusUnit(Bus, SubBus, HvRc = HvCallXm_connectBusUnit(Bus, SubBus,
AgentId, Irq); AgentId, Irq);

View File

@@ -16,7 +16,7 @@ obj-y += vdso32/ vdso64/
obj-$(CONFIG_PPC_OF) += of_device.o obj-$(CONFIG_PPC_OF) += of_device.o
pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_pci.o iSeries_irq.o \ pci-obj-$(CONFIG_PPC_ISERIES) += iSeries_irq.o \
iSeries_VpdInfo.o iSeries_VpdInfo.o
pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o pci-obj-$(CONFIG_PPC_MULTIPLATFORM) += pci_dn.o pci_direct_iommu.o

View File

@@ -39,8 +39,8 @@
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#include <asm/system.h> #include <asm/system.h>
#include <asm/ppc-pci.h>
#include "pci.h"
#include "bpa_iommu.h" #include "bpa_iommu.h"
static inline unsigned long static inline unsigned long

View File

@@ -43,8 +43,8 @@
#include <asm/time.h> #include <asm/time.h>
#include <asm/nvram.h> #include <asm/nvram.h>
#include <asm/cputable.h> #include <asm/cputable.h>
#include <asm/ppc-pci.h>
#include "pci.h"
#include "bpa_iic.h" #include "bpa_iic.h"
#include "bpa_iommu.h" #include "bpa_iommu.h"

View File

@@ -33,7 +33,7 @@
#include <asm/rtas.h> #include <asm/rtas.h>
#include <asm/atomic.h> #include <asm/atomic.h>
#include <asm/systemcfg.h> #include <asm/systemcfg.h>
#include "pci.h" #include <asm/ppc-pci.h>
#undef DEBUG #undef DEBUG

View File

@@ -23,8 +23,7 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/iommu.h> #include <asm/iommu.h>
#include <asm/ppc-pci.h>
#include "pci.h"
#ifdef DEBUG #ifdef DEBUG
#define DBG(x...) printk(x) #define DBG(x...) printk(x)

View File

@@ -47,7 +47,7 @@
#include <asm/systemcfg.h> #include <asm/systemcfg.h>
#include <asm/firmware.h> #include <asm/firmware.h>
#include <asm/tce.h> #include <asm/tce.h>
#include "pci.h" #include <asm/ppc-pci.h>
#define DBG(fmt...) #define DBG(fmt...)

View File

@@ -29,8 +29,7 @@
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/ppc-pci.h>
#include "pci.h"
static int __initdata s7a_workaround = -1; static int __initdata s7a_workaround = -1;

View File

@@ -63,9 +63,9 @@
#include <asm/firmware.h> #include <asm/firmware.h>
#include <asm/pmc.h> #include <asm/pmc.h>
#include <asm/mpic.h> #include <asm/mpic.h>
#include <asm/ppc-pci.h>
#include "i8259.h" #include "i8259.h"
#include "pci.h"
#ifdef DEBUG #ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt) #define DBG(fmt...) udbg_printf(fmt)

View File

@@ -31,8 +31,7 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/udbg.h> #include <asm/udbg.h>
#include <asm/ppc-pci.h>
#include "pci.h"
#ifdef DEBUG #ifdef DEBUG
#define DBG(fmt...) udbg_printf(fmt) #define DBG(fmt...) udbg_printf(fmt)

View File

@@ -27,8 +27,7 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/abs_addr.h> #include <asm/abs_addr.h>
#include <asm/ppc-pci.h>
#include "pci.h"
static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size, static void *pci_direct_alloc_coherent(struct device *hwdev, size_t size,
dma_addr_t *dma_handle, unsigned int __nocast flag) dma_addr_t *dma_handle, unsigned int __nocast flag)

View File

@@ -30,8 +30,7 @@
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/pSeries_reconfig.h> #include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
#include "pci.h"
/* /*
* Traverse_func that inits the PCI fields of the device node. * Traverse_func that inits the PCI fields of the device node.

View File

@@ -37,7 +37,7 @@
#include <asm/iommu.h> #include <asm/iommu.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
#include <asm/machdep.h> #include <asm/machdep.h>
#include "pci.h" #include <asm/ppc-pci.h>
#ifdef CONFIG_PPC_ISERIES #ifdef CONFIG_PPC_ISERIES
#include <asm/iSeries/iSeries_pci.h> #include <asm/iSeries/iSeries_pci.h>

View File

@@ -27,8 +27,8 @@
#include <asm/machdep.h> #include <asm/machdep.h>
#include <asm/pmac_feature.h> #include <asm/pmac_feature.h>
#include <asm/iommu.h> #include <asm/iommu.h>
#include <asm/ppc-pci.h>
#include "pci.h"
#include "pmac.h" #include "pmac.h"
#define DEBUG #define DEBUG

View File

@@ -39,8 +39,7 @@
#include <asm/iommu.h> #include <asm/iommu.h>
#include <asm/rtas.h> #include <asm/rtas.h>
#include <asm/mpic.h> #include <asm/mpic.h>
#include <asm/ppc-pci.h>
#include "pci.h"
/* RTAS tokens */ /* RTAS tokens */
static int read_pci_config; static int read_pci_config;

View File

@@ -53,8 +53,7 @@
#include <asm/time.h> #include <asm/time.h>
#include <asm/mmu_context.h> #include <asm/mmu_context.h>
#include <asm/systemcfg.h> #include <asm/systemcfg.h>
#include <asm/ppc-pci.h>
#include "pci.h"
/* readdir & getdents */ /* readdir & getdents */
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de))) #define NAME_OFFSET(de) ((int) ((de)->d_name - (char __user *) (de)))

View File

@@ -45,8 +45,7 @@
#include <asm/cacheflush.h> #include <asm/cacheflush.h>
#include <asm/lmb.h> #include <asm/lmb.h>
#include <asm/dart.h> #include <asm/dart.h>
#include <asm/ppc-pci.h>
#include "pci.h"
extern int iommu_force_on; extern int iommu_force_on;

View File

@@ -6,8 +6,8 @@
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#ifndef __PPC_KERNEL_PCI_H__ #ifndef _ASM_POWERPC_PPC_PCI_H
#define __PPC_KERNEL_PCI_H__ #define _ASM_POWERPC_PPC_PCI_H
#include <linux/pci.h> #include <linux/pci.h>
#include <asm/pci-bridge.h> #include <asm/pci-bridge.h>
@@ -51,4 +51,4 @@ extern unsigned long pci_probe_only;
extern unsigned long pci_assign_all_buses; extern unsigned long pci_assign_all_buses;
extern int pci_read_irq_line(struct pci_dev *pci_dev); extern int pci_read_irq_line(struct pci_dev *pci_dev);
#endif /* __PPC_KERNEL_PCI_H__ */ #endif /* _ASM_POWERPC_PPC_PCI_H */