diff options
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon.h')
-rw-r--r-- | drivers/gpu/drm/radeon/radeon.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h index 03141755c2ea..966ba0751feb 100644 --- a/drivers/gpu/drm/radeon/radeon.h +++ b/drivers/gpu/drm/radeon/radeon.h | |||
@@ -1048,6 +1048,9 @@ struct radeon_device { | |||
1048 | uint32_t pcie_reg_mask; | 1048 | uint32_t pcie_reg_mask; |
1049 | radeon_rreg_t pciep_rreg; | 1049 | radeon_rreg_t pciep_rreg; |
1050 | radeon_wreg_t pciep_wreg; | 1050 | radeon_wreg_t pciep_wreg; |
1051 | /* io port */ | ||
1052 | void __iomem *rio_mem; | ||
1053 | resource_size_t rio_mem_size; | ||
1051 | struct radeon_clock clock; | 1054 | struct radeon_clock clock; |
1052 | struct radeon_mc mc; | 1055 | struct radeon_mc mc; |
1053 | struct radeon_gart gart; | 1056 | struct radeon_gart gart; |
@@ -1130,6 +1133,26 @@ static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32 | |||
1130 | } | 1133 | } |
1131 | } | 1134 | } |
1132 | 1135 | ||
1136 | static inline u32 r100_io_rreg(struct radeon_device *rdev, u32 reg) | ||
1137 | { | ||
1138 | if (reg < rdev->rio_mem_size) | ||
1139 | return ioread32(rdev->rio_mem + reg); | ||
1140 | else { | ||
1141 | iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX); | ||
1142 | return ioread32(rdev->rio_mem + RADEON_MM_DATA); | ||
1143 | } | ||
1144 | } | ||
1145 | |||
1146 | static inline void r100_io_wreg(struct radeon_device *rdev, u32 reg, u32 v) | ||
1147 | { | ||
1148 | if (reg < rdev->rio_mem_size) | ||
1149 | iowrite32(v, rdev->rio_mem + reg); | ||
1150 | else { | ||
1151 | iowrite32(reg, rdev->rio_mem + RADEON_MM_INDEX); | ||
1152 | iowrite32(v, rdev->rio_mem + RADEON_MM_DATA); | ||
1153 | } | ||
1154 | } | ||
1155 | |||
1133 | /* | 1156 | /* |
1134 | * Cast helper | 1157 | * Cast helper |
1135 | */ | 1158 | */ |
@@ -1168,6 +1191,8 @@ static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32 | |||
1168 | WREG32_PLL(reg, tmp_); \ | 1191 | WREG32_PLL(reg, tmp_); \ |
1169 | } while (0) | 1192 | } while (0) |
1170 | #define DREG32_SYS(sqf, rdev, reg) seq_printf((sqf), #reg " : 0x%08X\n", r100_mm_rreg((rdev), (reg))) | 1193 | #define DREG32_SYS(sqf, rdev, reg) seq_printf((sqf), #reg " : 0x%08X\n", r100_mm_rreg((rdev), (reg))) |
1194 | #define RREG32_IO(reg) r100_io_rreg(rdev, (reg)) | ||
1195 | #define WREG32_IO(reg, v) r100_io_wreg(rdev, (reg), (v)) | ||
1171 | 1196 | ||
1172 | /* | 1197 | /* |
1173 | * Indirect registers accessor | 1198 | * Indirect registers accessor |