diff options
-rw-r--r-- | src/radeon.h | 2 | ||||
-rw-r--r-- | src/radeon_driver.c | 23 | ||||
-rw-r--r-- | src/radeon_macros.h | 4 | ||||
-rw-r--r-- | src/radeon_reg.h | 3 |
4 files changed, 31 insertions, 1 deletions
diff --git a/src/radeon.h b/src/radeon.h index 2b354ae0..d488429f 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -1056,8 +1056,10 @@ extern RADEONEntPtr RADEONEntPriv(ScrnInfoPtr pScrn); extern int RADEONMinBits(int val); extern unsigned RADEONINMC(ScrnInfoPtr pScrn, int addr); extern unsigned RADEONINPLL(ScrnInfoPtr pScrn, int addr); +extern unsigned RADEONINPCIE(ScrnInfoPtr pScrn, int addr); extern void RADEONOUTMC(ScrnInfoPtr pScrn, int addr, uint32_t data); extern void RADEONOUTPLL(ScrnInfoPtr pScrn, int addr, uint32_t data); +extern void RADEONOUTPCIE(ScrnInfoPtr pScrn, int addr, uint32_t data); extern void RADEONPllErrataAfterData(RADEONInfoPtr info); extern void RADEONPllErrataAfterIndex(RADEONInfoPtr info); extern void RADEONWaitForVerticalSync(ScrnInfoPtr pScrn); diff --git a/src/radeon_driver.c b/src/radeon_driver.c index b0b2e77b..8673f5e1 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -668,6 +668,29 @@ void RADEONOUTMC(ScrnInfoPtr pScrn, int addr, uint32_t data) } } +/* Read PCIE register */ +unsigned RADEONINPCIE(ScrnInfoPtr pScrn, int addr) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + CARD32 data; + + OUTREG(RADEON_PCIE_INDEX, addr & 0xff); + data = INREG(RADEON_PCIE_DATA); + + return data; +} + +/* Write PCIE register */ +void RADEONOUTPCIE(ScrnInfoPtr pScrn, int addr, uint32_t data) +{ + RADEONInfoPtr info = RADEONPTR(pScrn); + unsigned char *RADEONMMIO = info->MMIO; + + OUTREG(RADEON_PCIE_INDEX, ((addr) & 0xff)); + OUTREG(RADEON_PCIE_DATA, data); +} + static Bool radeon_get_mc_idle(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); diff --git a/src/radeon_macros.h b/src/radeon_macros.h index 387e5f5f..b7056b0d 100644 --- a/src/radeon_macros.h +++ b/src/radeon_macros.h @@ -152,7 +152,9 @@ do { \ } while (0) #define INMC(pScrn, addr) RADEONINMC(pScrn, addr) - #define OUTMC(pScrn, addr, val) RADEONOUTMC(pScrn, addr, val) +#define INPCIE(pScrn, addr) RADEONINPCIE(pScrn, addr) +#define OUTPCIE(pScrn, addr, val) RADEONOUTPCIE(pScrn, addr, val + #endif diff --git a/src/radeon_reg.h b/src/radeon_reg.h index e0d89aff..a1307945 100644 --- a/src/radeon_reg.h +++ b/src/radeon_reg.h @@ -274,6 +274,9 @@ #define RADEON_BUS_CNTL1 0x0034 # define RADEON_BUS_WAIT_ON_LOCK_EN (1 << 4) +#define RADEON_PCIE_INDEX 0x0030 +#define RADEON_PCIE_DATA 0x0034 + #define RADEON_CACHE_CNTL 0x1724 #define RADEON_CACHE_LINE 0x0f0c /* PCI */ #define RADEON_CAPABILITIES_ID 0x0f50 /* PCI */ |