From 5ceefe18f0a6a055e04a1e5333983bae86738be8 Mon Sep 17 00:00:00 2001 From: Hesham AL-Matary Date: Sat, 28 Sep 2013 10:08:25 +0200 Subject: 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. --- .../arm/raspberrypi/startup/mm_config_table.c | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c (limited to 'c/src/lib/libbsp/arm/raspberrypi/startup/mm_config_table.c') 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 + * + * + * 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 +#include + +#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); -- cgit v1.2.3