summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Deucher <alex@botch2.(none)>2007-11-03 20:46:17 -0400
committerAlex Deucher <alex@botch2.(none)>2007-11-03 20:46:17 -0400
commit5e9ebd8e496b72b051053d637c63b2956b7861d3 (patch)
tree51014c9d819e48a4f6eda30849fe87275f4473cf
parentc106075ccb81ca2ee4894743e676fd37653c8dce (diff)
Initial support for r4xx
- add r3xx/r4xx MC access macros and functions
-rw-r--r--src/Makefile.am2
-rw-r--r--src/radeon_atombios.c6
-rw-r--r--src/radeon_bios.c12
-rw-r--r--src/radeon_driver.c23
-rw-r--r--src/radeon_macros.h4
-rw-r--r--src/radeon_reg.h3
6 files changed, 41 insertions, 9 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index bcc66373..9bad63dd 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -100,7 +100,7 @@ radeon_drv_la_SOURCES = \
radeon_driver.c radeon_video.c radeon_bios.c radeon_mm_i2c.c \
radeon_vip.c radeon_misc.c radeon_probe.c radeon_display.c \
radeon_crtc.c radeon_output.c radeon_modes.c radeon_tv.c \
- $(RADEON_ATOMBIOS_SOURCES) radeon_atombios.c radeon_atomwrapper.c\
+ $(RADEON_ATOMBIOS_SOURCES) radeon_atombios.c radeon_atomwrapper.c \
$(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) atombios_output.c atombios_crtc.c
theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la
diff --git a/src/radeon_atombios.c b/src/radeon_atombios.c
index 12af4eb4..009df2ff 100644
--- a/src/radeon_atombios.c
+++ b/src/radeon_atombios.c
@@ -386,7 +386,7 @@ rhdInitAtomBIOS(int scrnIndex)
#if ATOM_BIOS_PARSER
/* Try to find out if BIOS has been posted (either by system or int10 */
- if (1 || !rhdBIOSGetFbBaseAndSize(scrnIndex, handle, &dummy, &dummy)) {
+ if (!rhdBIOSGetFbBaseAndSize(scrnIndex, handle, &dummy, &dummy)) {
/* run AsicInit */
if (!rhdASICInit(handle))
xf86DrvMsg(scrnIndex, X_WARNING,
@@ -849,7 +849,7 @@ CailReadMC(VOID *CAIL, ULONG Address)
ScrnInfoPtr pScrn = xf86Screens[((atomBIOSHandlePtr)CAIL)->scrnIndex];
CAILFUNC(CAIL);
- ret = AVIVOINMC(pScrn, Address);
+ ret = INMC(pScrn, Address);
DEBUGP(ErrorF("%s(%x) = %x\n",__func__,Address,ret));
return ret;
}
@@ -860,7 +860,7 @@ CailWriteMC(VOID *CAIL, ULONG Address, ULONG data)
CAILFUNC(CAIL);
ScrnInfoPtr pScrn = xf86Screens[((atomBIOSHandlePtr)CAIL)->scrnIndex];
DEBUGP(ErrorF("%s(%x,%x)\n",__func__,Address,data));
- AVIVOOUTMC(pScrn, Address, data);
+ OUTMC(pScrn, Address, data);
}
VOID
diff --git a/src/radeon_bios.c b/src/radeon_bios.c
index 3965263b..ec302189 100644
--- a/src/radeon_bios.c
+++ b/src/radeon_bios.c
@@ -132,12 +132,16 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
else
info->IsAtomBios = FALSE;
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s BIOS detected\n",
+ info->IsAtomBios ? "ATOM":"Legacy");
+
if (info->IsAtomBios) {
+#if 1
AtomBIOSArg atomBiosArg;
- if (RHDAtomBIOSFunc(pScrn->scrnIndex, NULL, ATOMBIOS_INIT, &atomBiosArg) == ATOM_SUCCESS) {
+ if (RHDAtomBIOSFunc(pScrn->scrnIndex, NULL, ATOMBIOS_INIT, &atomBiosArg) == ATOM_SUCCESS) {
info->atomBIOS = atomBiosArg.ptr;
- }
+ }
atomBiosArg.fb.start = info->FbFreeStart;
atomBiosArg.fb.size = info->FbFreeSize;
@@ -148,12 +152,10 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10)
info->FbFreeSize = atomBiosArg.fb.size;
}
rhdTestAtomBIOS(info->atomBIOS);
+#endif
info->MasterDataStart = RADEON_BIOS16 (info->ROMHeaderStart + 32);
}
- xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s BIOS detected\n",
- info->IsAtomBios ? "ATOM":"Legacy");
-
return TRUE;
}
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index a243c9f5..04a117bf 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -716,6 +716,29 @@ void RADEONOUTPLL(ScrnInfoPtr pScrn, int addr, CARD32 data)
RADEONPllErrataAfterData(info);
}
+/* Read MC register */
+unsigned RADEONINMC(ScrnInfoPtr pScrn, int addr)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO = info->MMIO;
+ CARD32 data;
+
+ OUTREG8(R300_MC_IND_INDEX, addr & 0x3f);
+ data = INREG(R300_MC_IND_DATA);
+
+ return data;
+}
+
+/* Write PLL information */
+void RADEONOUTMC(ScrnInfoPtr pScrn, int addr, CARD32 data)
+{
+ RADEONInfoPtr info = RADEONPTR(pScrn);
+ unsigned char *RADEONMMIO = info->MMIO;
+
+ OUTREG8(R300_MC_IND_INDEX, (((addr) & 0x3f) |
+ R300_MC_IND_WR_EN));
+ OUTREG(R300_MC_IND_DATA, data);
+}
#if 0
/* Read PAL information (only used for debugging) */
diff --git a/src/radeon_macros.h b/src/radeon_macros.h
index efc9e82c..4359eb88 100644
--- a/src/radeon_macros.h
+++ b/src/radeon_macros.h
@@ -129,4 +129,8 @@ do { \
} \
} while (0)
+#define INMC(pScrn, addr) RADEONINMC(pScrn, addr)
+
+#define OUTMC(pScrn, addr, val) RADEONOUTMC(pScrn, addr, val)
+
#endif
diff --git a/src/radeon_reg.h b/src/radeon_reg.h
index 26533397..1122f13b 100644
--- a/src/radeon_reg.h
+++ b/src/radeon_reg.h
@@ -996,6 +996,7 @@
#define RADEON_MPP_GP_CONFIG 0x01c8 /* ? */
#define R300_MC_IND_INDEX 0x01f8
# define R300_MC_IND_ADDR_MASK 0x3f
+# define R300_MC_IND_WR_EN (1 << 8)
#define R300_MC_IND_DATA 0x01fc
#define R300_MC_READ_CNTL_AB 0x017c
# define R300_MEM_RBS_POSITION_A_MASK 0x03
@@ -3270,4 +3271,6 @@
#define RADEON_RS480_UNK_e38 0xe38
#define RADEON_RS480_UNK_e3c 0xe3c
+#include "avivo_reg.h"
+
#endif