blob: 101fa098f62af7576f05b694a346e80349ae2c2d [file] [log] [blame]
Michal Simek12e84142009-03-27 14:25:12 +01001/*
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
Grant Likely9d24c882009-10-15 10:57:44 -060015#include <linux/of.h> /* linux/of.h gets to determine #include ordering */
16
Michal Simek12e84142009-03-27 14:25:12 +010017#ifndef _ASM_MICROBLAZE_PROM_H
18#define _ASM_MICROBLAZE_PROM_H
19#ifdef __KERNEL__
John Williams909964e2009-06-22 14:02:09 +100020#ifndef __ASSEMBLY__
21
Michal Simek12e84142009-03-27 14:25:12 +010022#include <linux/types.h>
Michal Simek12e84142009-03-27 14:25:12 +010023#include <asm/irq.h>
24#include <asm/atomic.h>
25
Michal Simek12e84142009-03-27 14:25:12 +010026#define HAVE_ARCH_DEVTREE_FIXUPS
27
Michal Simek12e84142009-03-27 14:25:12 +010028/* Other Prototypes */
Michal Simek12e84142009-03-27 14:25:12 +010029extern int early_uartlite_console(void);
Michal Simek12e84142009-03-27 14:25:12 +010030
Michal Simeka6475c12010-01-18 15:27:10 +010031#ifdef CONFIG_PCI
32/*
33 * PCI <-> OF matching functions
34 * (XXX should these be here?)
35 */
36struct pci_bus;
37struct pci_dev;
38extern int pci_device_from_OF_node(struct device_node *node,
39 u8 *bus, u8 *devfn);
40extern struct device_node *pci_busdev_to_OF_node(struct pci_bus *bus,
41 int devfn);
42extern struct device_node *pci_device_to_OF_node(struct pci_dev *dev);
43extern void pci_create_OF_bus_map(void);
44#endif
45
Michal Simek12e84142009-03-27 14:25:12 +010046/*
47 * OF address retreival & translation
48 */
49
Grant Likely1f5bef32010-06-08 07:48:09 -060050#ifdef CONFIG_PCI
51extern unsigned long pci_address_to_pio(phys_addr_t address);
Grant Likely22ae782f2010-07-29 11:49:01 -060052#define pci_address_to_pio pci_address_to_pio
Grant Likely1f5bef32010-06-08 07:48:09 -060053#endif /* CONFIG_PCI */
54
Michal Simek12e84142009-03-27 14:25:12 +010055/* Parse the ibm,dma-window property of an OF node into the busno, phys and
56 * size parameters.
57 */
58void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop,
59 unsigned long *busno, unsigned long *phys, unsigned long *size);
60
61extern void kdump_move_device_tree(void);
62
63/* CPU OF node matching */
64struct device_node *of_get_cpu_node(int cpu, unsigned int *thread);
65
66/* Get the MAC address */
67extern const void *of_get_mac_address(struct device_node *np);
68
Michal Simek12e84142009-03-27 14:25:12 +010069/**
Michal Simek12e84142009-03-27 14:25:12 +010070 * of_irq_map_pci - Resolve the interrupt for a PCI device
71 * @pdev: the device whose interrupt is to be resolved
72 * @out_irq: structure of_irq filled by this function
73 *
74 * This function resolves the PCI interrupt for a given PCI device. If a
75 * device-node exists for a given pci_dev, it will use normal OF tree
76 * walking. If not, it will implement standard swizzling and walk up the
77 * PCI tree until an device-node is found, at which point it will finish
78 * resolving using the OF tree walking.
79 */
80struct pci_dev;
Grant Likely22ae782f2010-07-29 11:49:01 -060081struct of_irq;
Michal Simek12e84142009-03-27 14:25:12 +010082extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
83
John Williams909964e2009-06-22 14:02:09 +100084#endif /* __ASSEMBLY__ */
Michal Simek12e84142009-03-27 14:25:12 +010085#endif /* __KERNEL__ */
Grant Likely22ae782f2010-07-29 11:49:01 -060086
87/* These includes are put at the bottom because they may contain things
88 * that are overridden by this file. Ideally they shouldn't be included
89 * by this file, but there are a bunch of .c files that currently depend
90 * on it. Eventually they will be cleaned up. */
91#include <linux/of_fdt.h>
92#include <linux/of_irq.h>
93#include <linux/platform_device.h>
94
Michal Simek12e84142009-03-27 14:25:12 +010095#endif /* _ASM_MICROBLAZE_PROM_H */