diff options
author | Nick Brassel <nick@tzarc.org> | 2022-11-12 10:57:44 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-11 23:57:44 +0000 |
commit | 092228571c40a31d88940055b4d2fa749f135314 (patch) | |
tree | e3cf8605a284ef7448f43a6f636c17271b4b8cd3 /builddefs | |
parent | 8c6d2946f7187ecc8ad53afa8f2365b352524459 (diff) |
Move EFL wear-leveling driver to be default for F1, F3, F4, L4, G4, WB32, GD32V. (#19020)
Diffstat (limited to 'builddefs')
-rw-r--r-- | builddefs/common_features.mk | 23 | ||||
-rw-r--r-- | builddefs/mcu_selection.mk | 7 |
2 files changed, 20 insertions, 10 deletions
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk index e597924469..c6a67ee87d 100644 --- a/builddefs/common_features.mk +++ b/builddefs/common_features.mk @@ -177,7 +177,7 @@ ifeq ($(strip $(QUANTUM_PAINTER_ENABLE)), yes) include $(QUANTUM_DIR)/painter/rules.mk endif -VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi wear_leveling +VALID_EEPROM_DRIVER_TYPES := vendor custom transient i2c spi wear_leveling legacy_stm32_flash EEPROM_DRIVER ?= vendor ifeq ($(filter $(EEPROM_DRIVER),$(VALID_EEPROM_DRIVER_TYPES)),) $(call CATASTROPHIC_ERROR,Invalid EEPROM_DRIVER,EEPROM_DRIVER="$(EEPROM_DRIVER)" is not a valid EEPROM driver) @@ -204,6 +204,12 @@ else OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_SPI QUANTUM_LIB_SRC += spi_master.c SRC += eeprom_driver.c eeprom_spi.c + else ifeq ($(strip $(EEPROM_DRIVER)), legacy_stm32_flash) + # STM32 Emulated EEPROM, backed by MCU flash (soon to be deprecated) + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED + COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash + COMMON_VPATH += $(DRIVER_PATH)/flash + SRC += eeprom_driver.c eeprom_stm32.c flash_stm32.c else ifeq ($(strip $(EEPROM_DRIVER)), transient) # Transient EEPROM implementation -- no data storage but provides runtime area for it OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_TRANSIENT @@ -214,20 +220,25 @@ else ifeq ($(PLATFORM),AVR) # Automatically provided by avr-libc, nothing required else ifeq ($(PLATFORM),CHIBIOS) - ifneq ($(filter STM32F3xx_% STM32F1xx_% %_STM32F401xC %_STM32F401xE %_STM32F405xG %_STM32F411xE %_STM32F072xB %_STM32F042x6 %_GD32VF103xB %_GD32VF103x8, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) - # Emulated EEPROM + ifneq ($(filter %_STM32F072xB %_STM32F042x6, $(MCU_SERIES)_$(MCU_LDSCRIPT)),) + # STM32 Emulated EEPROM, backed by MCU flash (soon to be deprecated) OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_STM32_FLASH_EMULATED COMMON_VPATH += $(PLATFORM_PATH)/$(PLATFORM_KEY)/$(DRIVER_DIR)/flash COMMON_VPATH += $(DRIVER_PATH)/flash SRC += eeprom_driver.c eeprom_stm32.c flash_stm32.c + else ifneq ($(filter $(MCU_SERIES),STM32F1xx STM32F3xx STM32F4xx STM32L4xx STM32G4xx WB32F3G71xx WB32FQ95xx GD32VF103),) + # Wear-leveling EEPROM implementation, backed by MCU flash + OPT_DEFS += -DEEPROM_DRIVER -DEEPROM_WEAR_LEVELING + SRC += eeprom_driver.c eeprom_wear_leveling.c + WEAR_LEVELING_DRIVER = embedded_flash else ifneq ($(filter $(MCU_SERIES),STM32L0xx STM32L1xx),) # 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 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 diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk index 0ea9630d59..de919bd263 100644 --- a/builddefs/mcu_selection.mk +++ b/builddefs/mcu_selection.mk @@ -348,8 +348,6 @@ ifneq ($(findstring STM32F401, $(MCU)),) # or <keyboard_dir>/ld/ ifeq ($(strip $(BOOTLOADER)), tinyuf2) MCU_LDSCRIPT ?= STM32F401xC_tinyuf2 - EEPROM_DRIVER ?= wear_leveling - WEAR_LEVELING_DRIVER ?= legacy else MCU_LDSCRIPT ?= STM32F401xC endif @@ -465,8 +463,6 @@ ifneq ($(findstring STM32F411, $(MCU)),) # or <keyboard_dir>/ld/ ifeq ($(strip $(BOOTLOADER)), tinyuf2) MCU_LDSCRIPT ?= STM32F411xE_tinyuf2 - EEPROM_DRIVER ?= wear_leveling - WEAR_LEVELING_DRIVER ?= legacy else MCU_LDSCRIPT ?= STM32F411xE endif @@ -520,6 +516,9 @@ ifneq ($(findstring STM32F446, $(MCU)),) # Bootloader address for STM32 DFU STM32_BOOTLOADER_ADDRESS ?= 0x1FFF0000 + + # Default as no chibios efl config + EEPROM_DRIVER ?= transient endif ifneq ($(findstring STM32G431, $(MCU)),) |