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 15#include <linux/of.h> /* linux/of.h gets to determine #include ordering */ 16 17#ifndef _ASM_MICROBLAZE_PROM_H 18#define _ASM_MICROBLAZE_PROM_H 19#ifdef __KERNEL__ 20#ifndef __ASSEMBLY__ 21 22#include <linux/types.h> 23#include <asm/irq.h> 24#include <asm/atomic.h> 25 26#define HAVE_ARCH_DEVTREE_FIXUPS 27 28/* Other Prototypes */ 29extern int early_uartlite_console(void); 30 31#ifdef CONFIG_PCI 32struct pci_bus; 33struct pci_dev; 34extern int pci_device_from_OF_node(struct device_node *node, 35 u8 *bus, u8 *devfn); 36extern struct device_node *pci_busdev_to_OF_node(struct pci_bus *bus, 37 int devfn); 38extern struct device_node *pci_device_to_OF_node(struct pci_dev *dev); 39extern void pci_create_OF_bus_map(void); 40#endif 41 42/* 43 * OF address retreival & translation 44 */ 45 46#ifdef CONFIG_PCI 47extern unsigned long pci_address_to_pio(phys_addr_t address); 48#define pci_address_to_pio pci_address_to_pio 49#endif /* CONFIG_PCI */ 50 51/* Parse the ibm,dma-window property of an OF node into the busno, phys and 52 * size parameters. 53 */ 54void of_parse_dma_window(struct device_node *dn, const void *dma_window_prop, 55 unsigned long *busno, unsigned long *phys, unsigned long *size); 56 57extern void kdump_move_device_tree(void); 58 59/* CPU OF node matching */ 60struct device_node *of_get_cpu_node(int cpu, unsigned int *thread); 61 62/* Get the MAC address */ 63extern const void *of_get_mac_address(struct device_node *np); 64 65/** 66 * of_irq_map_pci - Resolve the interrupt for a PCI device 67 * @pdev: the device whose interrupt is to be resolved 68 * @out_irq: structure of_irq filled by this function 69 * 70 * This function resolves the PCI interrupt for a given PCI device. If a 71 * device-node exists for a given pci_dev, it will use normal OF tree 72 * walking. If not, it will implement standard swizzling and walk up the 73 * PCI tree until an device-node is found, at which point it will finish 74 * resolving using the OF tree walking. 75 */ 76struct pci_dev; 77struct of_irq; 78extern int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 79 80#endif /* __ASSEMBLY__ */ 81#endif /* __KERNEL__ */ 82 83/* These includes are put at the bottom because they may contain things 84 * that are overridden by this file. Ideally they shouldn't be included 85 * by this file, but there are a bunch of .c files that currently depend 86 * on it. Eventually they will be cleaned up. */ 87#include <linux/of_fdt.h> 88#include <linux/of_irq.h> 89#include <linux/platform_device.h> 90 91#endif /* _ASM_MICROBLAZE_PROM_H */ 92