1 /*
2 * Definitions for talking to the Open Firmware PROM on
3 * Power Macintosh computers.
4 *
5 * Copyright (C) 1996 Paul Mackerras.
6 */
7 #ifdef __KERNEL__
8 #ifndef _PPC_PROM_H
9 #define _PPC_PROM_H
10
11 #include <linux/config.h>
12
13 typedef void *phandle;
14 typedef void *ihandle;
15
16 extern char *prom_display_paths[];
17 extern unsigned int prom_num_displays;
18 #ifndef CONFIG_MACH_SPECIFIC
19 extern int have_of;
20 #endif
21
22 struct address_range {
23 unsigned int space;
24 unsigned int address;
25 unsigned int size;
26 };
27
28 struct interrupt_info {
29 int line;
30 int sense; /* +ve/-ve logic, edge or level, etc. */
31 };
32
33 struct reg_property {
34 unsigned int address;
35 unsigned int size;
36 };
37
38 struct translation_property {
39 unsigned int virt;
40 unsigned int size;
41 unsigned int phys;
42 unsigned int flags;
43 };
44
45 struct property {
46 char *name;
47 int length;
48 unsigned char *value;
49 struct property *next;
50 };
51
52 struct device_node {
53 char *name;
54 char *type;
55 phandle node;
56 int n_addrs;
57 struct address_range *addrs;
58 int n_intrs;
59 struct interrupt_info *intrs;
60 char *full_name;
61 struct property *properties;
62 struct device_node *parent;
63 struct device_node *child;
64 struct device_node *sibling;
65 struct device_node *next; /* next device of same type */
66 struct device_node *allnext; /* next in list of all nodes */
67 };
68
69 struct prom_args;
70 typedef void (*prom_entry)(struct prom_args *);
71
72 /* Prototypes */
73 extern void abort(void);
74 extern unsigned long prom_init(int, int, prom_entry);
75 extern void prom_print(const char *msg);
76 extern void relocate_nodes(void);
77 extern void finish_device_tree(void);
78 extern struct device_node *find_devices(const char *name);
79 extern struct device_node *find_type_devices(const char *type);
80 extern struct device_node *find_path_device(const char *path);
81 extern struct device_node *find_compatible_devices(const char *type,
82 const char *compat);
83 extern struct device_node *find_pci_device_OFnode(unsigned char bus,
84 unsigned char dev_fn);
85 extern struct device_node *find_phandle(phandle);
86 extern struct device_node *find_all_nodes(void);
87 extern int device_is_compatible(struct device_node *device, const char *);
88 extern int machine_is_compatible(const char *compat);
89 extern unsigned char *get_property(struct device_node *node, const char *name,
90 int *lenp);
91 extern void print_properties(struct device_node *node);
92 extern int call_rtas(const char *service, int nargs, int nret,
93 unsigned long *outputs, ...);
94 extern void prom_drawstring(const char *c);
95 extern void prom_drawhex(unsigned long v);
96 extern void prom_drawchar(char c);
97
98 extern void map_bootx_text(void);
99
100
101 #endif /* _PPC_PROM_H */
102 #endif /* __KERNEL__ */
103
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.