sbus_32.h 1.6 KB

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