Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* $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. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 12 | #include <asm/prom.h> |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 13 | #include <asm/of_device.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | |
| 15 | struct sparc_isa_bridge; |
| 16 | |
| 17 | struct sparc_isa_device { |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 18 | struct of_device ofdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | struct sparc_isa_device *next; |
| 20 | struct sparc_isa_device *child; |
| 21 | struct sparc_isa_bridge *bus; |
David S. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 22 | struct device_node *prom_node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | struct resource resource; |
| 24 | unsigned int irq; |
| 25 | }; |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 26 | #define to_isa_device(d) container_of(d, struct sparc_isa_device, ofdev.dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 27 | |
| 28 | struct sparc_isa_bridge { |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 29 | struct of_device ofdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | 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. Miller | 690c8fd | 2006-06-22 19:12:03 -0700 | [diff] [blame] | 35 | struct device_node *prom_node; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | }; |
David S. Miller | a2bd4fd | 2006-06-23 01:44:10 -0700 | [diff] [blame] | 37 | #define to_isa_bridge(d) container_of(d, struct sparc_isa_bridge, ofdev.dev) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 38 | |
| 39 | extern struct sparc_isa_bridge *isa_chain; |
| 40 | |
| 41 | extern 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) */ |