1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _OF_DEVICE_COMMON_H
3 #define _OF_DEVICE_COMMON_H
5 static inline u64
of_read_addr(const u32
*cell
, int size
)
9 r
= (r
<< 32) | *(cell
++);
13 void of_bus_default_count_cells(struct device_node
*dev
, int *addrc
,
15 int of_out_of_range(const u32
*addr
, const u32
*base
,
16 const u32
*size
, int na
, int ns
);
17 int of_bus_default_map(u32
*addr
, const u32
*range
, int na
, int ns
, int pna
);
18 unsigned long of_bus_default_get_flags(const u32
*addr
, unsigned long flags
);
20 int of_bus_sbus_match(struct device_node
*np
);
21 void of_bus_sbus_count_cells(struct device_node
*child
, int *addrc
, int *sizec
);
23 /* Max address size we deal with */
24 #define OF_MAX_ADDR_CELLS 4
28 const char *addr_prop_name
;
29 int (*match
)(struct device_node
*parent
);
30 void (*count_cells
)(struct device_node
*child
,
31 int *addrc
, int *sizec
);
32 int (*map
)(u32
*addr
, const u32
*range
,
33 int na
, int ns
, int pna
);
34 unsigned long (*get_flags
)(const u32
*addr
, unsigned long);
37 #endif /* _OF_DEVICE_COMMON_H */