From f52cfbfccb5c6e7461629201049b3b4e2c244503 Mon Sep 17 00:00:00 2001 From: CMY Date: Mon, 28 Apr 2014 17:52:30 +0800 Subject: [PATCH] rk: ion: add version control disable ion snapshot by default fix build warn --- arch/arm/boot/dts/rk3288.dtsi | 8 ++++---- arch/arm/configs/rockchip_defconfig | 2 -- drivers/staging/android/ion/ion.c | 4 ++-- drivers/staging/android/ion/rockchip/rockchip_ion.c | 12 ++++++------ include/linux/rockchip_ion.h | 2 ++ 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 3e0cb606d034..32f0c94afb3a 100755 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -991,11 +991,11 @@ #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>; }; }; diff --git a/arch/arm/configs/rockchip_defconfig b/arch/arm/configs/rockchip_defconfig index 25bbd0cb062f..544e83eaa99a 100755 --- a/arch/arm/configs/rockchip_defconfig +++ b/arch/arm/configs/rockchip_defconfig @@ -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 diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 38d3f494ecbf..162156644146 100755 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -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); diff --git a/drivers/staging/android/ion/rockchip/rockchip_ion.c b/drivers/staging/android/ion/rockchip/rockchip_ion.c index b752a2b79c9f..3da5f73cf7da 100755 --- a/drivers/staging/android/ion/rockchip/rockchip_ion.c +++ b/drivers/staging/android/ion/rockchip/rockchip_ion.c @@ -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; diff --git a/include/linux/rockchip_ion.h b/include/linux/rockchip_ion.h index 34762b044b3d..c0b0ac6535c7 100755 --- a/include/linux/rockchip_ion.h +++ b/include/linux/rockchip_ion.h @@ -22,6 +22,8 @@ #include #endif +#define ROCKCHIP_ION_VERSION "v1.0" + enum ion_heap_ids { INVALID_HEAP_ID = -1, ION_CMA_HEAP_ID = 1, -- 2.34.1