#endif
#include <linux/compat.h>
-#include <linux/rockchip/psci.h>
struct ion_device *rockchip_ion_dev;
EXPORT_SYMBOL(rockchip_ion_dev);
extern int ion_handle_put(struct ion_handle *handle);
#define ION_CMA_HEAP_NAME "cma"
-#define ION_IOMMU_HEAP_NAME "iommu"
#define ION_VMALLOC_HEAP_NAME "vmalloc"
-#define ION_DRM_HEAP_NAME "drm"
#define ION_CARVEOUT_HEAP_NAME "carveout"
#define MAX_ION_HEAP 10
.type = ION_HEAP_TYPE_DMA,
.name = ION_CMA_HEAP_NAME,
},
- {
- .id = ION_DRM_HEAP_ID,
- .type = ION_HEAP_TYPE_DRM,
- .name = ION_DRM_HEAP_NAME,
- },
{
.id = ION_CARVEOUT_HEAP_ID,
.type = ION_HEAP_TYPE_CARVEOUT,
}
EXPORT_SYMBOL(rockchip_ion_client_create);
-static int rockchip_ion_set_secured(struct ion_client *client,
- unsigned long arg)
-{
- bool val = 0;
- int ret = 0;
-
- if (copy_from_user(&val, (void __user *)arg, sizeof(bool)))
- return -EFAULT;
-
- ret = psci_set_memory_secure(val);
- if (ret)
- pr_err("%s fail to set memory secured (%d)\n", __func__, ret);
-
- return ret;
-}
-
#ifdef CONFIG_COMPAT
struct compat_ion_phys_data {
compat_int_t handle;
switch (cmd) {
case ION_IOC_GET_PHYS:
return rockchip_ion_get_phys(client, arg);
- case ION_IOC_SET_SECURED:
- return rockchip_ion_set_secured(client, arg);
default:
return -ENOTTY;
}
ION_VMALLOC_HEAP_ID = 0,
ION_CARVEOUT_HEAP_ID = 2,
ION_CMA_HEAP_ID = 4,
- ION_DRM_HEAP_ID = 5,
};
#define ION_HEAP(bit) (1 << (bit))
*/
#define ION_IOC_GET_PHYS _IOWR(ION_IOC_ROCKCHIP_MAGIC, 0, \
struct ion_phys_data)
-/**
- * Set memory region secured.
- */
-#define ION_IOC_SET_SECURED _IOWR(ION_IOC_ROCKCHIP_MAGIC, 1, bool)
#endif