Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 85f267a7 authored by Xiaojie Yuan's avatar Xiaojie Yuan Committed by Alex Deucher
Browse files

drm/amdgpu/discovery: use hardcoded mmRCC_CONFIG_MEMSIZE



register base offset of nbio is not known before IP Discovery table is
parsed, so hardcode this value.

Signed-off-by: default avatarXiaojie Yuan <xiaojie.yuan@amd.com>
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 70cbfe3d
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -28,6 +28,7 @@
#include "nbio/nbio_2_3_offset.h"
#include "nbio/nbio_2_3_offset.h"
#include "discovery.h"
#include "discovery.h"


#define mmRCC_CONFIG_MEMSIZE	0xde3
#define mmMM_INDEX		0x0
#define mmMM_INDEX		0x0
#define mmMM_INDEX_HI		0x6
#define mmMM_INDEX_HI		0x6
#define mmMM_DATA		0x1
#define mmMM_DATA		0x1
@@ -134,8 +135,7 @@ static int hw_id_map[MAX_HWIP] = {
static int amdgpu_discovery_read_binary(struct amdgpu_device *adev, uint8_t *binary)
static int amdgpu_discovery_read_binary(struct amdgpu_device *adev, uint8_t *binary)
{
{
	uint32_t *p = (uint32_t *)binary;
	uint32_t *p = (uint32_t *)binary;
	uint64_t vram_size = RREG32_SOC15(NBIO, 0,
	uint64_t vram_size = (uint64_t)RREG32(mmRCC_CONFIG_MEMSIZE) << 20;
			mmRCC_DEV0_EPF0_RCC_CONFIG_MEMSIZE) * 1024 * 1024;
	uint64_t pos = vram_size - BINARY_MAX_SIZE;
	uint64_t pos = vram_size - BINARY_MAX_SIZE;
	unsigned long flags;
	unsigned long flags;