Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28721
b: refs/heads/master
c: 095eed4
h: refs/heads/master
i:
  28719: f2bffd3
v: v3
  • Loading branch information
Stephen Rothwell authored and Paul Mackerras committed May 24, 2006
1 parent a5f8dfd commit 53c55bb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: efbd386967aaa7fcf7ffbb13e4975df1cdf04cb8
refs/heads/master: 095eed4f8d0be13a7934031434b6e9ceddb87ff6
6 changes: 6 additions & 0 deletions trunk/arch/powerpc/kernel/pci_dn.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <asm/pci-bridge.h>
#include <asm/pSeries_reconfig.h>
#include <asm/ppc-pci.h>
#include <asm/firmware.h>

/*
* Traverse_func that inits the PCI fields of the device node.
Expand Down Expand Up @@ -59,6 +60,11 @@ static void * __devinit update_dn_pci_info(struct device_node *dn, void *data)
pdn->busno = (regs[0] >> 16) & 0xff;
pdn->devfn = (regs[0] >> 8) & 0xff;
}
if (firmware_has_feature(FW_FEATURE_ISERIES)) {
u32 *busp = (u32 *)get_property(dn, "linux,subbus", NULL);
if (busp)
pdn->bussubno = *busp;
}

pdn->pci_ext_config_space = (type && *type == 1);
return NULL;
Expand Down
42 changes: 14 additions & 28 deletions trunk/arch/powerpc/platforms/iseries/pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,21 @@ static void pci_Log_Error(char *Error_Text, int Bus, int SubBus,
void iSeries_pcibios_init(void)
{
struct pci_controller *phb;
struct device_node *node;
struct device_node *dn;
struct device_node *root = of_find_node_by_path("/");
struct device_node *node = NULL;

for_each_node_by_type(node, "pci") {
if (root == NULL) {
printk(KERN_CRIT "iSeries_pcibios_init: can't find root "
"of device tree\n");
return;
}
while ((node = of_get_next_child(root, node)) != NULL) {
HvBusNumber bus;
u32 *busp;

if ((node->type == NULL) || (strcmp(node->type, "pci") != 0))
continue;

busp = (u32 *)get_property(node, "bus-range", NULL);
if (busp == NULL)
continue;
Expand All @@ -186,33 +194,11 @@ void iSeries_pcibios_init(void)
phb->first_busno = bus;
phb->last_busno = bus;
phb->ops = &iSeries_pci_ops;
}

/* Find and connect the devices. */
for (dn = NULL; (dn = of_get_next_child(node, dn)) != NULL;) {
struct pci_dn *pdn;
u32 *reg;

reg = (u32 *)get_property(dn, "reg", NULL);
if (reg == NULL) {
printk(KERN_DEBUG "no reg property!\n");
continue;
}
busp = (u32 *)get_property(dn, "linux,subbus", NULL);
if (busp == NULL) {
printk(KERN_DEBUG "no subbus property!\n");
continue;
}
of_node_put(root);

pdn = kzalloc(sizeof(*pdn), GFP_KERNEL);
if (pdn == NULL)
return;
dn->data = pdn;
pdn->node = dn;
pdn->busno = bus;
pdn->devfn = (reg[0] >> 8) & 0xff;
pdn->bussubno = *busp;
}
}
pci_devs_phb_init();
}

/*
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/platforms/iseries/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ static void scan_bridge_slot(struct iseries_flat_dt *dt, HvBusNumber bus,
snprintf(buf, sizeof(buf), "pci@%x,%d",
PCI_SLOT(devfn), function);
dt_start_node(dt, buf);
reg[0] = (bus << 18) | (devfn << 8);
reg[0] = (bus << 16) | (devfn << 8);
reg[1] = 0;
reg[2] = 0;
reg[3] = 0;
Expand Down

0 comments on commit 53c55bb

Please sign in to comment.