blob: ecd9290f78d4f5a87acd85145d3172edfa0ccebb [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
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <asm/oplib.h>
David S. Miller690c8fd2006-06-22 19:12:03 -070011#include <asm/prom.h>
David S. Millera2bd4fd2006-06-23 01:44:10 -070012#include <asm/of_device.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013
14struct sparc_isa_bridge;
15
16struct sparc_isa_device {
David S. Millera2bd4fd2006-06-23 01:44:10 -070017 struct of_device ofdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 struct sparc_isa_device *next;
19 struct sparc_isa_device *child;
20 struct sparc_isa_bridge *bus;
David S. Miller690c8fd2006-06-22 19:12:03 -070021 struct device_node *prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -070022 struct resource resource;
23 unsigned int irq;
24};
David S. Millera2bd4fd2006-06-23 01:44:10 -070025#define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070026
27struct sparc_isa_bridge {
David S. Millera2bd4fd2006-06-23 01:44:10 -070028 struct of_device ofdev;
Linus Torvalds1da177e2005-04-16 15:20:36 -070029 struct sparc_isa_bridge *next;
30 struct sparc_isa_device *devices;
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 struct pci_dev *self;
32 int index;
David S. Miller690c8fd2006-06-22 19:12:03 -070033 struct device_node *prom_node;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034};
David S. Millera2bd4fd2006-06-23 01:44:10 -070035#define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev)
Linus Torvalds1da177e2005-04-16 15:20:36 -070036
37extern struct sparc_isa_bridge *isa_chain;
38
39extern void isa_init(void);
40
41#define for_each_isa(bus) \
42 for((bus) = isa_chain; (bus); (bus) = (bus)->next)
43
44#define for_each_isadev(dev, bus) \
45 for((dev) = (bus)->devices; (dev); (dev) = (dev)->next)
46
47#endif /* !(__SPARC64_ISA_H) */