Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp3299432ybb; Tue, 31 Mar 2020 02:23:48 -0700 (PDT) X-Google-Smtp-Source: ADFU+vu7UCHg5Uqx6GCU8rPkutPh2xDajZwWAlfVtO2JpS5bedOuNRU/mefLaC/9FQcRp3y8Hs1Q X-Received: by 2002:a9d:6c45:: with SMTP id g5mr12288978otq.347.1585646628820; Tue, 31 Mar 2020 02:23:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585646628; cv=none; d=google.com; s=arc-20160816; b=REY/zSrEMtQ2PlAR+2c034w32zCYH/h4uGG8cVfEvypzae5y93mksHw4ChIHKIiEke B+P+Yv30sEjCP8L9PKG3Wbr0ghNMHbo7Gs0oOw7DDl09xGbmzFYiQCorzYcvUgBSlXIs onp5AhSPSs4xFOcWhLUZKmkgq0EJBV7KbJWhmhEiwFT7RdFlZ9ruKAEt9jlqDwYGqqXg aT/PX/lrU2GDEtMc8zjPekkoOYPePyJu/l2nmgUWQVAghsaDw8/zNmgL2VKENKXzeRNc 6ZLlEqhIFp67AD6bT8gHJkxbl+PFWhamkLf8gasX6BDcuBG8+7EV3m1YXrqkwG538Xb3 sUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/0r7Enwzb8NshXKuM4em9yuJ5mRKk3fKkSCSwnbxslU=; b=okfhHMb+ugX7JXEwxQ5Xzqg1VZYDiB44YSWLYqTPfWW3EBkdRwomUe9CMOXMVxNp1y 0zYnDWX+R5u7oiS5Hoc3LAmPcW5O+vMz4CBVZMPXJgrWWOxf0q/qKpen8qNCFCVURJzK hDgD6ufdQVUycBZUp9QAzhavB2YRQd+M9IPA0dITEnWo/YRHMNJEWR9g/tw11pX3zve4 8DqVbrkzWmV1eAboHW8Hpg/2q3ZddgWhG6WXEHRAFAM8XcmhZrH8JyaPhUSjxrxrNDtc M3A0DDe419uCg2YZTf7gMckRowWAFPJFOSXQ2FBXpVEixZi8OIAOWAhZG/zG+TX6UMlv Ogrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dmoel8NH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s199si6833140oih.169.2020.03.31.02.23.37; Tue, 31 Mar 2020 02:23:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dmoel8NH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731210AbgCaJWo (ORCPT + 99 others); Tue, 31 Mar 2020 05:22:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:47822 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730859AbgCaJGX (ORCPT ); Tue, 31 Mar 2020 05:06:23 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6FFBB208E0; Tue, 31 Mar 2020 09:06:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1585645582; bh=89D/W5dkDOEaebT6FttbPUhPib2LdV/V0/CH33cNdGs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dmoel8NHUYe1IZnaed9UQ9xC9UozDb0LwxPhrp9HLpjlH3UJjsL7lYs2q3I5e7qS3 ytp56zZn3cWdcp7a6XePav4GEwXbuyZ7LYO9O/jeP7n50DlsV7oJAxRFWVnv8j0Hae FFTC5ysUxcyclT3h681wlTRigiqmEkMo6p1Asfw0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hawking Zhang , Candice Li , Alex Deucher , Sasha Levin Subject: [PATCH 5.5 071/170] drm/amdgpu: correct ROM_INDEX/DATA offset for VEGA20 Date: Tue, 31 Mar 2020 10:58:05 +0200 Message-Id: <20200331085431.914377179@linuxfoundation.org> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200331085423.990189598@linuxfoundation.org> References: <20200331085423.990189598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hawking Zhang [ Upstream commit f1c2cd3f8fb959123a9beba18c0e8112dcb2e137 ] The ROMC_INDEX/DATA offset was changed to e4/e5 since from smuio_v11 (vega20/arcturus). Signed-off-by: Hawking Zhang Tested-by: Candice Li Reviewed-by: Candice Li Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdgpu/soc15.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 624e223175c21..d6f4f825b439c 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c @@ -87,6 +87,13 @@ #define HDP_MEM_POWER_CTRL__RC_MEM_POWER_CTRL_EN_MASK 0x00010000L #define HDP_MEM_POWER_CTRL__RC_MEM_POWER_LS_EN_MASK 0x00020000L #define mmHDP_MEM_POWER_CTRL_BASE_IDX 0 + +/* for Vega20/arcturus regiter offset change */ +#define mmROM_INDEX_VG20 0x00e4 +#define mmROM_INDEX_VG20_BASE_IDX 0 +#define mmROM_DATA_VG20 0x00e5 +#define mmROM_DATA_VG20_BASE_IDX 0 + /* * Indirect registers accessor */ @@ -307,6 +314,8 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev, { u32 *dw_ptr; u32 i, length_dw; + uint32_t rom_index_offset; + uint32_t rom_data_offset; if (bios == NULL) return false; @@ -319,11 +328,23 @@ static bool soc15_read_bios_from_rom(struct amdgpu_device *adev, dw_ptr = (u32 *)bios; length_dw = ALIGN(length_bytes, 4) / 4; + switch (adev->asic_type) { + case CHIP_VEGA20: + case CHIP_ARCTURUS: + rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX_VG20); + rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA_VG20); + break; + default: + rom_index_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX); + rom_data_offset = SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA); + break; + } + /* set rom index to 0 */ - WREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_INDEX), 0); + WREG32(rom_index_offset, 0); /* read out the rom data */ for (i = 0; i < length_dw; i++) - dw_ptr[i] = RREG32(SOC15_REG_OFFSET(SMUIO, 0, mmROM_DATA)); + dw_ptr[i] = RREG32(rom_data_offset); return true; } -- 2.20.1