1 /* drivers/gpu/mali400/mali/platform/exynos4415/exynos4.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 4XXX based platforms
18 #ifdef CONFIG_PM_RUNTIME
19 #include <linux/pm_runtime.h>
22 #include <plat/devs.h>
23 #include "mali_kernel_common.h"
24 #include "exynos4_pmm.h"
26 #define MALI_GP_IRQ EXYNOS4_IRQ_GP_3D
27 #define MALI_PP0_IRQ EXYNOS4_IRQ_PP0_3D
28 #define MALI_PP1_IRQ EXYNOS4_IRQ_PP1_3D
29 #define MALI_PP2_IRQ EXYNOS4_IRQ_PP2_3D
30 #define MALI_PP3_IRQ EXYNOS4_IRQ_PP3_3D
31 #define MALI_GP_MMU_IRQ EXYNOS4_IRQ_GPMMU_3D
32 #define MALI_PP0_MMU_IRQ EXYNOS4_IRQ_PPMMU0_3D
33 #define MALI_PP1_MMU_IRQ EXYNOS4_IRQ_PPMMU1_3D
34 #define MALI_PP2_MMU_IRQ EXYNOS4_IRQ_PPMMU2_3D
35 #define MALI_PP3_MMU_IRQ EXYNOS4_IRQ_PPMMU3_3D
37 static struct resource mali_gpu_resources[] =
39 MALI_GPU_RESOURCES_MALI400_MP4(0x13000000,
40 MALI_GP_IRQ, MALI_GP_MMU_IRQ,
41 MALI_PP0_IRQ, MALI_PP0_MMU_IRQ,
42 MALI_PP1_IRQ, MALI_PP1_MMU_IRQ,
43 MALI_PP2_IRQ, MALI_PP2_MMU_IRQ,
44 MALI_PP3_IRQ, MALI_PP3_MMU_IRQ)
47 static struct mali_gpu_device_data mali_gpu_data =
49 .shared_mem_size = 256 * 1024 * 1024, /* 256MB */
50 .fb_start = 0x40000000,
51 .fb_size = 0xb1000000,
52 .utilization_interval = 100, /* 100ms */
53 .utilization_callback = mali_gpu_utilization_handler,
56 int mali_platform_device_register(void)
60 MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));
62 /* Connect resources to the device */
63 err = platform_device_add_resources(&exynos4_device_g3d, mali_gpu_resources, sizeof(mali_gpu_resources) / sizeof(mali_gpu_resources[0]));
66 err = platform_device_add_data(&exynos4_device_g3d, &mali_gpu_data, sizeof(mali_gpu_data));
69 mali_platform_init(&(exynos4_device_g3d.dev));
70 #ifdef CONFIG_PM_RUNTIME
71 pm_runtime_set_autosuspend_delay(&(exynos4_device_g3d.dev), 1000);
72 pm_runtime_use_autosuspend(&(exynos4_device_g3d.dev));
73 pm_runtime_enable(&(exynos4_device_g3d.dev));
82 void mali_platform_device_unregister(void)
84 MALI_DEBUG_PRINT(4, ("mali_platform_device_unregister() called\n"));
85 mali_platform_deinit(&(exynos4_device_g3d.dev));