blob: e8fc1d0ca1543647f4aaf22858afe01a5fd6c462 [file] [log] [blame]
Jordan Crouse914de9b2012-07-09 13:49:46 -06001/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef _ARCH_ARM_MACH_KGSL_H
14#define _ARCH_ARM_MACH_KGSL_H
15
16/* Clock flags to show which clocks should be controled by a given platform */
17#define KGSL_CLK_SRC 0x00000001
18#define KGSL_CLK_CORE 0x00000002
19#define KGSL_CLK_IFACE 0x00000004
20#define KGSL_CLK_MEM 0x00000008
21#define KGSL_CLK_MEM_IFACE 0x00000010
22#define KGSL_CLK_AXI 0x00000020
23
24#define KGSL_MAX_PWRLEVELS 5
25
26#define KGSL_CONVERT_TO_MBPS(val) \
27 (val*1000*1000U)
28
29#define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory"
30#define KGSL_3D0_IRQ "kgsl_3d0_irq"
31#define KGSL_2D0_REG_MEMORY "kgsl_2d0_reg_memory"
32#define KGSL_2D0_IRQ "kgsl_2d0_irq"
33#define KGSL_2D1_REG_MEMORY "kgsl_2d1_reg_memory"
34#define KGSL_2D1_IRQ "kgsl_2d1_irq"
35
36enum kgsl_iommu_context_id {
37 KGSL_IOMMU_CONTEXT_USER = 0,
38 KGSL_IOMMU_CONTEXT_PRIV = 1,
39};
40
41struct kgsl_iommu_ctx {
42 const char *iommu_ctx_name;
43 enum kgsl_iommu_context_id ctx_id;
44};
45
46struct kgsl_device_iommu_data {
47 const struct kgsl_iommu_ctx *iommu_ctxs;
48 int iommu_ctx_count;
49 unsigned int physstart;
50 unsigned int physend;
51};
52
53struct kgsl_pwrlevel {
54 unsigned int gpu_freq;
55 unsigned int bus_freq;
56 unsigned int io_fraction;
57};
58
59struct kgsl_device_platform_data {
60 struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
61 int init_level;
62 int num_levels;
63 int (*set_grp_async)(void);
64 unsigned int idle_timeout;
65 bool strtstp_sleepwake;
66 unsigned int nap_allowed;
67 unsigned int clk_map;
68 unsigned int idle_needed;
69 struct msm_bus_scale_pdata *bus_scale_table;
70 struct kgsl_device_iommu_data *iommu_data;
71 int iommu_count;
72 struct msm_dcvs_core_info *core_info;
73};
74
75#endif