aboutsummaryrefslogtreecommitdiffstats
path: root/src/rp2040/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'src/rp2040/Makefile')
-rw-r--r--src/rp2040/Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile
index f15302d1..ffc2c4c8 100644
--- a/src/rp2040/Makefile
+++ b/src/rp2040/Makefile
@@ -24,9 +24,10 @@ src-$(CONFIG_HAVE_GPIO_SPI) += rp2040/spi.c
src-$(CONFIG_HAVE_GPIO_I2C) += rp2040/i2c.c
# rp2040 stage2 building
-$(OUT)stage2.o: lib/rp2040/boot_stage2/boot2_w25q080.S
+STAGE2_FILE := $(shell echo $(CONFIG_RP2040_STAGE2_FILE))
+$(OUT)stage2.o: lib/rp2040/boot_stage2/$(STAGE2_FILE) $(OUT)autoconf.h
@echo " Building rp2040 stage2 $@"
- $(Q)$(CC) $(CFLAGS) -Ilib/rp2040/boot_stage2 -Ilib/rp2040/boot_stage2/asminclude -DPICO_FLASH_SPI_CLKDIV=2 -c $< -o $(OUT)stage2raw1.o
+ $(Q)$(CC) $(CFLAGS) -Ilib/rp2040/boot_stage2 -Ilib/rp2040/boot_stage2/asminclude -DPICO_FLASH_SPI_CLKDIV=$(CONFIG_RP2040_STAGE2_CLKDIV) -c $< -o $(OUT)stage2raw1.o
$(Q)$(LD) $(OUT)stage2raw1.o --script=lib/rp2040/boot_stage2/boot_stage2.ld -o $(OUT)stage2raw.o
$(Q)$(OBJCOPY) -O binary $(OUT)stage2raw.o $(OUT)stage2raw.bin
$(Q)lib/rp2040/boot_stage2/pad_checksum -s 0xffffffff $(OUT)stage2raw.bin $(OUT)stage2.S