aboutsummaryrefslogtreecommitdiff
path: root/include/libopencm3/cm3/fpb.h
diff options
context:
space:
mode:
authorGareth McMullin2011-02-08 19:40:16 +1300
committerGareth McMullin2011-02-08 19:40:16 +1300
commit0d7d0fe8290ada82c97fd78f44f6116d0117c33a (patch)
treedecf7d45df4ea67d55f57abc431b0aaa2f6eec2e /include/libopencm3/cm3/fpb.h
parent4954b4c006149838d2816a12edd47899ccb3ade5 (diff)
Added Flash Patch and Breakpoint (FPB) register definitions.
Diffstat (limited to 'include/libopencm3/cm3/fpb.h')
-rw-r--r--include/libopencm3/cm3/fpb.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/include/libopencm3/cm3/fpb.h b/include/libopencm3/cm3/fpb.h
new file mode 100644
index 0000000..6ebee12
--- /dev/null
+++ b/include/libopencm3/cm3/fpb.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of the libopencm3 project.
+ *
+ * Copyright (C) 2011 Gareth McMullin <gareth@blacksphere.co.nz>
+ *
+ * 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 3 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/>.
+ */
+
+#ifndef LIBOPENCM3_CM3_FPB_H
+#define LIBOPENCM3_CM3_FPB_H
+
+#define FPB_CTRL MMIO32(FPB_BASE + 0)
+#define FPB_REMAP MMIO32(FPB_BASE + 4)
+#define FPB_COMP (voltile u32 *)(FPB_BASE + 8)
+
+/* Flash Patch Control Register (FP_CTRL) */
+#define FPB_CTRL_ENABLE 0x0001
+#define FPB_CTRL_KEY 0x0002
+#define FPB_CTRL_NUM_CODE1_MASK 0x00F0
+#define FPB_CTRL_NUM_LIT_MASK 0x0F00
+#define FPB_CTRL_NUM_CODE2_MASK 0xE000
+
+/* Flash Patch Comparator Register (FP_COMPx) */
+#define FPB_COMP_ENABLE 0x0001
+#define FPB_COMP_REPLACE_REMAP 0x0000
+#define FPB_COMP_REPLACE_BREAK_LOWER 0x4000
+#define FPB_COMP_REPLACE_BREAK_UPPER 0x8000
+#define FPB_COMP_REPLACE_BREAK_BOTH 0xC000
+
+#endif
+