blob: f58361ba7357d2ca6c78c1236ed6586fdd6f8031 [file] [log] [blame]
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +01001/*
2 * Definitions for Device tree / OpenFirmware handling on X86
3 *
4 * based on arch/powerpc/include/asm/prom.h which is
5 * Copyright (C) 1996-2005 Paul Mackerras.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version
10 * 2 of the License, or (at your option) any later version.
11 */
12
13#ifndef _ASM_X86_PROM_H
14#define _ASM_X86_PROM_H
15#ifndef __ASSEMBLY__
16
17#include <linux/of.h>
18#include <linux/types.h>
Sebastian Andrzej Siewior96e0a072011-02-22 21:07:42 +010019#include <linux/pci.h>
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +010020
21#include <asm/irq.h>
22#include <asm/atomic.h>
23#include <asm/setup.h>
Sebastian Andrzej Siewior19c4f5f2011-02-22 21:07:39 +010024#include <asm/irq_controller.h>
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +010025
26#ifdef CONFIG_OF
Sebastian Andrzej Siewior3879a6f2011-02-22 21:07:40 +010027extern int of_ioapic;
28extern u64 initial_dtb;
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +010029extern void add_dtb(u64 data);
Sebastian Andrzej Siewiorbcc7c122011-02-22 21:07:44 +010030extern void x86_add_irq_domains(void);
Sebastian Andrzej Siewior3879a6f2011-02-22 21:07:40 +010031void x86_dtb_find_config(void);
32void x86_dtb_get_config(unsigned int unused);
Sebastian Andrzej Siewior96e0a072011-02-22 21:07:42 +010033void __cpuinit x86_of_pci_init(void);
34
35static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
36{
37 return pdev ? pdev->dev.of_node : NULL;
38}
39
40static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
41{
42 return pci_device_to_OF_node(bus->self);
43}
44
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +010045#else
46static inline void add_dtb(u64 data) { }
Sebastian Andrzej Siewiorbcc7c122011-02-22 21:07:44 +010047static inline void x86_add_irq_domains(void) { }
Sebastian Andrzej Siewior96e0a072011-02-22 21:07:42 +010048static inline void x86_of_pci_init(void) { }
Sebastian Andrzej Siewior3879a6f2011-02-22 21:07:40 +010049#define x86_dtb_find_config x86_init_noop
50#define x86_dtb_get_config x86_init_uint_noop
51#define of_ioapic 0
Sebastian Andrzej Siewiorda6b7372011-02-22 21:07:37 +010052#endif
53
54extern char cmd_line[COMMAND_LINE_SIZE];
55
56#define pci_address_to_pio pci_address_to_pio
57unsigned long pci_address_to_pio(phys_addr_t addr);
58
59/**
60 * irq_dispose_mapping - Unmap an interrupt
61 * @virq: linux virq number of the interrupt to unmap
62 *
63 * FIXME: We really should implement proper virq handling like power,
64 * but that's going to be major surgery.
65 */
66static inline void irq_dispose_mapping(unsigned int virq) { }
67
68#define HAVE_ARCH_DEVTREE_FIXUPS
69
70#endif /* __ASSEMBLY__ */
71#endif