Commit 44ef3390 authored by Stephen Rothwell's avatar Stephen Rothwell Committed by Paul Mackerras

[POWERPC] pci_controller->arch_data really is a struct device_node *

Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 6207e816
...@@ -145,7 +145,7 @@ void __init isa_bridge_find_early(struct pci_controller *hose) ...@@ -145,7 +145,7 @@ void __init isa_bridge_find_early(struct pci_controller *hose)
for_each_node_by_type(np, "isa") { for_each_node_by_type(np, "isa") {
/* Look for our hose being a parent */ /* Look for our hose being a parent */
for (parent = of_get_parent(np); parent;) { for (parent = of_get_parent(np); parent;) {
if (parent == hose->arch_data) { if (parent == hose->dn) {
of_node_put(parent); of_node_put(parent);
break; break;
} }
......
...@@ -62,7 +62,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev) ...@@ -62,7 +62,7 @@ struct pci_controller *pcibios_alloc_controller(struct device_node *dev)
phb->global_number = global_phb_number++; phb->global_number = global_phb_number++;
list_add_tail(&phb->list_node, &hose_list); list_add_tail(&phb->list_node, &hose_list);
spin_unlock(&hose_spinlock); spin_unlock(&hose_spinlock);
phb->arch_data = dev; phb->dn = dev;
phb->is_dynamic = mem_init_done; phb->is_dynamic = mem_init_done;
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
if (dev) { if (dev) {
...@@ -137,7 +137,7 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node) ...@@ -137,7 +137,7 @@ struct pci_controller* pci_find_hose_for_OF_device(struct device_node* node)
while(node) { while(node) {
struct pci_controller *hose, *tmp; struct pci_controller *hose, *tmp;
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) list_for_each_entry_safe(hose, tmp, &hose_list, list_node)
if (hose->arch_data == node) if (hose->dn == node)
return hose; return hose;
node = node->parent; node = node->parent;
} }
......
...@@ -662,8 +662,8 @@ pcibios_make_OF_bus_map(void) ...@@ -662,8 +662,8 @@ pcibios_make_OF_bus_map(void)
/* For each hose, we begin searching bridges */ /* For each hose, we begin searching bridges */
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) { list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
struct device_node* node; struct device_node* node = hose->dn;
node = (struct device_node *)hose->arch_data;
if (!node) if (!node)
continue; continue;
make_one_node_map(node, hose->first_busno); make_one_node_map(node, hose->first_busno);
...@@ -742,7 +742,7 @@ static struct device_node *scan_OF_for_pci_bus(struct pci_bus *bus) ...@@ -742,7 +742,7 @@ static struct device_node *scan_OF_for_pci_bus(struct pci_bus *bus)
struct pci_controller *hose = pci_bus_to_host(bus); struct pci_controller *hose = pci_bus_to_host(bus);
if (hose == NULL) if (hose == NULL)
return NULL; return NULL;
return of_node_get(hose->arch_data); return of_node_get(hose->dn);
} }
/* not a root bus, we need to get our parent */ /* not a root bus, we need to get our parent */
...@@ -812,9 +812,9 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn) ...@@ -812,9 +812,9 @@ pci_device_from_OF_node(struct device_node* node, u8* bus, u8* devfn)
return -ENODEV; return -ENODEV;
/* Make sure it's really a PCI device */ /* Make sure it's really a PCI device */
hose = pci_find_hose_for_OF_device(node); hose = pci_find_hose_for_OF_device(node);
if (!hose || !hose->arch_data) if (!hose || !hose->dn)
return -ENODEV; return -ENODEV;
if (!scan_OF_pci_childs(((struct device_node*)hose->arch_data)->child, if (!scan_OF_pci_childs(hose->dn->child,
find_OF_pci_device_filter, (void *)node)) find_OF_pci_device_filter, (void *)node))
return -ENODEV; return -ENODEV;
reg = of_get_property(node, "reg", NULL); reg = of_get_property(node, "reg", NULL);
......
...@@ -458,7 +458,7 @@ EXPORT_SYMBOL(of_scan_pci_bridge); ...@@ -458,7 +458,7 @@ EXPORT_SYMBOL(of_scan_pci_bridge);
void __devinit scan_phb(struct pci_controller *hose) void __devinit scan_phb(struct pci_controller *hose)
{ {
struct pci_bus *bus; struct pci_bus *bus;
struct device_node *node = hose->arch_data; struct device_node *node = hose->dn;
int i, mode; int i, mode;
struct resource *res; struct resource *res;
...@@ -705,8 +705,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus) ...@@ -705,8 +705,7 @@ int pcibios_unmap_io_space(struct pci_bus *bus)
if (hose->io_base_alloc == 0) if (hose->io_base_alloc == 0)
return 0; return 0;
DBG("IO unmapping for PHB %s\n", DBG("IO unmapping for PHB %s\n", hose->dn->full_name);
((struct device_node *)hose->arch_data)->full_name);
DBG(" alloc=0x%p\n", hose->io_base_alloc); DBG(" alloc=0x%p\n", hose->io_base_alloc);
/* This is a PHB, we fully unmap the IO area */ /* This is a PHB, we fully unmap the IO area */
...@@ -765,8 +764,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus) ...@@ -765,8 +764,7 @@ int __devinit pcibios_map_io_space(struct pci_bus *bus)
hose->io_base_virt = (void __iomem *)(area->addr + hose->io_base_virt = (void __iomem *)(area->addr +
hose->io_base_phys - phys_page); hose->io_base_phys - phys_page);
DBG("IO mapping for PHB %s\n", DBG("IO mapping for PHB %s\n", hose->dn->full_name);
((struct device_node *)hose->arch_data)->full_name);
DBG(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n", DBG(" phys=0x%016lx, virt=0x%p (alloc=0x%p)\n",
hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc); hose->io_base_phys, hose->io_base_virt, hose->io_base_alloc);
DBG(" size=0x%016lx (alloc=0x%016lx)\n", DBG(" size=0x%016lx (alloc=0x%016lx)\n",
......
...@@ -133,7 +133,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre, ...@@ -133,7 +133,7 @@ void *traverse_pci_devices(struct device_node *start, traverse_func pre,
*/ */
void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb) void __devinit pci_devs_phb_init_dynamic(struct pci_controller *phb)
{ {
struct device_node * dn = (struct device_node *) phb->arch_data; struct device_node *dn = phb->dn;
struct pci_dn *pdn; struct pci_dn *pdn;
/* PHB nodes themselves must not match */ /* PHB nodes themselves must not match */
......
...@@ -273,7 +273,7 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq) ...@@ -273,7 +273,7 @@ int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq)
#else #else
struct pci_controller *host; struct pci_controller *host;
host = pci_bus_to_host(pdev->bus); host = pci_bus_to_host(pdev->bus);
ppnode = host ? host->arch_data : NULL; ppnode = host ? host->dn : NULL;
#endif #endif
/* No node for host bridge ? give up */ /* No node for host bridge ? give up */
if (ppnode == NULL) if (ppnode == NULL)
......
...@@ -260,7 +260,7 @@ static int phb_set_bus_ranges(struct device_node *dev, ...@@ -260,7 +260,7 @@ static int phb_set_bus_ranges(struct device_node *dev,
int __devinit rtas_setup_phb(struct pci_controller *phb) int __devinit rtas_setup_phb(struct pci_controller *phb)
{ {
struct device_node *dev = phb->arch_data; struct device_node *dev = phb->dn;
if (is_python(dev)) if (is_python(dev))
python_countermeasures(dev); python_countermeasures(dev);
......
...@@ -59,7 +59,7 @@ static void __init pq2_pci_add_bridge(struct device_node *np) ...@@ -59,7 +59,7 @@ static void __init pq2_pci_add_bridge(struct device_node *np)
if (!hose) if (!hose)
return; return;
hose->arch_data = np; hose->dn = np;
setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0); setup_indirect_pci(hose, r.start + 0x100, r.start + 0x104, 0);
pci_process_bridge_OF_ranges(hose, np, 1); pci_process_bridge_OF_ranges(hose, np, 1);
......
...@@ -123,7 +123,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose, ...@@ -123,7 +123,7 @@ static int mpc85xx_exclude_device(struct pci_controller *hose,
struct device_node* node; struct device_node* node;
struct resource rsrc; struct resource rsrc;
node = (struct device_node *)hose->arch_data; node = hose->dn;
of_address_to_resource(node, 0, &rsrc); of_address_to_resource(node, 0, &rsrc);
if ((rsrc.start & 0xfffff) == primary_phb_addr) { if ((rsrc.start & 0xfffff) == primary_phb_addr) {
......
...@@ -124,7 +124,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev) ...@@ -124,7 +124,7 @@ static void __devinit quirk_uli5229(struct pci_dev *dev)
static void __devinit final_uli5288(struct pci_dev *dev) static void __devinit final_uli5288(struct pci_dev *dev)
{ {
struct pci_controller *hose = pci_bus_to_host(dev->bus); struct pci_controller *hose = pci_bus_to_host(dev->bus);
struct device_node *hosenode = hose ? hose->arch_data : NULL; struct device_node *hosenode = hose ? hose->dn : NULL;
struct of_irq oirq; struct of_irq oirq;
int virq, pin = 2; int virq, pin = 2;
u32 laddr[3]; u32 laddr[3];
......
...@@ -116,7 +116,7 @@ static int mpc86xx_exclude_device(struct pci_controller *hose, ...@@ -116,7 +116,7 @@ static int mpc86xx_exclude_device(struct pci_controller *hose,
struct device_node* node; struct device_node* node;
struct resource rsrc; struct resource rsrc;
node = (struct device_node *)hose->arch_data; node = hose->dn;
of_address_to_resource(node, 0, &rsrc); of_address_to_resource(node, 0, &rsrc);
if ((rsrc.start & 0xfffff) == 0x8000) { if ((rsrc.start & 0xfffff) == 0x8000) {
......
...@@ -238,7 +238,7 @@ static void __init spider_pci_setup_chip(struct spider_pci_bus *bus) ...@@ -238,7 +238,7 @@ static void __init spider_pci_setup_chip(struct spider_pci_bus *bus)
static void __init spider_pci_add_one(struct pci_controller *phb) static void __init spider_pci_add_one(struct pci_controller *phb)
{ {
struct spider_pci_bus *bus = &spider_pci_busses[spider_pci_count]; struct spider_pci_bus *bus = &spider_pci_busses[spider_pci_count];
struct device_node *np = phb->arch_data; struct device_node *np = phb->dn;
struct resource rsrc; struct resource rsrc;
void __iomem *regs; void __iomem *regs;
...@@ -317,7 +317,7 @@ static int __init spider_pci_workaround_init(void) ...@@ -317,7 +317,7 @@ static int __init spider_pci_workaround_init(void)
* update this code to cope with dynamically added busses * update this code to cope with dynamically added busses
*/ */
list_for_each_entry(phb, &hose_list, list_node) { list_for_each_entry(phb, &hose_list, list_node) {
struct device_node *np = phb->arch_data; struct device_node *np = phb->dn;
const char *model = of_get_property(np, "model", NULL); const char *model = of_get_property(np, "model", NULL);
/* If no model property or name isn't exactly "pci", skip */ /* If no model property or name isn't exactly "pci", skip */
......
...@@ -222,7 +222,7 @@ void __init celleb_pci_add_one(struct pci_controller *phb, ...@@ -222,7 +222,7 @@ void __init celleb_pci_add_one(struct pci_controller *phb,
void (*dummy_read)(struct pci_controller *)) void (*dummy_read)(struct pci_controller *))
{ {
struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count]; struct celleb_pci_bus *bus = &celleb_pci_busses[celleb_pci_count];
struct device_node *np = phb->arch_data; struct device_node *np = phb->dn;
if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) { if (celleb_pci_count >= MAX_CELLEB_PCI_BUS) {
printk(KERN_ERR "Too many pci bridges, workarounds" printk(KERN_ERR "Too many pci bridges, workarounds"
...@@ -262,7 +262,7 @@ int __init celleb_pci_workaround_init(void) ...@@ -262,7 +262,7 @@ int __init celleb_pci_workaround_init(void)
} }
list_for_each_entry(phb, &hose_list, list_node) { list_for_each_entry(phb, &hose_list, list_node) {
node = phb->arch_data; node = phb->dn;
match = of_match_node(celleb_pci_workaround_match, node); match = of_match_node(celleb_pci_workaround_match, node);
if (match) { if (match) {
......
...@@ -480,7 +480,7 @@ static struct of_device_id celleb_phb_match[] __initdata = { ...@@ -480,7 +480,7 @@ static struct of_device_id celleb_phb_match[] __initdata = {
int __init celleb_setup_phb(struct pci_controller *phb) int __init celleb_setup_phb(struct pci_controller *phb)
{ {
struct device_node *dev = phb->arch_data; struct device_node *dev = phb->dn;
const struct of_device_id *match; const struct of_device_id *match;
int (*setup_func)(struct device_node *, struct pci_controller *); int (*setup_func)(struct device_node *, struct pci_controller *);
......
...@@ -558,7 +558,7 @@ void __init maple_pci_init(void) ...@@ -558,7 +558,7 @@ void __init maple_pci_init(void)
* safe assumptions hopefully. * safe assumptions hopefully.
*/ */
if (u3_agp) { if (u3_agp) {
struct device_node *np = u3_agp->arch_data; struct device_node *np = u3_agp->dn;
PCI_DN(np)->busno = 0xf0; PCI_DN(np)->busno = 0xf0;
for (np = np->child; np; np = np->sibling) for (np = np->child; np; np = np->sibling)
PCI_DN(np)->busno = 0xf0; PCI_DN(np)->busno = 0xf0;
......
...@@ -319,7 +319,7 @@ static int u3_ht_skip_device(struct pci_controller *hose, ...@@ -319,7 +319,7 @@ static int u3_ht_skip_device(struct pci_controller *hose,
if (bus->self) if (bus->self)
busdn = pci_device_to_OF_node(bus->self); busdn = pci_device_to_OF_node(bus->self);
else else
busdn = hose->arch_data; busdn = hose->dn;
for (dn = busdn->child; dn; dn = dn->sibling) for (dn = busdn->child; dn; dn = dn->sibling)
if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn) if (PCI_DN(dn) && PCI_DN(dn)->devfn == devfn)
break; break;
...@@ -778,7 +778,7 @@ static void __init setup_u4_pcie(struct pci_controller* hose) ...@@ -778,7 +778,7 @@ static void __init setup_u4_pcie(struct pci_controller* hose)
static void __init setup_u3_ht(struct pci_controller* hose) static void __init setup_u3_ht(struct pci_controller* hose)
{ {
struct device_node *np = (struct device_node *)hose->arch_data; struct device_node *np = hose->dn;
struct pci_controller *other = NULL; struct pci_controller *other = NULL;
int i, cur; int i, cur;
...@@ -1032,7 +1032,7 @@ void __init pmac_pci_init(void) ...@@ -1032,7 +1032,7 @@ void __init pmac_pci_init(void)
* future though * future though
*/ */
if (u3_agp) { if (u3_agp) {
struct device_node *np = u3_agp->arch_data; struct device_node *np = u3_agp->dn;
PCI_DN(np)->busno = 0xf0; PCI_DN(np)->busno = 0xf0;
for (np = np->child; np; np = np->sibling) for (np = np->child; np; np = np->sibling)
PCI_DN(np)->busno = 0xf0; PCI_DN(np)->busno = 0xf0;
......
...@@ -251,7 +251,7 @@ static void iommu_table_setparms(struct pci_controller *phb, ...@@ -251,7 +251,7 @@ static void iommu_table_setparms(struct pci_controller *phb,
const unsigned long *basep; const unsigned long *basep;
const u32 *sizep; const u32 *sizep;
node = (struct device_node *)phb->arch_data; node = phb->dn;
basep = of_get_property(node, "linux,tce-base", NULL); basep = of_get_property(node, "linux,tce-base", NULL);
sizep = of_get_property(node, "linux,tce-size", NULL); sizep = of_get_property(node, "linux,tce-size", NULL);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/ioport.h> #include <linux/ioport.h>
struct device_node;
/* /*
* Structure of a PCI controller (host bridge) * Structure of a PCI controller (host bridge)
*/ */
...@@ -20,7 +22,7 @@ struct pci_controller { ...@@ -20,7 +22,7 @@ struct pci_controller {
#ifdef CONFIG_PPC64 #ifdef CONFIG_PPC64
int node; int node;
#endif #endif
void *arch_data; struct device_node *dn;
struct list_head list_node; struct list_head list_node;
struct device *parent; struct device *parent;
...@@ -132,7 +134,6 @@ extern void __init update_bridge_resource(struct pci_dev *dev, ...@@ -132,7 +134,6 @@ extern void __init update_bridge_resource(struct pci_dev *dev,
* by device_node->data. * by device_node->data.
*/ */
struct iommu_table; struct iommu_table;
struct device_node;
struct pci_dn { struct pci_dn {
int busno; /* pci bus number */ int busno; /* pci bus 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