All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Zhang, Hawking" <Hawking.Zhang@amd.com>
To: "Wang, Yang(Kevin)" <KevinYang.Wang@amd.com>,
	"amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Gao, Likun" <Likun.Gao@amd.com>,
	"Deucher, Alexander" <Alexander.Deucher@amd.com>
Subject: Re: [PATCH 03/10] drm/amdgpu: add helper to init rlc fw in header v2_2
Date: Mon, 19 Sep 2022 02:31:44 +0000	[thread overview]
Message-ID: <BN9PR12MB525727347B70EE24DAD3EC51FC4D9@BN9PR12MB5257.namprd12.prod.outlook.com> (raw)
In-Reply-To: <PH7PR12MB59973981CF9C648188B60578824A9@PH7PR12MB5997.namprd12.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3556 bytes --]

[AMD Official Use Only - General]

[Kevin]:
according to code logic in above, the following code is not needed to convert again.
ALIGN(le32_to_cpu(adev->gfx.rlc.rlc_dram_ucode_size_bytes), PAGE_SIZE);

Good catch. will make the change when push the code.

Regards,
Hawking

From: Wang, Yang(Kevin) <KevinYang.Wang@amd.com>
Date: Monday, September 19, 2022 at 01:15
To: Zhang, Hawking <Hawking.Zhang@amd.com>, amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>, Gao, Likun <Likun.Gao@amd.com>, Deucher, Alexander <Alexander.Deucher@amd.com>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: RE: [PATCH 03/10] drm/amdgpu: add helper to init rlc fw in header v2_2
[AMD Official Use Only - General]

-----Original Message-----
From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Hawking Zhang
Sent: Friday, September 16, 2022 1:01 AM
To: amd-gfx@lists.freedesktop.org; Gao, Likun <Likun.Gao@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>
Subject: [PATCH 03/10] drm/amdgpu: add helper to init rlc fw in header v2_2

To initialize rlc firmware in header v2_2

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c | 30 +++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
index 04bdb885918d..a055818d87f7 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c
@@ -376,3 +376,33 @@ static void amdgpu_gfx_rlc_init_microcode_v2_1(struct amdgpu_device *adev)
                }
        }
 }
+
+static void amdgpu_gfx_rlc_init_microcode_v2_2(struct amdgpu_device
+*adev) {
+       const struct rlc_firmware_header_v2_2 *rlc_hdr;
+       struct amdgpu_firmware_info *info;
+
+       rlc_hdr = (const struct rlc_firmware_header_v2_2 *)adev->gfx.rlc_fw->data;
+       adev->gfx.rlc.rlc_iram_ucode_size_bytes = le32_to_cpu(rlc_hdr->rlc_iram_ucode_size_bytes);
+       adev->gfx.rlc.rlc_iram_ucode = (u8 *)rlc_hdr + le32_to_cpu(rlc_hdr->rlc_iram_ucode_offset_bytes);
+       adev->gfx.rlc.rlc_dram_ucode_size_bytes = le32_to_cpu(rlc_hdr->rlc_dram_ucode_size_bytes);
+       adev->gfx.rlc.rlc_dram_ucode = (u8 *)rlc_hdr +
+le32_to_cpu(rlc_hdr->rlc_dram_ucode_offset_bytes);
+
+       if (adev->firmware.load_type == AMDGPU_FW_LOAD_PSP) {
+               if (adev->gfx.rlc.rlc_iram_ucode_size_bytes) {
+                       info = &adev->firmware.ucode[AMDGPU_UCODE_ID_RLC_IRAM];
+                       info->ucode_id = AMDGPU_UCODE_ID_RLC_IRAM;
+                       info->fw = adev->gfx.rlc_fw;
+                       adev->firmware.fw_size +=
+                               ALIGN(le32_to_cpu(adev->gfx.rlc.rlc_iram_ucode_size_bytes), PAGE_SIZE);
+               }
+
+               if (adev->gfx.rlc.rlc_dram_ucode_size_bytes) {
+                       info = &adev->firmware.ucode[AMDGPU_UCODE_ID_RLC_DRAM];
+                       info->ucode_id = AMDGPU_UCODE_ID_RLC_DRAM;
+                       info->fw = adev->gfx.rlc_fw;
+                       adev->firmware.fw_size +=
+                               ALIGN(le32_to_cpu(adev->gfx.rlc.rlc_dram_ucode_size_bytes), PAGE_SIZE);
+               }
+       }

[Kevin]:
according to code logic in above, the following code is not needed to convert again.
ALIGN(le32_to_cpu(adev->gfx.rlc.rlc_dram_ucode_size_bytes), PAGE_SIZE);

Best Regards,
Kevin
+}
--
2.17.1

[-- Attachment #2: Type: text/html, Size: 8531 bytes --]

  reply	other threads:[~2022-09-19  2:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-15 17:01 [PATCH 00/10] switch to common helper for rlc fw init Hawking Zhang
2022-09-15 17:01 ` [PATCH 01/10] drm/amdgpu: add helper to init rlc fw in header v2_0 Hawking Zhang
2022-09-15 17:01 ` [PATCH 02/10] drm/amdgpu: add helper to init rlc fw in header v2_1 Hawking Zhang
2022-09-15 17:01 ` [PATCH 03/10] drm/amdgpu: add helper to init rlc fw in header v2_2 Hawking Zhang
2022-09-18 17:15   ` Wang, Yang(Kevin)
2022-09-19  2:31     ` Zhang, Hawking [this message]
2022-09-15 17:01 ` [PATCH 04/10] drm/amdgpu: add helper to init rlc fw in header v2_3 Hawking Zhang
2022-09-15 17:01 ` [PATCH 05/10] drm/amdgpu: add helper to init rlc fw in header v2_4 Hawking Zhang
2022-09-15 17:01 ` [PATCH 06/10] drm/amdgpu: add helper to init rlc firmware Hawking Zhang
2022-09-15 17:01 ` [PATCH 07/10] drm/amdgpu/gfx8: switch to amdgpu_gfx_rlc_init_microcode Hawking Zhang
2022-09-19  5:25   ` Wang, Yang(Kevin)
2022-09-15 17:01 ` [PATCH 08/10] drm/amdgpu/gfx9: " Hawking Zhang
2022-09-15 17:01 ` [PATCH 09/10] drm/amdgpu/gfx10: " Hawking Zhang
2022-09-23 21:36   ` Deucher, Alexander
2022-09-24  7:14     ` Zhang, Hawking
2022-09-28 17:40       ` Dmitry Osipenko
2022-09-28 17:44         ` Deucher, Alexander
2022-09-28 17:47           ` Dmitry Osipenko
2022-09-28 19:06             ` Dmitry Osipenko
2022-09-28 19:32               ` Alex Deucher
2022-09-29 18:08                 ` Dmitry Osipenko
2022-09-15 17:01 ` [PATCH 10/10] drm/amdgpu/gfx11: " Hawking Zhang
2022-09-15 17:13 ` [PATCH 00/10] switch to common helper for rlc fw init Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BN9PR12MB525727347B70EE24DAD3EC51FC4D9@BN9PR12MB5257.namprd12.prod.outlook.com \
    --to=hawking.zhang@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=KevinYang.Wang@amd.com \
    --cc=Likun.Gao@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.