aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootloader.mk15
-rw-r--r--keyboards/ergodox_infinity/bootloader_defs.h1
-rw-r--r--keyboards/ergodox_infinity/rules.mk19
-rw-r--r--keyboards/infinity60/bootloader_defs.h1
-rw-r--r--keyboards/infinity60/rules.mk18
-rw-r--r--keyboards/k_type/bootloader_defs.h1
-rw-r--r--keyboards/k_type/rules.mk18
-rw-r--r--keyboards/whitefox/bootloader_defs.h1
-rw-r--r--keyboards/whitefox/rules.mk18
-rw-r--r--quantum/mcu_selection.mk2
-rw-r--r--tmk_core/chibios.mk2
-rw-r--r--tmk_core/common/chibios/bootloader.c6
12 files changed, 28 insertions, 74 deletions
diff --git a/bootloader.mk b/bootloader.mk
index e516e9ff9..d5f803f89 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -27,6 +27,7 @@
27# qmk-dfu QMK DFU (LUFA + blinkenlight) 27# qmk-dfu QMK DFU (LUFA + blinkenlight)
28# bootloadHID HIDBootFlash compatible (ATmega32A) 28# bootloadHID HIDBootFlash compatible (ATmega32A)
29# USBasp USBaspLoader (ATmega328P) 29# USBasp USBaspLoader (ATmega328P)
30# kiibohd Input:Club Kiibohd bootloader (only used on their boards)
30# 31#
31# BOOTLOADER_SIZE can still be defined manually, but it's recommended 32# BOOTLOADER_SIZE can still be defined manually, but it's recommended
32# you add any possible configuration to this list 33# you add any possible configuration to this list
@@ -89,7 +90,19 @@ ifeq ($(strip $(BOOTLOADER)), lufa-ms)
89 BOOTLOADER_SIZE = 6144 90 BOOTLOADER_SIZE = 6144
90 FIRMWARE_FORMAT = bin 91 FIRMWARE_FORMAT = bin
91endif 92endif
92
93ifdef BOOTLOADER_SIZE 93ifdef BOOTLOADER_SIZE
94 OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) 94 OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
95endif 95endif
96
97ifeq ($(strip $(BOOTLOADER)), kiibohd)
98 OPT_DEFS += -DBOOTLOADER_KIIBOHD
99 ifeq ($(strip $(MCU_ORIG)), MK20DX128)
100 MCU_LDSCRIPT = MK20DX128BLDR4
101 endif
102 ifeq ($(strip $(MCU_ORIG)), MK20DX256)
103 MCU_LDSCRIPT = MK20DX256BLDR8
104 endif
105
106 DFU_ARGS = -d 1C11:B007
107 DFU_SUFFIX_ARGS = -v 1C11 -p B007
108endif
diff --git a/keyboards/ergodox_infinity/bootloader_defs.h b/keyboards/ergodox_infinity/bootloader_defs.h
deleted file mode 100644
index c67153be6..000000000
--- a/keyboards/ergodox_infinity/bootloader_defs.h
+++ /dev/null
@@ -1 +0,0 @@
1#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/ergodox_infinity/rules.mk
index 29e5c6dd7..b9ead9e87 100644
--- a/keyboards/ergodox_infinity/rules.mk
+++ b/keyboards/ergodox_infinity/rules.mk
@@ -1,27 +1,12 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use 4# Bootloader selection
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 5BOOTLOADER = kiibohd
6# or <this_dir>/ld/
7# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
8# - LDSCRIPT =
9# - MKL26Z64 for Teensy LC
10# - MK20DX128 for Teensy 3.0
11# - MK20DX256 for Teensy 3.1 and 3.2
12# - MK20DX128BLDR4 for Infinity 60% with Kiibohd bootloader
13# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
14MCU_LDSCRIPT = MK20DX256BLDR8
15
16BOOTLOADER = dfu
17 6
18# Build Options 7# Build Options
19# comment out to disable the options. 8# comment out to disable the options.
20# 9#
21
22DFU_ARGS = -d 1c11:b007
23DFU_SUFFIX_ARGS = -p b007 -v 1c11
24
25BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration 10BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
26MOUSEKEY_ENABLE = yes # Mouse keys 11MOUSEKEY_ENABLE = yes # Mouse keys
27EXTRAKEY_ENABLE = yes # Audio control and System control 12EXTRAKEY_ENABLE = yes # Audio control and System control
diff --git a/keyboards/infinity60/bootloader_defs.h b/keyboards/infinity60/bootloader_defs.h
deleted file mode 100644
index c67153be6..000000000
--- a/keyboards/infinity60/bootloader_defs.h
+++ /dev/null
@@ -1 +0,0 @@
1#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity60/rules.mk b/keyboards/infinity60/rules.mk
index e6b234d82..dce10b571 100644
--- a/keyboards/infinity60/rules.mk
+++ b/keyboards/infinity60/rules.mk
@@ -1,16 +1,8 @@
1# MCU name 1# MCU name
2MCU = MK20DX128 2MCU = MK20DX128
3 3
4# Linker script to use 4# Bootloader selection
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 5BOOTLOADER = kiibohd
6# or <this_dir>/ld/
7# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
8# - LDSCRIPT =
9# - MKL26Z64 for Teensy LC
10# - MK20DX128 for Teensy 3.0
11# - MK20DX256 for Teensy 3.1 and 3.2
12# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
13MCU_LDSCRIPT = MK20DX128BLDR4
14 6
15# Board: it should exist either in <chibios>/os/hal/boards/ 7# Board: it should exist either in <chibios>/os/hal/boards/
16# or <this_dir>/boards 8# or <this_dir>/boards
@@ -21,15 +13,9 @@ MCU_LDSCRIPT = MK20DX128BLDR4
21# - MCHCK_K20 for Infinity KB 13# - MCHCK_K20 for Infinity KB
22BOARD = MCHCK_K20 14BOARD = MCHCK_K20
23 15
24BOOTLOADER = dfu
25
26# Build Options 16# Build Options
27# comment out to disable the options. 17# comment out to disable the options.
28# 18#
29
30DFU_ARGS = -d 1c11:b007
31DFU_SUFFIX_ARGS = -p b007 -v 1c11
32
33BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration 19BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
34## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) 20## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
35MOUSEKEY_ENABLE = yes # Mouse keys 21MOUSEKEY_ENABLE = yes # Mouse keys
diff --git a/keyboards/k_type/bootloader_defs.h b/keyboards/k_type/bootloader_defs.h
deleted file mode 100644
index c67153be6..000000000
--- a/keyboards/k_type/bootloader_defs.h
+++ /dev/null
@@ -1 +0,0 @@
1#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/k_type/rules.mk b/keyboards/k_type/rules.mk
index 56c4c606e..52a9b8ee6 100644
--- a/keyboards/k_type/rules.mk
+++ b/keyboards/k_type/rules.mk
@@ -1,17 +1,8 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use 4# Bootloader selection
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 5BOOTLOADER = kiibohd
6# or <this_dir>/ld/
7# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
8# - LDSCRIPT =
9# - MKL26Z64 for Teensy LC
10# - MK20DX128 for Teensy 3.0
11# - MK20DX256 for Teensy 3.1 and 3.2
12# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
13# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
14MCU_LDSCRIPT = MK20DX256BLDR8
15 6
16# Board: it should exist either in <chibios>/os/hal/boards/ 7# Board: it should exist either in <chibios>/os/hal/boards/
17# or <this_dir>/boards 8# or <this_dir>/boards
@@ -19,11 +10,6 @@ MCU_LDSCRIPT = MK20DX256BLDR8
19# hack to ensure the watchdog has started before trying to disable it. 10# hack to ensure the watchdog has started before trying to disable it.
20BOARD = IC_TEENSY_3_1 11BOARD = IC_TEENSY_3_1
21 12
22DFU_ARGS = -d 1c11:b007
23DFU_SUFFIX_ARGS = -p b007 -v 1c11
24
25BOOTLOADER = dfu
26
27# Build Options 13# Build Options
28# comment out to disable the options. 14# comment out to disable the options.
29# 15#
diff --git a/keyboards/whitefox/bootloader_defs.h b/keyboards/whitefox/bootloader_defs.h
deleted file mode 100644
index c67153be6..000000000
--- a/keyboards/whitefox/bootloader_defs.h
+++ /dev/null
@@ -1 +0,0 @@
1#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk
index 14507e9dd..c3621ebd1 100644
--- a/keyboards/whitefox/rules.mk
+++ b/keyboards/whitefox/rules.mk
@@ -1,17 +1,8 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use 4# Bootloader selection
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/ 5BOOTLOADER = kiibohd
6# or <this_dir>/ld/
7# - NOTE: a custom ld script is needed for EEPROM on Teensy LC
8# - LDSCRIPT =
9# - MKL26Z64 for Teensy LC
10# - MK20DX128 for Teensy 3.0
11# - MK20DX256 for Teensy 3.1 and 3.2
12# - MK20DX128BLDR4 for Infinity with Kiibohd bootloader
13# - MK20DX256BLDR8 for Infinity ErgoDox with Kiibohd bootloader
14MCU_LDSCRIPT = MK20DX256BLDR8
15 6
16# Board: it should exist either in <chibios>/os/hal/boards/ 7# Board: it should exist either in <chibios>/os/hal/boards/
17# or <this_dir>/boards 8# or <this_dir>/boards
@@ -22,11 +13,6 @@ MCU_LDSCRIPT = MK20DX256BLDR8
22# - MCHCK_K20 for Infinity KB 13# - MCHCK_K20 for Infinity KB
23BOARD = IC_TEENSY_3_1 14BOARD = IC_TEENSY_3_1
24 15
25DFU_ARGS = -d 1c11:b007
26DFU_SUFFIX_ARGS = -p b007 -v 1c11
27
28BOOTLOADER = dfu
29
30# Build Options 16# Build Options
31# comment out to disable the options. 17# comment out to disable the options.
32# 18#
diff --git a/quantum/mcu_selection.mk b/quantum/mcu_selection.mk
index 61fd7b6e4..33a0cabc8 100644
--- a/quantum/mcu_selection.mk
+++ b/quantum/mcu_selection.mk
@@ -1,3 +1,5 @@
1MCU_ORIG := $(MCU)
2
1ifneq ($(findstring MKL26Z64, $(MCU)),) 3ifneq ($(findstring MKL26Z64, $(MCU)),)
2 # Cortex version 4 # Cortex version
3 MCU = cortex-m0plus 5 MCU = cortex-m0plus
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index a218488a1..2bd53f0dc 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -386,7 +386,7 @@ bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
386flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter 386flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
387ifneq ($(strip $(PROGRAM_CMD)),) 387ifneq ($(strip $(PROGRAM_CMD)),)
388 $(PROGRAM_CMD) 388 $(PROGRAM_CMD)
389else ifeq ($(strip $(BOOTLOADER)),dfu) 389else ifeq ($(strip $(BOOTLOADER)),kiibohd)
390 $(call EXEC_DFU_UTIL) 390 $(call EXEC_DFU_UTIL)
391else ifeq ($(strip $(MCU_FAMILY)),KINETIS) 391else ifeq ($(strip $(MCU_FAMILY)),KINETIS)
392 $(call EXEC_TEENSY) 392 $(call EXEC_TEENSY)
diff --git a/tmk_core/common/chibios/bootloader.c b/tmk_core/common/chibios/bootloader.c
index 743448ee1..7b2cf5c43 100644
--- a/tmk_core/common/chibios/bootloader.c
+++ b/tmk_core/common/chibios/bootloader.c
@@ -82,7 +82,7 @@ void enter_bootloader_mode_if_requested(void) {
82#elif defined(KL2x) || defined(K20x) // STM32_BOOTLOADER_DUAL_BANK // STM32_BOOTLOADER_ADDRESS 82#elif defined(KL2x) || defined(K20x) // STM32_BOOTLOADER_DUAL_BANK // STM32_BOOTLOADER_ADDRESS
83/* Kinetis */ 83/* Kinetis */
84 84
85# if defined(KIIBOHD_BOOTLOADER) 85# if defined(BOOTLOADER_KIIBOHD)
86/* Kiibohd Bootloader (MCHCK and Infinity KB) */ 86/* Kiibohd Bootloader (MCHCK and Infinity KB) */
87# define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 87# define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000
88const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; 88const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff";
@@ -92,14 +92,14 @@ void bootloader_jump(void) {
92 SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; 92 SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
93} 93}
94 94
95# else /* defined(KIIBOHD_BOOTLOADER) */ 95# else /* defined(BOOTLOADER_KIIBOHD) */
96/* Default for Kinetis - expecting an ARM Teensy */ 96/* Default for Kinetis - expecting an ARM Teensy */
97# include "wait.h" 97# include "wait.h"
98void bootloader_jump(void) { 98void bootloader_jump(void) {
99 wait_ms(100); 99 wait_ms(100);
100 __BKPT(0); 100 __BKPT(0);
101} 101}
102# endif /* defined(KIIBOHD_BOOTLOADER) */ 102# endif /* defined(BOOTLOADER_KIIBOHD) */
103 103
104#else /* neither STM32 nor KINETIS */ 104#else /* neither STM32 nor KINETIS */
105__attribute__((weak)) void bootloader_jump(void) {} 105__attribute__((weak)) void bootloader_jump(void) {}