All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Evan Quan <evan.quan-5C7GfCeVMHo@public.gmane.org>
Cc: "Deucher,
	Alexander" <alexander.deucher-5C7GfCeVMHo@public.gmane.org>,
	Feifei Xu <feifei.xu-5C7GfCeVMHo@public.gmane.org>,
	candice.li-5C7GfCeVMHo@public.gmane.org,
	amd-gfx list
	<amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org>
Subject: Re: [PATCH] drm/amdgpu: add Vega20 PSP ASD firmware loading
Date: Thu, 20 Dec 2018 09:59:38 -0500	[thread overview]
Message-ID: <CADnq5_N4Q0LhH9efiWkJ-teFgdoGA2V+uzVKQUGWnF-9_VM5UQ@mail.gmail.com> (raw)
In-Reply-To: <20181220145011.15765-1-evan.quan-5C7GfCeVMHo@public.gmane.org>

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>

On Thu, Dec 20, 2018 at 9:50 AM Evan Quan <evan.quan@amd.com> wrote:
>
> Add PSP ASD firmware loading on Vega20. Not sure why
> this was missing before.
>
> Change-Id: I047bee28323b5b3bf54b4eec6f7089406b2e07e1
> Signed-off-by: Evan Quan <evan.quan@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 40 ++++++++++++++++++++------
>  1 file changed, 31 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> index 138d552bb022..0c6e7f9b143f 100644
> --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
> @@ -34,6 +34,7 @@
>  #include "nbio/nbio_7_4_offset.h"
>
>  MODULE_FIRMWARE("amdgpu/vega20_sos.bin");
> +MODULE_FIRMWARE("amdgpu/vega20_asd.bin");
>  MODULE_FIRMWARE("amdgpu/vega20_ta.bin");
>
>  /* address block */
> @@ -100,6 +101,7 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
>         char fw_name[30];
>         int err = 0;
>         const struct psp_firmware_header_v1_0 *sos_hdr;
> +       const struct psp_firmware_header_v1_0 *asd_hdr;
>         const struct ta_firmware_header_v1_0 *ta_hdr;
>
>         DRM_DEBUG("\n");
> @@ -132,14 +134,30 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
>         adev->psp.sos_start_addr = (uint8_t *)adev->psp.sys_start_addr +
>                                 le32_to_cpu(sos_hdr->sos_offset_bytes);
>
> +       snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_asd.bin", chip_name);
> +       err = request_firmware(&adev->psp.asd_fw, fw_name, adev->dev);
> +       if (err)
> +               goto out1;
> +
> +       err = amdgpu_ucode_validate(adev->psp.asd_fw);
> +       if (err)
> +               goto out1;
> +
> +       asd_hdr = (const struct psp_firmware_header_v1_0 *)adev->psp.asd_fw->data;
> +       adev->psp.asd_fw_version = le32_to_cpu(asd_hdr->header.ucode_version);
> +       adev->psp.asd_feature_version = le32_to_cpu(asd_hdr->ucode_feature_version);
> +       adev->psp.asd_ucode_size = le32_to_cpu(asd_hdr->header.ucode_size_bytes);
> +       adev->psp.asd_start_addr = (uint8_t *)asd_hdr +
> +                               le32_to_cpu(asd_hdr->header.ucode_array_offset_bytes);
> +
>         snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name);
>         err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev);
>         if (err)
> -               goto out;
> +               goto out2;
>
>         err = amdgpu_ucode_validate(adev->psp.ta_fw);
>         if (err)
> -               goto out;
> +               goto out2;
>
>         ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data;
>         adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version);
> @@ -148,14 +166,18 @@ static int psp_v11_0_init_microcode(struct psp_context *psp)
>                 le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes);
>
>         return 0;
> +
> +out2:
> +       release_firmware(adev->psp.ta_fw);
> +       adev->psp.ta_fw = NULL;
> +out1:
> +       release_firmware(adev->psp.asd_fw);
> +       adev->psp.asd_fw = NULL;
>  out:
> -       if (err) {
> -               dev_err(adev->dev,
> -                       "psp v11.0: Failed to load firmware \"%s\"\n",
> -                       fw_name);
> -               release_firmware(adev->psp.sos_fw);
> -               adev->psp.sos_fw = NULL;
> -       }
> +       dev_err(adev->dev,
> +               "psp v11.0: Failed to load firmware \"%s\"\n", fw_name);
> +       release_firmware(adev->psp.sos_fw);
> +       adev->psp.sos_fw = NULL;
>
>         return err;
>  }
> --
> 2.20.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

      parent reply	other threads:[~2018-12-20 14:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-20 14:50 [PATCH] drm/amdgpu: add Vega20 PSP ASD firmware loading Evan Quan
     [not found] ` <20181220145011.15765-1-evan.quan-5C7GfCeVMHo@public.gmane.org>
2018-12-20 14:59   ` Alex Deucher [this message]

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=CADnq5_N4Q0LhH9efiWkJ-teFgdoGA2V+uzVKQUGWnF-9_VM5UQ@mail.gmail.com \
    --to=alexdeucher-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=alexander.deucher-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    --cc=candice.li-5C7GfCeVMHo@public.gmane.org \
    --cc=evan.quan-5C7GfCeVMHo@public.gmane.org \
    --cc=feifei.xu-5C7GfCeVMHo@public.gmane.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.