summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/raspberrypi/include/mmu.h
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libbsp/arm/raspberrypi/include/mmu.h')
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/include/mmu.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/include/mmu.h b/c/src/lib/libbsp/arm/raspberrypi/include/mmu.h
new file mode 100644
index 0000000000..50e9180dcc
--- /dev/null
+++ b/c/src/lib/libbsp/arm/raspberrypi/include/mmu.h
@@ -0,0 +1,68 @@
+/**
+ * @file
+ *
+ * @ingroup rapberrypi_mmu
+ *
+ * @brief MMU API.
+ */
+
+/*
+ * Copyright (c) 2013 Alan Cudmore.
+ * based on work by:
+ * Copyright (c) 2009
+ * embedded brains GmbH
+ * Obere Lagerstr. 30
+ * D-82178 Puchheim
+ * Germany
+ * <rtems@embedded-brains.de>
+ *
+ * The license and distribution terms for this file may be
+ * found in the file LICENSE in this distribution or at
+ *
+ * http://www.rtems.com/license/LICENSE
+ *
+ */
+
+#ifndef LIBBSP_ARM_RASPBERRYPI_MMU_H
+#define LIBBSP_ARM_RASPBERRYPI_MMU_H
+
+#include <libcpu/arm-cp15.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @defgroup raspberrypi_mmu MMU Support
+ *
+ * @ingroup raspberrypi
+ *
+ * @brief MMU support.
+ *
+ * @{
+ */
+
+#define RASPBERRYPI_MMU_CLIENT_DOMAIN 15U
+
+#define RASPBERRYPI_MMU_READ_ONLY \
+ ((RASPBERRYPI_MMU_CLIENT_DOMAIN << ARM_MMU_SECT_DOMAIN_SHIFT) \
+ | ARM_MMU_SECT_DEFAULT)
+
+#define RASPBERRYPI_MMU_READ_ONLY_CACHED \
+ (RASPBERRYPI_MMU_READ_ONLY | ARM_MMU_SECT_C | ARM_MMU_SECT_B)
+
+#define RASPBERRYPI_MMU_READ_WRITE \
+ ((RASPBERRYPI_MMU_CLIENT_DOMAIN << ARM_MMU_SECT_DOMAIN_SHIFT) \
+ | ARM_MMU_SECT_AP_0 \
+ | ARM_MMU_SECT_DEFAULT)
+
+#define RASPBERRYPI_MMU_READ_WRITE_CACHED \
+ (RASPBERRYPI_MMU_READ_WRITE | ARM_MMU_SECT_C | ARM_MMU_SECT_B)
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* LIBBSP_ARM_RASPBERRYPI_MMU_H */