blob: d9728b9031fc90a9052eb55545cdede2576b4df8 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/* $Id: isa.h,v 1.1 2001/05/11 04:31:55 davem Exp $
2 * isa.h: Sparc64 layer for PCI to ISA bridge devices.
3 *
4 * Copyright (C) 2001 David S. Miller (davem@redhat.com)
5 */
6
7#ifndef __SPARC64_ISA_H
8#define __SPARC64_ISA_H
9
10#include <asm/pbm.h>
11#include <asm/oplib.h>
David S. Miller690c8fd2006-06-22 19:12:03 -070012#include <asm/prom.h>
David S. Millera2bd4fd2006-06-23 01:44:10 -070013#include <asm/of_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070014
15struct sparc_isa_bridge;
16
17struct sparc_isa_device {
David S. Millera2bd4fd2006-06-23 01:44:10 -070018 struct of_device ofdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070019 struct sparc_isa_device *next;
20 struct sparc_isa_device *child;
21 struct sparc_isa_bridge *bus;
David S. Miller690c8fd2006-06-22 19:12:03 -070022 struct device_node *prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -070023 struct resource resource;
24 unsigned int irq;
25};
David S. Millera2bd4fd2006-06-23 01:44:10 -070026#define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070027
28struct sparc_isa_bridge {
David S. Millera2bd4fd2006-06-23 01:44:10 -070029 struct of_device ofdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070030 struct sparc_isa_bridge *next;
31 struct sparc_isa_device *devices;
32 struct pci_pbm_info *parent;
33 struct pci_dev *self;
34 int index;
David S. Miller690c8fd2006-06-22 19:12:03 -070035 struct device_node *prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -070036};
David S. Millera2bd4fd2006-06-23 01:44:10 -070037#define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070038
39extern struct sparc_isa_bridge *isa_chain;
40
41extern void isa_init(void);
42
43#define for_each_isa(bus) \
44 for((bus) = isa_chain; (bus); (bus) = (bus)->next)
45
46#define for_each_isadev(dev, bus) \
47 for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
48
49#endif /* !(__SPARC64_ISA_H) */