rk30: port ipp
author黄涛 <huangtao@rock-chips.com>
Thu, 23 Feb 2012 08:57:25 +0000 (16:57 +0800)
committer黄涛 <huangtao@rock-chips.com>
Thu, 23 Feb 2012 08:57:25 +0000 (16:57 +0800)
arch/arm/mach-rk29/include/mach/rk29-ipp.h [new file with mode: 0644]
arch/arm/mach-rk30/devices.c
arch/arm/mach-rk30/include/mach/memory.h
drivers/staging/rk29/ipp/rk29-ipp.c

diff --git a/arch/arm/mach-rk29/include/mach/rk29-ipp.h b/arch/arm/mach-rk29/include/mach/rk29-ipp.h
new file mode 100644 (file)
index 0000000..706e19e
--- /dev/null
@@ -0,0 +1 @@
+#include <plat/ipp.h>
index 0e40bf7403989c773b84c7c90f08e37244d9b3e3..708eaaeb434806d4c4211e34a0bd88047ec90e32 100755 (executable)
@@ -745,6 +745,28 @@ static struct platform_device device_rga = {
 };
 #endif
 
+#ifdef CONFIG_RK29_IPP
+static struct resource resource_ipp[] = {
+       [0] = {
+               .start = RK30_IPP_PHYS,
+               .end   = RK30_IPP_PHYS + RK30_IPP_SIZE - 1,
+               .flags = IORESOURCE_MEM,
+       },
+       [1] = {
+               .start = IRQ_IPP,
+               .end   = IRQ_IPP,
+               .flags = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device device_ipp = {
+       .name           = "rk29-ipp",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(resource_ipp),
+       .resource       = resource_ipp,
+};
+#endif
+
 #ifdef CONFIG_KEYS_RK29
 extern struct rk29_keys_platform_data rk29_keys_pdata;
 static struct platform_device device_keys = {
@@ -771,6 +793,9 @@ static int __init rk30_init_devices(void)
 #ifdef CONFIG_RGA_RK30
        platform_device_register(&device_rga);
 #endif
+#ifdef CONFIG_RK29_IPP
+       platform_device_register(&device_ipp);
+#endif
 #ifdef CONFIG_LCDC_RK30
        platform_device_register(&device_lcdc);
 #endif
index c30244efe8d5949fbb5ca6acd11331906698d12e..37d66ae1399312de1a7adbfedbd71754e9d90032 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef __MACH_MEMORY_H
 #define __MACH_MEMORY_H
 
+#include <linux/version.h>
+
 /*
  * Physical DRAM offset.
  */
@@ -14,4 +16,9 @@
 #define SRAM_DATA_OFFSET       0xFEF03000
 #define SRAM_DATA_END          0xFEF03FFF
 
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 34))
+#define dmac_clean_range(start, end)   dmac_map_area(start, end - start, DMA_TO_DEVICE)
+#define dmac_inv_range(start, end)     dmac_unmap_area(start, end - start, DMA_FROM_DEVICE)
+#endif
+
 #endif
index 85313855808876abca9dff1e51ad9998e6812235..d3509d9b24563bd638462aedaf4e760718f71ba2 100755 (executable)
@@ -27,7 +27,7 @@
 #include <asm/io.h>\r
 #include <linux/irq.h>\r
 #include <linux/interrupt.h>\r
-#include <mach/rk29_iomap.h>\r
+#include <mach/io.h>\r
 #include <mach/irqs.h>\r
 #include <linux/fs.h>\r
 #include <asm/uaccess.h>\r
@@ -38,7 +38,7 @@
 #include <linux/wait.h>\r
 #include <linux/syscalls.h>\r
 #include <linux/timer.h>\r
-#include <mach/rk29-ipp.h>\r
+#include <plat/ipp.h>\r
 #include <linux/time.h>\r
 #include <asm/cacheflush.h>\r
 #include <linux/slab.h>\r