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. --- .../libbsp/arm/raspberrypi/startup/bspstarthooks.c | 22 +++------------------- 1 file changed, 3 insertions(+), 19 deletions(-) (limited to 'c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c') diff --git a/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c index a2241687cc..71b2ff1a44 100644 --- a/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c +++ b/c/src/lib/libbsp/arm/raspberrypi/startup/bspstarthooks.c @@ -7,6 +7,7 @@ */ /* + * Copyright (c) 2013. Hesham AL-Matary * Copyright (c) 2013 by Alan Cudmore * based on work by: * Copyright (c) 2009 @@ -24,33 +25,16 @@ #include #include #include -#include - -static void BSP_START_TEXT_SECTION raspberrypi_cache_setup(void) -{ - uint32_t ctrl = 0; - - /* Disable MMU and cache, basic settings */ - ctrl = arm_cp15_get_control(); - ctrl &= ~(ARM_CP15_CTRL_I | ARM_CP15_CTRL_R | ARM_CP15_CTRL_C - | ARM_CP15_CTRL_V | ARM_CP15_CTRL_M); - ctrl |= ARM_CP15_CTRL_S; - arm_cp15_set_control(ctrl); - - arm_cp15_cache_invalidate(); - arm_cp15_tlb_invalidate(); - -} - +#include void BSP_START_TEXT_SECTION bsp_start_hook_0(void) { - raspberrypi_cache_setup(); } void BSP_START_TEXT_SECTION bsp_start_hook_1(void) { bsp_start_copy_sections(); + bsp_memory_management_initialize(); bsp_start_clear_bss(); } -- cgit v1.2.3