X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-sparc%2Fsbus.h;h=d036e4419d7958a1245c631cd19d4ea76f3a9a65;hb=97bf2856c6014879bd04983a3e9dfcdac1e7fe85;hp=a13cddcecec5df15ac6be4a2d074a6637652b91e;hpb=76828883507a47dae78837ab5dec5a5b4513c667;p=linux-2.6.git diff --git a/include/asm-sparc/sbus.h b/include/asm-sparc/sbus.h index a13cddcec..d036e4419 100644 --- a/include/asm-sparc/sbus.h +++ b/include/asm-sparc/sbus.h @@ -11,7 +11,8 @@ #include #include -/* #include */ /* Unused since we use opaque iommu (|io-unit) */ +#include +#include #include /* We scan which devices are on the SBus using the PROM node device @@ -42,18 +43,19 @@ struct sbus_bus; /* Linux SBUS device tables */ struct sbus_dev { - struct sbus_bus *bus; /* Back ptr to sbus */ - struct sbus_dev *next; /* next device on this SBus or null */ - struct sbus_dev *child; /* For ledma and espdma on sun4m */ - struct sbus_dev *parent; /* Parent device if not toplevel */ - int prom_node; /* PROM device tree node for this device */ - char prom_name[64]; /* PROM device name */ + struct of_device ofdev; + struct sbus_bus *bus; + struct sbus_dev *next; + struct sbus_dev *child; + struct sbus_dev *parent; + int prom_node; + char prom_name[64]; int slot; struct resource resource[PROMREG_MAX]; struct linux_prom_registers reg_addrs[PROMREG_MAX]; - int num_registers, ranges_applied; + int num_registers; struct linux_prom_ranges device_ranges[PROMREG_MAX]; int num_device_ranges; @@ -61,9 +63,11 @@ struct sbus_dev { unsigned int irqs[4]; int num_irqs; }; +#define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev) /* This struct describes the SBus(s) found on this machine. */ struct sbus_bus { + struct of_device ofdev; void *iommu; /* Opaque IOMMU cookie */ struct sbus_dev *devices; /* Link to devices on this SBus */ struct sbus_bus *next; /* next SBus, if more than one SBus */ @@ -77,6 +81,7 @@ struct sbus_bus { int devid; int board; }; +#define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev) extern struct sbus_bus *sbus_root; @@ -102,6 +107,7 @@ sbus_is_slave(struct sbus_dev *dev) #define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ #define sbus_can_burst64(sdev) (0) /* actually, sparc_cpu_model==sun4d */ extern void sbus_set_sbus64(struct sbus_dev *, int); +extern void sbus_fill_device_irq(struct sbus_dev *); /* These yield IOMMU mappings in consistent mode. */ extern void *sbus_alloc_consistent(struct sbus_dev *, long, u32 *dma_addrp); @@ -139,4 +145,10 @@ extern void sbus_dma_sync_sg_for_device(struct sbus_dev *, struct scatterlist *, BTFIXUPDEF_CALL(unsigned int, sbint_to_irq, struct sbus_dev *sdev, unsigned int) #define sbint_to_irq(sdev, sbint) BTFIXUP_CALL(sbint_to_irq)(sdev, sbint) +extern void sbus_arch_bus_ranges_init(struct device_node *, struct sbus_bus *); +extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *); +extern void sbus_setup_arch_props(struct sbus_bus *, struct device_node *); +extern int sbus_arch_preinit(void); +extern void sbus_arch_postinit(void); + #endif /* !(_SPARC_SBUS_H) */