rk: ion: add version control

disable ion snapshot by default
		 fix build warn
This commit is contained in:
CMY
2014-04-28 17:52:30 +08:00
parent e17655ff42
commit f52cfbfccb
5 changed files with 14 additions and 14 deletions

View File

@@ -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>;
};
};

View File

@@ -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

View File

@@ -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);

View File

@@ -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;

View File

@@ -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,