1 /* drivers/gpu/mali400/mali/platform/exynos3250/exynos3.c
3 * Copyright 2011 by S.LSI. Samsung Electronics Inc.
4 * San#24, Nongseo-Dong, Giheung-Gu, Yongin, Korea
6 * Samsung SoC Mali400 DVFS driver
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software FoundatIon.
15 * Platform specific Mali driver functions for the exynos 3XXX based platforms
17 #include <linux/platform_device.h>
18 #include <linux/version.h>
20 #include <linux/pm_runtime.h>
21 #include <linux/mali/mali_utgard.h>
22 #include "mali_kernel_common.h"
24 #include <linux/irq.h>
25 #include <plat/devs.h>
27 #include "exynos3_pmm.h"
29 #define MALI_GP_IRQ EXYNOS3_IRQ_GP_3D
30 #define MALI_PP0_IRQ EXYNOS3_IRQ_PP0_3D
31 #define MALI_PP1_IRQ EXYNOS3_IRQ_PP1_3D
32 #define MALI_GP_MMU_IRQ EXYNOS3_IRQ_GPMMU_3D
33 #define MALI_PP0_MMU_IRQ EXYNOS3_IRQ_PPMMU0_3D
34 #define MALI_PP1_MMU_IRQ EXYNOS3_IRQ_PPMMU1_3D
36 static struct resource mali_gpu_resources[] = {
37 MALI_GPU_RESOURCES_MALI400_MP2(0x13000000,
38 MALI_GP_IRQ, MALI_GP_MMU_IRQ,
39 MALI_PP0_IRQ, MALI_PP0_MMU_IRQ,
40 MALI_PP1_IRQ, MALI_PP1_MMU_IRQ)
43 static struct mali_gpu_device_data mali_gpu_data = {
44 .shared_mem_size = 256 * 1024 * 1024, /* 256MB */
45 .fb_start = 0x40000000,
46 .fb_size = 0xb1000000,
47 .utilization_interval = 100, /* 100ms */
48 .utilization_callback = mali_exynos_update_dvfs,
51 int mali_platform_device_register(void)
55 MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
57 /* Connect resources to the device */
58 err = platform_device_add_resources(&exynos4_device_g3d,
60 sizeof(mali_gpu_resources) /
61 sizeof(mali_gpu_resources[0]));
63 err = platform_device_add_data(&exynos4_device_g3d,
65 sizeof(mali_gpu_data));
67 mali_platform_init(&(exynos4_device_g3d.dev));
69 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
70 pm_runtime_set_autosuspend_delay(&(exynos4_device_g3d.dev), 50);
71 pm_runtime_use_autosuspend(&(exynos4_device_g3d.dev));
73 pm_runtime_enable(&(exynos4_device_g3d.dev));
81 void mali_platform_device_unregister(void)
83 MALI_DEBUG_PRINT(4, ("mali_platform_device_unregister() called\n"));
85 mali_platform_deinit(&(exynos4_device_g3d.dev));