xref: /haiku/headers/private/graphics/radeon_hd/r600_reg.h (revision 25a7b01d15612846f332751841da3579db313082)
12613175eSAlexander von Gluck IV /*
25cf44ddaSAlexander von Gluck IV  * Copyright 2008 Advanced Micro Devices, Inc.
35cf44ddaSAlexander von Gluck IV  * Copyright 2008 Red Hat Inc.
45cf44ddaSAlexander von Gluck IV  * Copyright 2009 Jerome Glisse.
52613175eSAlexander von Gluck IV  *
62613175eSAlexander von Gluck IV  * Permission is hereby granted, free of charge, to any person obtaining a
72613175eSAlexander von Gluck IV  * copy of this software and associated documentation files (the "Software"),
82613175eSAlexander von Gluck IV  * to deal in the Software without restriction, including without limitation
92613175eSAlexander von Gluck IV  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
102613175eSAlexander von Gluck IV  * and/or sell copies of the Software, and to permit persons to whom the
112613175eSAlexander von Gluck IV  * Software is furnished to do so, subject to the following conditions:
122613175eSAlexander von Gluck IV  *
135cf44ddaSAlexander von Gluck IV  * The above copyright notice and this permission notice shall be included in
145cf44ddaSAlexander von Gluck IV  * all copies or substantial portions of the Software.
152613175eSAlexander von Gluck IV  *
165cf44ddaSAlexander von Gluck IV  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
175cf44ddaSAlexander von Gluck IV  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
182613175eSAlexander von Gluck IV  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
195cf44ddaSAlexander von Gluck IV  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
205cf44ddaSAlexander von Gluck IV  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
215cf44ddaSAlexander von Gluck IV  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
225cf44ddaSAlexander von Gluck IV  * OTHER DEALINGS IN THE SOFTWARE.
235cf44ddaSAlexander von Gluck IV  *
245cf44ddaSAlexander von Gluck IV  * Authors: Dave Airlie
255cf44ddaSAlexander von Gluck IV  *          Alex Deucher
265cf44ddaSAlexander von Gluck IV  *          Jerome Glisse
27*f8af3174SAlexander von Gluck IV  *          Alexander von Gluck <kallisti5@unixzen.com>
282613175eSAlexander von Gluck IV  */
295cf44ddaSAlexander von Gluck IV #ifndef __R600_REG_H__
305cf44ddaSAlexander von Gluck IV #define __R600_REG_H__
312613175eSAlexander von Gluck IV 
322613175eSAlexander von Gluck IV 
338ef0a0d2SAlexander von Gluck IV /* Scratch Registers */
3493aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG0					0x1724 // aka R600_BIOS_0_SCRATCH
3593aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG1					0x1728 // aka R600_BIOS_1_SCRATCH
3693aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG2					0x172c // aka R600_BIOS_2_SCRATCH
3793aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG3					0x1730 // aka R600_BIOS_3_SCRATCH
3893aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG4					0x1734 // aka R600_BIOS_4_SCRATCH
3993aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG5					0x1738 // aka R600_BIOS_5_SCRATCH
4093aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG6					0x173c // aka R600_BIOS_6_SCRATCH
4193aac98dSAlexander von Gluck IV #define R600_SCRATCH_REG7					0x1740 // aka R600_BIOS_7_SCRATCH
428ef0a0d2SAlexander von Gluck IV 
4393aac98dSAlexander von Gluck IV /* CRT controler register offset */
44025d4eedSAlexander von Gluck IV #define R600_CRTC0_REGISTER_OFFSET				0x0
45025d4eedSAlexander von Gluck IV #define R600_CRTC1_REGISTER_OFFSET				0x800
46025d4eedSAlexander von Gluck IV 
475cf44ddaSAlexander von Gluck IV #define R600_PCIE_PORT_INDEX					0x0038
485cf44ddaSAlexander von Gluck IV #define R600_PCIE_PORT_DATA						0x003c
491d5cfc64SAlexander von Gluck IV 
50*f8af3174SAlexander von Gluck IV /* Memory Controler */
515cf44ddaSAlexander von Gluck IV #define R600_MC_VM_FB_LOCATION					0x2180
525cf44ddaSAlexander von Gluck IV #define 	R600_MC_FB_BASE_MASK				0x0000FFFF
535cf44ddaSAlexander von Gluck IV #define 	R600_MC_FB_BASE_SHIFT				0
545cf44ddaSAlexander von Gluck IV #define 	R600_MC_FB_TOP_MASK					0xFFFF0000
555cf44ddaSAlexander von Gluck IV #define 	R600_MC_FB_TOP_SHIFT				16
565cf44ddaSAlexander von Gluck IV #define R600_MC_VM_AGP_TOP						0x2184
575cf44ddaSAlexander von Gluck IV #define 	R600_MC_AGP_TOP_MASK				0x0003FFFF
585cf44ddaSAlexander von Gluck IV #define 	R600_MC_AGP_TOP_SHIFT				0
595cf44ddaSAlexander von Gluck IV #define R600_MC_VM_AGP_BOT						0x2188
605cf44ddaSAlexander von Gluck IV #define 	R600_MC_AGP_BOT_MASK				0x0003FFFF
615cf44ddaSAlexander von Gluck IV #define 	R600_MC_AGP_BOT_SHIFT				0
625cf44ddaSAlexander von Gluck IV #define R600_MC_VM_AGP_BASE						0x218c
635cf44ddaSAlexander von Gluck IV #define R600_MC_VM_SYSTEM_APERTURE_LOW_ADDR		0x2190
645cf44ddaSAlexander von Gluck IV #define 	R600_LOGICAL_PAGE_NUMBER_MASK		0x000FFFFF
655cf44ddaSAlexander von Gluck IV #define 	R600_LOGICAL_PAGE_NUMBER_SHIFT		0
665cf44ddaSAlexander von Gluck IV #define R600_MC_VM_SYSTEM_APERTURE_HIGH_ADDR	0x2194
675cf44ddaSAlexander von Gluck IV #define R600_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR	0x2198
681d5cfc64SAlexander von Gluck IV 
695cf44ddaSAlexander von Gluck IV #define R600_RAMCFG								0x2408
705cf44ddaSAlexander von Gluck IV #define 	R600_CHANSIZE						(1 << 7)
715cf44ddaSAlexander von Gluck IV #define 	R600_CHANSIZE_OVERRIDE				(1 << 10)
725cf44ddaSAlexander von Gluck IV 
735cf44ddaSAlexander von Gluck IV #define R600_GENERAL_PWRMGT						0x618
745cf44ddaSAlexander von Gluck IV #define 	R600_OPEN_DRAIN_PADS				(1 << 11)
755cf44ddaSAlexander von Gluck IV 
765cf44ddaSAlexander von Gluck IV #define R600_LOWER_GPIO_ENABLE					0x710
775cf44ddaSAlexander von Gluck IV #define R600_CTXSW_VID_LOWER_GPIO_CNTL			0x718
785cf44ddaSAlexander von Gluck IV #define R600_HIGH_VID_LOWER_GPIO_CNTL			0x71c
795cf44ddaSAlexander von Gluck IV #define R600_MEDIUM_VID_LOWER_GPIO_CNTL			0x720
805cf44ddaSAlexander von Gluck IV #define R600_LOW_VID_LOWER_GPIO_CNTL			0x724
815cf44ddaSAlexander von Gluck IV 
825cf44ddaSAlexander von Gluck IV #define R600_D1GRPH_SWAP_CONTROL				0x610C
835cf44ddaSAlexander von Gluck IV #define 	R600_D1GRPH_SWAP_ENDIAN_NONE		(0 << 0)
845cf44ddaSAlexander von Gluck IV #define 	R600_D1GRPH_SWAP_ENDIAN_16BIT		(1 << 0)
855cf44ddaSAlexander von Gluck IV #define 	R600_D1GRPH_SWAP_ENDIAN_32BIT		(2 << 0)
865cf44ddaSAlexander von Gluck IV #define 	R600_D1GRPH_SWAP_ENDIAN_64BIT		(3 << 0)
875cf44ddaSAlexander von Gluck IV 
88*f8af3174SAlexander von Gluck IV /* Hot plug detection */
898ef0a0d2SAlexander von Gluck IV #define R600_HDP_HOST_PATH_CNTL					0x2C00
908ef0a0d2SAlexander von Gluck IV #define R600_HDP_NONSURFACE_BASE				0x2C04
918ef0a0d2SAlexander von Gluck IV #define R600_HDP_NONSURFACE_INFO				0x2C08
928ef0a0d2SAlexander von Gluck IV #define R600_HDP_NONSURFACE_SIZE				0x2C0C
938ef0a0d2SAlexander von Gluck IV #define R600_HDP_REG_COHERENCY_FLUSH_CNTL		0x54A0
948ef0a0d2SAlexander von Gluck IV #define R600_HDP_TILING_CONFIG					0x2F3C
958ef0a0d2SAlexander von Gluck IV #define R600_HDP_DEBUG1							0x2F34
965cf44ddaSAlexander von Gluck IV 
975cf44ddaSAlexander von Gluck IV #define R600_BUS_CNTL							0x5420
985cf44ddaSAlexander von Gluck IV #define 	R600_BIOS_ROM_DIS					(1 << 1)
995cf44ddaSAlexander von Gluck IV #define R600_CONFIG_CNTL						0x5424
1005cf44ddaSAlexander von Gluck IV #define R600_CONFIG_MEMSIZE						0x5428
1015cf44ddaSAlexander von Gluck IV #define R600_CONFIG_F0_BASE						0x542C
1025cf44ddaSAlexander von Gluck IV #define R600_CONFIG_APER_SIZE					0x5430
1035cf44ddaSAlexander von Gluck IV 
1045cf44ddaSAlexander von Gluck IV #define R600_ROM_CNTL							0x1600
1055cf44ddaSAlexander von Gluck IV #define 	R600_SCK_OVERWRITE					(1 << 1)
1065cf44ddaSAlexander von Gluck IV #define 	R600_SCK_PRESCALE_CRYSTAL_CLK_SHIFT	28
1075cf44ddaSAlexander von Gluck IV #define 	R600_SCK_PRESCALE_CRYSTAL_CLK_MASK	(0xf << 28)
1081d5cfc64SAlexander von Gluck IV 
1091d5cfc64SAlexander von Gluck IV #define R600_CG_SPLL_FUNC_CNTL					0x600
1101d5cfc64SAlexander von Gluck IV #define 	R600_SPLL_BYPASS_EN					(1 << 3)
1115cf44ddaSAlexander von Gluck IV #define R600_CG_SPLL_STATUS						0x60c
1125cf44ddaSAlexander von Gluck IV #define 	R600_SPLL_CHG_STATUS				(1 << 1)
11352aeea24SAlexander von Gluck IV 
1141d5cfc64SAlexander von Gluck IV 
1155cf44ddaSAlexander von Gluck IV /* Audio, these regs were reverse enginered,
1165cf44ddaSAlexander von Gluck IV  * so the chance is high that the naming is wrong
1175cf44ddaSAlexander von Gluck IV  * R6xx+ ??? */
1182613175eSAlexander von Gluck IV 
1195cf44ddaSAlexander von Gluck IV /* Audio clocks */
1205cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PLL1_MUL						0x0514
1215cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PLL1_DIV						0x0518
1225cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PLL2_MUL						0x0524
1235cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PLL2_DIV						0x0528
1245cf44ddaSAlexander von Gluck IV #define R600_AUDIO_CLK_SRCSEL					0x0534
1252613175eSAlexander von Gluck IV 
1265cf44ddaSAlexander von Gluck IV /* Audio general */
1275cf44ddaSAlexander von Gluck IV #define R600_AUDIO_ENABLE						0x7300
1285cf44ddaSAlexander von Gluck IV #define R600_AUDIO_TIMING						0x7344
1292613175eSAlexander von Gluck IV 
1305cf44ddaSAlexander von Gluck IV /* Audio params */
1315cf44ddaSAlexander von Gluck IV #define R600_AUDIO_VENDOR_ID					0x7380
1325cf44ddaSAlexander von Gluck IV #define R600_AUDIO_REVISION_ID					0x7384
1335cf44ddaSAlexander von Gluck IV #define R600_AUDIO_ROOT_NODE_COUNT				0x7388
1345cf44ddaSAlexander von Gluck IV #define R600_AUDIO_NID1_NODE_COUNT				0x738c
1355cf44ddaSAlexander von Gluck IV #define R600_AUDIO_NID1_TYPE					0x7390
1365cf44ddaSAlexander von Gluck IV #define R600_AUDIO_SUPPORTED_SIZE_RATE			0x7394
1375cf44ddaSAlexander von Gluck IV #define R600_AUDIO_SUPPORTED_CODEC				0x7398
1385cf44ddaSAlexander von Gluck IV #define R600_AUDIO_SUPPORTED_POWER_STATES		0x739c
1395cf44ddaSAlexander von Gluck IV #define R600_AUDIO_NID2_CAPS					0x73a0
1405cf44ddaSAlexander von Gluck IV #define R600_AUDIO_NID3_CAPS					0x73a4
1415cf44ddaSAlexander von Gluck IV #define R600_AUDIO_NID3_PIN_CAPS				0x73a8
1422613175eSAlexander von Gluck IV 
1435cf44ddaSAlexander von Gluck IV /* Audio conn list */
1445cf44ddaSAlexander von Gluck IV #define R600_AUDIO_CONN_LIST_LEN				0x73ac
1455cf44ddaSAlexander von Gluck IV #define R600_AUDIO_CONN_LIST					0x73b0
1465cf44ddaSAlexander von Gluck IV 
1475cf44ddaSAlexander von Gluck IV /* Audio verbs */
1485cf44ddaSAlexander von Gluck IV #define R600_AUDIO_RATE_BPS_CHANNEL				0x73c0
1495cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PLAYING						0x73c4
1505cf44ddaSAlexander von Gluck IV #define R600_AUDIO_IMPLEMENTATION_ID			0x73c8
1515cf44ddaSAlexander von Gluck IV #define R600_AUDIO_CONFIG_DEFAULT				0x73cc
1525cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PIN_SENSE					0x73d0
1535cf44ddaSAlexander von Gluck IV #define R600_AUDIO_PIN_WIDGET_CNTL				0x73d4
1545cf44ddaSAlexander von Gluck IV #define R600_AUDIO_STATUS_BITS					0x73d8
1555cf44ddaSAlexander von Gluck IV 
1565cf44ddaSAlexander von Gluck IV /* HDMI base register addresses */
1575cf44ddaSAlexander von Gluck IV #define R600_HDMI_BLOCK1						0x7400
1585cf44ddaSAlexander von Gluck IV #define R600_HDMI_BLOCK2						0x7700
1595cf44ddaSAlexander von Gluck IV #define R600_HDMI_BLOCK3						0x7800
1605cf44ddaSAlexander von Gluck IV 
1615cf44ddaSAlexander von Gluck IV /* HDMI registers */
1625cf44ddaSAlexander von Gluck IV #define R600_HDMI_ENABLE						0x00
1635cf44ddaSAlexander von Gluck IV #define R600_HDMI_STATUS						0x04
1645cf44ddaSAlexander von Gluck IV #define 	R600_HDMI_INT_PENDING				(1 << 29)
1655cf44ddaSAlexander von Gluck IV #define R600_HDMI_CNTL							0x08
1665cf44ddaSAlexander von Gluck IV #define 	R600_HDMI_INT_EN					(1 << 28)
1675cf44ddaSAlexander von Gluck IV #define 	R600_HDMI_INT_ACK					(1 << 29)
1685cf44ddaSAlexander von Gluck IV #define R600_HDMI_UNKNOWN_0						0x0C
1695cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIOCNTL						0x10
1705cf44ddaSAlexander von Gluck IV #define R600_HDMI_VIDEOCNTL						0x14
1715cf44ddaSAlexander von Gluck IV #define R600_HDMI_VERSION						0x18
1725cf44ddaSAlexander von Gluck IV #define R600_HDMI_UNKNOWN_1						0x28
1735cf44ddaSAlexander von Gluck IV #define R600_HDMI_VIDEOINFOFRAME_0				0x54
1745cf44ddaSAlexander von Gluck IV #define R600_HDMI_VIDEOINFOFRAME_1				0x58
1755cf44ddaSAlexander von Gluck IV #define R600_HDMI_VIDEOINFOFRAME_2				0x5c
1765cf44ddaSAlexander von Gluck IV #define R600_HDMI_VIDEOINFOFRAME_3				0x60
1775cf44ddaSAlexander von Gluck IV #define R600_HDMI_32kHz_CTS						0xac
1785cf44ddaSAlexander von Gluck IV #define R600_HDMI_32kHz_N						0xb0
1795cf44ddaSAlexander von Gluck IV #define R600_HDMI_44_1kHz_CTS					0xb4
1805cf44ddaSAlexander von Gluck IV #define R600_HDMI_44_1kHz_N						0xb8
1815cf44ddaSAlexander von Gluck IV #define R600_HDMI_48kHz_CTS						0xbc
1825cf44ddaSAlexander von Gluck IV #define R600_HDMI_48kHz_N						0xc0
1835cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIOINFOFRAME_0				0xcc
1845cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIOINFOFRAME_1				0xd0
1855cf44ddaSAlexander von Gluck IV #define R600_HDMI_IEC60958_1					0xd4
1865cf44ddaSAlexander von Gluck IV #define R600_HDMI_IEC60958_2					0xd8
1875cf44ddaSAlexander von Gluck IV #define R600_HDMI_UNKNOWN_2						0xdc
1885cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIO_DEBUG_0					0xe0
1895cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIO_DEBUG_1					0xe4
1905cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIO_DEBUG_2					0xe8
1915cf44ddaSAlexander von Gluck IV #define R600_HDMI_AUDIO_DEBUG_3					0xec
1925cf44ddaSAlexander von Gluck IV 
1935cf44ddaSAlexander von Gluck IV /* HDMI additional config base register addresses */
1945cf44ddaSAlexander von Gluck IV #define R600_HDMI_CONFIG1						0x7600
1955cf44ddaSAlexander von Gluck IV #define R600_HDMI_CONFIG2						0x7a00
1962613175eSAlexander von Gluck IV 
1970cd97231SAlexander von Gluck IV /* Thermal information */
1980cd97231SAlexander von Gluck IV #define R600_CG_THERMAL_STATUS					0x7F4
1990cd97231SAlexander von Gluck IV #define 	R600_ASIC_T(x)						((x) << 0)
2000cd97231SAlexander von Gluck IV #define 	R600_ASIC_T_MASK					0x1FF
2010cd97231SAlexander von Gluck IV #define 	R600_ASIC_T_SHIFT					0
2020cd97231SAlexander von Gluck IV 
2038ef0a0d2SAlexander von Gluck IV 
2048ef0a0d2SAlexander von Gluck IV #endif /* __R600_REG_H__ */