sparc: Kill sbus_devaddr() and sbus_dev_slot().
[firefly-linux-kernel-4.4.55.git] / arch / sparc / include / asm / sbus_64.h
1 /* sbus.h: Defines for the Sun SBus.
2  *
3  * Copyright (C) 1996, 1999, 2007 David S. Miller (davem@davemloft.net)
4  */
5
6 #ifndef _SPARC64_SBUS_H
7 #define _SPARC64_SBUS_H
8
9 #include <linux/dma-mapping.h>
10 #include <linux/ioport.h>
11 #include <linux/of_device.h>
12
13 #include <asm/oplib.h>
14 #include <asm/prom.h>
15 #include <asm/iommu.h>
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
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;
33         int prom_node;
34         char prom_name[64];
35         int slot;
36 };
37 #define to_sbus_device(d) container_of(d, struct sbus_dev, ofdev.dev)
38
39 /* This struct describes the SBus(s) found on this machine. */
40 struct sbus_bus {
41         struct of_device        ofdev;
42         struct sbus_dev         *devices;       /* Tree of SBUS devices */
43         struct sbus_bus         *next;          /* Next SBUS in system  */
44         int                     prom_node;      /* OBP node of SBUS     */
45         char                    prom_name[64];  /* Usually "sbus" or "sbi" */
46         int                     clock_freq;
47         int portid;
48 };
49 #define to_sbus(d) container_of(d, struct sbus_bus, ofdev.dev)
50
51 extern void sbus_setup_iommu(struct sbus_bus *, struct device_node *);
52 extern int sbus_arch_preinit(void);
53 extern void sbus_arch_postinit(void);
54
55 #endif /* !(_SPARC64_SBUS_H) */