aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Deucher <alexdeucher@gmail.com>2008-05-27 22:54:16 -0400
committerDave Airlie <airlied@redhat.com>2008-06-18 21:27:39 -0400
commit2735977b12cb0f113aae24afff04747b6d0f5bf1 (patch)
treeb1ff6774d4a86bbbcb3b7bae28c55d79dcb6e6ab
parent3722bfc607d46275369865c02fe8694486d640b5 (diff)
drm/radeon: IGP clean up register and magic numbers.
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/char/drm/radeon_cp.c79
-rw-r--r--drivers/char/drm/radeon_drv.h113
2 files changed, 110 insertions, 82 deletions
diff --git a/drivers/char/drm/radeon_cp.c b/drivers/char/drm/radeon_cp.c
index 6e13f4bec917..38eda336a657 100644
--- a/drivers/char/drm/radeon_cp.c
+++ b/drivers/char/drm/radeon_cp.c
@@ -109,9 +109,9 @@ static u32 RADEON_READ_PCIE(drm_radeon_private_t *dev_priv, int addr)
109static u32 RADEON_READ_IGPGART(drm_radeon_private_t *dev_priv, int addr) 109static u32 RADEON_READ_IGPGART(drm_radeon_private_t *dev_priv, int addr)
110{ 110{
111 u32 ret; 111 u32 ret;
112 RADEON_WRITE(RADEON_IGPGART_INDEX, addr & 0x7f); 112 RADEON_WRITE(RS400_NB_MC_INDEX, addr & 0x7f);
113 ret = RADEON_READ(RADEON_IGPGART_DATA); 113 ret = RADEON_READ(RS400_NB_MC_DATA);
114 RADEON_WRITE(RADEON_IGPGART_INDEX, 0x7f); 114 RADEON_WRITE(RS400_NB_MC_INDEX, 0x7f);
115 return ret; 115 return ret;
116} 116}
117 117
@@ -613,14 +613,18 @@ static void radeon_set_igpgart(drm_radeon_private_t * dev_priv, int on)
613 (long)dev_priv->gart_info.bus_addr, 613 (long)dev_priv->gart_info.bus_addr,
614 dev_priv->gart_size); 614 dev_priv->gart_size);
615 615
616 RADEON_WRITE_IGPGART(RADEON_IGPGART_UNK_18, 0x1000); 616 RADEON_WRITE_IGPGART(RS400_MC_MISC_CNTL, RS400_GART_INDEX_REG_EN);
617 RADEON_WRITE_IGPGART(RADEON_IGPGART_ENABLE, 0x1); 617 RADEON_WRITE_IGPGART(RS400_AGP_ADDRESS_SPACE_SIZE, (RS400_GART_EN |
618 RADEON_WRITE_IGPGART(RADEON_IGPGART_CTRL, 0x42040800); 618 RS400_VA_SIZE_32MB));
619 RADEON_WRITE_IGPGART(RADEON_IGPGART_BASE_ADDR, 619 RADEON_WRITE_IGPGART(RS400_GART_FEATURE_ID, (RS400_HANG_EN |
620 RS400_TLB_ENABLE |
621 RS400_GTW_LAC_EN |
622 RS400_1LEVEL_GART));
623 RADEON_WRITE_IGPGART(RS400_GART_BASE,
620 dev_priv->gart_info.bus_addr); 624 dev_priv->gart_info.bus_addr);
621 625
622 temp = RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_UNK_39); 626 temp = RADEON_READ_IGPGART(dev_priv, RS400_AGP_MODE_CNTL);
623 RADEON_WRITE_IGPGART(RADEON_IGPGART_UNK_39, temp); 627 RADEON_WRITE_IGPGART(RS400_AGP_MODE_CNTL, temp);
624 628
625 RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev_priv->gart_vm_start); 629 RADEON_WRITE(RADEON_AGP_BASE, (unsigned int)dev_priv->gart_vm_start);
626 dev_priv->gart_size = 32*1024*1024; 630 dev_priv->gart_size = 32*1024*1024;
@@ -629,13 +633,13 @@ static void radeon_set_igpgart(drm_radeon_private_t * dev_priv, int on)
629 dev_priv->gart_size) & 0xffff0000) | 633 dev_priv->gart_size) & 0xffff0000) |
630 (dev_priv->gart_vm_start >> 16))); 634 (dev_priv->gart_vm_start >> 16)));
631 635
632 temp = RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_ENABLE); 636 temp = RADEON_READ_IGPGART(dev_priv, RS400_AGP_ADDRESS_SPACE_SIZE);
633 RADEON_WRITE_IGPGART(RADEON_IGPGART_ENABLE, temp); 637 RADEON_WRITE_IGPGART(RS400_AGP_ADDRESS_SPACE_SIZE, temp);
634 638
635 RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_FLUSH); 639 RADEON_READ_IGPGART(dev_priv, RS400_GART_CACHE_CNTRL);
636 RADEON_WRITE_IGPGART(RADEON_IGPGART_FLUSH, 0x1); 640 RADEON_WRITE_IGPGART(RS400_GART_CACHE_CNTRL, RS400_GART_CACHE_INVALIDATE);
637 RADEON_READ_IGPGART(dev_priv, RADEON_IGPGART_FLUSH); 641 RADEON_READ_IGPGART(dev_priv, RS400_GART_CACHE_CNTRL);
638 RADEON_WRITE_IGPGART(RADEON_IGPGART_FLUSH, 0x0); 642 RADEON_WRITE_IGPGART(RS400_GART_CACHE_CNTRL, 0);
639 } 643 }
640} 644}
641 645
@@ -650,21 +654,26 @@ static void radeon_set_rs690gart(drm_radeon_private_t *dev_priv, int on)
650 (long)dev_priv->gart_info.bus_addr, 654 (long)dev_priv->gart_info.bus_addr,
651 dev_priv->gart_size); 655 dev_priv->gart_size);
652 656
653 temp = RS690_READ_MCIND(dev_priv, RS690_MC_MISC_CNTL); 657 temp = RS690_READ_MCIND(dev_priv, RS400_MC_MISC_CNTL);
654 RS690_WRITE_MCIND(RS690_MC_MISC_CNTL, 0x5000); 658 RS690_WRITE_MCIND(RS400_MC_MISC_CNTL, (RS400_GART_INDEX_REG_EN |
659 RS690_BLOCK_GFX_D3_EN));
655 660
656 RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, 661 RS690_WRITE_MCIND(RS400_AGP_ADDRESS_SPACE_SIZE, (RS400_GART_EN |
657 RS690_MC_GART_EN | RS690_MC_AGP_SIZE_32MB); 662 RS400_VA_SIZE_32MB));
658 663
659 temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_FEATURE_ID); 664 temp = RS690_READ_MCIND(dev_priv, RS400_GART_FEATURE_ID);
660 RS690_WRITE_MCIND(RS690_MC_GART_FEATURE_ID, 0x42040800); 665 RS690_WRITE_MCIND(RS400_GART_FEATURE_ID, (RS400_HANG_EN |
666 RS400_TLB_ENABLE |
667 RS400_GTW_LAC_EN |
668 RS400_1LEVEL_GART));
661 669
662 temp = dev_priv->gart_info.bus_addr & 0xfffff000; 670 temp = dev_priv->gart_info.bus_addr & 0xfffff000;
663 temp |= (upper_32_bits(dev_priv->gart_info.bus_addr) & 0xff) << 4; 671 temp |= (upper_32_bits(dev_priv->gart_info.bus_addr) & 0xff) << 4;
664 RS690_WRITE_MCIND(RS690_MC_GART_BASE, temp); 672 RS690_WRITE_MCIND(RS400_GART_BASE, temp);
665 673
666 temp = RS690_READ_MCIND(dev_priv, RS690_MC_AGP_MODE_CONTROL); 674 temp = RS690_READ_MCIND(dev_priv, RS400_AGP_MODE_CNTL);
667 RS690_WRITE_MCIND(RS690_MC_AGP_MODE_CONTROL, 0x01400000); 675 RS690_WRITE_MCIND(RS400_AGP_MODE_CNTL, ((1 << RS400_REQ_TYPE_SNOOP_SHIFT) |
676 RS400_REQ_TYPE_SNOOP_DIS));
668 677
669 RS690_WRITE_MCIND(RS690_MC_AGP_BASE, 678 RS690_WRITE_MCIND(RS690_MC_AGP_BASE,
670 (unsigned int)dev_priv->gart_vm_start); 679 (unsigned int)dev_priv->gart_vm_start);
@@ -677,32 +686,32 @@ static void radeon_set_rs690gart(drm_radeon_private_t *dev_priv, int on)
677 686
678 RS690_WRITE_MCIND(RS690_MC_AGP_LOCATION, temp); 687 RS690_WRITE_MCIND(RS690_MC_AGP_LOCATION, temp);
679 688
680 temp = RS690_READ_MCIND(dev_priv, RS690_MC_AGP_SIZE); 689 temp = RS690_READ_MCIND(dev_priv, RS400_AGP_ADDRESS_SPACE_SIZE);
681 RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, 690 RS690_WRITE_MCIND(RS400_AGP_ADDRESS_SPACE_SIZE, (RS400_GART_EN |
682 RS690_MC_GART_EN | RS690_MC_AGP_SIZE_32MB); 691 RS400_VA_SIZE_32MB));
683 692
684 do { 693 do {
685 temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_CACHE_CNTL); 694 temp = RS690_READ_MCIND(dev_priv, RS400_GART_CACHE_CNTRL);
686 if ((temp & RS690_MC_GART_CLEAR_STATUS) == 695 if ((temp & RS690_MC_GART_CLEAR_STATUS) ==
687 RS690_MC_GART_CLEAR_DONE) 696 RS690_MC_GART_CLEAR_DONE)
688 break; 697 break;
689 DRM_UDELAY(1); 698 DRM_UDELAY(1);
690 } while (1); 699 } while (1);
691 700
692 RS690_WRITE_MCIND(RS690_MC_GART_CACHE_CNTL, 701 RS690_WRITE_MCIND(RS400_GART_CACHE_CNTRL,
693 RS690_MC_GART_CC_CLEAR); 702 RS400_GART_CACHE_INVALIDATE);
703
694 do { 704 do {
695 temp = RS690_READ_MCIND(dev_priv, RS690_MC_GART_CACHE_CNTL); 705 temp = RS690_READ_MCIND(dev_priv, RS400_GART_CACHE_CNTRL);
696 if ((temp & RS690_MC_GART_CLEAR_STATUS) == 706 if ((temp & RS690_MC_GART_CLEAR_STATUS) ==
697 RS690_MC_GART_CLEAR_DONE) 707 RS690_MC_GART_CLEAR_DONE)
698 break; 708 break;
699 DRM_UDELAY(1); 709 DRM_UDELAY(1);
700 } while (1); 710 } while (1);
701 711
702 RS690_WRITE_MCIND(RS690_MC_GART_CACHE_CNTL, 712 RS690_WRITE_MCIND(RS400_GART_CACHE_CNTRL, 0);
703 RS690_MC_GART_CC_NO_CHANGE);
704 } else { 713 } else {
705 RS690_WRITE_MCIND(RS690_MC_AGP_SIZE, RS690_MC_GART_DIS); 714 RS690_WRITE_MCIND(RS400_AGP_ADDRESS_SPACE_SIZE, 0);
706 } 715 }
707} 716}
708 717
diff --git a/drivers/char/drm/radeon_drv.h b/drivers/char/drm/radeon_drv.h
index b22816b57659..f25933e9e56a 100644
--- a/drivers/char/drm/radeon_drv.h
+++ b/drivers/char/drm/radeon_drv.h
@@ -444,13 +444,13 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev,
444#define RADEON_PCIE_DATA 0x0034 444#define RADEON_PCIE_DATA 0x0034
445#define RADEON_PCIE_TX_GART_CNTL 0x10 445#define RADEON_PCIE_TX_GART_CNTL 0x10
446# define RADEON_PCIE_TX_GART_EN (1 << 0) 446# define RADEON_PCIE_TX_GART_EN (1 << 0)
447# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0<<1) 447# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_PASS_THRU (0 << 1)
448# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1<<1) 448# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_CLAMP_LO (1 << 1)
449# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3<<1) 449# define RADEON_PCIE_TX_GART_UNMAPPED_ACCESS_DISCARD (3 << 1)
450# define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0<<3) 450# define RADEON_PCIE_TX_GART_MODE_32_128_CACHE (0 << 3)
451# define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1<<3) 451# define RADEON_PCIE_TX_GART_MODE_8_4_128_CACHE (1 << 3)
452# define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1<<5) 452# define RADEON_PCIE_TX_GART_CHK_RW_VALID_EN (1 << 5)
453# define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1<<8) 453# define RADEON_PCIE_TX_GART_INVALIDATE_TLB (1 << 8)
454#define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11 454#define RADEON_PCIE_TX_DISCARD_RD_ADDR_LO 0x11
455#define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12 455#define RADEON_PCIE_TX_DISCARD_RD_ADDR_HI 0x12
456#define RADEON_PCIE_TX_GART_BASE 0x13 456#define RADEON_PCIE_TX_GART_BASE 0x13
@@ -459,14 +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 RADEON_IGPGART_INDEX 0x168 462#define RS400_NB_MC_INDEX 0x168
463#define RADEON_IGPGART_DATA 0x16c 463# define RS400_NB_MC_IND_WR_EN (1 << 8)
464#define RADEON_IGPGART_UNK_18 0x18 464#define RS400_NB_MC_DATA 0x16c
465#define RADEON_IGPGART_CTRL 0x2b
466#define RADEON_IGPGART_BASE_ADDR 0x2c
467#define RADEON_IGPGART_FLUSH 0x2e
468#define RADEON_IGPGART_ENABLE 0x38
469#define RADEON_IGPGART_UNK_39 0x39
470 465
471#define RS690_MC_INDEX 0x78 466#define RS690_MC_INDEX 0x78
472# define RS690_MC_INDEX_MASK 0x1ff 467# define RS690_MC_INDEX_MASK 0x1ff
@@ -474,33 +469,55 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev,
474# define RS690_MC_INDEX_WR_ACK 0x7f 469# define RS690_MC_INDEX_WR_ACK 0x7f
475#define RS690_MC_DATA 0x7c 470#define RS690_MC_DATA 0x7c
476 471
477#define RS690_MC_MISC_CNTL 0x18 472/* MC indirect registers */
478#define RS690_MC_GART_FEATURE_ID 0x2b 473#define RS400_MC_MISC_CNTL 0x18
479#define RS690_MC_GART_BASE 0x2c 474# define RS400_DISABLE_GTW (1 << 1)
480#define RS690_MC_GART_CACHE_CNTL 0x2e 475/* switch between MCIND GART and MM GART registers. 0 = mmgart, 1 = mcind gart */
481# define RS690_MC_GART_CC_NO_CHANGE 0x0 476# define RS400_GART_INDEX_REG_EN (1 << 12)
482# define RS690_MC_GART_CC_CLEAR 0x1 477# define RS690_BLOCK_GFX_D3_EN (1 << 14)
483# define RS690_MC_GART_CLEAR_STATUS (1 << 1) 478#define RS400_K8_FB_LOCATION 0x1e
479#define RS400_GART_FEATURE_ID 0x2b
480# define RS400_HANG_EN (1 << 11)
481# define RS400_TLB_ENABLE (1 << 18)
482# define RS400_P2P_ENABLE (1 << 19)
483# define RS400_GTW_LAC_EN (1 << 25)
484# define RS400_2LEVEL_GART (0 << 30)
485# define RS400_1LEVEL_GART (1 << 30)
486# define RS400_PDC_EN (1 << 31)
487#define RS400_GART_BASE 0x2c
488#define RS400_GART_CACHE_CNTRL 0x2e
489# define RS400_GART_CACHE_INVALIDATE (1 << 0) /* wait for it to clear */
490/* ??? */
491# define RS690_MC_GART_CLEAR_STATUS (1 << 1)
484# define RS690_MC_GART_CLEAR_DONE (0 << 1) 492# define RS690_MC_GART_CLEAR_DONE (0 << 1)
485# define RS690_MC_GART_CLEAR_PENDING (1 << 1) 493# define RS690_MC_GART_CLEAR_PENDING (1 << 1)
486#define RS690_MC_AGP_SIZE 0x38 494#define RS400_AGP_ADDRESS_SPACE_SIZE 0x38
487# define RS690_MC_GART_DIS 0x0 495# define RS400_GART_EN (1 << 0)
488# define RS690_MC_GART_EN 0x1 496# define RS400_VA_SIZE_32MB (0 << 1)
489# define RS690_MC_AGP_SIZE_32MB (0 << 1) 497# define RS400_VA_SIZE_64MB (1 << 1)
490# define RS690_MC_AGP_SIZE_64MB (1 << 1) 498# define RS400_VA_SIZE_128MB (2 << 1)
491# define RS690_MC_AGP_SIZE_128MB (2 << 1) 499# define RS400_VA_SIZE_256MB (3 << 1)
492# define RS690_MC_AGP_SIZE_256MB (3 << 1) 500# define RS400_VA_SIZE_512MB (4 << 1)
493# define RS690_MC_AGP_SIZE_512MB (4 << 1) 501# define RS400_VA_SIZE_1GB (5 << 1)
494# define RS690_MC_AGP_SIZE_1GB (5 << 1) 502# define RS400_VA_SIZE_2GB (6 << 1)
495# define RS690_MC_AGP_SIZE_2GB (6 << 1) 503#define RS400_AGP_MODE_CNTL 0x39
496#define RS690_MC_AGP_MODE_CONTROL 0x39 504# define RS400_POST_GART_Q_SIZE (1 << 18)
505# define RS400_NONGART_SNOOP (1 << 19)
506# define RS400_AGP_RD_BUF_SIZE (1 << 20)
507# define RS400_REQ_TYPE_SNOOP_SHIFT 22
508# define RS400_REQ_TYPE_SNOOP_MASK 0x3
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
497#define RS690_MC_FB_LOCATION 0x100 514#define RS690_MC_FB_LOCATION 0x100
498#define RS690_MC_AGP_LOCATION 0x101 515#define RS690_MC_AGP_LOCATION 0x101
499#define RS690_MC_AGP_BASE 0x102 516#define RS690_MC_AGP_BASE 0x102
500#define RS690_MC_AGP_BASE_2 0x103 517#define RS690_MC_AGP_BASE_2 0x103
501 518
502#define R520_MC_IND_INDEX 0x70 519#define R520_MC_IND_INDEX 0x70
503#define R520_MC_IND_WR_EN (1<<24) 520#define R520_MC_IND_WR_EN (1 << 24)
504#define R520_MC_IND_DATA 0x74 521#define R520_MC_IND_DATA 0x74
505 522
506#define RV515_MC_FB_LOCATION 0x01 523#define RV515_MC_FB_LOCATION 0x01
@@ -512,6 +529,8 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev,
512#define RADEON_MPP_TB_CONFIG 0x01c0 529#define RADEON_MPP_TB_CONFIG 0x01c0
513#define RADEON_MEM_CNTL 0x0140 530#define RADEON_MEM_CNTL 0x0140
514#define RADEON_MEM_SDRAM_MODE_REG 0x0158 531#define RADEON_MEM_SDRAM_MODE_REG 0x0158
532#define RADEON_AGP_BASE_2 0x015c
533#define RS400_AGP_BASE_2 0x0164
515#define RADEON_AGP_BASE 0x0170 534#define RADEON_AGP_BASE 0x0170
516 535
517#define RADEON_RB3D_COLOROFFSET 0x1c40 536#define RADEON_RB3D_COLOROFFSET 0x1c40
@@ -1079,36 +1098,36 @@ extern int r300_do_cp_cmdbuf(struct drm_device * dev,
1079#define RADEON_READ8(reg) DRM_READ8( dev_priv->mmio, (reg) ) 1098#define RADEON_READ8(reg) DRM_READ8( dev_priv->mmio, (reg) )
1080#define RADEON_WRITE8(reg,val) DRM_WRITE8( dev_priv->mmio, (reg), (val) ) 1099#define RADEON_WRITE8(reg,val) DRM_WRITE8( dev_priv->mmio, (reg), (val) )
1081 1100
1082#define RADEON_WRITE_PLL( addr, val ) \ 1101#define RADEON_WRITE_PLL(addr, val) \
1083do { \ 1102do { \
1084 RADEON_WRITE8( RADEON_CLOCK_CNTL_INDEX, \ 1103 RADEON_WRITE8(RADEON_CLOCK_CNTL_INDEX, \
1085 ((addr) & 0x1f) | RADEON_PLL_WR_EN ); \ 1104 ((addr) & 0x1f) | RADEON_PLL_WR_EN ); \
1086 RADEON_WRITE( RADEON_CLOCK_CNTL_DATA, (val) ); \ 1105 RADEON_WRITE(RADEON_CLOCK_CNTL_DATA, (val)); \
1087} while (0) 1106} while (0)
1088 1107
1089#define RADEON_WRITE_IGPGART( addr, val ) \ 1108#define RADEON_WRITE_IGPGART(addr, val) \
1090do { \ 1109do { \
1091 RADEON_WRITE( RADEON_IGPGART_INDEX, \ 1110 RADEON_WRITE(RS400_NB_MC_INDEX, \
1092 ((addr) & 0x7f) | (1 << 8)); \ 1111 ((addr) & 0x7f) | RS400_NB_MC_IND_WR_EN); \
1093 RADEON_WRITE( RADEON_IGPGART_DATA, (val) ); \ 1112 RADEON_WRITE(RS400_NB_MC_DATA, (val)); \
1094 RADEON_WRITE( RADEON_IGPGART_INDEX, 0x7f ); \ 1113 RADEON_WRITE(RS400_NB_MC_INDEX, 0x7f); \
1095} while (0) 1114} while (0)
1096 1115
1097#define RADEON_WRITE_PCIE( addr, val ) \ 1116#define RADEON_WRITE_PCIE(addr, val) \
1098do { \ 1117do { \
1099 RADEON_WRITE8( RADEON_PCIE_INDEX, \ 1118 RADEON_WRITE8(RADEON_PCIE_INDEX, \
1100 ((addr) & 0xff)); \ 1119 ((addr) & 0xff)); \
1101 RADEON_WRITE( RADEON_PCIE_DATA, (val) ); \ 1120 RADEON_WRITE(RADEON_PCIE_DATA, (val)); \
1102} while (0) 1121} while (0)
1103 1122
1104#define RADEON_WRITE_MCIND( addr, val ) \ 1123#define RADEON_WRITE_MCIND(addr, val) \
1105 do { \ 1124 do { \
1106 RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \ 1125 RADEON_WRITE(R520_MC_IND_INDEX, 0xff0000 | ((addr) & 0xff)); \
1107 RADEON_WRITE(R520_MC_IND_DATA, (val)); \ 1126 RADEON_WRITE(R520_MC_IND_DATA, (val)); \
1108 RADEON_WRITE(R520_MC_IND_INDEX, 0); \ 1127 RADEON_WRITE(R520_MC_IND_INDEX, 0); \
1109 } while (0) 1128 } while (0)
1110 1129
1111#define RS690_WRITE_MCIND( addr, val ) \ 1130#define RS690_WRITE_MCIND(addr, val) \
1112do { \ 1131do { \
1113 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_EN | ((addr) & RS690_MC_INDEX_MASK)); \ 1132 RADEON_WRITE(RS690_MC_INDEX, RS690_MC_INDEX_WR_EN | ((addr) & RS690_MC_INDEX_MASK)); \
1114 RADEON_WRITE(RS690_MC_DATA, val); \ 1133 RADEON_WRITE(RS690_MC_DATA, val); \