Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Ceresoli via buildroot <buildroot@buildroot.org>
To: "Frager, Neal" <neal.frager@amd.com>
Cc: Brandon Maier <brandon.maier@collins.com>,
	"buildroot@buildroot.org" <buildroot@buildroot.org>
Subject: Re: [Buildroot] [PATCH 1/1] boot/uboot/uboot.mk: support binary pm_cfg_obj
Date: Mon, 12 Dec 2022 10:35:08 +0100	[thread overview]
Message-ID: <20221212103508.7855148f@booty> (raw)
In-Reply-To: <CH2PR12MB500455907F9D4CB0D5CFAA90F01F9@CH2PR12MB5004.namprd12.prod.outlook.com>

Hello Brandon, Neal,

On Sat, 10 Dec 2022 09:55:01 +0000
"Frager, Neal" <neal.frager@amd.com> wrote:

> Hi Brandon,
> 
> > BR2_TARGET_UBOOT_ZYNQMP_PM_CFG only works with C files, as it always tries to process them through tools/zynqmp_pm_cfg_obj_convert.py. Rework the logic so if the pm_cfg_obj isn't a C file, it is provided directly to U-Boot.  
> 
> Good idea to add this support.  It is true that since developers cannot build the pmufw with buildroot, it makes sense that they may also
> build the pm_cfg_obj.bin binary outside of buildroot as well.
> 
> 
> > +	$(if $(filter %.c,$(UBOOT_ZYNQMP_PM_CFG_PATH)),
> > +		$(UBOOT_DIR)/tools/zynqmp_pm_cfg_obj_convert.py $(UBOOT_ZYNQMP_PM_CFG_BASENAME).c $(UBOOT_ZYNQMP_PM_CFG_BASENAME).bin
> > +		$(call KCONFIG_SET_OPT,CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE,"$(UBOOT_ZYNQMP_PM_CFG_BASENAME).bin"),
> > +		$(call KCONFIG_SET_OPT,CONFIG_ZYNQMP_SPL_PM_CFG_OBJ_FILE,"$(UBOOT_ZYNQMP_PM_CFG_PATH)"))
> >  endef  
> 
> Just a question to the community.  Should we handle the error when a user configures the BR2_TARGET_UBOOT_ZYNQMP_PM_CFG to be a file
> that is not a c file nor a binary file?  With the above if statement, the file would get fed directly into u-boot and the build process will succeed.
> However, the user will get a run-time error at boot time when the spl attempts to load an invalid pmu configuration blob.
> 
> In the previous version, when we only accepted c files, the zynqmp_pm_cfg_obj_convert.py would error out causing a build failure if the input
> file was not an expected pm_cfg_obj.c file.
> 
> So the question is which is better.  If the user configures an invalid file format, should there be a build failure or a run-time boot failure?

How would you detect which binary is "valid"? It's a pretty fuzzy
definition.

We definitely don't check the validity of other binaries the user wants
to use (the pmufw to name one), which makes sense as Buildroot users
need to understand what they are doing after all.

-- 
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  reply	other threads:[~2022-12-12  9:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-09 19:40 [Buildroot] [PATCH 1/1] boot/uboot/uboot.mk: support binary pm_cfg_obj Brandon Maier via buildroot
2022-12-10  9:55 ` Frager, Neal via buildroot
2022-12-12  9:35   ` Luca Ceresoli via buildroot [this message]
2022-12-12  9:43     ` Frager, Neal via buildroot
2022-12-12  9:31 ` Luca Ceresoli via buildroot
2022-12-12 12:52   ` Frager, Neal via buildroot
2022-12-13  8:23     ` Luca Ceresoli via buildroot
2022-12-12 15:41   ` [Buildroot] [External] " Maier, Brandon L Collins via buildroot
2022-12-13  8:21     ` Luca Ceresoli via buildroot
2022-12-22 14:37     ` Frager, Neal via buildroot
2022-12-29 22:42       ` Luca Ceresoli via buildroot

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=20221212103508.7855148f@booty \
    --to=buildroot@buildroot.org \
    --cc=brandon.maier@collins.com \
    --cc=luca.ceresoli@bootlin.com \
    --cc=neal.frager@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox