Commit | Line | Data |
---|---|---|
12e84142 MS |
1 | /* |
2 | * Definitions for talking to the Open Firmware PROM on | |
3 | * Power Macintosh computers. | |
4 | * | |
5 | * Copyright (C) 1996-2005 Paul Mackerras. | |
6 | * | |
7 | * Updates for PPC64 by Peter Bergner & David Engebretsen, IBM Corp. | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or | |
10 | * modify it under the terms of the GNU General Public License | |
11 | * as published by the Free Software Foundation; either version | |
12 | * 2 of the License, or (at your option) any later version. | |
13 | */ | |
14 | ||
9d24c888 GL |
15 | #include <linux/of.h> /* linux/of.h gets to determine #include ordering */ |
16 | ||
12e84142 MS |
17 | #ifndef _ASM_MICROBLAZE_PROM_H |
18 | #define _ASM_MICROBLAZE_PROM_H | |
19 | #ifdef __KERNEL__ | |
909964ec JW |
20 | #ifndef __ASSEMBLY__ |
21 | ||
12e84142 | 22 | #include <linux/types.h> |
12e84142 MS |
23 | #include <asm/irq.h> |
24 | #include <asm/atomic.h> | |
25 | ||
12e84142 MS |
26 | #define HAVE_ARCH_DEVTREE_FIXUPS |
27 | ||
12e84142 | 28 | /* Other Prototypes */ |
12e84142 | 29 | extern int early_uartlite_console(void); |
67f4aaa2 | 30 | extern int early_uart16550_console(void); |
12e84142 | 31 | |
a6475c13 MS |
32 | #ifdef CONFIG_PCI |
33 | /* | |
34 | * PCI <-> OF matching functions | |
35 | * (XXX should these be here?) | |
36 | */ | |
37 | struct pci_bus; | |
38 | struct pci_dev; | |
39 | extern int pci_device_from_OF_node(struct device_node *node, | |
40 | u8 *bus, u8 *devfn); | |
41 | extern struct device_node *pci_busdev_to_OF_node(struct pci_bus *bus, | |
42 | int devfn); | |
43 | extern struct device_node *pci_device_to_OF_node(struct pci_dev *dev); | |
44 | extern void pci_create_OF_bus_map(void); | |
45 | #endif | |
46 | ||
12e84142 MS |
47 | /* |
48 | * OF address retreival & translation | |
49 | */ | |
50 | ||
1f5bef30 GL |
51 | #ifdef CONFIG_PCI |
52 | extern unsigned long pci_address_to_pio(phys_addr_t address); | |
22ae782f | 53 | #define pci_address_to_pio pci_address_to_pio |
1f5bef30 GL |
54 | #endif /* CONFIG_PCI */ |
55 | ||
12e84142 MS |
56 | /* Parse the ibm,dma-window property of an OF node into the busno, phys and |
57 | * size parameters. | |
58 | */ | |
59 | void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, | |
60 | unsigned long *busno, unsigned long *phys, unsigned long *size); | |
61 | ||
62 | extern void kdump_move_device_tree(void); | |
63 | ||
64 | /* CPU OF node matching */ | |
65 | struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); | |
66 | ||
12e84142 MS |
67 | /** |
68 | * of_irq_map_pci - Resolve the interrupt for a PCI device | |
69 | * @pdev: the device whose interrupt is to be resolved | |
70 | * @out_irq: structure of_irq filled by this function | |
71 | * | |
72 | * This function resolves the PCI interrupt for a given PCI device. If a | |
73 | * device-node exists for a given pci_dev, it will use normal OF tree | |
74 | * walking. If not, it will implement standard swizzling and walk up the | |
75 | * PCI tree until an device-node is found, at which point it will finish | |
76 | * resolving using the OF tree walking. | |
77 | */ | |
78 | struct pci_dev; | |
22ae782f | 79 | struct of_irq; |
12e84142 MS |
80 | extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); |
81 | ||
909964ec | 82 | #endif /* __ASSEMBLY__ */ |
12e84142 | 83 | #endif /* __KERNEL__ */ |
22ae782f GL |
84 | |
85 | /* These includes are put at the bottom because they may contain things | |
86 | * that are overridden by this file. Ideally they shouldn't be included | |
87 | * by this file, but there are a bunch of .c files that currently depend | |
88 | * on it. Eventually they will be cleaned up. */ | |
89 | #include <linux/of_fdt.h> | |
90 | #include <linux/of_irq.h> | |
91 | #include <linux/platform_device.h> | |
92 | ||
12e84142 | 93 | #endif /* _ASM_MICROBLAZE_PROM_H */ |