1/* MN10300 PCI definitions 2 * 3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 4 * Written by David Howells (dhowells@redhat.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public Licence 8 * as published by the Free Software Foundation; either version 9 * 2 of the Licence, or (at your option) any later version. 10 */ 11#ifndef _ASM_PCI_H 12#define _ASM_PCI_H 13 14#ifdef __KERNEL__ 15#include <linux/mm.h> /* for struct page */ 16 17#define __pcbdebug(FMT, ADDR, ...) do {} while (0) 18#define __pcidebug(FMT, BUS, DEVFN, WHERE, ...) do {} while (0) 19 20/* Can be used to override the logic in pci_scan_bus for skipping 21 * already-configured bus numbers - to be used for buggy BIOSes or 22 * architectures with incomplete PCI setup by the loader */ 23 24#ifdef CONFIG_PCI 25#define pcibios_assign_all_busses() 1 26extern void unit_pci_init(void); 27#else 28#define pcibios_assign_all_busses() 0 29#endif 30 31extern unsigned long pci_mem_start; 32#define PCIBIOS_MIN_IO 0xBE000004 33#define PCIBIOS_MIN_MEM 0xB8000000 34 35void pcibios_set_master(struct pci_dev *dev); 36void pcibios_penalize_isa_irq(int irq); 37 38/* Dynamic DMA mapping stuff. 39 * i386 has everything mapped statically. 40 */ 41 42#include <linux/types.h> 43#include <linux/slab.h> 44#include <asm/scatterlist.h> 45#include <linux/string.h> 46#include <asm/io.h> 47 48struct pci_dev; 49 50/* The PCI address space does equal the physical memory 51 * address space. The networking and block device layers use 52 * this boolean for bounce buffer decisions. 53 */ 54#define PCI_DMA_BUS_IS_PHYS (1) 55 56/* Return the index of the PCI controller for device. */ 57static inline int pci_controller_num(struct pci_dev *dev) 58{ 59 return 0; 60} 61 62#define HAVE_PCI_MMAP 63extern int pci_mmap_page_range(struct pci_dev *dev, struct vm_area_struct *vma, 64 enum pci_mmap_state mmap_state, 65 int write_combine); 66 67#endif /* __KERNEL__ */ 68 69/* implement the pci_ DMA API in terms of the generic device dma_ one */ 70#include <asm-generic/pci-dma-compat.h> 71 72/** 73 * pcibios_resource_to_bus - convert resource to PCI bus address 74 * @dev: device which owns this resource 75 * @region: converted bus-centric region (start,end) 76 * @res: resource to convert 77 * 78 * Convert a resource to a PCI device bus address or bus window. 79 */ 80extern void pcibios_resource_to_bus(struct pci_dev *dev, 81 struct pci_bus_region *region, 82 struct resource *res); 83 84extern void pcibios_bus_to_resource(struct pci_dev *dev, 85 struct resource *res, 86 struct pci_bus_region *region); 87 88static inline struct resource * 89pcibios_select_root(struct pci_dev *pdev, struct resource *res) 90{ 91 struct resource *root = NULL; 92 93 if (res->flags & IORESOURCE_IO) 94 root = &ioport_resource; 95 if (res->flags & IORESOURCE_MEM) 96 root = &iomem_resource; 97 98 return root; 99} 100 101static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, int channel) 102{ 103 return channel ? 15 : 14; 104} 105 106#endif /* _ASM_PCI_H */ 107