diff options
| author | Ryan <fauxpark@gmail.com> | 2020-08-12 12:28:20 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-12 12:28:20 +1000 |
| commit | e2d4cd1a41c667da186891e3dbaf535c6b0717df (patch) | |
| tree | 8ae44fc6f6b80efb522ca523862ce511eab1161e | |
| parent | 98e1e18f6bcae6977ef56747243158eb94c6bd69 (diff) | |
| download | qmk_firmware-e2d4cd1a41c667da186891e3dbaf535c6b0717df.tar.gz qmk_firmware-e2d4cd1a41c667da186891e3dbaf535c6b0717df.zip | |
Add Kiibohd bootloader type to bootloader.mk (#9908)
| -rw-r--r-- | bootloader.mk | 13 | ||||
| -rw-r--r-- | keyboards/ergodox_infinity/bootloader_defs.h | 1 | ||||
| -rw-r--r-- | keyboards/ergodox_infinity/rules.mk | 18 | ||||
| -rw-r--r-- | keyboards/infinity60/bootloader_defs.h | 1 | ||||
| -rw-r--r-- | keyboards/infinity60/rules.mk | 17 | ||||
| -rw-r--r-- | keyboards/k_type/bootloader_defs.h | 1 | ||||
| -rw-r--r-- | keyboards/k_type/rules.mk | 18 | ||||
| -rw-r--r-- | keyboards/whitefox/bootloader_defs.h | 1 | ||||
| -rw-r--r-- | keyboards/whitefox/rules.mk | 18 | ||||
| -rw-r--r-- | tmk_core/chibios.mk | 2 | ||||
| -rw-r--r-- | tmk_core/common/chibios/bootloader.c | 6 |
11 files changed, 25 insertions, 71 deletions
diff --git a/bootloader.mk b/bootloader.mk index e516e9ff9..c22291e43 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,6 +90,18 @@ ifeq ($(strip $(BOOTLOADER)), lufa-ms) | |||
| 89 | BOOTLOADER_SIZE = 6144 | 90 | BOOTLOADER_SIZE = 6144 |
| 90 | FIRMWARE_FORMAT = bin | 91 | FIRMWARE_FORMAT = bin |
| 91 | endif | 92 | endif |
| 93 | ifeq ($(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 | ||
| 104 | endif | ||
| 92 | 105 | ||
| 93 | ifdef BOOTLOADER_SIZE | 106 | ifdef BOOTLOADER_SIZE |
| 94 | OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) | 107 | OPT_DEFS += -DBOOTLOADER_SIZE=$(strip $(BOOTLOADER_SIZE)) |
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 31bc20454..572bda2a9 100644 --- a/keyboards/ergodox_infinity/rules.mk +++ b/keyboards/ergodox_infinity/rules.mk | |||
| @@ -1,32 +1,18 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = MK20DX256 | 2 | MCU = 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 | ||
| 14 | MCU_LDSCRIPT = MK20DX256BLDR8 | ||
| 15 | |||
| 16 | # Vector table for application | 4 | # Vector table for application |
| 17 | # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ | 5 | # 0x00000000-0x00001000 area is occupied by bootlaoder.*/ |
| 18 | # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB | 6 | # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB |
| 19 | OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 | 7 | OPT_DEFS += -DCORTEX_VTOR_INIT=0x00002000 |
| 20 | 8 | ||
| 21 | BOOTLOADER = dfu | 9 | # Bootloader selection |
| 10 | BOOTLOADER = kiibohd | ||
| 22 | 11 | ||
| 23 | # Build Options | 12 | # Build Options |
| 24 | # comment out to disable the options. | 13 | # comment out to disable the options. |
| 25 | # | 14 | # |
| 26 | 15 | ||
| 27 | DFU_ARGS = -d 1c11:b007 | ||
| 28 | DFU_SUFFIX_ARGS = -p b007 -v 1c11 | ||
| 29 | |||
| 30 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | 16 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration |
| 31 | MOUSEKEY_ENABLE = yes # Mouse keys | 17 | MOUSEKEY_ENABLE = yes # Mouse keys |
| 32 | EXTRAKEY_ENABLE = yes # Audio control and System control | 18 | EXTRAKEY_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 579eab0f3..8fb4b499e 100644 --- a/keyboards/infinity60/rules.mk +++ b/keyboards/infinity60/rules.mk | |||
| @@ -1,17 +1,6 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = MK20DX128 | 2 | MCU = 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 | ||
| 13 | MCU_LDSCRIPT = MK20DX128BLDR4 | ||
| 14 | |||
| 15 | # Board: it should exist either in <chibios>/os/hal/boards/ | 4 | # Board: it should exist either in <chibios>/os/hal/boards/ |
| 16 | # or <this_dir>/boards | 5 | # or <this_dir>/boards |
| 17 | # - BOARD = | 6 | # - BOARD = |
| @@ -26,15 +15,13 @@ BOARD = MCHCK_K20 | |||
| 26 | # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB | 15 | # The CORTEX_VTOR... is needed only for MCHCK/Infinity KB |
| 27 | OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 | 16 | OPT_DEFS = -DCORTEX_VTOR_INIT=0x00001000 |
| 28 | 17 | ||
| 29 | BOOTLOADER = dfu | 18 | # Bootloader selection |
| 19 | BOOTLOADER = kiibohd | ||
| 30 | 20 | ||
| 31 | # Build Options | 21 | # Build Options |
| 32 | # comment out to disable the options. | 22 | # comment out to disable the options. |
| 33 | # | 23 | # |
| 34 | 24 | ||
| 35 | DFU_ARGS = -d 1c11:b007 | ||
| 36 | DFU_SUFFIX_ARGS = -p b007 -v 1c11 | ||
| 37 | |||
| 38 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration | 25 | BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration |
| 39 | ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) | 26 | ## (Note that for BOOTMAGIC on Teensy LC you have to use a custom .ld script.) |
| 40 | MOUSEKEY_ENABLE = yes # Mouse keys | 27 | MOUSEKEY_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..176a28d86 100644 --- a/keyboards/k_type/rules.mk +++ b/keyboards/k_type/rules.mk | |||
| @@ -1,28 +1,14 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = MK20DX256 | 2 | MCU = 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 | ||
| 14 | MCU_LDSCRIPT = MK20DX256BLDR8 | ||
| 15 | |||
| 16 | # Board: it should exist either in <chibios>/os/hal/boards/ | 4 | # Board: it should exist either in <chibios>/os/hal/boards/ |
| 17 | # or <this_dir>/boards | 5 | # or <this_dir>/boards |
| 18 | # This board was copied from PJRC_TEENSY_3_1. The only difference should be a | 6 | # This board was copied from PJRC_TEENSY_3_1. The only difference should be a |
| 19 | # hack to ensure the watchdog has started before trying to disable it. | 7 | # hack to ensure the watchdog has started before trying to disable it. |
| 20 | BOARD = IC_TEENSY_3_1 | 8 | BOARD = IC_TEENSY_3_1 |
| 21 | 9 | ||
| 22 | DFU_ARGS = -d 1c11:b007 | 10 | # Bootloader selection |
| 23 | DFU_SUFFIX_ARGS = -p b007 -v 1c11 | 11 | BOOTLOADER = kiibohd |
| 24 | |||
| 25 | BOOTLOADER = dfu | ||
| 26 | 12 | ||
| 27 | # Build Options | 13 | # Build Options |
| 28 | # comment out to disable the options. | 14 | # comment out to disable the options. |
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..568b33b46 100644 --- a/keyboards/whitefox/rules.mk +++ b/keyboards/whitefox/rules.mk | |||
| @@ -1,18 +1,6 @@ | |||
| 1 | # MCU name | 1 | # MCU name |
| 2 | MCU = MK20DX256 | 2 | MCU = 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 | ||
| 14 | MCU_LDSCRIPT = MK20DX256BLDR8 | ||
| 15 | |||
| 16 | # Board: it should exist either in <chibios>/os/hal/boards/ | 4 | # Board: it should exist either in <chibios>/os/hal/boards/ |
| 17 | # or <this_dir>/boards | 5 | # or <this_dir>/boards |
| 18 | # - BOARD = | 6 | # - BOARD = |
| @@ -22,10 +10,8 @@ MCU_LDSCRIPT = MK20DX256BLDR8 | |||
| 22 | # - MCHCK_K20 for Infinity KB | 10 | # - MCHCK_K20 for Infinity KB |
| 23 | BOARD = IC_TEENSY_3_1 | 11 | BOARD = IC_TEENSY_3_1 |
| 24 | 12 | ||
| 25 | DFU_ARGS = -d 1c11:b007 | 13 | # Bootloader selection |
| 26 | DFU_SUFFIX_ARGS = -p b007 -v 1c11 | 14 | BOOTLOADER = kiibohd |
| 27 | |||
| 28 | BOOTLOADER = dfu | ||
| 29 | 15 | ||
| 30 | # Build Options | 16 | # Build Options |
| 31 | # comment out to disable the options. | 17 | # comment out to disable the options. |
diff --git a/tmk_core/chibios.mk b/tmk_core/chibios.mk index 09aaddeef..4c288646e 100644 --- a/tmk_core/chibios.mk +++ b/tmk_core/chibios.mk | |||
| @@ -324,7 +324,7 @@ bin: $(BUILD_DIR)/$(TARGET).bin sizeafter | |||
| 324 | flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter | 324 | flash: $(BUILD_DIR)/$(TARGET).bin cpfirmware sizeafter |
| 325 | ifneq ($(strip $(PROGRAM_CMD)),) | 325 | ifneq ($(strip $(PROGRAM_CMD)),) |
| 326 | $(PROGRAM_CMD) | 326 | $(PROGRAM_CMD) |
| 327 | else ifeq ($(strip $(BOOTLOADER)),dfu) | 327 | else ifeq ($(strip $(BOOTLOADER)),kiibohd) |
| 328 | $(call EXEC_DFU_UTIL) | 328 | $(call EXEC_DFU_UTIL) |
| 329 | else ifeq ($(strip $(MCU_FAMILY)),KINETIS) | 329 | else 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 4cf5dae7e..6833511c0 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(KIIBOHD_BOOTLOADER) | 47 | # if defined(BOOTLOADER_KIIBOHD) |
| 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 |
| 50 | const uint8_t sys_reset_to_loader_magic[] = "\xff\x00\x7fRESET TO LOADER\x7f\x00\xff"; | 50 | const 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(KIIBOHD_BOOTLOADER) */ | 57 | # else /* defined(BOOTLOADER_KIIBOHD) */ |
| 58 | /* Default for Kinetis - expecting an ARM Teensy */ | 58 | /* Default for Kinetis - expecting an ARM Teensy */ |
| 59 | # include "wait.h" | 59 | # include "wait.h" |
| 60 | void bootloader_jump(void) { | 60 | void bootloader_jump(void) { |
| 61 | wait_ms(100); | 61 | wait_ms(100); |
| 62 | __BKPT(0); | 62 | __BKPT(0); |
| 63 | } | 63 | } |
| 64 | # endif /* defined(KIIBOHD_BOOTLOADER) */ | 64 | # endif /* defined(BOOTLOADER_KIIBOHD) */ |
| 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) {} |
