summaryrefslogtreecommitdiff
path: root/platforms/arm_atsam/bootloader.mk
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
committerNick Brassel <nick@tzarc.org>2022-11-28 07:54:00 +1100
commit4020674163fc80914059c4c9c3be5c0ae00bd150 (patch)
tree6f4187d72b04d03572adf507502afbda9726d696 /platforms/arm_atsam/bootloader.mk
parent8f9b49dc5b05fd3421e47aa76822a5b2199dfca6 (diff)
parent9e78e65a566487b2f4fe7b663971a01deb6ddad2 (diff)
Merge remote-tracking branch 'upstream/develop'
Diffstat (limited to 'platforms/arm_atsam/bootloader.mk')
-rw-r--r--platforms/arm_atsam/bootloader.mk46
1 files changed, 46 insertions, 0 deletions
diff --git a/platforms/arm_atsam/bootloader.mk b/platforms/arm_atsam/bootloader.mk
new file mode 100644
index 0000000000..1ec42edeb6
--- /dev/null
+++ b/platforms/arm_atsam/bootloader.mk
@@ -0,0 +1,46 @@
+# Copyright 2017 Jack Humbert
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# If it's possible that multiple bootloaders can be used for one project,
+# you can leave this unset, and the correct size will be selected
+# automatically.
+#
+# Sets the bootloader defined in the keyboard's/keymap's rules.mk
+#
+# Current options for ARM (ATSAM):
+# md-boot Atmel SAM-BA (only used by Drop boards)
+#
+# If you need to provide your own implementation, you can set inside `rules.mk`
+# `BOOTLOADER = custom` -- you'll need to provide your own implementations. See
+# the respective file under `platforms/<PLATFORM>/bootloaders/custom.c` to see
+# which functions may be overridden.
+
+ifeq ($(strip $(BOOTLOADER)), custom)
+ OPT_DEFS += -DBOOTLOADER_CUSTOM
+ BOOTLOADER_TYPE = custom
+endif
+
+ifeq ($(strip $(BOOTLOADER)), md-boot)
+ OPT_DEFS += -DBOOTLOADER_MD_BOOT
+ BOOTLOADER_TYPE = md_boot
+endif
+
+ifeq ($(strip $(BOOTLOADER_TYPE)),)
+ ifneq ($(strip $(BOOTLOADER)),)
+ $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,Invalid bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.)
+ else
+ $(call CATASTROPHIC_ERROR,Invalid BOOTLOADER,No bootloader specified. Please set an appropriate bootloader in your rules.mk or info.json.)
+ endif
+endif