Signed-off-by: Wojciech Dubowik <[email protected]>
---
.../250-fix-dma-mapping-for-ahb-bus.patch | 37 ++++++++++++++++++++
.../250-fix-dma-mapping-for-ahb-bus.patch | 31 ++++++++++++++++
.../250-fix-dma-mapping-for-ahb-bus.patch | 31 ++++++++++++++++
.../250-fix-dma-mapping-for-ahb-bus.patch | 31 ++++++++++++++++
4 files changed, 130 insertions(+), 0 deletions(-)
create mode 100644
target/linux/atheros/patches-2.6.32/250-fix-dma-mapping-for-ahb-bus.patch
create mode 100644
target/linux/atheros/patches-2.6.34/250-fix-dma-mapping-for-ahb-bus.patch
create mode 100644
target/linux/atheros/patches-2.6.35/250-fix-dma-mapping-for-ahb-bus.patch
create mode 100644
target/linux/atheros/patches-2.6.36/250-fix-dma-mapping-for-ahb-bus.patch
diff --git
a/target/linux/atheros/patches-2.6.32/250-fix-dma-mapping-for-ahb-bus.patch
b/target/linux/atheros/patches-2.6.32/250-fix-dma-mapping-for-ahb-bus.patch
new file mode 100644
index 0000000..a386741
--- /dev/null
+++ b/target/linux/atheros/patches-2.6.32/250-fix-dma-mapping-for-ahb-bus.patch
@@ -0,0 +1,37 @@
+--- a/arch/mips/include/asm/mach-ar231x/dma-coherence.h.orig
++++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+@@ -10,18 +10,32 @@
+ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
+ #define __ASM_MACH_GENERIC_DMA_COHERENCE_H
+
++#include <linux/pci.h>
++
+ #define PCI_DMA_OFFSET 0x20000000
+
++#ifdef CONFIG_PCI
++#define dev_is_pci(d) ((d)->bus == &pci_bus_type)
++#else
++#define dev_is_pci(d) (false)
++#endif
++
+ struct device;
+
+ static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t
size)
+ {
+- return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return virt_to_phys(addr);
++ else
++ return virt_to_phys(addr) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
+ {
+- return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return page_to_phys(page);
++ else
++ return page_to_phys(page) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
diff --git
a/target/linux/atheros/patches-2.6.34/250-fix-dma-mapping-for-ahb-bus.patch
b/target/linux/atheros/patches-2.6.34/250-fix-dma-mapping-for-ahb-bus.patch
new file mode 100644
index 0000000..5648b43
--- /dev/null
+++ b/target/linux/atheros/patches-2.6.34/250-fix-dma-mapping-for-ahb-bus.patch
@@ -0,0 +1,31 @@
+--- a/arch/mips/include/asm/mach-ar231x/dma-coherence.h
++++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+@@ -10,18 +10,26 @@
+ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
+ #define __ASM_MACH_GENERIC_DMA_COHERENCE_H
+
++#include <linux/pci.h>
++
+ #define PCI_DMA_OFFSET 0x20000000
+
+ struct device;
+
+ static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t
size)
+ {
+- return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return virt_to_phys(addr);
++ else
++ return virt_to_phys(addr) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
+ {
+- return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return page_to_phys(page);
++ else
++ return page_to_phys(page) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
diff --git
a/target/linux/atheros/patches-2.6.35/250-fix-dma-mapping-for-ahb-bus.patch
b/target/linux/atheros/patches-2.6.35/250-fix-dma-mapping-for-ahb-bus.patch
new file mode 100644
index 0000000..5648b43
--- /dev/null
+++ b/target/linux/atheros/patches-2.6.35/250-fix-dma-mapping-for-ahb-bus.patch
@@ -0,0 +1,31 @@
+--- a/arch/mips/include/asm/mach-ar231x/dma-coherence.h
++++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+@@ -10,18 +10,26 @@
+ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
+ #define __ASM_MACH_GENERIC_DMA_COHERENCE_H
+
++#include <linux/pci.h>
++
+ #define PCI_DMA_OFFSET 0x20000000
+
+ struct device;
+
+ static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t
size)
+ {
+- return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return virt_to_phys(addr);
++ else
++ return virt_to_phys(addr) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
+ {
+- return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return page_to_phys(page);
++ else
++ return page_to_phys(page) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
diff --git
a/target/linux/atheros/patches-2.6.36/250-fix-dma-mapping-for-ahb-bus.patch
b/target/linux/atheros/patches-2.6.36/250-fix-dma-mapping-for-ahb-bus.patch
new file mode 100644
index 0000000..5648b43
--- /dev/null
+++ b/target/linux/atheros/patches-2.6.36/250-fix-dma-mapping-for-ahb-bus.patch
@@ -0,0 +1,31 @@
+--- a/arch/mips/include/asm/mach-ar231x/dma-coherence.h
++++ b/arch/mips/include/asm/mach-ar231x/dma-coherence.h
+@@ -10,18 +10,26 @@
+ #ifndef __ASM_MACH_GENERIC_DMA_COHERENCE_H
+ #define __ASM_MACH_GENERIC_DMA_COHERENCE_H
+
++#include <linux/pci.h>
++
+ #define PCI_DMA_OFFSET 0x20000000
+
+ struct device;
+
+ static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t
size)
+ {
+- return virt_to_phys(addr) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return virt_to_phys(addr);
++ else
++ return virt_to_phys(addr) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static dma_addr_t plat_map_dma_mem_page(struct device *dev, struct page *page)
+ {
+- return page_to_phys(page) + (dev != NULL ? PCI_DMA_OFFSET : 0);
++ if (dev == NULL)
++ return page_to_phys(page);
++ else
++ return page_to_phys(page) + (dev_is_pci(dev) ? PCI_DMA_OFFSET
: 0);
+ }
+
+ static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
--
1.7.1
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel