Changeset 037e8ae5 in rtems
- Timestamp:
- May 2, 2013, 3:42:20 PM (8 years ago)
- Branches:
- 4.11, 5, master
- Children:
- 88cf23f
- Parents:
- 544615d
- git-author:
- Sebastian Huber <sebastian.huber@…> (05/02/13 15:42:20)
- git-committer:
- Sebastian Huber <sebastian.huber@…> (05/03/13 15:30:55)
- Location:
- c/src/lib
- Files:
-
- 3 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
c/src/lib/libbsp/arm/lpc32xx/Makefile.am
r544615d r037e8ae5 94 94 libbsp_a_SOURCES += ../shared/abort/simple_abort.c 95 95 libbsp_a_SOURCES += ../shared/startup/bsp-start-memcpy.S 96 libbsp_a_SOURCES += ../shared/arm-cp15-set-ttb-entries.c 96 97 97 98 # Startup … … 129 130 libbsp_a_SOURCES += misc/emc.c 130 131 libbsp_a_SOURCES += misc/i2c.c 131 libbsp_a_SOURCES += misc/mmu.c132 132 libbsp_a_SOURCES += misc/nand-mlc.c 133 133 libbsp_a_SOURCES += misc/nand-mlc-erase-block-safe.c -
c/src/lib/libbsp/arm/lpc32xx/include/mmu.h
r544615d r037e8ae5 62 62 * @return Previous section flags of the first modified entry. 63 63 */ 64 uint32_t lpc32xx_set_translation_table_entries(64 static inline uint32_t lpc32xx_set_translation_table_entries( 65 65 const void *begin, 66 66 const void *end, 67 67 uint32_t section_flags 68 ); 68 ) 69 { 70 return arm_cp15_set_translation_table_entries(begin, end, section_flags); 71 } 69 72 70 73 /** @} */ -
c/src/lib/libbsp/arm/shared/arm-cp15-set-ttb-entries.c
r544615d r037e8ae5 1 /**2 * @file3 *4 * @ingroup lpc32xx_mmu5 *6 * @brief MMU support implementation.7 */8 9 1 /* 10 * Copyright (c) 2010-201 1embedded brains GmbH. All rights reserved.2 * Copyright (c) 2010-2013 embedded brains GmbH. All rights reserved. 11 3 * 12 4 * embedded brains GmbH … … 21 13 */ 22 14 23 #include < bsp/mmu.h>15 #include <libcpu/arm-cp15.h> 24 16 25 static uint32_t disable_mmu(void) 26 { 27 uint32_t ctrl = 0; 28 29 arm_cp15_data_cache_test_and_clean_and_invalidate(); 30 31 ctrl = arm_cp15_get_control(); 32 arm_cp15_set_control(ctrl & ~ARM_CP15_CTRL_M); 33 34 arm_cp15_tlb_invalidate(); 35 36 return ctrl; 37 } 38 39 static void restore_mmu_control(uint32_t ctrl) 40 { 41 arm_cp15_set_control(ctrl); 42 } 43 44 uint32_t set_translation_table_entries( 17 static uint32_t set_translation_table_entries( 45 18 const void *begin, 46 19 const void *end, … … 48 21 ) 49 22 { 23 uint32_t cl_size = arm_cp15_get_min_cache_line_size(); 50 24 uint32_t *ttb = arm_cp15_get_translation_table_base(); 51 25 uint32_t i = ARM_MMU_SECT_GET_INDEX(begin); 52 26 uint32_t iend = ARM_MMU_SECT_GET_INDEX(ARM_MMU_SECT_MVA_ALIGN_UP(end)); 53 uint32_t ctrl = disable_mmu(); 54 uint32_t section_flags_of_first_entry = ttb [i]; 27 uint32_t ctrl; 28 uint32_t section_flags_of_first_entry; 29 30 ctrl = arm_cp15_mmu_disable(cl_size); 31 arm_cp15_tlb_invalidate(); 32 section_flags_of_first_entry = ttb [i]; 55 33 56 34 while (i < iend) { 57 ttb [i] = (i << ARM_MMU_SECT_BASE_SHIFT) | section_flags; 35 uint32_t addr = i << ARM_MMU_SECT_BASE_SHIFT; 36 37 ttb [i] = addr | section_flags; 38 58 39 ++i; 59 40 } 60 41 61 restore_mmu_control(ctrl);42 arm_cp15_set_control(ctrl); 62 43 63 44 return section_flags_of_first_entry; 64 45 } 65 46 66 uint32_t lpc32xx_set_translation_table_entries(47 uint32_t arm_cp15_set_translation_table_entries( 67 48 const void *begin, 68 49 const void *end, … … 71 52 { 72 53 rtems_interrupt_level level; 73 uint32_t section_flags_of_first_entry = 0;54 uint32_t section_flags_of_first_entry; 74 55 75 56 rtems_interrupt_disable(level); -
c/src/lib/libcpu/arm/shared/include/arm-cp15.h
r544615d r037e8ae5 775 775 } 776 776 777 /** 778 * @brief Sets the @a section_flags for the address range [@a begin, @a end). 779 * 780 * @return Previous section flags of the first modified entry. 781 */ 782 uint32_t arm_cp15_set_translation_table_entries( 783 const void *begin, 784 const void *end, 785 uint32_t section_flags 786 ); 787 777 788 /** @} */ 778 789
Note: See TracChangeset
for help on using the changeset viewer.