blob: a51cc469e28bfc5697a1f2c906cae6f405a8a5ef [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
Jordan Crouse4815e9f2012-07-09 15:36:37 -060036#define ADRENO_CHIPID(_co, _ma, _mi, _pa) \
37 ((((_co) & 0xFF) << 24) | \
38 (((_ma) & 0xFF) << 16) | \
39 (((_mi) & 0xFF) << 8) | \
40 ((_pa) & 0xFF))
41
Jordan Crouse914de9b2012-07-09 13:49:46 -060042enum kgsl_iommu_context_id {
43 KGSL_IOMMU_CONTEXT_USER = 0,
44 KGSL_IOMMU_CONTEXT_PRIV = 1,
45};
46
47struct kgsl_iommu_ctx {
48 const char *iommu_ctx_name;
49 enum kgsl_iommu_context_id ctx_id;
50};
51
52struct kgsl_device_iommu_data {
53 const struct kgsl_iommu_ctx *iommu_ctxs;
54 int iommu_ctx_count;
55 unsigned int physstart;
56 unsigned int physend;
57};
58
59struct kgsl_pwrlevel {
60 unsigned int gpu_freq;
61 unsigned int bus_freq;
62 unsigned int io_fraction;
63};
64
65struct kgsl_device_platform_data {
66 struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
67 int init_level;
68 int num_levels;
69 int (*set_grp_async)(void);
70 unsigned int idle_timeout;
71 bool strtstp_sleepwake;
72 unsigned int nap_allowed;
73 unsigned int clk_map;
74 unsigned int idle_needed;
75 struct msm_bus_scale_pdata *bus_scale_table;
76 struct kgsl_device_iommu_data *iommu_data;
77 int iommu_count;
78 struct msm_dcvs_core_info *core_info;
Jordan Crouse4815e9f2012-07-09 15:36:37 -060079 unsigned int chipid;
Jordan Crouse914de9b2012-07-09 13:49:46 -060080};
81
82#endif