mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marco Felsch <m.felsch@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org, uol@pengutronix.de
Subject: Re: [PATCH master v1 2/6] firmware: turn missing firmware into linker error
Date: Thu, 29 Jun 2023 11:07:50 +0200	[thread overview]
Message-ID: <20230629090750.q2r5ler7ponpwchw@pengutronix.de> (raw)
In-Reply-To: <20230626153335.3592017-3-a.fatoum@pengutronix.de>

On 23-06-26, Ahmad Fatoum wrote:
> Appending to firmware-y results in an assembly file being generated that
> defines a section embedding the firmware in question verbatim via .incbin.
> To update the assembly file as required, the target has a dependency on
> the firmware. When the firmware is missing, the build will abort there.
> 
> In preparation for deferring missing PBL firmware errors till the very
> end, let's remove the firmware dependency if the missing firmware file
> is built into PBL and replace the .incbin with a reference to an ultimately
> undefined variable.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>

Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>

> ---
>  firmware/Makefile | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/firmware/Makefile b/firmware/Makefile
> index 8050d0418d33..c66d19c677e8 100644
> --- a/firmware/Makefile
> +++ b/firmware/Makefile
> @@ -41,6 +41,7 @@ obj-pbl-y := $(addsuffix .gen.o, $(firmware-y))
>  
>  FWNAME    = $(patsubst $(obj)/%.extgen.S,%,$(patsubst $(obj)/%.gen.S,%,$@))
>  FWSTR     = $(subst /,_,$(subst .,_,$(subst -,_,$(FWNAME))))
> +FWNAME_EXISTS = $(if $(wildcard $(fwdir)/$(FWNAME)),1,0)
>  
>  filechk_fwbin = { \
>  	echo "/* Generated by $(src)/Makefile */"		;\
> @@ -50,7 +51,11 @@ filechk_fwbin = { \
>  	echo "    .p2align $(ASM_LGPTR)"			;\
>  	echo ".global _fw_$(FWSTR)_start"			;\
>  	echo "_fw_$(FWSTR)_start:"				;\
> +	echo "\#if $(FWNAME_EXISTS)"				;\
>  	echo "    .incbin \"$(fwdir)/$(FWNAME)\""		;\
> +	echo "\#else"						;\
> +	echo "ASM_PTR _fwname_$(FWSTR)"				;\
> +	echo "\#endif"						;\
>  	echo ".global _fw_$(FWSTR)_end"				;\
>  	echo "_fw_$(FWSTR)_end:"				;\
>  }
> @@ -88,7 +93,7 @@ clean-files += *.sha.bin *.sum
>  $(patsubst %.gen.o,$(obj)/%.gen.o, $(obj-pbl-y)): $(obj)/%.gen.o: $(fwdir)/%
>  
>  # The same for pbl:
> -$(patsubst %.gen.o,$(obj)/%.gen.pbl.o, $(obj-pbl-y)): $(obj)/%.gen.pbl.o: $(fwdir)/%
> +$(patsubst %.gen.o,$(obj)/%.gen.pbl.o, $(obj-pbl-y)): $(obj)/%.gen.pbl.o: $(wildcard $(fwdir)/%)
>  $(patsubst %.gen.o,$(obj)/%.extgen.pbl.o, $(pbl-y)): $(obj)/%.extgen.pbl.o: $(fwdir)/%
>  
>  pbl-y := $(addsuffix .extgen.o, $(fw-external-y))
> -- 
> 2.39.2
> 
> 
> 



  reply	other threads:[~2023-06-29  9:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-26 15:33 [PATCH master v1 0/6] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-06-26 15:33 ` [PATCH master v1 1/6] firmware: reference pointer alignment defined in <asm-generic/pointer.h> Ahmad Fatoum
2023-06-29  8:57   ` Marco Felsch
2023-06-26 15:33 ` [PATCH master v1 2/6] firmware: turn missing firmware into linker error Ahmad Fatoum
2023-06-29  9:07   ` Marco Felsch [this message]
2023-06-26 15:33 ` [PATCH master v1 3/6] firmware: optionally turn missing firmware errors into warnings Ahmad Fatoum
2023-07-03  6:25   ` Marco Felsch
2023-07-03  8:45     ` Ahmad Fatoum
2023-06-26 15:33 ` [PATCH master v1 4/6] ARM: Rockchip: gracefully handle missing firmware Ahmad Fatoum
2023-06-26 15:33 ` [PATCH master v1 5/6] ARM64: unset CONFIG_MISSING_FIRMWARE_ERROR for Rockchip/i.MX Ahmad Fatoum
2023-07-03  6:33   ` Marco Felsch
2023-07-03  8:46     ` Ahmad Fatoum
2023-06-26 15:33 ` [PATCH master v1 6/6] firmware: don't hardcode firmware paths in srctree for existence check Ahmad Fatoum
2023-07-03  6:34   ` Marco Felsch

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=20230629090750.q2r5ler7ponpwchw@pengutronix.de \
    --to=m.felsch@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=uol@pengutronix.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