mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/
synced 2026-04-18 06:33:43 -04:00
drm/amdgpu: implement mmio byte access helper for MB
mailbox registers can be accessed with a byte boundry according to BIF team, so this patch prepares register byte access and will be used by following patches. Actually, for mailbox registers once the byte field is touched even not changed, the mailbox behaves, so we need the byte width accessing to those sort of regs. Signed-off-by: Monk Liu <Monk.Liu@amd.com> Reviewed-by: Pixel Ding <Pixel.Ding@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -121,6 +121,32 @@ uint32_t amdgpu_mm_rreg(struct amdgpu_device *adev, uint32_t reg,
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* MMIO register read with bytes helper functions
|
||||
* @offset:bytes offset from MMIO start
|
||||
*
|
||||
*/
|
||||
|
||||
uint8_t amdgpu_mm_rreg8(struct amdgpu_device *adev, uint32_t offset) {
|
||||
if (offset < adev->rmmio_size)
|
||||
return (readb(adev->rmmio + offset));
|
||||
BUG();
|
||||
}
|
||||
|
||||
/*
|
||||
* MMIO register write with bytes helper functions
|
||||
* @offset:bytes offset from MMIO start
|
||||
* @value: the value want to be written to the register
|
||||
*
|
||||
*/
|
||||
void amdgpu_mm_wreg8(struct amdgpu_device *adev, uint32_t offset, uint8_t value) {
|
||||
if (offset < adev->rmmio_size)
|
||||
writeb(value, adev->rmmio + offset);
|
||||
else
|
||||
BUG();
|
||||
}
|
||||
|
||||
|
||||
void amdgpu_mm_wreg(struct amdgpu_device *adev, uint32_t reg, uint32_t v,
|
||||
uint32_t acc_flags)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user