#include <linux/wakelock.h>\r
#include <linux/cdev.h>\r
#include <linux/of.h>\r
+#include <linux/of_platform.h>\r
#include <linux/rockchip/cpu.h>\r
#include <linux/rockchip/cru.h>\r
\r
#endif\r
\r
#ifdef CONFIG_VCODEC_MMU\r
-#include <linux/rockchip/iovmm.h>\r
-#include <linux/rockchip/sysmmu.h>\r
+#include <linux/rockchip-iovmm.h>\r
#include <linux/dma-buf.h>\r
#endif\r
\r
\r
#if defined(CONFIG_VCODEC_MMU)\r
if (pservice->mmu_dev) {\r
- iovmm_deactivate(pservice->dev);\r
+ rockchip_iovmm_deactivate(pservice->dev);\r
}\r
#endif \r
\r
\r
#if defined(CONFIG_VCODEC_MMU) \r
if (pservice->mmu_dev) {\r
- iovmm_activate(pservice->dev);\r
+ rockchip_iovmm_activate(pservice->dev);\r
}\r
#endif \r
}\r
}\r
#endif\r
\r
+#ifdef CONFIG_VCODEC_MMU\r
+static struct device *rockchip_get_sysmmu_device_by_compatible(const char *compt)\r
+{\r
+ struct device_node *dn = NULL;\r
+ struct platform_device *pd = NULL;\r
+ struct device *ret = NULL ;\r
+\r
+ dn = of_find_compatible_node(NULL,NULL,compt);\r
+ if(!dn)\r
+ {\r
+ printk("can't find device node %s \r\n",compt);\r
+ return NULL;\r
+ }\r
+ \r
+ pd = of_find_device_by_node(dn);\r
+ if(!pd)\r
+ { \r
+ printk("can't find platform device in device node %s \r\n",compt);\r
+ return NULL;\r
+ }\r
+ ret = &pd->dev;\r
+ \r
+ return ret;\r
+\r
+}\r
+#ifdef CONFIG_IOMMU_API\r
+static inline void platform_set_sysmmu(struct device *iommu, struct device *dev)\r
+{\r
+ dev->archdata.iommu = iommu;\r
+}\r
+#else\r
+static inline void platform_set_sysmmu(struct device *iommu, struct device *dev)\r
+{\r
+}\r
+#endif\r
+#endif\r
+\r
#if HEVC_TEST_ENABLE\r
static int hevc_test_case0(vpu_service_info *pservice);\r
#endif\r
\r
if (pservice->mmu_dev) {\r
platform_set_sysmmu(pservice->mmu_dev, pservice->dev);\r
- iovmm_activate(pservice->dev);\r
+ rockchip_iovmm_activate(pservice->dev);\r
}\r
}\r
#endif\r
#include <linux/rk_fb.h>\r
#include <linux/wakelock.h>\r
#include <linux/of.h>\r
+#include <linux/of_platform.h>\r
#include <linux/io.h>\r
#include <linux/module.h>\r
#include <asm/cacheflush.h>\r
\r
#if defined(CONFIG_IEP_IOMMU)\r
if (iep_service.iommu_dev) {\r
- iovmm_activate(iep_service.iommu_dev);\r
+ rockchip_iovmm_activate(iep_service.iommu_dev);\r
}\r
#endif \r
\r
\r
#if defined(CONFIG_IEP_IOMMU)\r
if (iep_service.iommu_dev) {\r
- iovmm_deactivate(iep_service.iommu_dev);\r
+ rockchip_iovmm_deactivate(iep_service.iommu_dev);\r
}\r
#endif \r
\r
.fops = &iep_fops,\r
};\r
\r
+#ifdef CONFIG_IEP_IOMMU\r
+static struct device *rockchip_get_sysmmu_device_by_compatible(const char *compt)\r
+{\r
+ struct device_node *dn = NULL;\r
+ struct platform_device *pd = NULL;\r
+ struct device *ret = NULL ;\r
+\r
+ dn = of_find_compatible_node(NULL,NULL,compt);\r
+ if(!dn)\r
+ {\r
+ printk("can't find device node %s \r\n",compt);\r
+ return NULL;\r
+ }\r
+ \r
+ pd = of_find_device_by_node(dn);\r
+ if(!pd)\r
+ { \r
+ printk("can't find platform device in device node %s \r\n",compt);\r
+ return NULL;\r
+ }\r
+ ret = &pd->dev;\r
+ \r
+ return ret;\r
+\r
+}\r
+#ifdef CONFIG_IOMMU_API\r
+static inline void platform_set_sysmmu(struct device *iommu, struct device *dev)\r
+{\r
+ dev->archdata.iommu = iommu;\r
+}\r
+#else\r
+static inline void platform_set_sysmmu(struct device *iommu, struct device *dev)\r
+{\r
+}\r
+#endif\r
+#endif\r
+\r
#if defined(CONFIG_IEP_IOMMU)\r
extern struct ion_client *rockchip_ion_client_create(const char * name);\r
#endif\r
\r
if (mmu_dev) {\r
platform_set_sysmmu(mmu_dev, &pdev->dev);\r
- iovmm_activate(&pdev->dev);\r
+ rockchip_iovmm_activate(&pdev->dev);\r
}\r
\r
iep_service.iommu_dev = &pdev->dev;\r
\r
#ifdef CONFIG_IEP_IOMMU\r
#include <linux/rockchip_ion.h>\r
-#include <linux/rockchip/iovmm.h>\r
-#include <linux/rockchip/sysmmu.h>\r
+#include <linux/rockchip-iovmm.h>\r
#include <linux/dma-buf.h>\r
#endif\r
#include "iep.h"\r