All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Josh Boyer <jwboyer@kernel.org>
Cc: linux-firmware@kernel.org, Rob Clark <robdclark@gmail.com>,
	Jonathan Marek <jonathan@marek.ca>,
	Fabio Estevam <festevam@gmail.com>
Subject: Re: [PATCH] qcom: add firmware files for Adreno A200
Date: Wed, 11 Jan 2023 17:17:24 +0200	[thread overview]
Message-ID: <d6aa1de2-55c5-c9cd-76f6-d94e91ca4e84@linaro.org> (raw)
In-Reply-To: <CA+5PVA5ZXLZM=iVvr9tMSGeRbRLgzuODt4bkt+ZvMnzF50MU3w@mail.gmail.com>

On 11/01/2023 14:51, Josh Boyer wrote:
> On Mon, Jan 2, 2023 at 8:14 AM Dmitry Baryshkov
> <dmitry.baryshkov@linaro.org> wrote:
>>
>> Add firmware files for Adreno A20x (codenamed yamato), found in
>> Freescale i.MX51/i.MX53 and in some prehistoric Qualcomm Snapdragon
>> SoCs.
>>
>> The firmware were generated from the header files from EfikaMX kernel
>> sources ([1]), which bear copyright by QUALCOMM Incorporated and have
>> BSD-3-Clause licence.
> 
> How did you generate it?

I hope you don't mind putting the program here.

// SPDX-License-Identifier: BSD-3-Clause
/*
  * Copyright (C) 2022 Linaro Ltd.
  * Author: Dmitry Baryshkov
  */

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <errno.h>
#include <unistd.h>

typedef uint32_t uint32;

#include "pm4_microcode.inl"
#include "pfp_microcode_nrt.inl"

int dump(const char *name, uint32_t *data, size_t n)
{
	FILE *f;
	int ret;
	uint32_t zero = 0;

	f = fopen(name, "w");
	if (!f) {
		fprintf(stderr, "fopen: %s: %s\n", name, strerror(errno));
		return 1;
	}

	if (fwrite(&zero, 4, 1, f) != 1) {
		fprintf(stderr, "error writing data\n");
		fclose(f);
		unlink(name);
		return 1;
	}

	ret = fwrite(data, 4, n, f);
	if (ret != n) {
		fprintf(stderr, "error writing data\n");
		fclose(f);
		unlink(name);
		return 1;
	}

	fclose(f);

	return 0;
}

int main(int argc, char **argv)
{

	if (argc != 3) {
		fprintf(stderr, "Usage: %s <pfp> <pm4>\n", argv[0]);
		return 1;
	}

	if (dump(argv[1], aPFP_Microcode_nrt, PFP_MICROCODE_SIZE_NRT))
		return 1;

	if (dump(argv[2], &aPM4_Microcode[0][0], PM4_MICROCODE_SIZE * 3))
		return 1;

	return 0;
}


> 
> josh
> 
>> [1] https://github.com/genesi/linux-legacy/tree/master/drivers/mxc/amd-gpu
>>
>> Cc: Rob Clark <robdclark@gmail.com>
>> Cc: Jonathan Marek <jonathan@marek.ca>
>> Cc: Fabio Estevam <festevam@gmail.com>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> ---
>>
>> Note: the following patch needs to be applied to get this firmware to
>> work. It is most likely to find its way into the 6.3 kernel.
>>
>> https://lore.kernel.org/dri-devel/20230101155753.779176-1-dmitry.baryshkov@linaro.org/
>>
>> ---
>>   LICENSE.qcom_yamato |  25 +++++++++++++++++++++++++
>>   WHENCE              |  13 +++++++++++++
>>   qcom/yamato_pfp.fw  | Bin 0 -> 1156 bytes
>>   qcom/yamato_pm4.fw  | Bin 0 -> 9220 bytes
>>   4 files changed, 38 insertions(+)
>>   create mode 100644 LICENSE.qcom_yamato
>>   create mode 100644 qcom/yamato_pfp.fw
>>   create mode 100644 qcom/yamato_pm4.fw
>>
>> diff --git a/LICENSE.qcom_yamato b/LICENSE.qcom_yamato
>> new file mode 100644
>> index 000000000000..1fd702bb9264
>> --- /dev/null
>> +++ b/LICENSE.qcom_yamato
>> @@ -0,0 +1,25 @@
>> +Copyright (c) 2008-2011, QUALCOMM Incorporated. All rights reserved.
>> +
>> +Redistribution and use in source and binary forms, with or without
>> +modification, are permitted provided that the following conditions are met:
>> +    * Redistributions of source code must retain the above copyright
>> +      notice, this list of conditions and the following disclaimer.
>> +    * Redistributions in binary form must reproduce the above copyright
>> +      notice, this list of conditions and the following disclaimer in the
>> +      documentation and/or other materials provided with the distribution.
>> +    * Neither the name of QUALCOMM Incorporated nor
>> +      the names of its contributors may be used to endorse or promote
>> +      products derived from this software without specific prior written
>> +      permission.
>> +
>> +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
>> +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
>> +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
>> +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
>> +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
>> +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
>> +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
>> +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
>> +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
>> +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
>> +POSSIBILITY OF SUCH DAMAGE.
>> diff --git a/WHENCE b/WHENCE
>> index f31fa308cc89..f14730a31368 100644
>> --- a/WHENCE
>> +++ b/WHENCE
>> @@ -5742,6 +5742,19 @@ https://developer.qualcomm.com/hardware/dragonboard-410c/tools
>>
>>   --------------------------------------------------------------------------
>>
>> +Driver: adreno - Qualcomm Adreno GPU firmware
>> +
>> +File: qcom/yamato_pfp.fw
>> +File: qcom/yamato_pm4.fw
>> +
>> +Licence: Redistributable, BSD-3-Clause licence, See LICENSE.qcom_yamato
>> +
>> +Binary files generated from header files in EfikaMX kernel sources. A prefix of
>> +four zero bytes was prepended to make them work with the DRM MSM driver. See
>> +https://github.com/genesi/linux-legacy/tree/master/drivers/mxc/amd-gpu
>> +

-- 
With best wishes
Dmitry


  reply	other threads:[~2023-01-11 15:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-02 13:14 [PATCH] qcom: add firmware files for Adreno A200 Dmitry Baryshkov
2023-01-02 16:11 ` Dmitry Baryshkov
2023-01-11 12:51 ` Josh Boyer
2023-01-11 15:17   ` Dmitry Baryshkov [this message]
2023-01-17 12:55     ` Josh Boyer
2023-01-17 12:56       ` Dmitry Baryshkov
  -- strict thread matches above, loose matches on Subject: below --
2019-09-04 11:26 [PATCH] qcom: Add " Fabio Estevam
2019-09-04 12:09 ` Nicolas Dechesne
2019-09-04 14:39   ` Rob Clark
2019-09-04 15:34   ` Josh Boyer
2019-09-06 15:09     ` Chris Healy
2019-09-06 15:27       ` Nicolas Dechesne

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=d6aa1de2-55c5-c9cd-76f6-d94e91ca4e84@linaro.org \
    --to=dmitry.baryshkov@linaro.org \
    --cc=festevam@gmail.com \
    --cc=jonathan@marek.ca \
    --cc=jwboyer@kernel.org \
    --cc=linux-firmware@kernel.org \
    --cc=robdclark@gmail.com \
    /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.