diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2022-06-18 19:23:42 +0300 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2022-06-20 20:03:58 +0300 |
commit | 9e52dc337fdae5f4cb98744f75cdcd61a1fa2c07 (patch) | |
tree | 026f7005a0ddb7fc91e2746714b23a373399ee2d | |
parent | 52a8afba43e4997764283b868c017bc261a56896 (diff) |
rp2040: Add options to Kconfig for "stage2" flash chip options
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | src/rp2040/Kconfig | 14 | ||||
-rw-r--r-- | src/rp2040/Makefile | 5 |
2 files changed, 17 insertions, 2 deletions
diff --git a/src/rp2040/Kconfig b/src/rp2040/Kconfig index 2b604e8c6..95db68bca 100644 --- a/src/rp2040/Kconfig +++ b/src/rp2040/Kconfig @@ -47,6 +47,20 @@ config FLASH_START hex default 0x10000000 + +###################################################################### +# Bootloader options +###################################################################### + +config RP2040_STAGE2_FILE + string + default "boot2_w25q080.S" + +config RP2040_STAGE2_CLKDIV + int + default 2 + + ###################################################################### # Communication inteface ###################################################################### diff --git a/src/rp2040/Makefile b/src/rp2040/Makefile index f15302d18..ffc2c4c86 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 |