summaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-07-02 15:18:50 +1000
committerGitHub <noreply@github.com>2022-07-02 15:18:50 +1000
commit5846b40f7444af96b0d8ddf3af9b558193c2475d (patch)
tree7bec13529ef3654ed290e68617eb1c659c05a49d /builddefs
parent9f1c4f304d0597b7024d079eb358bb0c71be3ce8 (diff)
downloadqmk_firmware-5846b40f7444af96b0d8ddf3af9b558193c2475d.tar.gz
qmk_firmware-5846b40f7444af96b0d8ddf3af9b558193c2475d.zip
RP2040 emulated EEPROM. (#17519)
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/common_features.mk10
-rw-r--r--builddefs/mcu_selection.mk2
2 files changed, 10 insertions, 2 deletions
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 2edc1bdef0..c11e5688e3 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -220,6 +220,11 @@ else
# True EEPROM on STM32L0xx, L1xx
OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_L0_L1
SRC += eeprom_driver.c eeprom_stm32_L0_L1.c
+ else ifneq ($(filter $(MCU_SERIES),RP2040),)
+ # Wear-leveling EEPROM implementation, backed by RP2040 flash
+ OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING
+ SRC += eeprom_driver.c eeprom_wear_leveling.c
+ WEAR_LEVELING_DRIVER = rp2040_flash
else ifneq ($(filter $(MCU_SERIES),KL2x K20x),)
# Teensy EEPROM implementations
OPT_DEFS += -DEEPROM_TEENSY
@@ -241,7 +246,7 @@ else
endif
endif
-VALID_WEAR_LEVELING_DRIVER_TYPES := custom embedded_flash spi_flash legacy
+VALID_WEAR_LEVELING_DRIVER_TYPES := custom embedded_flash spi_flash rp2040_flash legacy
WEAR_LEVELING_DRIVER ?= none
ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none)
ifeq ($(filter $(WEAR_LEVELING_DRIVER),$(VALID_WEAR_LEVELING_DRIVER_TYPES)),)
@@ -262,6 +267,9 @@ ifneq ($(strip $(WEAR_LEVELING_DRIVER)),none)
FLASH_DRIVER := spi
SRC += wear_leveling_flash_spi.c
POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_flash_spi_config.h
+ else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), rp2040_flash)
+ SRC += wear_leveling_rp2040_flash.c
+ POST_CONFIG_H += $(DRIVER_PATH)/wear_leveling/wear_leveling_rp2040_flash_config.h
else ifeq ($(strip $(WEAR_LEVELING_DRIVER)), legacy)
COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash
SRC += flash_stm32.c wear_leveling_legacy.c
diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk
index d676e0c06a..135f663c14 100644
--- a/builddefs/mcu_selection.mk
+++ b/builddefs/mcu_selection.mk
@@ -135,7 +135,7 @@ ifneq ($(findstring RP2040, $(MCU)),)
# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
# or <keyboard_dir>/ld/
STARTUPLD_CONTRIB = $(CHIBIOS_CONTRIB)/os/common/startup/ARMCMx/compilers/GCC/ld
- MCU_LDSCRIPT ?= RP2040_FLASH
+ MCU_LDSCRIPT ?= RP2040_FLASH_TIMECRIT
LDFLAGS += -L $(STARTUPLD_CONTRIB)
# Startup code to use