aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2020-08-22 08:42:28 +1000
committerGitHub <noreply@github.com>2020-08-21 15:42:28 -0700
commit70ce4ba56f5d805e71c2b1de7334d6492b5e350a (patch)
treeb5ac7fc20ebae31861c24eeb56c7dc0acc4b7a19
parent1b0272e801d5ed5fb9af6012376e0d23ca678acd (diff)
downloadqmk_firmware-70ce4ba56f5d805e71c2b1de7334d6492b5e350a.tar.gz
qmk_firmware-70ce4ba56f5d805e71c2b1de7334d6492b5e350a.zip
Revert "Add Kiibohd bootloader type to bootloader.mk (#9908)" (#10126)
This reverts commit e2d4cd1a41c667da186891e3dbaf535c6b0717df.
-rw-r--r--bootloader.mk13
-rw-r--r--keyboards/ergodox_infinity/bootloader_defs.h1
-rw-r--r--keyboards/ergodox_infinity/rules.mk18
-rw-r--r--keyboards/infinity60/bootloader_defs.h1
-rw-r--r--keyboards/infinity60/rules.mk17
-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--tmk_core/chibios.mk2
-rw-r--r--tmk_core/common/chibios/bootloader.c6
11 files changed, 71 insertions, 25 deletions
diff --git a/bootloader.mk b/bootloader.mk
index c22291e43..e516e9ff9 100644
--- a/bootloader.mk
+++ b/bootloader.mk
@@ -27,7 +27,6 @@
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)
31# 30#
32# BOOTLOADER_SIZE can still be defined manually, but it's recommended 31# BOOTLOADER_SIZE can still be defined manually, but it's recommended
33# you add any possible configuration to this list 32# you add any possible configuration to this list
@@ -90,18 +89,6 @@ ifeq ($(strip $(BOOTLOADER)), lufa-ms)
90 BOOTLOADER_SIZE = 6144 89 BOOTLOADER_SIZE = 6144
91 FIRMWARE_FORMAT = bin 90 FIRMWARE_FORMAT = bin
92endif 91endif
93ifeq ($(strip $(BOOTLOADER)), kiibohd)
94 OPT_DEFS += -DBOOTLOADER_KIIBOHD
95 ifeq ($(strip $(MCU)), MK20DX128)
96 MCU_LDSCRIPT = MK20DX128BLDR4
97 endif
98 ifeq ($(strip $(MCU)), MK20DX256)
99 MCU_LDSCRIPT = MK20DX256BLDR8
100 endif
101
102 DFU_ARGS = -d 1C11:B007
103 DFU_SUFFIX_ARGS = -v 1C11 -p B007
104endif
105 92
106ifdef BOOTLOADER_SIZE 93ifdef BOOTLOADER_SIZE
107 OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) 94 OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE))
diff --git a/keyboards/ergodox_infinity/bootloader_defs.h b/keyboards/ergodox_infinity/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/ergodox_infinity/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/ergodox_infinity/rules.mk b/keyboards/ergodox_infinity/rules.mk
index 572bda2a9..31bc20454 100644
--- a/keyboards/ergodox_infinity/rules.mk
+++ b/keyboards/ergodox_infinity/rules.mk
@@ -1,18 +1,32 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
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
4# Vector table for application 16# Vector table for application
5# 0x00000000-0x00001000 area is occupied by bootlaoder.*/ 17# 0x00000000-0x00001000 area is occupied by bootlaoder.*/
6# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB 18# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
7OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 19OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000
8 20
9# Bootloader selection 21BOOTLOADER = dfu
10BOOTLOADER = kiibohd
11 22
12# Build Options 23# Build Options
13# comment out to disable the options. 24# comment out to disable the options.
14# 25#
15 26
27DFU_ARGS = -d 1c11:b007
28DFU_SUFFIX_ARGS = -p b007 -v 1c11
29
16BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration 30BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
17MOUSEKEY_ENABLE = yes # Mouse keys 31MOUSEKEY_ENABLE = yes # Mouse keys
18EXTRAKEY_ENABLE = yes # Audio control and System control 32EXTRAKEY_ENABLE = yes # Audio control and System control
diff --git a/keyboards/infinity60/bootloader_defs.h b/keyboards/infinity60/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/infinity60/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/infinity60/rules.mk b/keyboards/infinity60/rules.mk
index 8fb4b499e..579eab0f3 100644
--- a/keyboards/infinity60/rules.mk
+++ b/keyboards/infinity60/rules.mk
@@ -1,6 +1,17 @@
1# MCU name 1# MCU name
2MCU = MK20DX128 2MCU = MK20DX128
3 3
4# Linker script to use
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
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
4# Board: it should exist either in <chibios>/os/hal/boards/ 15# Board: it should exist either in <chibios>/os/hal/boards/
5# or <this_dir>/boards 16# or <this_dir>/boards
6# - BOARD = 17# - BOARD =
@@ -15,13 +26,15 @@ BOARD = MCHCK_K20
15# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB 26# The CORTEX_VTOR... is needed only for MCHCK/Infinity KB
16OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 27OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000
17 28
18# Bootloader selection 29BOOTLOADER = dfu
19BOOTLOADER = kiibohd
20 30
21# Build Options 31# Build Options
22# comment out to disable the options. 32# comment out to disable the options.
23# 33#
24 34
35DFU_ARGS = -d 1c11:b007
36DFU_SUFFIX_ARGS = -p b007 -v 1c11
37
25BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration 38BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration
26## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) 39## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.)
27MOUSEKEY_ENABLE = yes # Mouse keys 40MOUSEKEY_ENABLE = yes # Mouse keys
diff --git a/keyboards/k_type/bootloader_defs.h b/keyboards/k_type/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/k_type/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/k_type/rules.mk b/keyboards/k_type/rules.mk
index 176a28d86..56c4c606e 100644
--- a/keyboards/k_type/rules.mk
+++ b/keyboards/k_type/rules.mk
@@ -1,14 +1,28 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
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
4# Board: it should exist either in <chibios>/os/hal/boards/ 16# Board: it should exist either in <chibios>/os/hal/boards/
5# or <this_dir>/boards 17# or <this_dir>/boards
6# This board was copied from PJRC_TEENSY_3_1. The only difference should be a 18# This board was copied from PJRC_TEENSY_3_1. The only difference should be a
7# hack to ensure the watchdog has started before trying to disable it. 19# hack to ensure the watchdog has started before trying to disable it.
8BOARD = IC_TEENSY_3_1 20BOARD = IC_TEENSY_3_1
9 21
10# Bootloader selection 22DFU_ARGS = -d 1c11:b007
11BOOTLOADER = kiibohd 23DFU_SUFFIX_ARGS = -p b007 -v 1c11
24
25BOOTLOADER = dfu
12 26
13# Build Options 27# Build Options
14# comment out to disable the options. 28# comment out to disable the options.
diff --git a/keyboards/whitefox/bootloader_defs.h b/keyboards/whitefox/bootloader_defs.h
new file mode 100644
index 000000000..c67153be6
--- /dev/null
+++ b/keyboards/whitefox/bootloader_defs.h
@@ -0,0 +1 @@
#define KIIBOHD_BOOTLOADER
diff --git a/keyboards/whitefox/rules.mk b/keyboards/whitefox/rules.mk
index 568b33b46..14507e9dd 100644
--- a/keyboards/whitefox/rules.mk
+++ b/keyboards/whitefox/rules.mk
@@ -1,6 +1,18 @@
1# MCU name 1# MCU name
2MCU = MK20DX256 2MCU = MK20DX256
3 3
4# Linker script to use
5# - it should exist either in <chibios>/os/common/ports/ARMCMx/compilers/GCC/ld/
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
4# Board: it should exist either in <chibios>/os/hal/boards/ 16# Board: it should exist either in <chibios>/os/hal/boards/
5# or <this_dir>/boards 17# or <this_dir>/boards
6# - BOARD = 18# - BOARD =
@@ -10,8 +22,10 @@ MCU = MK20DX256
10# - MCHCK_K20 for Infinity KB 22# - MCHCK_K20 for Infinity KB
11BOARD = IC_TEENSY_3_1 23BOARD = IC_TEENSY_3_1
12 24
13# Bootloader selection 25DFU_ARGS = -d 1c11:b007
14BOOTLOADER = kiibohd 26DFU_SUFFIX_ARGS = -p b007 -v 1c11
27
28BOOTLOADER = dfu
15 29
16# Build Options 30# Build Options
17# comment out to disable the options. 31# comment out to disable the options.
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk
index 4c288646e..09aaddeef 100644
--- a/tmk_core/chibios.mk
+++ b/tmk_core/chibios.mk
@@ -324,7 +324,7 @@ bin: $(BUILD_DIR)/$(TARGET).bin sizeafter
324flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter 324flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter
325ifneq ($(strip $(PROGRAM_CMD)),) 325ifneq ($(strip $(PROGRAM_CMD)),)
326 $(PROGRAM_CMD) 326 $(PROGRAM_CMD)
327else ifeq ($(strip $(BOOTLOADER)),kiibohd) 327else ifeq ($(strip $(BOOTLOADER)),dfu)
328 $(call EXEC_DFU_UTIL) 328 $(call EXEC_DFU_UTIL)
329else ifeq ($(strip $(MCU_FAMILY)),KINETIS) 329else ifeq ($(strip $(MCU_FAMILY)),KINETIS)
330 $(call EXEC_TEENSY) 330 $(call EXEC_TEENSY)
diff --git a/tmk_core/common/chibios/bootloader.c b/tmk_core/common/chibios/bootloader.c
index 6833511c0..4cf5dae7e 100644
--- a/tmk_core/common/chibios/bootloader.c
+++ b/tmk_core/common/chibios/bootloader.c
@@ -44,7 +44,7 @@ void enter_bootloader_mode_if_requested(void) {
44#elif defined(KL2x) || defined(K20x) /* STM32_BOOTLOADER_ADDRESS */ 44#elif defined(KL2x) || defined(K20x) /* STM32_BOOTLOADER_ADDRESS */
45/* Kinetis */ 45/* Kinetis */
46 46
47# if defined(BOOTLOADER_KIIBOHD) 47# if defined(KIIBOHD_BOOTLOADER)
48/* Kiibohd Bootloader (MCHCK and Infinity KB) */ 48/* Kiibohd Bootloader (MCHCK and Infinity KB) */
49# define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000 49# define SCB_AIRCR_VECTKEY_WRITEMAGIC 0x05FA0000
50const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; 50const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff";
@@ -54,14 +54,14 @@ void bootloader_jump(void) {
54 SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk; 54 SCB->AIRCR = SCB_AIRCR_VECTKEY_WRITEMAGIC | SCB_AIRCR_SYSRESETREQ_Msk;
55} 55}
56 56
57# else /* defined(BOOTLOADER_KIIBOHD) */ 57# else /* defined(KIIBOHD_BOOTLOADER) */
58/* Default for Kinetis - expecting an ARM Teensy */ 58/* Default for Kinetis - expecting an ARM Teensy */
59# include "wait.h" 59# include "wait.h"
60void bootloader_jump(void) { 60void bootloader_jump(void) {
61 wait_ms(100); 61 wait_ms(100);
62 __BKPT(0); 62 __BKPT(0);
63} 63}
64# endif /* defined(BOOTLOADER_KIIBOHD) */ 64# endif /* defined(KIIBOHD_BOOTLOADER) */
65 65
66#else /* neither STM32 nor KINETIS */ 66#else /* neither STM32 nor KINETIS */
67__attribute__((weak)) void bootloader_jump(void) {} 67__attribute__((weak)) void bootloader_jump(void) {}