1 /*************************************************************************/ /*!
3 @Title System Description Header
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description This header provides system-specific declarations and macros
6 @License Dual MIT/GPLv2
8 The contents of this file are subject to the MIT license as set out below.
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
32 This License is also included in this distribution in the file called
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
44 #if !defined(__APOLLO_REGS_H__)
45 #define __APOLLO_REGS_H__
48 * The core clock speed is passed through a multiplier depending on the TC version.
50 * On TC_ES1: Multiplier = x3, final speed = 270MHz
51 * On TC_ES2: Multiplier = x6, final speed = 540MHz
52 * On TCF5: Multiplier = 1x final speed = 45MHz
55 * The base (unmultiplied speed) can be adjusted using a module parameter called "sys_core_clk_speed",
60 * PVR_SRVKM_PARAMS="sys_core_clk_speed=60000000" /etc/init.d/rc.pvr start
62 * would result in a core speed of 60MHz xMultiplier.
65 * The memory clock is unmultiplied and can be adjusted using a module parameter called
66 * "sys_mem_clk_speed", this should be the number in Hz for the memory clock speed.
70 * PVR_SRVKM_PARAMS="sys_mem_clk_speed=100000000" /etc/init.d/rc.pvr start
72 * would attempt to start the driver with the memory clock speed set to 100MHz.
75 * Same applies to the system interface clock speed sys_sysif_clk_speed.
76 * Needed for TCF5 but not for TC_ES2/ES1.
79 * PVR_SRVKM_PARAMS="sys_mem_clk_speed=45000000" /etc/init.d/rc.pvr start
81 * would attempt to start the driver with the system clock speed set to 45MHz.
84 * All parameters can be specified at once, eg:
85 * PVR_SRVKM_PARAMS="sys_mem_clk_speed=MEMORY_SPEED sys_core_clk_speed=CORE_SPEED sys_mem_clk_speed=SYSIF_SPEED" /etc/init.d/rc.pvr start
88 #define RGX_TC_SYS_CLOCK_SPEED (50000000) /*< At the moment just used for TCF5 */
90 #if defined(TC_APOLLO_TCF5_12_4_1_48)
92 #undef RGX_TC_SYS_CLOCK_SPEED
93 #define RGX_TC_CORE_CLOCK_SPEED (60000000)
94 #define RGX_TC_MEM_CLOCK_SPEED (45000000)
95 #define RGX_TC_SYS_CLOCK_SPEED (45000000)
96 #elif defined(TC_APOLLO_TCF5_14_8_1_20) || defined(TC_APOLLO_TCF5_22_18_22_22) || \
97 defined(TC_APOLLO_TCF5_22_34_22_23) || defined(TC_APOLLO_TCF5_22_44_22_25) || \
98 defined(TC_APOLLO_TCF5_22_45_22_29) || defined(TC_APOLLO_TCF5_22_49_21_16) || \
99 defined(TC_APOLLO_TCF5_22_50_22_29)
100 /* TC TCF5 (14.* / 22.*) */
101 #define RGX_TC_CORE_CLOCK_SPEED (20000000)
102 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
103 #elif defined(TC_APOLLO_TCF5_22_19_54_24) || defined(TC_APOLLO_TCF5_22_30_54_25) || \
104 defined(TC_APOLLO_TCF5_22_36_54_28) || defined(TC_APOLLO_TCF5_22_40_54_30) || \
105 defined(TC_APOLLO_TCF5_22_48_54_30)
107 #define RGX_TC_CORE_CLOCK_SPEED (100000000)
108 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
109 #elif defined(TC_APOLLO_TCF5_22_26_54_24)
111 #define RGX_TC_CORE_CLOCK_SPEED (13000000)
112 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
113 #elif defined(TC_APOLLO_TCF5_22_32_54_328) || defined(TC_APOLLO_TCF5_22_46_54_330)
115 #define RGX_TC_CORE_CLOCK_SPEED (50000000)
116 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
117 #elif defined(TC_APOLLO_TCF5_22_33_21_11)
119 #undef RGX_TC_SYS_CLOCK_SPEED
120 #define RGX_TC_CORE_CLOCK_SPEED (20000000)
121 #define RGX_TC_MEM_CLOCK_SPEED (45000000)
122 #define RGX_TC_SYS_CLOCK_SPEED (45000000)
123 #elif defined(TC_APOLLO_TCF5_22_41_54_330)
125 #define RGX_TC_CORE_CLOCK_SPEED (80000000)
126 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
127 #elif defined(TC_APOLLO_TCF5_BVNC_NOT_SUPPORTED)
128 /* TC TCF5 (22.*) fallback frequencies */
129 #undef RGX_TC_SYS_CLOCK_SPEED
130 #define RGX_TC_CORE_CLOCK_SPEED (20000000)
131 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
132 #define RGX_TC_SYS_CLOCK_SPEED (50000000)
133 #elif defined(TC_APOLLO_TCF5_REFERENCE)
134 /* TC TCF5 (Reference bitfile) */
135 #undef RGX_TC_SYS_CLOCK_SPEED
136 #define RGX_TC_CORE_CLOCK_SPEED (50000000)
137 #define RGX_TC_MEM_CLOCK_SPEED (50000000)
138 #define RGX_TC_SYS_CLOCK_SPEED (45000000)
139 #elif defined(TC_APOLLO_BONNIE)
141 #define RGX_TC_CORE_CLOCK_SPEED (18000000)
142 #define RGX_TC_MEM_CLOCK_SPEED (65000000)
143 #elif defined(TC_APOLLO_ES2)
145 #define RGX_TC_CORE_CLOCK_SPEED (90000000)
146 #define RGX_TC_MEM_CLOCK_SPEED (104000000)
149 #define RGX_TC_CORE_CLOCK_SPEED (90000000)
150 #define RGX_TC_MEM_CLOCK_SPEED (65000000)
154 #define TC5_SYS_APOLLO_REG_PCI_BASENUM (1)
155 #define TC5_SYS_APOLLO_REG_PDP2_OFFSET (0x800000)
156 #define TC5_SYS_APOLLO_REG_PDP2_SIZE (0x7C4)
158 #define TC5_SYS_APOLLO_REG_PDP2_FBDC_OFFSET (0xA00000)
159 #define TC5_SYS_APOLLO_REG_PDP2_FBDC_SIZE (0x14)
161 #define TC5_SYS_APOLLO_REG_HDMI_OFFSET (0xC00000)
162 #define TC5_SYS_APOLLO_REG_HDMI_SIZE (0x1C)
165 #define TCF_TEMP_SENSOR_SPI_OFFSET 0xe
166 #define TCF_TEMP_SENSOR_TO_C(raw) (((raw) * 248 / 4096) - 54)
168 /* Number of bytes that are broken */
169 #define SYS_DEV_MEM_BROKEN_BYTES (1024 * 1024)
170 #define SYS_DEV_MEM_REGION_SIZE (0x40000000 - SYS_DEV_MEM_BROKEN_BYTES)
172 /* Apollo reg on base register 0 */
173 #define SYS_APOLLO_REG_PCI_BASENUM (0)
174 #define SYS_APOLLO_REG_REGION_SIZE (0x00010000)
176 #define SYS_APOLLO_REG_SYS_OFFSET (0x0000)
177 #define SYS_APOLLO_REG_SYS_SIZE (0x0400)
179 #define SYS_APOLLO_REG_PLL_OFFSET (0x1000)
180 #define SYS_APOLLO_REG_PLL_SIZE (0x0400)
182 #define SYS_APOLLO_REG_HOST_OFFSET (0x4050)
183 #define SYS_APOLLO_REG_HOST_SIZE (0x0014)
185 #define SYS_APOLLO_REG_PDP1_OFFSET (0xC000)
186 #define SYS_APOLLO_REG_PDP1_SIZE (0x2000)
188 /* Offsets for flashing Apollo PROMs from base 0 */
189 #define APOLLO_FLASH_STAT_OFFSET (0x4058)
190 #define APOLLO_FLASH_DATA_WRITE_OFFSET (0x4050)
191 #define APOLLO_FLASH_RESET_OFFSET (0x4060)
193 #define APOLLO_FLASH_FIFO_STATUS_MASK (0xF)
194 #define APOLLO_FLASH_FIFO_STATUS_SHIFT (0)
195 #define APOLLO_FLASH_PROGRAM_STATUS_MASK (0xF)
196 #define APOLLO_FLASH_PROGRAM_STATUS_SHIFT (16)
198 #define APOLLO_FLASH_PROG_COMPLETE_BIT (0x1)
199 #define APOLLO_FLASH_PROG_PROGRESS_BIT (0x2)
200 #define APOLLO_FLASH_PROG_FAILED_BIT (0x4)
201 #define APOLLO_FLASH_INV_FILETYPE_BIT (0x8)
203 #define APOLLO_FLASH_FIFO_SIZE (8)
205 /* RGX reg on base register 1 */
206 #define SYS_RGX_REG_PCI_BASENUM (1)
207 #define SYS_RGX_REG_REGION_SIZE (0x7FFFF)
209 /* Device memory (including HP mapping) on base register 2 */
210 #define SYS_DEV_MEM_PCI_BASENUM (2)
212 #endif /* if !defined(__APOLLO_REGS_H__) */