rk: ion: add version control
authorCMY <cmy@rock-chips.com>
Mon, 28 Apr 2014 09:52:30 +0000 (17:52 +0800)
committerCMY <cmy@rock-chips.com>
Wed, 30 Apr 2014 00:38:25 +0000 (08:38 +0800)
         disable ion snapshot by default
 fix build warn

arch/arm/boot/dts/rk3288.dtsi
arch/arm/configs/rockchip_defconfig
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/rockchip/rockchip_ion.c
include/linux/rockchip_ion.h

index 3e0cb606d0349ed87d061e3bacf3a389451bb61c..32f0c94afb3a7c7d2a4721c5f275dc8683c9da2f 100755 (executable)
                #size-cells = <0>;
                rockchip,ion-heap@1 { /* CMA HEAP */
                        compatible = "rockchip,ion-reserve";
-                       reg = <1>;
-                       memory-reservation = <0x00000000 0x20000000>; /* 512MB */
+                       rockchip,ion_heap = <1>;
+                       reg = <0x00000000 0x20000000>; /* 512MB */
                };
-               rockchip,ion-heap@3 { /* SYSTEM HEAP */
-                       reg = <3>;
+               rockchip,ion-heap@3 { /* VMALLOC HEAP */
+                       rockchip,ion_heap = <3>;
                };
        };
 
index 25bbd0cb062ff171048de444117becd2477cb955..544e83eaa99a122cacc18ef24a216517455e808f 100755 (executable)
@@ -502,8 +502,6 @@ CONFIG_SW_SYNC=y
 CONFIG_SW_SYNC_USER=y
 CONFIG_ION=y
 CONFIG_ION_ROCKCHIP=y
-CONFIG_ION_ROCKCHIP_SNAPSHOT=y
-CONFIG_ION_SNAPSHOT_BUF_SHIFT=15
 CONFIG_COMMON_CLK_DEBUG=y
 CONFIG_IIO=y
 CONFIG_ROCKCHIP_ADC=y
index 38d3f494ecbf122e525a91e587c01a09e9a1a6a9..162156644146f41dcd0e491336848ae001a007bf 100755 (executable)
@@ -116,7 +116,6 @@ struct ion_handle {
        int id;
 };
 
-static void ion_iommu_force_unmap(struct ion_buffer *buffer);
 extern char *rockchip_ion_snapshot_get(unsigned *size);
 extern int rockchip_ion_snapshot_debugfs(struct dentry* root);
 
@@ -281,6 +280,7 @@ void ion_buffer_destroy(struct ion_buffer *buffer)
                buffer->heap->ops->unmap_kernel(buffer->heap, buffer);
        buffer->heap->ops->unmap_dma(buffer->heap, buffer);
 #ifdef CONFIG_ROCKCHIP_IOMMU
+       static void ion_iommu_force_unmap(struct ion_buffer *buffer);
        ion_iommu_force_unmap(buffer);
 #endif
        buffer->heap->ops->free(buffer);
@@ -937,7 +937,7 @@ static int ion_debug_client_show_buffer(struct seq_file *s, void *unused)
                        buffer->heap->ops->phys(buffer->heap, buffer, &pa, &len);
 
                seq_printf(s, "%16.16s:   0x%08lx   0x%08lx %8zuKB %4d %4d %4d\n",
-                       buffer->heap->name, buffer->vaddr, pa, len>>10, buffer->handle_count,
+                       buffer->heap->name, (unsigned long)buffer->vaddr, pa, len>>10, buffer->handle_count,
                        atomic_read(&buffer->ref.refcount), atomic_read(&handle->ref.refcount));
 #ifdef CONFIG_ROCKCHIP_IOMMU
                ion_debug_client_show_buffer_map(s, buffer);
index b752a2b79c9f7be37ec4109dbac29117ad33cf5b..3da5f73cf7da90ff5dece431f9ec5964f9948c98 100755 (executable)
@@ -109,13 +109,13 @@ static int rockchip_ion_get_heap_base_size(struct device_node *node,
        int ret = 0;
 
        ret = of_property_read_u32_array(node,
-                       "memory-reservation", val, 2);
+                       "reg", val, 2);
        if (!ret) {
                heap->base = val[0];
                heap->size = val[1];
        }
 
-       printk("heap: %x@%x\n", heap->size, heap->base);
+       pr_debug("heap: %x@%lx\n", heap->size, heap->base);
 
        return 0;
 }
@@ -147,7 +147,7 @@ static struct ion_platform_data *rockchip_ion_parse_dt(
        pdata->nr = num_heaps;
         
        for_each_child_of_node(dt_node, node) {
-               ret = of_property_read_u32(node, "reg", &val);
+               ret = of_property_read_u32(node, "rockchip,ion_heap", &val);
                if (ret) {
                        pr_err("%s: Unable to find reg key", __func__);
                        goto free_heaps;
@@ -372,7 +372,7 @@ static int rockchip_ion_probe(struct platform_device *pdev)
        if (pdata_needs_to_be_freed)
                kfree(pdata);
 
-       pr_info("Rockchip ion module is successfully loaded\n");
+       pr_info("Rockchip ion module is successfully loaded (%s)\n", ROCKCHIP_ION_VERSION);
        return 0;
 err:
        for (i = 0; i < num_heaps; i++) {
@@ -410,14 +410,14 @@ int __init rockchip_ion_find_reserve_mem(unsigned long node, const char *uname,
        if (!of_flat_dt_is_compatible(node, "rockchip,ion-reserve"))
                return 0;
 
-       prop = of_get_flat_dt_prop(node, "memory-reservation", &len);
+       prop = of_get_flat_dt_prop(node, "reg", &len);
        if (!prop || (len != 2 * sizeof(unsigned long)))
                return 0;
 
        base = be32_to_cpu(prop[0]);
        size = be32_to_cpu(prop[1]);
 
-       prop = of_get_flat_dt_prop(node, "reg", &len);
+       prop = of_get_flat_dt_prop(node, "rockchip,ion_heap", &len);
        if (!prop || (len != sizeof(unsigned long)))
                return 0;
 
index 34762b044b3d5a910ba5f7d0782987300c56d567..c0b0ac6535c766ddfe65048bd2be3f3582518ba4 100755 (executable)
@@ -22,6 +22,8 @@
 #include <linux/ion.h>
 #endif
 
+#define ROCKCHIP_ION_VERSION   "v1.0"
+
 enum ion_heap_ids {
        INVALID_HEAP_ID = -1,
        ION_CMA_HEAP_ID = 1,