[PATCH] drm/amdgpu: add get_rom_offset callback for NBIO 6.3.2
Alex Deucher <[email protected]>
| Newsgroups | org.freedesktop.lists.amd-gfx |
|---|---|
| Message-ID | <[email protected]> |
From: Le Ma <[email protected]> Add the get_rom_offset callback to retrieve the VBIOS ROM offset from REGS_ROM_OFFSET_CTRL for vbios imaging fetching from spirom. Signed-off-by: Le Ma <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> --- drivers/gpu/drm/amd/amdgpu/nbio_v6_3_2.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v6_3_2.c b/drivers/gpu/drm/amd/amdgpu/nbio_v6_3_2.c index d249011b2cf77..a40a13ca10113 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v6_3_2.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v6_3_2.c @@ -83,6 +83,21 @@ static u32 nbio_v6_3_2_get_memsize(struct amdgpu_device *adev) return RREG32_SOC15(NBIO, 0, regRCC_DEV0_EPF0_RCC_CONFIG_MEMSIZE); } +static u32 nbio_v6_3_2_get_rom_offset(struct amdgpu_device *adev) +{ + u32 data, rom_offset; + + data = RREG32_SOC15(NBIO, 0, regREGS_ROM_OFFSET_CTRL); + rom_offset = REG_GET_FIELD(data, REGS_ROM_OFFSET_CTRL, ROM_OFFSET); + + /* Temp W/A for nbio v6.3.2. Retrieving rom_offset as 1 but vbios + * image is actually located from offset 2 + */ + rom_offset += 1; + + return rom_offset; +} + static void nbio_v6_3_2_enable_doorbell_aperture(struct amdgpu_device *adev, bool enable) { @@ -366,4 +381,5 @@ const struct amdgpu_nbio_funcs nbio_v6_3_2_funcs = { .sdma_doorbell_range = nbio_v6_3_2_sdma_doorbell_range, .vcn_doorbell_range = nbio_v6_3_2_vcn_doorbell_range, .init_registers = nbio_v6_3_2_init_registers, + .get_rom_offset = nbio_v6_3_2_get_rom_offset, }; -- 2.55.0