xref: /openbmc/linux/arch/powerpc/include/asm/prom.h (revision 9d24c888c779c877f1baf5a73e0cec78266ff7bb)
1*9d24c888SGrant Likely #include <linux/of.h>	/* linux/of.h gets to determine #include ordering */
2b8b572e1SStephen Rothwell #ifndef _POWERPC_PROM_H
3b8b572e1SStephen Rothwell #define _POWERPC_PROM_H
4b8b572e1SStephen Rothwell #ifdef __KERNEL__
5b8b572e1SStephen Rothwell 
6b8b572e1SStephen Rothwell /*
7b8b572e1SStephen Rothwell  * Definitions for talking to the Open Firmware PROM on
8b8b572e1SStephen Rothwell  * Power Macintosh computers.
9b8b572e1SStephen Rothwell  *
10b8b572e1SStephen Rothwell  * Copyright (C) 1996-2005 Paul Mackerras.
11b8b572e1SStephen Rothwell  *
12b8b572e1SStephen Rothwell  * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp.
13b8b572e1SStephen Rothwell  *
14b8b572e1SStephen Rothwell  * This program is free software; you can redistribute it and/or
15b8b572e1SStephen Rothwell  * modify it under the terms of the GNU General Public License
16b8b572e1SStephen Rothwell  * as published by the Free Software Foundation; either version
17b8b572e1SStephen Rothwell  * 2 of the License, or (at your option) any later version.
18b8b572e1SStephen Rothwell  */
19b8b572e1SStephen Rothwell #include <linux/types.h>
20b8b572e1SStephen Rothwell #include <linux/proc_fs.h>
21b8b572e1SStephen Rothwell #include <linux/platform_device.h>
22b8b572e1SStephen Rothwell #include <asm/irq.h>
23b8b572e1SStephen Rothwell #include <asm/atomic.h>
24b8b572e1SStephen Rothwell 
25b8b572e1SStephen Rothwell #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT	1
26b8b572e1SStephen Rothwell #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT	1
27b8b572e1SStephen Rothwell 
28b8b572e1SStephen Rothwell #define of_compat_cmp(s1, s2, l)	strcasecmp((s1), (s2))
29b8b572e1SStephen Rothwell #define of_prop_cmp(s1, s2)		strcmp((s1), (s2))
30b8b572e1SStephen Rothwell #define of_node_cmp(s1, s2)		strcasecmp((s1), (s2))
31b8b572e1SStephen Rothwell 
32b8b572e1SStephen Rothwell /* Definitions used by the flattened device tree */
33b8b572e1SStephen Rothwell #define OF_DT_HEADER		0xd00dfeed	/* marker */
34b8b572e1SStephen Rothwell #define OF_DT_BEGIN_NODE	0x1		/* Start of node, full name */
35b8b572e1SStephen Rothwell #define OF_DT_END_NODE		0x2		/* End node */
36b8b572e1SStephen Rothwell #define OF_DT_PROP		0x3		/* Property: name off, size,
37b8b572e1SStephen Rothwell 						 * content */
38b8b572e1SStephen Rothwell #define OF_DT_NOP		0x4		/* nop */
39b8b572e1SStephen Rothwell #define OF_DT_END		0x9
40b8b572e1SStephen Rothwell 
41b8b572e1SStephen Rothwell #define OF_DT_VERSION		0x10
42b8b572e1SStephen Rothwell 
43b8b572e1SStephen Rothwell /*
44b8b572e1SStephen Rothwell  * This is what gets passed to the kernel by prom_init or kexec
45b8b572e1SStephen Rothwell  *
46b8b572e1SStephen Rothwell  * The dt struct contains the device tree structure, full pathes and
47b8b572e1SStephen Rothwell  * property contents. The dt strings contain a separate block with just
48b8b572e1SStephen Rothwell  * the strings for the property names, and is fully page aligned and
49b8b572e1SStephen Rothwell  * self contained in a page, so that it can be kept around by the kernel,
50b8b572e1SStephen Rothwell  * each property name appears only once in this page (cheap compression)
51b8b572e1SStephen Rothwell  *
52b8b572e1SStephen Rothwell  * the mem_rsvmap contains a map of reserved ranges of physical memory,
53b8b572e1SStephen Rothwell  * passing it here instead of in the device-tree itself greatly simplifies
54b8b572e1SStephen Rothwell  * the job of everybody. It's just a list of u64 pairs (base/size) that
55b8b572e1SStephen Rothwell  * ends when size is 0
56b8b572e1SStephen Rothwell  */
57b8b572e1SStephen Rothwell struct boot_param_header
58b8b572e1SStephen Rothwell {
59b8b572e1SStephen Rothwell 	u32	magic;			/* magic word OF_DT_HEADER */
60b8b572e1SStephen Rothwell 	u32	totalsize;		/* total size of DT block */
61b8b572e1SStephen Rothwell 	u32	off_dt_struct;		/* offset to structure */
62b8b572e1SStephen Rothwell 	u32	off_dt_strings;		/* offset to strings */
63b8b572e1SStephen Rothwell 	u32	off_mem_rsvmap;		/* offset to memory reserve map */
64b8b572e1SStephen Rothwell 	u32	version;		/* format version */
65b8b572e1SStephen Rothwell 	u32	last_comp_version;	/* last compatible version */
66b8b572e1SStephen Rothwell 	/* version 2 fields below */
67b8b572e1SStephen Rothwell 	u32	boot_cpuid_phys;	/* Physical CPU id we're booting on */
68b8b572e1SStephen Rothwell 	/* version 3 fields below */
69b8b572e1SStephen Rothwell 	u32	dt_strings_size;	/* size of the DT strings block */
70b8b572e1SStephen Rothwell 	/* version 17 fields below */
71b8b572e1SStephen Rothwell 	u32	dt_struct_size;		/* size of the DT structure block */
72b8b572e1SStephen Rothwell };
73b8b572e1SStephen Rothwell 
74b8b572e1SStephen Rothwell 
75b8b572e1SStephen Rothwell 
76b8b572e1SStephen Rothwell typedef u32 phandle;
77b8b572e1SStephen Rothwell typedef u32 ihandle;
78b8b572e1SStephen Rothwell 
79b8b572e1SStephen Rothwell struct property {
80b8b572e1SStephen Rothwell 	char	*name;
81b8b572e1SStephen Rothwell 	int	length;
82b8b572e1SStephen Rothwell 	void	*value;
83b8b572e1SStephen Rothwell 	struct property *next;
84b8b572e1SStephen Rothwell };
85b8b572e1SStephen Rothwell 
86b8b572e1SStephen Rothwell struct device_node {
87b8b572e1SStephen Rothwell 	const char *name;
88b8b572e1SStephen Rothwell 	const char *type;
89b8b572e1SStephen Rothwell 	phandle	node;
90b8b572e1SStephen Rothwell 	phandle linux_phandle;
91b8b572e1SStephen Rothwell 	char	*full_name;
92b8b572e1SStephen Rothwell 
93b8b572e1SStephen Rothwell 	struct	property *properties;
94b8b572e1SStephen Rothwell 	struct  property *deadprops; /* removed properties */
95b8b572e1SStephen Rothwell 	struct	device_node *parent;
96b8b572e1SStephen Rothwell 	struct	device_node *child;
97b8b572e1SStephen Rothwell 	struct	device_node *sibling;
98b8b572e1SStephen Rothwell 	struct	device_node *next;	/* next device of same type */
99b8b572e1SStephen Rothwell 	struct	device_node *allnext;	/* next in list of all nodes */
100b8b572e1SStephen Rothwell 	struct  proc_dir_entry *pde;	/* this node's proc directory */
101b8b572e1SStephen Rothwell 	struct  kref kref;
102b8b572e1SStephen Rothwell 	unsigned long _flags;
103b8b572e1SStephen Rothwell 	void	*data;
104b8b572e1SStephen Rothwell };
105b8b572e1SStephen Rothwell 
106b8b572e1SStephen Rothwell extern struct device_node *of_chosen;
107b8b572e1SStephen Rothwell 
108b8b572e1SStephen Rothwell static inline int of_node_check_flag(struct device_node *n, unsigned long flag)
109b8b572e1SStephen Rothwell {
110b8b572e1SStephen Rothwell 	return test_bit(flag, &n->_flags);
111b8b572e1SStephen Rothwell }
112b8b572e1SStephen Rothwell 
113b8b572e1SStephen Rothwell static inline void of_node_set_flag(struct device_node *n, unsigned long flag)
114b8b572e1SStephen Rothwell {
115b8b572e1SStephen Rothwell 	set_bit(flag, &n->_flags);
116b8b572e1SStephen Rothwell }
117b8b572e1SStephen Rothwell 
118b8b572e1SStephen Rothwell 
119b8b572e1SStephen Rothwell #define HAVE_ARCH_DEVTREE_FIXUPS
120b8b572e1SStephen Rothwell 
121b8b572e1SStephen Rothwell static inline void set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de)
122b8b572e1SStephen Rothwell {
123b8b572e1SStephen Rothwell 	dn->pde = de;
124b8b572e1SStephen Rothwell }
125b8b572e1SStephen Rothwell 
126b8b572e1SStephen Rothwell 
127b8b572e1SStephen Rothwell extern struct device_node *of_find_all_nodes(struct device_node *prev);
128b8b572e1SStephen Rothwell extern struct device_node *of_node_get(struct device_node *node);
129b8b572e1SStephen Rothwell extern void of_node_put(struct device_node *node);
130b8b572e1SStephen Rothwell 
131b8b572e1SStephen Rothwell /* For scanning the flat device-tree at boot time */
132b8b572e1SStephen Rothwell extern int __init of_scan_flat_dt(int (*it)(unsigned long node,
133b8b572e1SStephen Rothwell 					    const char *uname, int depth,
134b8b572e1SStephen Rothwell 					    void *data),
135b8b572e1SStephen Rothwell 				  void *data);
136b8b572e1SStephen Rothwell extern void* __init of_get_flat_dt_prop(unsigned long node, const char *name,
137b8b572e1SStephen Rothwell 					unsigned long *size);
138b8b572e1SStephen Rothwell extern int __init of_flat_dt_is_compatible(unsigned long node, const char *name);
139b8b572e1SStephen Rothwell extern unsigned long __init of_get_flat_dt_root(void);
140b8b572e1SStephen Rothwell 
141b8b572e1SStephen Rothwell /* For updating the device tree at runtime */
142b8b572e1SStephen Rothwell extern void of_attach_node(struct device_node *);
143b8b572e1SStephen Rothwell extern void of_detach_node(struct device_node *);
144b8b572e1SStephen Rothwell 
145b8b572e1SStephen Rothwell /* Other Prototypes */
146b8b572e1SStephen Rothwell extern void finish_device_tree(void);
147b8b572e1SStephen Rothwell extern void unflatten_device_tree(void);
148b8b572e1SStephen Rothwell extern void early_init_devtree(void *);
149b8b572e1SStephen Rothwell extern int machine_is_compatible(const char *compat);
150b8b572e1SStephen Rothwell extern void print_properties(struct device_node *node);
151b8b572e1SStephen Rothwell extern int prom_n_intr_cells(struct device_node* np);
152b8b572e1SStephen Rothwell extern void prom_get_irq_senses(unsigned char *senses, int off, int max);
153b8b572e1SStephen Rothwell extern int prom_add_property(struct device_node* np, struct property* prop);
154b8b572e1SStephen Rothwell extern int prom_remove_property(struct device_node *np, struct property *prop);
155b8b572e1SStephen Rothwell extern int prom_update_property(struct device_node *np,
156b8b572e1SStephen Rothwell 				struct property *newprop,
157b8b572e1SStephen Rothwell 				struct property *oldprop);
158b8b572e1SStephen Rothwell 
159b8b572e1SStephen Rothwell #ifdef CONFIG_PPC32
160b8b572e1SStephen Rothwell /*
161b8b572e1SStephen Rothwell  * PCI <-> OF matching functions
162b8b572e1SStephen Rothwell  * (XXX should these be here?)
163b8b572e1SStephen Rothwell  */
164b8b572e1SStephen Rothwell struct pci_bus;
165b8b572e1SStephen Rothwell struct pci_dev;
166b8b572e1SStephen Rothwell extern int pci_device_from_OF_node(struct device_node *node,
167b8b572e1SStephen Rothwell 				   u8* bus, u8* devfn);
168b8b572e1SStephen Rothwell extern struct device_node* pci_busdev_to_OF_node(struct pci_bus *, int);
169b8b572e1SStephen Rothwell extern struct device_node* pci_device_to_OF_node(struct pci_dev *);
170b8b572e1SStephen Rothwell extern void pci_create_OF_bus_map(void);
171b8b572e1SStephen Rothwell #endif
172b8b572e1SStephen Rothwell 
173b8b572e1SStephen Rothwell extern struct resource *request_OF_resource(struct device_node* node,
174b8b572e1SStephen Rothwell 				int index, const char* name_postfix);
175b8b572e1SStephen Rothwell extern int release_OF_resource(struct device_node* node, int index);
176b8b572e1SStephen Rothwell 
177b8b572e1SStephen Rothwell 
178b8b572e1SStephen Rothwell /*
179b8b572e1SStephen Rothwell  * OF address retreival & translation
180b8b572e1SStephen Rothwell  */
181b8b572e1SStephen Rothwell 
182b8b572e1SStephen Rothwell 
183b8b572e1SStephen Rothwell /* Helper to read a big number; size is in cells (not bytes) */
184b8b572e1SStephen Rothwell static inline u64 of_read_number(const u32 *cell, int size)
185b8b572e1SStephen Rothwell {
186b8b572e1SStephen Rothwell 	u64 r = 0;
187b8b572e1SStephen Rothwell 	while (size--)
188b8b572e1SStephen Rothwell 		r = (r << 32) | *(cell++);
189b8b572e1SStephen Rothwell 	return r;
190b8b572e1SStephen Rothwell }
191b8b572e1SStephen Rothwell 
192b8b572e1SStephen Rothwell /* Like of_read_number, but we want an unsigned long result */
193b8b572e1SStephen Rothwell #ifdef CONFIG_PPC32
194b8b572e1SStephen Rothwell static inline unsigned long of_read_ulong(const u32 *cell, int size)
195b8b572e1SStephen Rothwell {
196b8b572e1SStephen Rothwell 	return cell[size-1];
197b8b572e1SStephen Rothwell }
198b8b572e1SStephen Rothwell #else
199b8b572e1SStephen Rothwell #define of_read_ulong(cell, size)	of_read_number(cell, size)
200b8b572e1SStephen Rothwell #endif
201b8b572e1SStephen Rothwell 
202b8b572e1SStephen Rothwell /* Translate an OF address block into a CPU physical address
203b8b572e1SStephen Rothwell  */
204b8b572e1SStephen Rothwell extern u64 of_translate_address(struct device_node *np, const u32 *addr);
205b8b572e1SStephen Rothwell 
206b8b572e1SStephen Rothwell /* Translate a DMA address from device space to CPU space */
207b8b572e1SStephen Rothwell extern u64 of_translate_dma_address(struct device_node *dev,
208b8b572e1SStephen Rothwell 				    const u32 *in_addr);
209b8b572e1SStephen Rothwell 
210b8b572e1SStephen Rothwell /* Extract an address from a device, returns the region size and
211b8b572e1SStephen Rothwell  * the address space flags too. The PCI version uses a BAR number
212b8b572e1SStephen Rothwell  * instead of an absolute index
213b8b572e1SStephen Rothwell  */
214b8b572e1SStephen Rothwell extern const u32 *of_get_address(struct device_node *dev, int index,
215b8b572e1SStephen Rothwell 			   u64 *size, unsigned int *flags);
216b8b572e1SStephen Rothwell #ifdef CONFIG_PCI
217b8b572e1SStephen Rothwell extern const u32 *of_get_pci_address(struct device_node *dev, int bar_no,
218b8b572e1SStephen Rothwell 			       u64 *size, unsigned int *flags);
219b8b572e1SStephen Rothwell #else
220b8b572e1SStephen Rothwell static inline const u32 *of_get_pci_address(struct device_node *dev,
221b8b572e1SStephen Rothwell 		int bar_no, u64 *size, unsigned int *flags)
222b8b572e1SStephen Rothwell {
223b8b572e1SStephen Rothwell 	return NULL;
224b8b572e1SStephen Rothwell }
225b8b572e1SStephen Rothwell #endif /* CONFIG_PCI */
226b8b572e1SStephen Rothwell 
227b8b572e1SStephen Rothwell /* Get an address as a resource. Note that if your address is
228b8b572e1SStephen Rothwell  * a PIO address, the conversion will fail if the physical address
229b8b572e1SStephen Rothwell  * can't be internally converted to an IO token with
230b8b572e1SStephen Rothwell  * pci_address_to_pio(), that is because it's either called to early
231b8b572e1SStephen Rothwell  * or it can't be matched to any host bridge IO space
232b8b572e1SStephen Rothwell  */
233b8b572e1SStephen Rothwell extern int of_address_to_resource(struct device_node *dev, int index,
234b8b572e1SStephen Rothwell 				  struct resource *r);
235b8b572e1SStephen Rothwell #ifdef CONFIG_PCI
236b8b572e1SStephen Rothwell extern int of_pci_address_to_resource(struct device_node *dev, int bar,
237b8b572e1SStephen Rothwell 				      struct resource *r);
238b8b572e1SStephen Rothwell #else
239b8b572e1SStephen Rothwell static inline int of_pci_address_to_resource(struct device_node *dev, int bar,
240b8b572e1SStephen Rothwell 		struct resource *r)
241b8b572e1SStephen Rothwell {
242b8b572e1SStephen Rothwell 	return -ENOSYS;
243b8b572e1SStephen Rothwell }
244b8b572e1SStephen Rothwell #endif /* CONFIG_PCI */
245b8b572e1SStephen Rothwell 
246b8b572e1SStephen Rothwell /* Parse the ibm,dma-window property of an OF node into the busno, phys and
247b8b572e1SStephen Rothwell  * size parameters.
248b8b572e1SStephen Rothwell  */
249b8b572e1SStephen Rothwell void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
250b8b572e1SStephen Rothwell 		unsigned long *busno, unsigned long *phys, unsigned long *size);
251b8b572e1SStephen Rothwell 
252b8b572e1SStephen Rothwell extern void kdump_move_device_tree(void);
253b8b572e1SStephen Rothwell 
254b8b572e1SStephen Rothwell /* CPU OF node matching */
255b8b572e1SStephen Rothwell struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
256b8b572e1SStephen Rothwell 
257e523f723SNathan Lynch /* cache lookup */
258e523f723SNathan Lynch struct device_node *of_find_next_cache_node(struct device_node *np);
259e523f723SNathan Lynch 
260b8b572e1SStephen Rothwell /* Get the MAC address */
261b8b572e1SStephen Rothwell extern const void *of_get_mac_address(struct device_node *np);
262b8b572e1SStephen Rothwell 
263b8b572e1SStephen Rothwell /*
264b8b572e1SStephen Rothwell  * OF interrupt mapping
265b8b572e1SStephen Rothwell  */
266b8b572e1SStephen Rothwell 
267b8b572e1SStephen Rothwell /* This structure is returned when an interrupt is mapped. The controller
268b8b572e1SStephen Rothwell  * field needs to be put() after use
269b8b572e1SStephen Rothwell  */
270b8b572e1SStephen Rothwell 
271b8b572e1SStephen Rothwell #define OF_MAX_IRQ_SPEC		 4 /* We handle specifiers of at most 4 cells */
272b8b572e1SStephen Rothwell 
273b8b572e1SStephen Rothwell struct of_irq {
274b8b572e1SStephen Rothwell 	struct device_node *controller;	/* Interrupt controller node */
275b8b572e1SStephen Rothwell 	u32 size;			/* Specifier size */
276b8b572e1SStephen Rothwell 	u32 specifier[OF_MAX_IRQ_SPEC];	/* Specifier copy */
277b8b572e1SStephen Rothwell };
278b8b572e1SStephen Rothwell 
279b8b572e1SStephen Rothwell /**
280b8b572e1SStephen Rothwell  * of_irq_map_init - Initialize the irq remapper
281b8b572e1SStephen Rothwell  * @flags:	flags defining workarounds to enable
282b8b572e1SStephen Rothwell  *
283b8b572e1SStephen Rothwell  * Some machines have bugs in the device-tree which require certain workarounds
284b8b572e1SStephen Rothwell  * to be applied. Call this before any interrupt mapping attempts to enable
285b8b572e1SStephen Rothwell  * those workarounds.
286b8b572e1SStephen Rothwell  */
287b8b572e1SStephen Rothwell #define OF_IMAP_OLDWORLD_MAC	0x00000001
288b8b572e1SStephen Rothwell #define OF_IMAP_NO_PHANDLE	0x00000002
289b8b572e1SStephen Rothwell 
290b8b572e1SStephen Rothwell extern void of_irq_map_init(unsigned int flags);
291b8b572e1SStephen Rothwell 
292b8b572e1SStephen Rothwell /**
293b8b572e1SStephen Rothwell  * of_irq_map_raw - Low level interrupt tree parsing
294b8b572e1SStephen Rothwell  * @parent:	the device interrupt parent
295b8b572e1SStephen Rothwell  * @intspec:	interrupt specifier ("interrupts" property of the device)
296b8b572e1SStephen Rothwell  * @ointsize:   size of the passed in interrupt specifier
297b8b572e1SStephen Rothwell  * @addr:	address specifier (start of "reg" property of the device)
298b8b572e1SStephen Rothwell  * @out_irq:	structure of_irq filled by this function
299b8b572e1SStephen Rothwell  *
300b8b572e1SStephen Rothwell  * Returns 0 on success and a negative number on error
301b8b572e1SStephen Rothwell  *
302b8b572e1SStephen Rothwell  * This function is a low-level interrupt tree walking function. It
303b8b572e1SStephen Rothwell  * can be used to do a partial walk with synthetized reg and interrupts
304b8b572e1SStephen Rothwell  * properties, for example when resolving PCI interrupts when no device
305b8b572e1SStephen Rothwell  * node exist for the parent.
306b8b572e1SStephen Rothwell  *
307b8b572e1SStephen Rothwell  */
308b8b572e1SStephen Rothwell 
309b8b572e1SStephen Rothwell extern int of_irq_map_raw(struct device_node *parent, const u32 *intspec,
310b8b572e1SStephen Rothwell 			  u32 ointsize, const u32 *addr,
311b8b572e1SStephen Rothwell 			  struct of_irq *out_irq);
312b8b572e1SStephen Rothwell 
313b8b572e1SStephen Rothwell 
314b8b572e1SStephen Rothwell /**
315b8b572e1SStephen Rothwell  * of_irq_map_one - Resolve an interrupt for a device
316b8b572e1SStephen Rothwell  * @device:	the device whose interrupt is to be resolved
317b8b572e1SStephen Rothwell  * @index:     	index of the interrupt to resolve
318b8b572e1SStephen Rothwell  * @out_irq:	structure of_irq filled by this function
319b8b572e1SStephen Rothwell  *
320b8b572e1SStephen Rothwell  * This function resolves an interrupt, walking the tree, for a given
321b8b572e1SStephen Rothwell  * device-tree node. It's the high level pendant to of_irq_map_raw().
322b8b572e1SStephen Rothwell  * It also implements the workarounds for OldWolrd Macs.
323b8b572e1SStephen Rothwell  */
324b8b572e1SStephen Rothwell extern int of_irq_map_one(struct device_node *device, int index,
325b8b572e1SStephen Rothwell 			  struct of_irq *out_irq);
326b8b572e1SStephen Rothwell 
327b8b572e1SStephen Rothwell /**
328b8b572e1SStephen Rothwell  * of_irq_map_pci - Resolve the interrupt for a PCI device
329b8b572e1SStephen Rothwell  * @pdev:	the device whose interrupt is to be resolved
330b8b572e1SStephen Rothwell  * @out_irq:	structure of_irq filled by this function
331b8b572e1SStephen Rothwell  *
332b8b572e1SStephen Rothwell  * This function resolves the PCI interrupt for a given PCI device. If a
333b8b572e1SStephen Rothwell  * device-node exists for a given pci_dev, it will use normal OF tree
334b8b572e1SStephen Rothwell  * walking. If not, it will implement standard swizzling and walk up the
335b8b572e1SStephen Rothwell  * PCI tree until an device-node is found, at which point it will finish
336b8b572e1SStephen Rothwell  * resolving using the OF tree walking.
337b8b572e1SStephen Rothwell  */
338b8b572e1SStephen Rothwell struct pci_dev;
339b8b572e1SStephen Rothwell extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
340b8b572e1SStephen Rothwell 
341b8b572e1SStephen Rothwell extern int of_irq_to_resource(struct device_node *dev, int index,
342b8b572e1SStephen Rothwell 			struct resource *r);
343b8b572e1SStephen Rothwell 
344b8b572e1SStephen Rothwell /**
345b8b572e1SStephen Rothwell  * of_iomap - Maps the memory mapped IO for a given device_node
346b8b572e1SStephen Rothwell  * @device:	the device whose io range will be mapped
347b8b572e1SStephen Rothwell  * @index:	index of the io range
348b8b572e1SStephen Rothwell  *
349b8b572e1SStephen Rothwell  * Returns a pointer to the mapped memory
350b8b572e1SStephen Rothwell  */
351b8b572e1SStephen Rothwell extern void __iomem *of_iomap(struct device_node *device, int index);
352b8b572e1SStephen Rothwell 
353b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
354b8b572e1SStephen Rothwell #endif /* _POWERPC_PROM_H */
355