public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sean Anderson <seanga2@gmail.com>
To: Ralph Siemsen <ralph.siemsen@linaro.org>
Cc: andre.przywara@arm.com, heiko.thiery@gmail.com, pali@kernel.org,
	samuel@sholland.org, sjg@chromium.org, sr@denx.de,
	takahiro.akashi@linaro.org, u-boot@lists.denx.de,
	sean.anderson@seco.com
Subject: Re: [RFC PATCH v2 9/9] tools: spkgimage: add Renesas SPKG format
Date: Mon, 22 Aug 2022 23:42:54 -0400	[thread overview]
Message-ID: <0e426d60-e6a4-4f3f-7a55-8c3cf9d90e08@gmail.com> (raw)
In-Reply-To: <CANp-EDZ-xbiYq0p5LYOHG8Wgx1U-6pn+QzL31E8q5dXFQOENqg@mail.gmail.com>

On 8/16/22 10:33 AM, Ralph Siemsen wrote:
> Hi Sean,
> 
> I've implemented most of the suggestions. I will post an updated
> series, since it seems that sending v2 of just one patch has confused
> patchwork.
> 
> However so as not to entirely remove confusion, the updated series
> will be v3, since I already used v2 for the one patch. :-P
> 
> On Sat, Aug 13, 2022 at 9:45 PM Ralph Siemsen <ralph.siemsen@linaro.org> wrote:
>>>
>>> I wonder if you could just fill in the header directly. This is
>>> for a userspace tool, and this struct will be created at most
>>> once. It's OK to use 10 bytes :)
>>
>> I could fill the header directly, but I figured it would be cleaner to
>> keep the config file parsing separate from header generation.
> 
> Does it seem reasonable to keep these structures separated?

Yes, that is fine.

>>>> +static int spkgimage_verify_header(unsigned char *ptr, int size,
>>>> +                                struct image_tool_params *param)
>>>> +{
>>>> +     struct spkg_file *file = (struct spkg_file *)ptr;
>>>> +     struct spkg_hdr *header = (struct spkg_hdr *)ptr;
>>>> +     char signature[4] = SPKG_HEADER_SIGNATURE;
>>>
>>> If this naming does not come from documentation, I would suggest
>>> something like SPKG_HEADER_MAGIC, since this is not a signature,
>>> or even a CRC.
>>
>> The name does in fact come from the RZ/N1 documentation. However I
>> agree that SPKG_HEADER_MAGIC would better reflect what these bytes
>> actually are.
> 
> Upon checking the documentation, it turns out they use the term
> "marker" rather than "signature" for these bytes. So I have switched
> the code to match.

That sounds good.

>>>> +static int spkgimage_check_image_types(uint8_t type)
>>>> +{
>>>> +     return type == IH_TYPE_RENESAS_SPKG ? 0 : 1;
>>>
>>> This function is not necessary if you only support one type.
>>
>> Without this function, mkimage kept telling me that my format
>> (spkgimage) was not supported, and none of my callbacks got invoked.
>> It only complained when trying to generate a header. When listing the
>> supported formats, spkgimage showed up correctly.
>>
>> I'll take another look on Monday, maybe I missed something obvious.
> 
> I have re-checked this:
> - without the function, mkimage complains that spkgimage is unknown
> - with a function that unconditionally returns 0, it works fine
> 
> If it really is meant to work without the function, then a bug must
> have crept in elsewhere...

Huh. I did a quick grep so maybe I missed something. IMO this *should*
work without a function, because we have tons of drivers which just
have an equality check. In any case, you can just do

return type == IH_TYPE_RENESAS_SPKG ? 0 : -EINVAL;

--Sean


  reply	other threads:[~2022-08-23  3:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 12:59 [RFC PATCH v1 0/9] Renesas RZ/N1 SoC initial support Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 1/9] ARM: armv7: add non-SPL enable for Cortex SMPEN Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 2/9] clk: renesas: prepare for non-RCAR clock drivers Ralph Siemsen
2022-08-13  4:37   ` Sean Anderson
2022-08-09 12:59 ` [RFC PATCH v1 3/9] clk: renesas: add R906G032 driver Ralph Siemsen
2022-08-13  5:30   ` Sean Anderson
2022-08-15  2:48     ` Ralph Siemsen
2022-08-23  4:14       ` Sean Anderson
2022-08-26 15:47         ` Ralph Siemsen
2023-02-22 17:39           ` Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 4/9] pinctrl: " Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 5/9] ram: cadence: add driver for Cadence EDAC Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 6/9] dts: basic devicetree for Renesas RZ/N1 SoC Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 7/9] ARM: rzn1: basic support " Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 8/9] board: schneider: add LCES board support Ralph Siemsen
2022-08-09 12:59 ` [RFC PATCH v1 9/9] tools: Add tool to create Renesas SPKG images Ralph Siemsen
2022-08-09 13:03   ` Pali Rohár
2022-08-09 13:07     ` Pali Rohár
2022-08-09 15:54       ` Ralph Siemsen
2022-08-09 16:06         ` Pali Rohár
2022-08-09 17:02           ` Ralph Siemsen
2022-08-09 17:15         ` Sean Anderson
2022-08-12 17:00           ` Ralph Siemsen
2022-08-12 17:03   ` [RFC PATCH v2 9/9] tools: spkgimage: add Renesas SPKG format Ralph Siemsen
2022-08-13 14:47     ` Sean Anderson
2022-08-14  1:45       ` Ralph Siemsen
2022-08-16 14:33         ` Ralph Siemsen
2022-08-23  3:42           ` Sean Anderson [this message]
2022-08-26 15:01             ` Ralph Siemsen

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=0e426d60-e6a4-4f3f-7a55-8c3cf9d90e08@gmail.com \
    --to=seanga2@gmail.com \
    --cc=andre.przywara@arm.com \
    --cc=heiko.thiery@gmail.com \
    --cc=pali@kernel.org \
    --cc=ralph.siemsen@linaro.org \
    --cc=samuel@sholland.org \
    --cc=sean.anderson@seco.com \
    --cc=sjg@chromium.org \
    --cc=sr@denx.de \
    --cc=takahiro.akashi@linaro.org \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox