diff options
Diffstat (limited to 'include/asm-powerpc/prom.h')
| -rw-r--r-- | include/asm-powerpc/prom.h | 34 | 
1 files changed, 21 insertions, 13 deletions
| diff --git a/include/asm-powerpc/prom.h b/include/asm-powerpc/prom.h index 020ed015a94b..ec400f608e16 100644 --- a/include/asm-powerpc/prom.h +++ b/include/asm-powerpc/prom.h | |||
| @@ -18,7 +18,9 @@ | |||
| 18 | #include <linux/types.h> | 18 | #include <linux/types.h> | 
| 19 | #include <linux/proc_fs.h> | 19 | #include <linux/proc_fs.h> | 
| 20 | #include <linux/platform_device.h> | 20 | #include <linux/platform_device.h> | 
| 21 | #include <asm/irq.h> | ||
| 21 | #include <asm/atomic.h> | 22 | #include <asm/atomic.h> | 
| 23 | #include <asm/io.h> | ||
| 22 | 24 | ||
| 23 | /* Definitions used by the flattened device tree */ | 25 | /* Definitions used by the flattened device tree */ | 
| 24 | #define OF_DT_HEADER 0xd00dfeed /* marker */ | 26 | #define OF_DT_HEADER 0xd00dfeed /* marker */ | 
| @@ -58,6 +60,8 @@ struct boot_param_header | |||
| 58 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | 60 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | 
| 59 | /* version 3 fields below */ | 61 | /* version 3 fields below */ | 
| 60 | u32 dt_strings_size; /* size of the DT strings block */ | 62 | u32 dt_strings_size; /* size of the DT strings block */ | 
| 63 | /* version 17 fields below */ | ||
| 64 | u32 dt_struct_size; /* size of the DT structure block */ | ||
| 61 | }; | 65 | }; | 
| 62 | 66 | ||
| 63 | 67 | ||
| @@ -68,7 +72,7 @@ typedef u32 ihandle; | |||
| 68 | struct property { | 72 | struct property { | 
| 69 | char *name; | 73 | char *name; | 
| 70 | int length; | 74 | int length; | 
| 71 | unsigned char *value; | 75 | void *value; | 
| 72 | struct property *next; | 76 | struct property *next; | 
| 73 | }; | 77 | }; | 
| 74 | 78 | ||
| @@ -108,14 +112,6 @@ static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_e | |||
| 108 | } | 112 | } | 
| 109 | 113 | ||
| 110 | 114 | ||
| 111 | /* OBSOLETE: Old style node lookup */ | ||
| 112 | extern struct device_node *find_devices(const char *name); | ||
| 113 | extern struct device_node *find_type_devices(const char *type); | ||
| 114 | extern struct device_node *find_path_device(const char *path); | ||
| 115 | extern struct device_node *find_compatible_devices(const char *type, | ||
| 116 | const char *compat); | ||
| 117 | extern struct device_node *find_all_nodes(void); | ||
| 118 | |||
| 119 | /* New style node lookup */ | 115 | /* New style node lookup */ | 
| 120 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 116 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 
| 121 | const char *name); | 117 | const char *name); | 
| @@ -159,15 +155,17 @@ extern void of_detach_node(const struct device_node *); | |||
| 159 | extern void finish_device_tree(void); | 155 | extern void finish_device_tree(void); | 
| 160 | extern void unflatten_device_tree(void); | 156 | extern void unflatten_device_tree(void); | 
| 161 | extern void early_init_devtree(void *); | 157 | extern void early_init_devtree(void *); | 
| 162 | extern int device_is_compatible(const struct device_node *device, | 158 | extern int of_device_is_compatible(const struct device_node *device, | 
| 163 | const char *); | 159 | const char *); | 
| 160 | #define device_is_compatible(d, c) of_device_is_compatible((d), (c)) | ||
| 164 | extern int machine_is_compatible(const char *compat); | 161 | extern int machine_is_compatible(const char *compat); | 
| 165 | extern const void *get_property(const struct device_node *node, | 162 | extern const void *of_get_property(const struct device_node *node, | 
| 166 | const char *name, | 163 | const char *name, | 
| 167 | int *lenp); | 164 | int *lenp); | 
| 165 | #define get_property(a, b, c) of_get_property((a), (b), (c)) | ||
| 168 | extern void print_properties(struct device_node *node); | 166 | extern void print_properties(struct device_node *node); | 
| 169 | extern int prom_n_addr_cells(struct device_node* np); | 167 | extern int of_n_addr_cells(struct device_node* np); | 
| 170 | extern int prom_n_size_cells(struct device_node* np); | 168 | extern int of_n_size_cells(struct device_node* np); | 
| 171 | extern int prom_n_intr_cells(struct device_node* np); | 169 | extern int prom_n_intr_cells(struct device_node* np); | 
| 172 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | 170 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | 
| 173 | extern int prom_add_property(struct device_node* np, struct property* prop); | 171 | extern int prom_add_property(struct device_node* np, struct property* prop); | 
| @@ -350,6 +348,16 @@ static inline int of_irq_to_resource(struct device_node *dev, int index, struct | |||
| 350 | return irq; | 348 | return irq; | 
| 351 | } | 349 | } | 
| 352 | 350 | ||
| 351 | static inline void __iomem *of_iomap(struct device_node *np, int index) | ||
| 352 | { | ||
| 353 | struct resource res; | ||
| 354 | |||
| 355 | if (of_address_to_resource(np, index, &res)) | ||
| 356 | return NULL; | ||
| 357 | |||
| 358 | return ioremap(res.start, 1 + res.end - res.start); | ||
| 359 | } | ||
| 360 | |||
| 353 | 361 | ||
| 354 | #endif /* __KERNEL__ */ | 362 | #endif /* __KERNEL__ */ | 
| 355 | #endif /* _POWERPC_PROM_H */ | 363 | #endif /* _POWERPC_PROM_H */ | 
