summaryrefslogtreecommitdiff
path: root/builddefs
diff options
context:
space:
mode:
Diffstat (limited to 'builddefs')
-rw-r--r--builddefs/bootloader.mk4
-rw-r--r--builddefs/common_features.mk4
-rw-r--r--builddefs/mcu_selection.mk35
3 files changed, 41 insertions, 2 deletions
diff --git a/builddefs/bootloader.mk b/builddefs/bootloader.mk
index eba8e280e4..3d4c03b01c 100644
--- a/builddefs/bootloader.mk
+++ b/builddefs/bootloader.mk
@@ -200,6 +200,10 @@ ifeq ($(strip $(BOOTLOADER)), tinyuf2)
OPT_DEFS += -DBOOTLOADER_TINYUF2
BOOTLOADER_TYPE = tinyuf2
endif
+ifeq ($(strip $(BOOTLOADER)), rp2040)
+ OPT_DEFS += -DBOOTLOADER_RP2040
+ BOOTLOADER_TYPE = rp2040
+endif
ifeq ($(strip $(BOOTLOADER)), halfkay)
OPT_DEFS += -DBOOTLOADER_HALFKAY
BOOTLOADER_TYPE = halfkay
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index b447c6743d..2edc1bdef0 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -547,7 +547,7 @@ ifeq ($(strip $(BACKLIGHT_ENABLE)), yes)
endif
endif
-VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c
+VALID_WS2812_DRIVER_TYPES := bitbang pwm spi i2c vendor
WS2812_DRIVER ?= bitbang
ifeq ($(strip $(WS2812_DRIVER_REQUIRED)), yes)
@@ -637,7 +637,7 @@ ifneq ($(strip $(DEBOUNCE_TYPE)), custom)
endif
-VALID_SERIAL_DRIVER_TYPES := bitbang usart
+VALID_SERIAL_DRIVER_TYPES := bitbang usart vendor
SERIAL_DRIVER ?= bitbang
ifeq ($(filter $(SERIAL_DRIVER),$(VALID_SERIAL_DRIVER_TYPES)),)
diff --git a/builddefs/mcu_selection.mk b/builddefs/mcu_selection.mk
index d5fb731e08..d676e0c06a 100644
--- a/builddefs/mcu_selection.mk
+++ b/builddefs/mcu_selection.mk
@@ -116,6 +116,41 @@ ifneq ($(findstring MK66FX1M0, $(MCU)),)
BOARD ?= PJRC_TEENSY_3_6
endif
+ifneq ($(findstring RP2040, $(MCU)),)
+ # Cortex version
+ MCU = cortex-m0plus
+
+ # ARM version, CORTEX-M0/M1 are 6, CORTEX-M3/M4/M7 are 7
+ CHIBIOS_PORT = ARMv6-M-RP2
+
+ ## chip/board settings
+ # - the next two should match the directories in
+ # <chibios[-contrib]>/os/hal/ports/$(MCU_PORT_NAME)/$(MCU_SERIES)
+ # OR
+ # <chibios[-contrib]>/os/hal/ports/$(MCU_FAMILY)/$(MCU_SERIES)
+ MCU_FAMILY = RP
+ MCU_SERIES = RP2040
+
+ # Linker script to use
+ # - 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
+ LDFLAGS += -L $(STARTUPLD_CONTRIB)
+
+ # Startup code to use
+ # - it should exist in <chibios>/os/common/startup/ARMCMx/compilers/GCC/mk/
+ MCU_STARTUP ?= rp2040
+
+ # Board: it should exist either in <chibios>/os/hal/boards/,
+ # <keyboard_dir>/boards/, or drivers/boards/
+ BOARD ?= GENERIC_PROMICRO_RP2040
+
+ # Default UF2 Bootloader settings
+ UF2_FAMILY ?= RP2040
+ FIRMWARE_FORMAT ?= uf2
+endif
+
ifneq ($(findstring STM32F042, $(MCU)),)
# Cortex version
MCU = cortex-m0