sbus_64.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* sbus.h: Defines for the Sun SBus.
  2. *
  3. * Copyright (C) 1996, 1999, 2007 David S. Miller (davem@davemloft.net)
  4. */
  5. #ifndef _SPARC64_SBUS_H
  6. #define _SPARC64_SBUS_H
  7. #include <linux/dma-mapping.h>
  8. #include <linux/ioport.h>
  9. #include <linux/of_device.h>
  10. #include <asm/oplib.h>
  11. #include <asm/prom.h>
  12. #include <asm/iommu.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; /* Tree of SBUS devices */
  33. struct sbus_bus *next; /* Next SBUS in system */
  34. };
  35. #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev)
  36. extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
  37. extern int sbus_arch_preinit(void);
  38. extern void sbus_arch_postinit(void);
  39. #endif /* !(_SPARC64_SBUS_H) */