.. | .. |
---|
50 | 50 | |
---|
51 | 51 | struct device_node { |
---|
52 | 52 | const char *name; |
---|
53 | | - const char *type; |
---|
54 | 53 | phandle phandle; |
---|
55 | 54 | const char *full_name; |
---|
56 | 55 | struct fwnode_handle fwnode; |
---|
.. | .. |
---|
66 | 65 | unsigned long _flags; |
---|
67 | 66 | void *data; |
---|
68 | 67 | #if defined(CONFIG_SPARC) |
---|
69 | | - const char *path_component_name; |
---|
70 | 68 | unsigned int unique_id; |
---|
71 | 69 | struct of_irq_controller *irq_trans; |
---|
72 | 70 | #endif |
---|
.. | .. |
---|
110 | 108 | #if defined(CONFIG_OF_KOBJ) |
---|
111 | 109 | kobject_init(&node->kobj, &of_node_ktype); |
---|
112 | 110 | #endif |
---|
113 | | - node->fwnode.ops = &of_fwnode_ops; |
---|
| 111 | + fwnode_init(&node->fwnode, &of_fwnode_ops); |
---|
114 | 112 | } |
---|
115 | 113 | |
---|
116 | 114 | #if defined(CONFIG_OF_KOBJ) |
---|
.. | .. |
---|
252 | 250 | #include <asm/prom.h> |
---|
253 | 251 | #endif |
---|
254 | 252 | |
---|
255 | | -/* Default #address and #size cells. Allow arch asm/prom.h to override */ |
---|
256 | | -#if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) |
---|
257 | | -#define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 |
---|
258 | | -#define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 |
---|
259 | | -#endif |
---|
260 | | - |
---|
261 | 253 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) |
---|
262 | 254 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) |
---|
263 | 255 | |
---|
.. | .. |
---|
358 | 350 | const char *name, |
---|
359 | 351 | int *lenp); |
---|
360 | 352 | extern struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); |
---|
| 353 | +extern struct device_node *of_get_next_cpu_node(struct device_node *prev); |
---|
| 354 | +extern struct device_node *of_get_cpu_state_node(struct device_node *cpu_node, |
---|
| 355 | + int index); |
---|
| 356 | + |
---|
361 | 357 | #define for_each_property_of_node(dn, pp) \ |
---|
362 | 358 | for (pp = dn->properties; pp != NULL; pp = pp->next) |
---|
363 | 359 | |
---|
.. | .. |
---|
397 | 393 | extern void of_alias_scan(void * (*dt_alloc)(u64 size, u64 align)); |
---|
398 | 394 | extern int of_alias_get_id(struct device_node *np, const char *stem); |
---|
399 | 395 | extern int of_alias_get_highest_id(const char *stem); |
---|
| 396 | +extern int of_alias_get_alias_list(const struct of_device_id *matches, |
---|
| 397 | + const char *stem, unsigned long *bitmap, |
---|
| 398 | + unsigned int nbits); |
---|
400 | 399 | |
---|
401 | 400 | extern int of_machine_is_compatible(const char *compat); |
---|
402 | 401 | |
---|
.. | .. |
---|
555 | 554 | |
---|
556 | 555 | extern int of_cpu_node_to_id(struct device_node *np); |
---|
557 | 556 | |
---|
| 557 | +int of_map_id(struct device_node *np, u32 id, |
---|
| 558 | + const char *map_name, const char *map_mask_name, |
---|
| 559 | + struct device_node **target, u32 *id_out); |
---|
| 560 | + |
---|
| 561 | +phys_addr_t of_dma_get_max_cpu_address(struct device_node *np); |
---|
| 562 | + |
---|
558 | 563 | #else /* CONFIG_OF */ |
---|
559 | 564 | |
---|
560 | 565 | static inline void of_core_init(void) |
---|
.. | .. |
---|
623 | 628 | } |
---|
624 | 629 | |
---|
625 | 630 | static inline struct device_node *of_get_parent(const struct device_node *node) |
---|
| 631 | +{ |
---|
| 632 | + return NULL; |
---|
| 633 | +} |
---|
| 634 | + |
---|
| 635 | +static inline struct device_node *of_get_next_parent(struct device_node *node) |
---|
626 | 636 | { |
---|
627 | 637 | return NULL; |
---|
628 | 638 | } |
---|
.. | .. |
---|
755 | 765 | |
---|
756 | 766 | static inline struct device_node *of_get_cpu_node(int cpu, |
---|
757 | 767 | unsigned int *thread) |
---|
| 768 | +{ |
---|
| 769 | + return NULL; |
---|
| 770 | +} |
---|
| 771 | + |
---|
| 772 | +static inline struct device_node *of_get_next_cpu_node(struct device_node *prev) |
---|
| 773 | +{ |
---|
| 774 | + return NULL; |
---|
| 775 | +} |
---|
| 776 | + |
---|
| 777 | +static inline struct device_node *of_get_cpu_state_node(struct device_node *cpu_node, |
---|
| 778 | + int index) |
---|
758 | 779 | { |
---|
759 | 780 | return NULL; |
---|
760 | 781 | } |
---|
.. | .. |
---|
898 | 919 | return -ENOSYS; |
---|
899 | 920 | } |
---|
900 | 921 | |
---|
| 922 | +static inline int of_alias_get_alias_list(const struct of_device_id *matches, |
---|
| 923 | + const char *stem, unsigned long *bitmap, |
---|
| 924 | + unsigned int nbits) |
---|
| 925 | +{ |
---|
| 926 | + return -ENOSYS; |
---|
| 927 | +} |
---|
| 928 | + |
---|
901 | 929 | static inline int of_machine_is_compatible(const char *compat) |
---|
| 930 | +{ |
---|
| 931 | + return 0; |
---|
| 932 | +} |
---|
| 933 | + |
---|
| 934 | +static inline int of_add_property(struct device_node *np, struct property *prop) |
---|
| 935 | +{ |
---|
| 936 | + return 0; |
---|
| 937 | +} |
---|
| 938 | + |
---|
| 939 | +static inline int of_remove_property(struct device_node *np, struct property *prop) |
---|
902 | 940 | { |
---|
903 | 941 | return 0; |
---|
904 | 942 | } |
---|
.. | .. |
---|
955 | 993 | static inline int of_cpu_node_to_id(struct device_node *np) |
---|
956 | 994 | { |
---|
957 | 995 | return -ENODEV; |
---|
| 996 | +} |
---|
| 997 | + |
---|
| 998 | +static inline int of_map_id(struct device_node *np, u32 id, |
---|
| 999 | + const char *map_name, const char *map_mask_name, |
---|
| 1000 | + struct device_node **target, u32 *id_out) |
---|
| 1001 | +{ |
---|
| 1002 | + return -EINVAL; |
---|
| 1003 | +} |
---|
| 1004 | + |
---|
| 1005 | +static inline phys_addr_t of_dma_get_max_cpu_address(struct device_node *np) |
---|
| 1006 | +{ |
---|
| 1007 | + return PHYS_ADDR_MAX; |
---|
958 | 1008 | } |
---|
959 | 1009 | |
---|
960 | 1010 | #define of_match_ptr(_ptr) NULL |
---|
.. | .. |
---|
1144 | 1194 | } |
---|
1145 | 1195 | |
---|
1146 | 1196 | /** |
---|
1147 | | - * of_property_read_bool - Findfrom a property |
---|
| 1197 | + * of_property_read_bool - Find a property |
---|
1148 | 1198 | * @np: device node from which the property value is to be read. |
---|
1149 | 1199 | * @propname: name of the property to be searched. |
---|
1150 | 1200 | * |
---|
.. | .. |
---|
1228 | 1278 | for (child = of_get_next_available_child(parent, NULL); child != NULL; \ |
---|
1229 | 1279 | child = of_get_next_available_child(parent, child)) |
---|
1230 | 1280 | |
---|
| 1281 | +#define for_each_of_cpu_node(cpu) \ |
---|
| 1282 | + for (cpu = of_get_next_cpu_node(NULL); cpu != NULL; \ |
---|
| 1283 | + cpu = of_get_next_cpu_node(cpu)) |
---|
| 1284 | + |
---|
1231 | 1285 | #define for_each_node_with_property(dn, prop_name) \ |
---|
1232 | 1286 | for (dn = of_find_node_with_property(NULL, prop_name); dn; \ |
---|
1233 | 1287 | dn = of_find_node_with_property(dn, prop_name)) |
---|
.. | .. |
---|
1257 | 1311 | #if defined(CONFIG_OF) && !defined(MODULE) |
---|
1258 | 1312 | #define _OF_DECLARE(table, name, compat, fn, fn_type) \ |
---|
1259 | 1313 | static const struct of_device_id __of_table_##name \ |
---|
1260 | | - __used __section(__##table##_of_table) \ |
---|
| 1314 | + __used __section("__" #table "_of_table") \ |
---|
1261 | 1315 | __aligned(__alignof__(struct of_device_id)) \ |
---|
1262 | 1316 | = { .compatible = compat, \ |
---|
1263 | 1317 | .data = (fn == (fn_type)NULL) ? fn : fn } |
---|