xref: /openbmc/linux/arch/mips/include/asm/prom.h (revision b9ccfda2)
1 /*
2  *  arch/mips/include/asm/prom.h
3  *
4  *  Copyright (C) 2010 Cisco Systems Inc. <dediao@cisco.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  */
11 #ifndef __ASM_PROM_H
12 #define __ASM_PROM_H
13 
14 #ifdef CONFIG_OF
15 #include <linux/bug.h>
16 #include <linux/io.h>
17 #include <linux/types.h>
18 #include <asm/bootinfo.h>
19 
20 extern int early_init_dt_scan_memory_arch(unsigned long node,
21 	const char *uname, int depth, void *data);
22 
23 extern int reserve_mem_mach(unsigned long addr, unsigned long size);
24 extern void free_mem_mach(unsigned long addr, unsigned long size);
25 
26 extern void device_tree_init(void);
27 
28 static inline unsigned long pci_address_to_pio(phys_addr_t address)
29 {
30 	/*
31 	 * The ioport address can be directly used by inX() / outX()
32 	 */
33 	BUG_ON(address > IO_SPACE_LIMIT);
34 
35 	return (unsigned long) address;
36 }
37 #define pci_address_to_pio pci_address_to_pio
38 
39 struct boot_param_header;
40 
41 extern void __dt_setup_arch(struct boot_param_header *bph);
42 
43 #define dt_setup_arch(sym)						\
44 ({									\
45 	extern struct boot_param_header __dtb_##sym##_begin;		\
46 									\
47 	__dt_setup_arch(&__dtb_##sym##_begin);				\
48 })
49 
50 #else /* CONFIG_OF */
51 static inline void device_tree_init(void) { }
52 #endif /* CONFIG_OF */
53 
54 #endif /* __ASM_PROM_H */
55