Commit 5b78e64f authored by Anton Blanchard's avatar Anton Blanchard

ppc64: merge in some iSeries fixes from 2.4

parent 6c827b9f
......@@ -146,7 +146,7 @@ int iSeries_Device_Information(struct pci_dev* PciDev,char* Buffer, int BufferS
int device_Location(struct pci_dev* PciDev,char* BufPtr)
{
struct iSeries_Device_Node* DevNode = (struct iSeries_Device_Node*)PciDev->sysdata;
return sprintf(BufPtr,"PCI: Bus%3d, Device%3d, Vendor %04X, Location %s",
return sprintf(BufPtr,"PCI: Bus%3d, AgentId%3d, Vendor %04X, Location %s",
DevNode->DsaAddr.busNumber,
DevNode->AgentId,
DevNode->Vendor,
......
......@@ -448,7 +448,7 @@ int iSeries_Scan_Bridge_Slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo* Bridg
HvSubBusNumber SubBus = BridgeInfo->subBusNumber;
u16 VendorId = 0;
int HvRc = 0;
int Irq = 0;
u8 Irq = 0;
int IdSel = ISERIES_GET_DEVICE_FROM_SUBBUS(SubBus);
int Function = ISERIES_GET_FUNCTION_FROM_SUBBUS(SubBus);
HvAgentId AgentId = ISERIES_PCI_AGENTID(IdSel, Function);
......@@ -475,9 +475,14 @@ int iSeries_Scan_Bridge_Slot(HvBusNumber Bus, struct HvCallPci_BridgeInfo* Bridg
/**********************************************************/
/* FoundDevice: 0x18.28.10 = 0x12AE */
/**********************************************************/
HvCallPci_configStore8(Bus, SubBus, AgentId, PCI_INTERRUPT_LINE, Irq);
PPCDBG(PPCDBG_BUSWALK,"PCI:- FoundDevice: 0x%02X.%02X.%02X = 0x%04X\n",
Bus, SubBus, AgentId, VendorId);
HvRc = HvCallPci_configStore8(Bus, SubBus, AgentId, PCI_INTERRUPT_LINE, Irq);
if( HvRc != 0) {
pci_Log_Error("PciCfgStore Irq Failed!",Bus,SubBus,AgentId,HvRc);
}
++DeviceCount;
DeviceNode = build_device_node(Bus, SubBus, EADsIdSel, Function);
DeviceNode->Vendor = VendorId;
......
......@@ -1003,7 +1003,7 @@ int mf_getVmlinuxChunk(char *buffer, int *size, int offset, u64 side)
}
}
pci_unmap_single(iSeries_vio_dev, dma_addr, *size, PCI_DMA_FROMDEVICE);
pci_unmap_single(iSeries_vio_dev, dma_addr, len, PCI_DMA_FROMDEVICE);
return rc;
}
......
......@@ -71,12 +71,12 @@ void mf_proc_init(struct proc_dir_entry *iSeries_proc)
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_a);
ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_a);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)0;
ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
ent->read_proc = NULL;
mf_b = proc_mkdir("B", mf_proc_root);
if (!mf_b) return;
......@@ -88,12 +88,12 @@ void mf_proc_init(struct proc_dir_entry *iSeries_proc)
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_b);
ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_b);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)1;
ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
ent->read_proc = NULL;
mf_c = proc_mkdir("C", mf_proc_root);
if (!mf_c) return;
......@@ -105,12 +105,12 @@ void mf_proc_init(struct proc_dir_entry *iSeries_proc)
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR|S_IWUSR, mf_c);
ent = create_proc_entry("vmlinux", S_IFREG|S_IWUSR, mf_c);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)2;
ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = proc_mf_change_vmlinux;
ent->read_proc = NULL;
mf_d = proc_mkdir("D", mf_proc_root);
if (!mf_d) return;
......@@ -122,14 +122,14 @@ void mf_proc_init(struct proc_dir_entry *iSeries_proc)
ent->data = (void *)3;
ent->read_proc = proc_mf_dump_cmdline;
ent->write_proc = proc_mf_change_cmdline;
#if 0
ent = create_proc_entry("vmlinux", S_IFREG|S_IRUSR, mf_d);
if (!ent) return;
ent->nlink = 1;
ent->data = (void *)3;
ent->read_proc = proc_mf_dump_vmlinux;
ent->write_proc = NULL;
#endif
ent = create_proc_entry("side", S_IFREG|S_IRUSR|S_IWUSR, mf_proc_root);
if (!ent) return;
ent->nlink = 1;
......@@ -191,21 +191,17 @@ int proc_mf_dump_vmlinux
if (sizeToGet != 0)
{
*start = page + off;
printk("mf_proc.c: got count %d off %d\n", sizeToGet, (int)off);
return sizeToGet;
} else {
printk("mf_proc.c: eof\n");
*eof = 1;
return 0;
}
} else {
printk("mf_proc.c: eof\n");
*eof = 1;
return 0;
}
}
int proc_mf_dump_side
(char *page, char **start, off_t off, int count, int *eof, void *data)
{
......
......@@ -40,6 +40,7 @@ struct iSeries_Device_Node;
#define ISERIES_DEVICE(DevPtr) DevPtr->DsaAddr.deviceId
#define ISERIES_DEVFUN(DevPtr) DevPtr->DevFn
#define ISERIES_DSA(DevPtr) (*(u64*)&DevPtr->DsaAddr)
#define ISERIES_DEVNODE(PciDev) ((struct iSeries_Device_Node*)PciDev->sysdata)
#define EADsMaxAgents 7
/************************************************************************************/
......@@ -87,6 +88,7 @@ struct iSeries_Device_Node {
int IoRetry; /* Current Retry Count */
int Flags; /* Possible flags(disable/bist)*/
u16 Vendor; /* Vendor ID */
u8 LogicalSlot; /* Hv Slot Index for Tces */
struct TceTable* DevTceTable; /* Device TCE Table */
u8 PhbId; /* Phb Card is on. */
u16 Board; /* Board Number */
......
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