blob: 349dbe75e8de746d2d23f36fd58ca812c21da0a2 [file] [log] [blame]
Lucille Sylvester395e6ce2013-01-18 17:09:02 -07001/* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
Jordan Crouse914de9b2012-07-09 13:49:46 -06002 *
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
Vladimir Razgulinbae66be2013-04-16 12:40:16 -060023#define KGSL_CLK_ALT_MEM_IFACE 0x00000040
Jordan Crouse914de9b2012-07-09 13:49:46 -060024
Lucille Sylvester395e6ce2013-01-18 17:09:02 -070025#define KGSL_MAX_PWRLEVELS 10
Jordan Crouse914de9b2012-07-09 13:49:46 -060026
27#define KGSL_CONVERT_TO_MBPS(val) \
28 (val*1000*1000U)
29
30#define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory"
Harsh Vardhan Dwivedi623b9a22012-10-28 20:54:17 -060031#define KGSL_3D0_SHADER_MEMORY "kgsl_3d0_shader_memory"
Jordan Crouse914de9b2012-07-09 13:49:46 -060032#define KGSL_3D0_IRQ "kgsl_3d0_irq"
33#define KGSL_2D0_REG_MEMORY "kgsl_2d0_reg_memory"
34#define KGSL_2D0_IRQ "kgsl_2d0_irq"
35#define KGSL_2D1_REG_MEMORY "kgsl_2d1_reg_memory"
36#define KGSL_2D1_IRQ "kgsl_2d1_irq"
37
Jordan Crouse4815e9f2012-07-09 15:36:37 -060038#define ADRENO_CHIPID(_co, _ma, _mi, _pa) \
39 ((((_co) & 0xFF) << 24) | \
40 (((_ma) & 0xFF) << 16) | \
41 (((_mi) & 0xFF) << 8) | \
42 ((_pa) & 0xFF))
43
Jordan Crouse914de9b2012-07-09 13:49:46 -060044enum kgsl_iommu_context_id {
45 KGSL_IOMMU_CONTEXT_USER = 0,
46 KGSL_IOMMU_CONTEXT_PRIV = 1,
47};
48
49struct kgsl_iommu_ctx {
50 const char *iommu_ctx_name;
51 enum kgsl_iommu_context_id ctx_id;
52};
53
Shubhraprakash Dasd20ca272013-01-15 15:53:32 -080054/*
55 * struct kgsl_device_iommu_data - Struct holding iommu context data obtained
56 * from dtsi file
57 * @iommu_ctxs: Pointer to array of struct hoding context name and id
58 * @iommu_ctx_count: Number of contexts defined in the dtsi file
59 * @iommu_halt_enable: Indicated if smmu halt h/w feature is supported
60 * @physstart: Start of iommu registers physical address
61 * @physend: End of iommu registers physical address
62 */
Jordan Crouse914de9b2012-07-09 13:49:46 -060063struct kgsl_device_iommu_data {
64 const struct kgsl_iommu_ctx *iommu_ctxs;
65 int iommu_ctx_count;
Shubhraprakash Dasd20ca272013-01-15 15:53:32 -080066 int iommu_halt_enable;
Jordan Crouse914de9b2012-07-09 13:49:46 -060067 unsigned int physstart;
68 unsigned int physend;
69};
70
71struct kgsl_pwrlevel {
72 unsigned int gpu_freq;
73 unsigned int bus_freq;
74 unsigned int io_fraction;
75};
76
77struct kgsl_device_platform_data {
78 struct kgsl_pwrlevel pwrlevel[KGSL_MAX_PWRLEVELS];
79 int init_level;
80 int num_levels;
81 int (*set_grp_async)(void);
82 unsigned int idle_timeout;
83 bool strtstp_sleepwake;
84 unsigned int nap_allowed;
85 unsigned int clk_map;
86 unsigned int idle_needed;
Lucille Sylvester395e6ce2013-01-18 17:09:02 -070087 unsigned int step_mul;
Jordan Crouse914de9b2012-07-09 13:49:46 -060088 struct msm_bus_scale_pdata *bus_scale_table;
89 struct kgsl_device_iommu_data *iommu_data;
90 int iommu_count;
91 struct msm_dcvs_core_info *core_info;
Jordan Crouse4815e9f2012-07-09 15:36:37 -060092 unsigned int chipid;
Jordan Crouse914de9b2012-07-09 13:49:46 -060093};
94
95#endif