Lucille Sylvester | 395e6ce | 2013-01-18 17:09:02 -0700 | [diff] [blame] | 1 | /* Copyright (c) 2012-2013, The Linux Foundation. All rights reserved. |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 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 |
Vladimir Razgulin | bae66be | 2013-04-16 12:40:16 -0600 | [diff] [blame] | 23 | #define KGSL_CLK_ALT_MEM_IFACE 0x00000040 |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 24 | |
Lucille Sylvester | 395e6ce | 2013-01-18 17:09:02 -0700 | [diff] [blame] | 25 | #define KGSL_MAX_PWRLEVELS 10 |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 26 | |
| 27 | #define KGSL_CONVERT_TO_MBPS(val) \ |
| 28 | (val*1000*1000U) |
| 29 | |
| 30 | #define KGSL_3D0_REG_MEMORY "kgsl_3d0_reg_memory" |
Harsh Vardhan Dwivedi | 623b9a2 | 2012-10-28 20:54:17 -0600 | [diff] [blame] | 31 | #define KGSL_3D0_SHADER_MEMORY "kgsl_3d0_shader_memory" |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 32 | #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 Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 38 | #define ADRENO_CHIPID(_co, _ma, _mi, _pa) \ |
| 39 | ((((_co) & 0xFF) << 24) | \ |
| 40 | (((_ma) & 0xFF) << 16) | \ |
| 41 | (((_mi) & 0xFF) << 8) | \ |
| 42 | ((_pa) & 0xFF)) |
| 43 | |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 44 | enum kgsl_iommu_context_id { |
| 45 | KGSL_IOMMU_CONTEXT_USER = 0, |
| 46 | KGSL_IOMMU_CONTEXT_PRIV = 1, |
| 47 | }; |
| 48 | |
| 49 | struct kgsl_iommu_ctx { |
| 50 | const char *iommu_ctx_name; |
| 51 | enum kgsl_iommu_context_id ctx_id; |
| 52 | }; |
| 53 | |
Shubhraprakash Das | d20ca27 | 2013-01-15 15:53:32 -0800 | [diff] [blame] | 54 | /* |
| 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 Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 63 | struct kgsl_device_iommu_data { |
| 64 | const struct kgsl_iommu_ctx *iommu_ctxs; |
| 65 | int iommu_ctx_count; |
Shubhraprakash Das | d20ca27 | 2013-01-15 15:53:32 -0800 | [diff] [blame] | 66 | int iommu_halt_enable; |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 67 | unsigned int physstart; |
| 68 | unsigned int physend; |
| 69 | }; |
| 70 | |
| 71 | struct kgsl_pwrlevel { |
| 72 | unsigned int gpu_freq; |
| 73 | unsigned int bus_freq; |
| 74 | unsigned int io_fraction; |
| 75 | }; |
| 76 | |
| 77 | struct 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 Sylvester | 395e6ce | 2013-01-18 17:09:02 -0700 | [diff] [blame] | 87 | unsigned int step_mul; |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 88 | 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 Crouse | 4815e9f | 2012-07-09 15:36:37 -0600 | [diff] [blame] | 92 | unsigned int chipid; |
Jordan Crouse | 914de9b | 2012-07-09 13:49:46 -0600 | [diff] [blame] | 93 | }; |
| 94 | |
| 95 | #endif |