3 * (C) COPYRIGHT 2011-2015 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
20 #include <linux/ioport.h>
21 #include <mali_kbase.h>
22 #include <mali_kbase_defs.h>
23 #include <mali_kbase_config.h>
24 #include "mali_kbase_cpu_vexpress.h"
25 #include "mali_kbase_config_platform.h"
27 #define HARD_RESET_AT_POWER_OFF 0
30 static struct kbase_io_resources io_resources = {
36 .end = 0xFC010000 + (4096 * 4) - 1
39 #endif /* CONFIG_OF */
41 static int pm_callback_power_on(struct kbase_device *kbdev)
43 /* Nothing is needed on VExpress, but we may have destroyed GPU state (if the below HARD_RESET code is active) */
47 static void pm_callback_power_off(struct kbase_device *kbdev)
49 #if HARD_RESET_AT_POWER_OFF
50 /* Cause a GPU hard reset to test whether we have actually idled the GPU
51 * and that we properly reconfigure the GPU on power up.
52 * Usually this would be dangerous, but if the GPU is working correctly it should
53 * be completely safe as the GPU should not be active at this point.
54 * However this is disabled normally because it will most likely interfere with
57 KBASE_TRACE_ADD(kbdev, CORE_GPU_HARD_RESET, NULL, NULL, 0u, 0);
58 kbase_os_reg_write(kbdev, GPU_CONTROL_REG(GPU_COMMAND), GPU_COMMAND_HARD_RESET);
62 struct kbase_pm_callback_conf pm_callbacks = {
63 .power_on_callback = pm_callback_power_on,
64 .power_off_callback = pm_callback_power_off,
65 .power_suspend_callback = NULL,
66 .power_resume_callback = NULL
69 static struct kbase_platform_config versatile_platform_config = {
71 .io_resources = &io_resources
75 struct kbase_platform_config *kbase_get_platform_config(void)
77 return &versatile_platform_config;
81 int kbase_platform_early_init(void)
83 /* Nothing needed at this stage */