summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
diff options
context:
space:
mode:
authorHesham AL-Matary <heshamelmatary@gmail.com>2013-09-28 10:08:25 +0200
committerGedare Bloom <gedare@rtems.org>2013-10-03 08:55:33 -0400
commit5ceefe18f0a6a055e04a1e5333983bae86738be8 (patch)
tree7256c26f30a1cd90a1a5938f7de144d843c06074 /c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
parentAdd a new necessary definition needed for raspberrypi MMU support (diff)
downloadrtems-5ceefe18f0a6a055e04a1e5333983bae86738be8.tar.bz2
Shared MMU initialization for ARM BSPs and RaspberryPi MMU support
Add support for MMU initialization for RaspberryPi. Introduce new shared MMU configuration table that can be used by other BSPs that call the arm_cp15_start_setup_translation_table_and_enable_mmu_and_cache function. Demonstrate the use of the generic table with RaspberryPi.
Diffstat (limited to '')
-rw-r--r--c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c70
1 files changed, 70 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c b/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
new file mode 100644
index 0000000000..5436a76870
--- /dev/null
+++ b/c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c
@@ -0,0 +1,70 @@
+/*
+ * Copyright (c) 2013 embedded brains GmbH. All rights reserved.
+ *
+ * embedded brains GmbH
+ * Dornierstr. 4
+ * 82178 Puchheim
+ * Germany
+ * <info@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.
+ */
+
+#include <bsp/start.h>
+#include <bsp/arm-cp15-start.h>
+
+#ifdef RTEMS_SMP
+ #define MMU_DATA_READ_WRITE ARMV7_MMU_DATA_READ_WRITE_SHAREABLE
+#else
+ #define MMU_DATA_READ_WRITE ARMV7_MMU_DATA_READ_WRITE_CACHED
+#endif
+
+BSP_START_DATA_SECTION const arm_cp15_start_section_config
+bsp_mm_config_table[] = {
+ {
+ .begin = (uint32_t) bsp_section_fast_text_begin,
+ .end = (uint32_t) bsp_section_fast_text_end,
+ .flags = ARMV7_MMU_CODE_CACHED
+ }, {
+ .begin = (uint32_t) bsp_section_fast_data_begin,
+ .end = (uint32_t) bsp_section_fast_data_end,
+ .flags = MMU_DATA_READ_WRITE
+ }, {
+ .begin = (uint32_t) bsp_section_start_begin,
+ .end = (uint32_t) bsp_section_start_end,
+ .flags = ARMV7_MMU_CODE_CACHED
+ }, {
+ .begin = (uint32_t) bsp_section_vector_begin,
+ .end = (uint32_t) bsp_section_vector_end,
+ .flags = MMU_DATA_READ_WRITE
+ }, {
+ .begin = (uint32_t) bsp_section_text_begin,
+ .end = (uint32_t) bsp_section_text_end,
+ .flags = ARMV7_MMU_CODE_CACHED
+ }, {
+ .begin = (uint32_t) bsp_section_rodata_begin,
+ .end = (uint32_t) bsp_section_rodata_end,
+ .flags = ARMV7_MMU_DATA_READ_ONLY_CACHED
+ }, {
+ .begin = (uint32_t) bsp_section_data_begin,
+ .end = (uint32_t) bsp_section_data_end,
+ .flags = MMU_DATA_READ_WRITE
+ }, {
+ .begin = (uint32_t) bsp_section_bss_begin,
+ .end = (uint32_t) bsp_section_bss_end,
+ .flags = MMU_DATA_READ_WRITE
+ }, {
+ .begin = (uint32_t) bsp_section_work_begin,
+ .end = (uint32_t) bsp_section_work_end,
+ .flags = MMU_DATA_READ_WRITE
+ }, {
+ .begin = (uint32_t) bsp_section_stack_begin,
+ .end = (uint32_t) bsp_section_stack_end,
+ .flags = MMU_DATA_READ_WRITE
+ }
+};
+
+BSP_START_DATA_SECTION const size_t bsp_mm_config_table_size =
+RTEMS_ARRAY_SIZE(&bsp_mm_config_table);