[PATCH v4 3/6] tools: Add mkfwumdata tool for FWU metadata image

Michal Simek michal.simek at amd.com
Mon Apr 17 08:37:52 CEST 2023



On 4/14/23 17:02, Jassi Brar wrote:
> On Fri, Apr 14, 2023 at 8:53 AM Michal Simek <michal.simek at amd.com> wrote:
>>
>>
>>
>> On 4/10/23 06:05, Jassi Brar wrote:
>>> On Wed, 29 Mar 2023 at 07:29, Michal Simek <michal.simek at amd.com> wrote:
>>>> On 3/27/23 23:16, jassisinghbrar at gmail.com wrote:
>>>
>>>>> diff --git a/tools/mkfwumdata.c b/tools/mkfwumdata.c
>>>>> new file mode 100644
>>>>> index 0000000000..43dabf3b72
>>>>> --- /dev/null
>>>>> +++ b/tools/mkfwumdata.c
>>>>> @@ -0,0 +1,334 @@
>>>>> +// SPDX-License-Identifier: GPL-2.0+
>>>>> +/*
>>>>> + * Copyright (c) 2023, Linaro Limited
>>>>> + */
>>>>> +
>>>>> +#include <errno.h>
>>>>> +#include <getopt.h>
>>>>> +#include <limits.h>
>>>>> +#include <stdio.h>
>>>>> +#include <stdint.h>
>>>>> +#include <stdlib.h>
>>>>> +#include <string.h>
>>>>> +#include <u-boot/crc.h>
>>>>> +#include <unistd.h>
>>>>> +#include <uuid/uuid.h>
>>>>> +
>>>>> +/* This will dynamically allocate the fwu_mdata */
>>>>> +#define CONFIG_FWU_NUM_BANKS         0
>>>>> +#define CONFIG_FWU_NUM_IMAGES_PER_BANK       0
>>>>
>>>> These two are completely unused.
>>>>
>>> these are necessary for include/fwu_mdata.h that comes later.
>>
>> If that's come later, add it later.
>>
> Can you please actually look at the code to see the underlying constraint?

Ok. I misunderstand your comment.

You have it there because of #include <fwu_mdata.h> and using macros there.
Can you just allocated that structures at run time instead of statically defined 
them via array? That would clean that design and also fix checkpatch issue.

Thanks,
Michal

$ ./scripts/checkpatch.pl -f tools/mkfwumdata.c
ERROR: All CONFIG symbols are managed by Kconfig
#18: FILE: tools/mkfwumdata.c:18:
+#define CONFIG_FWU_NUM_BANKS		0

ERROR: All CONFIG symbols are managed by Kconfig
#19: FILE: tools/mkfwumdata.c:19:
+#define CONFIG_FWU_NUM_IMAGES_PER_BANK	0

total: 2 errors, 0 warnings, 0 checks, 334 lines checked


More information about the U-Boot mailing list