bsps/arm: Add ARMV7_CP15_START_DEFAULT_SECTIONS

This commit is contained in:
Sebastian Huber
2013-10-27 19:35:16 +01:00
parent f074a4d1bb
commit fbed79bdd0
3 changed files with 46 additions and 82 deletions

View File

@@ -16,51 +16,11 @@
#include <bsp/start.h>
#include <bsp/arm-cp15-start.h>
#include <bsp/arm-a9mpcore-start.h>
#include <bsp/linker-symbols.h>
BSP_START_DATA_SECTION static const arm_cp15_start_section_config
rvpbxa9_mmu_config_table[] = {
ARMV7_CP15_START_DEFAULT_SECTIONS,
{
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_bss_begin,
.end = (uint32_t) bsp_section_bss_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_work_begin,
.end = (uint32_t) bsp_section_work_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_stack_begin,
.end = (uint32_t) bsp_section_stack_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = 0x10000000U,
.end = 0x10020000U,
.flags = ARMV7_MMU_DEVICE

View File

@@ -18,6 +18,7 @@
#include <libcpu/arm-cp15.h>
#include <bsp/start.h>
#include <bsp/linker-symbols.h>
#ifdef __cplusplus
extern "C" {
@@ -29,6 +30,49 @@ typedef struct {
uint32_t flags;
} arm_cp15_start_section_config;
#define ARMV7_CP15_START_DEFAULT_SECTIONS \
{ \
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.begin = (uint32_t) bsp_section_bss_begin, \
.end = (uint32_t) bsp_section_bss_end, \
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.begin = (uint32_t) bsp_section_work_begin, \
.end = (uint32_t) bsp_section_work_end, \
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}, { \
.begin = (uint32_t) bsp_section_stack_begin, \
.end = (uint32_t) bsp_section_stack_end, \
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED \
}
extern const arm_cp15_start_section_config bsp_mm_config_table[];
extern const size_t bsp_mm_config_table_size;

View File

@@ -16,51 +16,11 @@
#include <bsp/start.h>
#include <bsp/arm-cp15-start.h>
#include <bsp/arm-a9mpcore-start.h>
#include <bsp/linker-symbols.h>
BSP_START_DATA_SECTION static const arm_cp15_start_section_config
zynq_mmu_config_table[] = {
ARMV7_CP15_START_DEFAULT_SECTIONS,
{
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.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 = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_bss_begin,
.end = (uint32_t) bsp_section_bss_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_work_begin,
.end = (uint32_t) bsp_section_work_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = (uint32_t) bsp_section_stack_begin,
.end = (uint32_t) bsp_section_stack_end,
.flags = ARMV7_MMU_DATA_READ_WRITE_CACHED
}, {
.begin = 0xe0000000U,
.end = 0xe0200000U,
.flags = ARMV7_MMU_DEVICE