From: Michael Brown Date: Tue, 13 May 2025 17:25:24 +0000 (+0100) Subject: [riscv] Add a .pf32 build target for padded parallel flash images X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=d1c1e578af900d3b975635ef3cf9410b24590ef3;p=thirdparty%2Fipxe.git [riscv] Add a .pf32 build target for padded parallel flash images QEMU's -pflash option requires an image that has been padded to the exact expected size (32MB for all of the supported RISC-V virtual machines). Add a .pf32 build target which is simply the equivalent .sbi target padded to 32MB in size, to simplify testing. Signed-off-by: Michael Brown --- diff --git a/src/Makefile b/src/Makefile index be5c7fda6..6367b13ea 100644 --- a/src/Makefile +++ b/src/Makefile @@ -26,6 +26,7 @@ PRINTF := printf PERL := perl PYTHON := python TRUE := true +TRUNCATE := truncate CC = $(CROSS_COMPILE)gcc CPP = $(CC) -E AS = $(CROSS_COMPILE)as diff --git a/src/arch/riscv/Makefile.sbi b/src/arch/riscv/Makefile.sbi index 2546366b2..d748ef42e 100644 --- a/src/arch/riscv/Makefile.sbi +++ b/src/arch/riscv/Makefile.sbi @@ -15,3 +15,10 @@ LDSCRIPT = arch/riscv/scripts/sbi.lds # MEDIA += sbi MEDIA += lkrn + +# Padded flash device images (e.g. for QEMU's -pflash option) +# +NON_AUTO_MEDIA += pf32 +%.pf32 : %.sbi $(MAKEDEPS) + $(Q)$(CP) $< $@ + $(Q)$(TRUNCATE) -s 32M $@