diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2008-05-27 23:28:59 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-06-18 21:27:39 -0400 |
commit | 45e519052e8f583a709edd442a23f59581d3fe42 (patch) | |
tree | e928f17fdc5f8c52d33a649c361aa5c2cdee720c /drivers/char/drm/radeon_drv.h | |
parent | 2735977b12cb0f113aae24afff04747b6d0f5bf1 (diff) |
drm/radeon: merge IGP chip setup and fixup RS400 vs RS480 support
We only support RS480 (AMD based IGP) at the moment not
RS400 (Intel based IGP) ones.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/char/drm/radeon_drv.h')
-rw-r--r-- | drivers/char/drm/radeon_drv.h | 120 |
1 files changed, 62 insertions, 58 deletions
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h index f25933e9e56a..3063b0fa512f 100644 --- a/drivers/char/drm/radeon_drv.h +++ b/drivers/char/drm/radeon_drv.h | |||
@@ -122,7 +122,7 @@ enum radeon_family { | |||
122 | CHIP_RV380, | 122 | CHIP_RV380, |
123 | CHIP_R420, | 123 | CHIP_R420, |
124 | CHIP_RV410, | 124 | CHIP_RV410, |
125 | CHIP_RS400, | 125 | CHIP_RS480, |
126 | CHIP_RS690, | 126 | CHIP_RS690, |
127 | CHIP_RV515, | 127 | CHIP_RV515, |
128 | CHIP_R520, | 128 | CHIP_R520, |
@@ -459,9 +459,9 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev, | |||
459 | #define RADEON_PCIE_TX_GART_END_LO 0x16 | 459 | #define RADEON_PCIE_TX_GART_END_LO 0x16 |
460 | #define RADEON_PCIE_TX_GART_END_HI 0x17 | 460 | #define RADEON_PCIE_TX_GART_END_HI 0x17 |
461 | 461 | ||
462 | #define RS400_NB_MC_INDEX 0x168 | 462 | #define RS480_NB_MC_INDEX 0x168 |
463 | # define RS400_NB_MC_IND_WR_EN (1 << 8) | 463 | # define RS480_NB_MC_IND_WR_EN (1 << 8) |
464 | #define RS400_NB_MC_DATA 0x16c | 464 | #define RS480_NB_MC_DATA 0x16c |
465 | 465 | ||
466 | #define RS690_MC_INDEX 0x78 | 466 | #define RS690_MC_INDEX 0x78 |
467 | # define RS690_MC_INDEX_MASK 0x1ff | 467 | # define RS690_MC_INDEX_MASK 0x1ff |
@@ -470,46 +470,42 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev, | |||
470 | #define RS690_MC_DATA 0x7c | 470 | #define RS690_MC_DATA 0x7c |
471 | 471 | ||
472 | /* MC indirect registers */ | 472 | /* MC indirect registers */ |
473 | #define RS400_MC_MISC_CNTL 0x18 | 473 | #define RS480_MC_MISC_CNTL 0x18 |
474 | # define RS400_DISABLE_GTW (1 << 1) | 474 | # define RS480_DISABLE_GTW (1 << 1) |
475 | /* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */ | 475 | /* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */ |
476 | # define RS400_GART_INDEX_REG_EN (1 << 12) | 476 | # define RS480_GART_INDEX_REG_EN (1 << 12) |
477 | # define RS690_BLOCK_GFX_D3_EN (1 << 14) | 477 | # define RS690_BLOCK_GFX_D3_EN (1 << 14) |
478 | #define RS400_K8_FB_LOCATION 0x1e | 478 | #define RS480_K8_FB_LOCATION 0x1e |
479 | #define RS400_GART_FEATURE_ID 0x2b | 479 | #define RS480_GART_FEATURE_ID 0x2b |
480 | # define RS400_HANG_EN (1 << 11) | 480 | # define RS480_HANG_EN (1 << 11) |
481 | # define RS400_TLB_ENABLE (1 << 18) | 481 | # define RS480_TLB_ENABLE (1 << 18) |
482 | # define RS400_P2P_ENABLE (1 << 19) | 482 | # define RS480_P2P_ENABLE (1 << 19) |
483 | # define RS400_GTW_LAC_EN (1 << 25) | 483 | # define RS480_GTW_LAC_EN (1 << 25) |
484 | # define RS400_2LEVEL_GART (0 << 30) | 484 | # define RS480_2LEVEL_GART (0 << 30) |
485 | # define RS400_1LEVEL_GART (1 << 30) | 485 | # define RS480_1LEVEL_GART (1 << 30) |
486 | # define RS400_PDC_EN (1 << 31) | 486 | # define RS480_PDC_EN (1 << 31) |
487 | #define RS400_GART_BASE 0x2c | 487 | #define RS480_GART_BASE 0x2c |
488 | #define RS400_GART_CACHE_CNTRL 0x2e | 488 | #define RS480_GART_CACHE_CNTRL 0x2e |
489 | # define RS400_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ | 489 | # define RS480_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */ |
490 | /* ??? */ | 490 | #define RS480_AGP_ADDRESS_SPACE_SIZE 0x38 |
491 | # define RS690_MC_GART_CLEAR_STATUS (1 << 1) | 491 | # define RS480_GART_EN (1 << 0) |
492 | # define RS690_MC_GART_CLEAR_DONE (0 << 1) | 492 | # define RS480_VA_SIZE_32MB (0 << 1) |
493 | # define RS690_MC_GART_CLEAR_PENDING (1 << 1) | 493 | # define RS480_VA_SIZE_64MB (1 << 1) |
494 | #define RS400_AGP_ADDRESS_SPACE_SIZE 0x38 | 494 | # define RS480_VA_SIZE_128MB (2 << 1) |
495 | # define RS400_GART_EN (1 << 0) | 495 | # define RS480_VA_SIZE_256MB (3 << 1) |
496 | # define RS400_VA_SIZE_32MB (0 << 1) | 496 | # define RS480_VA_SIZE_512MB (4 << 1) |
497 | # define RS400_VA_SIZE_64MB (1 << 1) | 497 | # define RS480_VA_SIZE_1GB (5 << 1) |
498 | # define RS400_VA_SIZE_128MB (2 << 1) | 498 | # define RS480_VA_SIZE_2GB (6 << 1) |
499 | # define RS400_VA_SIZE_256MB (3 << 1) | 499 | #define RS480_AGP_MODE_CNTL 0x39 |
500 | # define RS400_VA_SIZE_512MB (4 << 1) | 500 | # define RS480_POST_GART_Q_SIZE (1 << 18) |
501 | # define RS400_VA_SIZE_1GB (5 << 1) | 501 | # define RS480_NONGART_SNOOP (1 << 19) |
502 | # define RS400_VA_SIZE_2GB (6 << 1) | 502 | # define RS480_AGP_RD_BUF_SIZE (1 << 20) |
503 | #define RS400_AGP_MODE_CNTL 0x39 | 503 | # define RS480_REQ_TYPE_SNOOP_SHIFT 22 |
504 | # define RS400_POST_GART_Q_SIZE (1 << 18) | 504 | # define RS480_REQ_TYPE_SNOOP_MASK 0x3 |
505 | # define RS400_NONGART_SNOOP (1 << 19) | 505 | # define RS480_REQ_TYPE_SNOOP_DIS (1 << 24) |
506 | # define RS400_AGP_RD_BUF_SIZE (1 << 20) | 506 | #define RS480_MC_MISC_UMA_CNTL 0x5f |
507 | # define RS400_REQ_TYPE_SNOOP_SHIFT 22 | 507 | #define RS480_MC_MCLK_CNTL 0x7a |
508 | # define RS400_REQ_TYPE_SNOOP_MASK 0x3 | 508 | #define RS480_MC_UMA_DUALCH_CNTL 0x86 |
509 | # define RS400_REQ_TYPE_SNOOP_DIS (1 << 24) | ||
510 | #define RS400_MC_MISC_UMA_CNTL 0x5f | ||
511 | #define RS400_MC_MCLK_CNTL 0x7a | ||
512 | #define RS400_MC_UMA_DUALCH_CNTL 0x86 | ||
513 | 509 | ||
514 | #define RS690_MC_FB_LOCATION 0x100 | 510 | #define RS690_MC_FB_LOCATION 0x100 |
515 | #define RS690_MC_AGP_LOCATION 0x101 | 511 | #define RS690_MC_AGP_LOCATION 0x101 |
@@ -529,8 +525,8 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev, | |||
529 | #define RADEON_MPP_TB_CONFIG 0x01c0 | 525 | #define RADEON_MPP_TB_CONFIG 0x01c0 |
530 | #define RADEON_MEM_CNTL 0x0140 | 526 | #define RADEON_MEM_CNTL 0x0140 |
531 | #define RADEON_MEM_SDRAM_MODE_REG 0x0158 | 527 | #define RADEON_MEM_SDRAM_MODE_REG 0x0158 |
532 | #define RADEON_AGP_BASE_2 0x015c | 528 | #define RADEON_AGP_BASE_2 0x015c /* r200+ only */ |
533 | #define RS400_AGP_BASE_2 0x0164 | 529 | #define RS480_AGP_BASE_2 0x0164 |
534 | #define RADEON_AGP_BASE 0x0170 | 530 | #define RADEON_AGP_BASE 0x0170 |
535 | 531 | ||
536 | #define RADEON_RB3D_COLOROFFSET 0x1c40 | 532 | #define RADEON_RB3D_COLOROFFSET 0x1c40 |
@@ -1105,14 +1101,6 @@ do { \ | |||
1105 | RADEON_WRITE(RADEON_CLOCK_CNTL_DATA, (val)); \ | 1101 | RADEON_WRITE(RADEON_CLOCK_CNTL_DATA, (val)); \ |
1106 | } while (0) | 1102 | } while (0) |
1107 | 1103 | ||
1108 | #define RADEON_WRITE_IGPGART(addr, val) \ | ||
1109 | do { \ | ||
1110 | RADEON_WRITE(RS400_NB_MC_INDEX, \ | ||
1111 | ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \ | ||
1112 | RADEON_WRITE(RS400_NB_MC_DATA, (val)); \ | ||
1113 | RADEON_WRITE(RS400_NB_MC_INDEX, 0x7f); \ | ||
1114 | } while (0) | ||
1115 | |||
1116 | #define RADEON_WRITE_PCIE(addr, val) \ | 1104 | #define RADEON_WRITE_PCIE(addr, val) \ |
1117 | do { \ | 1105 | do { \ |
1118 | RADEON_WRITE8(RADEON_PCIE_INDEX, \ | 1106 | RADEON_WRITE8(RADEON_PCIE_INDEX, \ |
@@ -1120,12 +1108,20 @@ do { \ | |||
1120 | RADEON_WRITE(RADEON_PCIE_DATA, (val)); \ | 1108 | RADEON_WRITE(RADEON_PCIE_DATA, (val)); \ |
1121 | } while (0) | 1109 | } while (0) |
1122 | 1110 | ||
1123 | #define RADEON_WRITE_MCIND(addr, val) \ | 1111 | #define R500_WRITE_MCIND(addr, val) \ |
1124 | do { \ | 1112 | do { \ |
1125 | RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ | 1113 | RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ |
1126 | RADEON_WRITE(R520_MC_IND_DATA, (val)); \ | 1114 | RADEON_WRITE(R520_MC_IND_DATA, (val)); \ |
1127 | RADEON_WRITE(R520_MC_IND_INDEX, 0); \ | 1115 | RADEON_WRITE(R520_MC_IND_INDEX, 0); \ |
1128 | } while (0) | 1116 | } while (0) |
1117 | |||
1118 | #define RS480_WRITE_MCIND(addr, val) \ | ||
1119 | do { \ | ||
1120 | RADEON_WRITE(RS480_NB_MC_INDEX, \ | ||
1121 | ((addr) & 0xff) | RS480_NB_MC_IND_WR_EN); \ | ||
1122 | RADEON_WRITE(RS480_NB_MC_DATA, (val)); \ | ||
1123 | RADEON_WRITE(RS480_NB_MC_INDEX, 0xff); \ | ||
1124 | } while (0) | ||
1129 | 1125 | ||
1130 | #define RS690_WRITE_MCIND(addr, val) \ | 1126 | #define RS690_WRITE_MCIND(addr, val) \ |
1131 | do { \ | 1127 | do { \ |
@@ -1134,6 +1130,14 @@ do { \ | |||
1134 | RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); \ | 1130 | RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_ACK); \ |
1135 | } while (0) | 1131 | } while (0) |
1136 | 1132 | ||
1133 | #define IGP_WRITE_MCIND(addr, val) \ | ||
1134 | do { \ | ||
1135 | if ((dev_priv->flags & RADEON_FAMILY_MASK) == CHIP_RS690) \ | ||
1136 | RS690_WRITE_MCIND(addr, val); \ | ||
1137 | else \ | ||
1138 | RS480_WRITE_MCIND(addr, val); \ | ||
1139 | } while (0) | ||
1140 | |||
1137 | #define CP_PACKET0( reg, n ) \ | 1141 | #define CP_PACKET0( reg, n ) \ |
1138 | (RADEON_CP_PACKET0 | ((n) << 16) | ((reg) >> 2)) | 1142 | (RADEON_CP_PACKET0 | ((n) << 16) | ((reg) >> 2)) |
1139 | #define CP_PACKET0_TABLE( reg, n ) \ | 1143 | #define CP_PACKET0_TABLE( reg, n ) \ |