diff options
| author | Michal Simek <michal.simek@xilinx.com> | 2014-05-16 07:37:02 -0400 |
|---|---|---|
| committer | Michal Simek <michal.simek@xilinx.com> | 2014-06-04 00:59:57 -0400 |
| commit | 193bca5934db1ca1d0ffcedf551030ff5556a07c (patch) | |
| tree | e5ae4908176bd9b26f1b73407892d9b64be12410 /arch | |
| parent | 28d1880c6872af3d1c17bc46da5795b9eba04bee (diff) | |
microblaze: Cleanup PCI_DRAM_OFFSET handling
PCI_DRAM_OFFSET/pci_dram_offset is 0 all the time and there
is no difference for PCI and !PCI cases.
Also remove the whole code which setup archdata.dma_data
which is completely unused.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Diffstat (limited to 'arch')
| -rw-r--r-- | arch/microblaze/include/asm/device.h | 1 | ||||
| -rw-r--r-- | arch/microblaze/include/asm/io.h | 3 | ||||
| -rw-r--r-- | arch/microblaze/kernel/dma.c | 23 | ||||
| -rw-r--r-- | arch/microblaze/pci/pci-common.c | 3 |
4 files changed, 3 insertions, 27 deletions
diff --git a/arch/microblaze/include/asm/device.h b/arch/microblaze/include/asm/device.h index 123b2fe72d01..eb639b479c7b 100644 --- a/arch/microblaze/include/asm/device.h +++ b/arch/microblaze/include/asm/device.h | |||
| @@ -14,7 +14,6 @@ struct device_node; | |||
| 14 | struct dev_archdata { | 14 | struct dev_archdata { |
| 15 | /* DMA operations on that device */ | 15 | /* DMA operations on that device */ |
| 16 | struct dma_map_ops *dma_ops; | 16 | struct dma_map_ops *dma_ops; |
| 17 | void *dma_data; | ||
| 18 | }; | 17 | }; |
| 19 | 18 | ||
| 20 | struct pdev_archdata { | 19 | struct pdev_archdata { |
diff --git a/arch/microblaze/include/asm/io.h b/arch/microblaze/include/asm/io.h index 1e4c3329f62e..433751b2a003 100644 --- a/arch/microblaze/include/asm/io.h +++ b/arch/microblaze/include/asm/io.h | |||
| @@ -19,17 +19,14 @@ | |||
| 19 | #ifndef CONFIG_PCI | 19 | #ifndef CONFIG_PCI |
| 20 | #define _IO_BASE 0 | 20 | #define _IO_BASE 0 |
| 21 | #define _ISA_MEM_BASE 0 | 21 | #define _ISA_MEM_BASE 0 |
| 22 | #define PCI_DRAM_OFFSET 0 | ||
| 23 | #else | 22 | #else |
| 24 | #define _IO_BASE isa_io_base | 23 | #define _IO_BASE isa_io_base |
| 25 | #define _ISA_MEM_BASE isa_mem_base | 24 | #define _ISA_MEM_BASE isa_mem_base |
| 26 | #define PCI_DRAM_OFFSET pci_dram_offset | ||
| 27 | struct pci_dev; | 25 | struct pci_dev; |
| 28 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); | 26 | extern void pci_iounmap(struct pci_dev *dev, void __iomem *); |
| 29 | #define pci_iounmap pci_iounmap | 27 | #define pci_iounmap pci_iounmap |
| 30 | 28 | ||
| 31 | extern unsigned long isa_io_base; | 29 | extern unsigned long isa_io_base; |
| 32 | extern unsigned long pci_dram_offset; | ||
| 33 | extern resource_size_t isa_mem_base; | 30 | extern resource_size_t isa_mem_base; |
| 34 | #endif | 31 | #endif |
| 35 | 32 | ||
diff --git a/arch/microblaze/kernel/dma.c b/arch/microblaze/kernel/dma.c index da68d00fd087..8f9b99508e79 100644 --- a/arch/microblaze/kernel/dma.c +++ b/arch/microblaze/kernel/dma.c | |||
| @@ -13,23 +13,6 @@ | |||
| 13 | #include <linux/export.h> | 13 | #include <linux/export.h> |
| 14 | #include <linux/bug.h> | 14 | #include <linux/bug.h> |
| 15 | 15 | ||
| 16 | /* | ||
| 17 | * Generic direct DMA implementation | ||
| 18 | * | ||
| 19 | * This implementation supports a per-device offset that can be applied if | ||
| 20 | * the address at which memory is visible to devices is not 0. Platform code | ||
| 21 | * can set archdata.dma_data to an unsigned long holding the offset. By | ||
| 22 | * default the offset is PCI_DRAM_OFFSET. | ||
| 23 | */ | ||
| 24 | |||
| 25 | static unsigned long get_dma_direct_offset(struct device *dev) | ||
| 26 | { | ||
| 27 | if (likely(dev)) | ||
| 28 | return (unsigned long)dev->archdata.dma_data; | ||
| 29 | |||
| 30 | return PCI_DRAM_OFFSET; /* FIXME Not sure if is correct */ | ||
| 31 | } | ||
| 32 | |||
| 33 | #define NOT_COHERENT_CACHE | 16 | #define NOT_COHERENT_CACHE |
| 34 | 17 | ||
| 35 | static void *dma_direct_alloc_coherent(struct device *dev, size_t size, | 18 | static void *dma_direct_alloc_coherent(struct device *dev, size_t size, |
| @@ -51,7 +34,7 @@ static void *dma_direct_alloc_coherent(struct device *dev, size_t size, | |||
| 51 | return NULL; | 34 | return NULL; |
| 52 | ret = page_address(page); | 35 | ret = page_address(page); |
| 53 | memset(ret, 0, size); | 36 | memset(ret, 0, size); |
| 54 | *dma_handle = virt_to_phys(ret) + get_dma_direct_offset(dev); | 37 | *dma_handle = virt_to_phys(ret); |
| 55 | 38 | ||
| 56 | return ret; | 39 | return ret; |
| 57 | #endif | 40 | #endif |
| @@ -77,7 +60,7 @@ static int dma_direct_map_sg(struct device *dev, struct scatterlist *sgl, | |||
| 77 | 60 | ||
| 78 | /* FIXME this part of code is untested */ | 61 | /* FIXME this part of code is untested */ |
| 79 | for_each_sg(sgl, sg, nents, i) { | 62 | for_each_sg(sgl, sg, nents, i) { |
| 80 | sg->dma_address = sg_phys(sg) + get_dma_direct_offset(dev); | 63 | sg->dma_address = sg_phys(sg); |
| 81 | __dma_sync(page_to_phys(sg_page(sg)) + sg->offset, | 64 | __dma_sync(page_to_phys(sg_page(sg)) + sg->offset, |
| 82 | sg->length, direction); | 65 | sg->length, direction); |
| 83 | } | 66 | } |
| @@ -104,7 +87,7 @@ static inline dma_addr_t dma_direct_map_page(struct device *dev, | |||
| 104 | struct dma_attrs *attrs) | 87 | struct dma_attrs *attrs) |
| 105 | { | 88 | { |
| 106 | __dma_sync(page_to_phys(page) + offset, size, direction); | 89 | __dma_sync(page_to_phys(page) + offset, size, direction); |
| 107 | return page_to_phys(page) + offset + get_dma_direct_offset(dev); | 90 | return page_to_phys(page) + offset; |
| 108 | } | 91 | } |
| 109 | 92 | ||
| 110 | static inline void dma_direct_unmap_page(struct device *dev, | 93 | static inline void dma_direct_unmap_page(struct device *dev, |
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index 99ac12ad4b9b..2cf412f4db4e 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
| @@ -48,7 +48,6 @@ static int global_phb_number; /* Global phb counter */ | |||
| 48 | resource_size_t isa_mem_base; | 48 | resource_size_t isa_mem_base; |
| 49 | 49 | ||
| 50 | unsigned long isa_io_base; | 50 | unsigned long isa_io_base; |
| 51 | unsigned long pci_dram_offset; | ||
| 52 | static int pci_bus_count; | 51 | static int pci_bus_count; |
| 53 | 52 | ||
| 54 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) | 53 | struct pci_controller *pcibios_alloc_controller(struct device_node *dev) |
| @@ -872,8 +871,6 @@ void pcibios_setup_bus_devices(struct pci_bus *bus) | |||
| 872 | */ | 871 | */ |
| 873 | set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); | 872 | set_dev_node(&dev->dev, pcibus_to_node(dev->bus)); |
| 874 | 873 | ||
| 875 | dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET; | ||
| 876 | |||
| 877 | /* Read default IRQs and fixup if necessary */ | 874 | /* Read default IRQs and fixup if necessary */ |
| 878 | dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); | 875 | dev->irq = of_irq_parse_and_map_pci(dev, 0, 0); |
| 879 | } | 876 | } |
