more changes on original files
[linux-2.4.git] / include / asm-parisc / hardware.h
1 #ifndef _PARISC_HARDWARE_H
2 #define _PARISC_HARDWARE_H
3
4 #include <asm/pdc.h>
5
6 struct parisc_device_id {
7         unsigned char   hw_type;        /* 5 bits used */
8         unsigned char   hversion_rev;   /* 4 bits */
9         unsigned short  hversion;       /* 12 bits */
10         unsigned int    sversion;       /* 20 bits */
11 };
12
13 #define HWTYPE_ANY_ID   0xff
14 #define HVERSION_REV_ANY_ID     0xff
15 #define HVERSION_ANY_ID 0xffff
16 #define SVERSION_ANY_ID 0xffffffffU
17
18 struct hp_hardware {
19         unsigned short  hw_type:5;      /* HPHW_xxx */
20         unsigned short  hversion;
21         unsigned long   sversion:28;
22         unsigned short  opt;
23         const char      name[80];       /* The hardware description */
24 };
25
26 struct parisc_device {
27         unsigned long   hpa;            /* Hard Physical Address */
28         struct parisc_device_id id;
29         struct parisc_device *parent;
30         struct parisc_device *sibling;
31         struct parisc_device *child;
32         struct parisc_driver *driver;   /* Driver for this device */
33         void            *sysdata;       /* Driver instance private data */
34         char            name[80];       /* The hardware description */
35         int             irq;
36
37         char            hw_path;        /* The module number on this bus */
38         unsigned int    num_addrs;      /* some devices have additional address ranges. */
39         unsigned long   *addr;          /* which will be stored here */
40  
41 #ifdef __LP64__
42         /* parms for pdc_pat_cell_module() call */
43         unsigned long   pcell_loc;      /* Physical Cell location */
44         unsigned long   mod_index;      /* PAT specific - Misc Module info */
45
46         /* generic info returned from pdc_pat_cell_module() */
47         unsigned long   mod_info;       /* PAT specific - Misc Module info */
48         unsigned long   pmod_loc;       /* physical Module location */
49 #endif
50 };
51
52 enum cpu_type {
53         pcx     = 0, /* pa7000          pa 1.0  */
54         pcxs    = 1, /* pa7000          pa 1.1a */
55         pcxt    = 2, /* pa7100          pa 1.1b */
56         pcxt_   = 3, /* pa7200  (t')    pa 1.1c */
57         pcxl    = 4, /* pa7100lc        pa 1.1d */
58         pcxl2   = 5, /* pa7300lc        pa 1.1e */
59         pcxu    = 6, /* pa8000          pa 2.0  */
60         pcxu_   = 7, /* pa8200  (u+)    pa 2.0  */
61         pcxw    = 8, /* pa8500          pa 2.0  */
62         pcxw_   = 9, /* pa8600  (w+)    pa 2.0  */
63         pcxw2   = 10 /* pa8700          pa 2.0  */
64 };
65
66 extern char *cpu_name_version[][2]; /* mapping from enum cpu_type to strings */
67
68 struct parisc_driver {
69         struct parisc_driver *next;
70         char *name; 
71         const struct parisc_device_id *id_table;
72         int (*probe) (struct parisc_device *dev); /* New device discovered */
73 };
74
75 struct io_module {
76         volatile uint32_t nothing;              /* reg 0 */
77         volatile uint32_t io_eim;
78         volatile uint32_t io_dc_adata;
79         volatile uint32_t io_ii_cdata;
80         volatile uint32_t io_dma_link;          /* reg 4 */
81         volatile uint32_t io_dma_command;
82         volatile uint32_t io_dma_address;
83         volatile uint32_t io_dma_count;
84         volatile uint32_t io_flex;              /* reg 8 */
85         volatile uint32_t io_spa_address;
86         volatile uint32_t reserved1[2];
87         volatile uint32_t io_command;           /* reg 12 */
88         volatile uint32_t io_status;
89         volatile uint32_t io_control;
90         volatile uint32_t io_data;
91         volatile uint32_t reserved2;            /* reg 16 */
92         volatile uint32_t chain_addr;
93         volatile uint32_t sub_mask_clr;
94         volatile uint32_t reserved3[13];
95         volatile uint32_t undefined[480];
96         volatile uint32_t unpriv[512];
97 };
98
99 struct bc_module {
100         volatile uint32_t unused1[12];
101         volatile uint32_t io_command;
102         volatile uint32_t io_status;
103         volatile uint32_t io_control;
104         volatile uint32_t unused2[1];
105         volatile uint32_t io_err_resp;
106         volatile uint32_t io_err_info;
107         volatile uint32_t io_err_req;
108         volatile uint32_t unused3[11];
109         volatile uint32_t io_io_low;
110         volatile uint32_t io_io_high;
111 };
112
113 #define HPHW_NPROC     0 
114 #define HPHW_MEMORY    1       
115 #define HPHW_B_DMA     2
116 #define HPHW_OBSOLETE  3
117 #define HPHW_A_DMA     4
118 #define HPHW_A_DIRECT  5
119 #define HPHW_OTHER     6
120 #define HPHW_BCPORT    7
121 #define HPHW_CIO       8
122 #define HPHW_CONSOLE   9
123 #define HPHW_FIO       10
124 #define HPHW_BA        11
125 #define HPHW_IOA       12
126 #define HPHW_BRIDGE    13
127 #define HPHW_FABRIC    14
128 #define HPHW_FAULTY    31
129
130
131 /* hardware.c: */
132 extern const char *parisc_hardware_description(struct parisc_device_id *id);
133 extern enum cpu_type parisc_get_cpu_type(unsigned long hversion);
134
135 struct pci_dev;
136
137 /* drivers.c: */
138 extern struct parisc_device *alloc_pa_dev(unsigned long hpa,
139                 struct hardware_path *path);
140 extern int register_parisc_device(struct parisc_device *dev);
141 extern int register_parisc_driver(struct parisc_driver *driver);
142 extern int count_parisc_driver(struct parisc_driver *driver);
143 extern int unregister_parisc_driver(struct parisc_driver *driver);
144 extern void walk_central_bus(void);
145 extern void fixup_child_irqs(struct parisc_device *parent, int irqbase,
146                 int (*choose)(struct parisc_device *parent));
147 extern void print_subdevices(struct parisc_device *dev);
148 extern const struct parisc_device *find_pa_parent_type(const struct parisc_device *, int);
149 extern void print_parisc_devices(void);
150 extern char *print_pa_hwpath(struct parisc_device *dev, char *path);
151 extern char *print_pci_hwpath(struct pci_dev *dev, char *path);
152 extern void get_pci_node_path(struct pci_dev *dev, struct hardware_path *path);
153
154
155 /* inventory.c: */
156 extern void do_memory_inventory(void);
157 extern void do_device_inventory(void);
158
159 #endif /* _PARISC_HARDWARE_H */