Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | * sbus.h: Defines for the Sun SBus. |
| 3 | * |
| 4 | * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) |
| 5 | */ |
| 6 | |
| 7 | #ifndef _SPARC_SBUS_H |
| 8 | #define _SPARC_SBUS_H |
| 9 | |
| 10 | #include <linux/dma-mapping.h> |
| 11 | #include <linux/ioport.h> |
Stephen Rothwell | 764f257 | 2008-08-07 15:33:36 -0700 | [diff] [blame] | 12 | #include <linux/of_device.h> |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 13 | |
| 14 | #include <asm/oplib.h> |
| 15 | #include <asm/prom.h> |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 16 | #include <asm/scatterlist.h> |
| 17 | |
| 18 | /* We scan which devices are on the SBus using the PROM node device |
| 19 | * tree. SBus devices are described in two different ways. You can |
| 20 | * either get an absolute address at which to access the device, or |
| 21 | * you can get a SBus 'slot' number and an offset within that slot. |
| 22 | */ |
| 23 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 24 | struct sbus_bus; |
| 25 | |
| 26 | /* Linux SBUS device tables */ |
| 27 | struct sbus_dev { |
| 28 | struct of_device ofdev; |
| 29 | struct sbus_bus *bus; |
| 30 | struct sbus_dev *next; |
| 31 | struct sbus_dev *child; |
| 32 | struct sbus_dev *parent; |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 33 | }; |
| 34 | #define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev) |
| 35 | |
| 36 | /* This struct describes the SBus(s) found on this machine. */ |
| 37 | struct sbus_bus { |
| 38 | struct of_device ofdev; |
| 39 | struct sbus_dev *devices; /* Link to devices on this SBus */ |
| 40 | struct sbus_bus *next; /* next SBus, if more than one SBus */ |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 41 | }; |
| 42 | #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) |
| 43 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 44 | /* These yield IOMMU mappings in consistent mode. */ |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 45 | void prom_adjust_ranges(struct linux_prom_ranges *, int, |
| 46 | struct linux_prom_ranges *, int); |
| 47 | |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 48 | extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); |
Sam Ravnborg | f5e706a | 2008-07-17 21:55:51 -0700 | [diff] [blame] | 49 | extern int sbus_arch_preinit(void); |
| 50 | extern void sbus_arch_postinit(void); |
| 51 | |
| 52 | #endif /* !(_SPARC_SBUS_H) */ |