···44#define _ASM_BFIN_PCI_H5566#include <asm/scatterlist.h>77+#include <asm-generic/pci-dma-compat.h>88+#include <asm-generic/pci.h>7988-/*99- *1010- * Written by Wout Klaren.1111- */1212-1313-/* Added by Chang Junxiao */1410#define PCIBIOS_MIN_IO 0x000010001511#define PCIBIOS_MIN_MEM 0x1000000016121717-#define PCI_DMA_BUS_IS_PHYS (1)1818-struct pci_ops;1919-2020-/*2121- * Structure with hardware dependent information and functions of the2222- * PCI bus.2323- */2424-struct pci_bus_info {2525-2626- /*2727- * Resources of the PCI bus.2828- */2929- struct resource mem_space;3030- struct resource io_space;3131-3232- /*3333- * System dependent functions.3434- */3535- struct pci_ops *bfin_pci_ops;3636- void (*fixup) (int pci_modify);3737- void (*conf_device) (unsigned char bus, unsigned char device_fn);3838-};3939-4040-#define pcibios_assign_all_busses() 04113static inline void pcibios_set_master(struct pci_dev *dev)4214{4343-4415 /* No special bus mastering setup handling */4516}4617static inline void pcibios_penalize_isa_irq(int irq)4718{4848-4919 /* We don't do dynamic PCI IRQ allocation */5050-}5151-static inline dma_addr_t pci_map_single(struct pci_dev *hwdev, void *ptr,5252- size_t size, int direction)5353-{5454- if (direction == PCI_DMA_NONE)5555- BUG();5656-5757- /* return virt_to_bus(ptr); */5858- return (dma_addr_t) ptr;5959-}6060-6161-/* Unmap a single streaming mode DMA translation. The dma_addr and size6262- * must match what was provided for in a previous pci_map_single call. All6363- * other usages are undefined.6464- *6565- * After this call, reads by the cpu to the buffer are guarenteed to see6666- * whatever the device wrote there.6767- */6868-static inline void pci_unmap_single(struct pci_dev *hwdev, dma_addr_t dma_addr,6969- size_t size, int direction)7070-{7171- if (direction == PCI_DMA_NONE)7272- BUG();7373-7474- /* Nothing to do */7575-}7676-7777-/* Map a set of buffers described by scatterlist in streaming7878- * mode for DMA. This is the scather-gather version of the7979- * above pci_map_single interface. Here the scatter gather list8080- * elements are each tagged with the appropriate dma address8181- * and length. They are obtained via sg_dma_{address,length}(SG).8282- *8383- * NOTE: An implementation may be able to use a smaller number of8484- * DMA address/length pairs than there are SG table elements.8585- * (for example via virtual mapping capabilities)8686- * The routine returns the number of addr/length pairs actually8787- * used, at most nents.8888- *8989- * Device ownership issues as mentioned above for pci_map_single are9090- * the same here.9191- */9292-static inline int pci_map_sg(struct pci_dev *hwdev, struct scatterlist *sg,9393- int nents, int direction)9494-{9595- if (direction == PCI_DMA_NONE)9696- BUG();9797- return nents;9898-}9999-100100-/* Unmap a set of streaming mode DMA translations.101101- * Again, cpu read rules concerning calls here are the same as for102102- * pci_unmap_single() above.103103- */104104-static inline void pci_unmap_sg(struct pci_dev *hwdev, struct scatterlist *sg,105105- int nents, int direction)106106-{107107- if (direction == PCI_DMA_NONE)108108- BUG();109109-110110- /* Nothing to do */111111-}112112-113113-/* Make physical memory consistent for a single114114- * streaming mode DMA translation after a transfer.115115- *116116- * If you perform a pci_map_single() but wish to interrogate the117117- * buffer using the cpu, yet do not wish to teardown the PCI dma118118- * mapping, you must call this function before doing so. At the119119- * next point you give the PCI dma address back to the card, the120120- * device again owns the buffer.121121- */122122-static inline void pci_dma_sync_single(struct pci_dev *hwdev,123123- dma_addr_t dma_handle, size_t size,124124- int direction)125125-{126126- if (direction == PCI_DMA_NONE)127127- BUG();128128-129129- /* Nothing to do */130130-}131131-132132-/* Make physical memory consistent for a set of streaming133133- * mode DMA translations after a transfer.134134- *135135- * The same as pci_dma_sync_single but for a scatter-gather list,136136- * same rules and usage.137137- */138138-static inline void pci_dma_sync_sg(struct pci_dev *hwdev,139139- struct scatterlist *sg, int nelems,140140- int direction)141141-{142142- if (direction == PCI_DMA_NONE)143143- BUG();144144-145145- /* Nothing to do */14620}1472114822#endif /* _ASM_BFIN_PCI_H */