prom.h 1.8 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/*
 * Definitions for Device tree / OpenFirmware handling on X86
 *
 * based on arch/powerpc/include/asm/prom.h which is
 *         Copyright (C) 1996-2005 Paul Mackerras.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version
 * 2 of the License, or (at your option) any later version.
 */

#ifndef _ASM_X86_PROM_H
#define _ASM_X86_PROM_H
#ifndef __ASSEMBLY__

#include <linux/of.h>
#include <linux/types.h>
19
#include <linux/pci.h>
20 21 22 23

#include <asm/irq.h>
#include <asm/atomic.h>
#include <asm/setup.h>
24
#include <asm/irq_controller.h>
25 26

#ifdef CONFIG_OF
27 28
extern int of_ioapic;
extern u64 initial_dtb;
29
extern void add_dtb(u64 data);
30 31
void x86_dtb_find_config(void);
void x86_dtb_get_config(unsigned int unused);
32
void add_interrupt_host(struct irq_domain *ih);
33 34 35 36 37 38 39 40 41 42 43 44
void __cpuinit x86_of_pci_init(void);

static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
{
	return pdev ? pdev->dev.of_node : NULL;
}

static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
{
	return pci_device_to_OF_node(bus->self);
}

45 46
#else
static inline void add_dtb(u64 data) { }
47
static inline void x86_of_pci_init(void) { }
48 49 50
#define x86_dtb_find_config x86_init_noop
#define x86_dtb_get_config x86_init_uint_noop
#define of_ioapic 0
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
#endif

extern char cmd_line[COMMAND_LINE_SIZE];

#define pci_address_to_pio pci_address_to_pio
unsigned long pci_address_to_pio(phys_addr_t addr);

/**
 * irq_dispose_mapping - Unmap an interrupt
 * @virq: linux virq number of the interrupt to unmap
 *
 * FIXME: We really should implement proper virq handling like power,
 * but that's going to be major surgery.
 */
static inline void irq_dispose_mapping(unsigned int virq) { }

#define HAVE_ARCH_DEVTREE_FIXUPS

#endif /* __ASSEMBLY__ */
#endif