Changeset 51ffa21 in rtems
- Timestamp:
- 07/22/22 06:27:12 (17 months ago)
- Branches:
- master
- Children:
- 31036f1d
- Parents:
- b868d0a
- git-author:
- Chris Johns <chrisj@…> (07/22/22 06:27:12)
- git-committer:
- Chris Johns <chrisj@…> (07/27/22 23:04:46)
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bsps/aarch64/xilinx-versal/include/bsp.h
rb868d0a r51ffa21 48 48 49 49 #include <bsp/default-initial-extension.h> 50 #include <bsp/linker-symbols.h> 50 51 #include <bsp/start.h> 51 52 … … 61 62 62 63 #define BSP_RESET_SMC 64 65 /* 66 * DDRMC mapping 67 */ 68 LINKER_SYMBOL(bsp_r0_ram_base) 69 LINKER_SYMBOL(bsp_r0_ram_end) 70 LINKER_SYMBOL(bsp_r1_ram_base) 71 LINKER_SYMBOL(bsp_r1_ram_end) 63 72 64 73 /** -
bsps/aarch64/xilinx-versal/start/bspstartmmu.c
rb868d0a r51ffa21 39 39 #include <libcpu/mmu-vmsav8-64.h> 40 40 41 #include <rtems/malloc.h> 42 #include <rtems/sysinit.h> 43 41 44 BSP_START_DATA_SECTION static const aarch64_mmu_config_entry 42 45 versal_mmu_config_table[] = { … … 58 61 .end = 0xffc00000U, 59 62 .flags = AARCH64_MMU_DEVICE 63 }, { /* DDRMC0_region1_mem, if not used size is 0 and ignored */ 64 .begin = (uintptr_t) bsp_r1_ram_base, 65 .end = (uintptr_t) bsp_r1_ram_end, 66 .flags = AARCH64_MMU_DATA_RW_CACHED 67 } 68 }; 69 70 /* 71 * Create an MMU table to get the R1 base and end. This avoids 72 * relocation errors as the R1 addresses are in the upper A64 address 73 * space. 74 * 75 * The versal_mmu_config_table table cannot be used because the regions 76 * in that table have no identifiers to indicate which region is the 77 * the DDRMC0_region1_mem region. 78 */ 79 static const struct mem_region { 80 uintptr_t begin; 81 uintptr_t end; 82 } bsp_r1_region[] = { 83 { /* DDRMC0_region1_mem, if not used size is 0 and ignored */ 84 .begin = (uintptr_t) bsp_r1_ram_base, 85 .end = (uintptr_t) bsp_r1_ram_end, 60 86 } 61 87 }; … … 79 105 aarch64_mmu_enable(); 80 106 } 107 108 void bsp_r1_heap_extend(void); 109 void bsp_r1_heap_extend(void) 110 { 111 const struct mem_region* r1 = &bsp_r1_region[0]; 112 if (r1->begin != r1->end) { 113 rtems_status_code sc = 114 rtems_heap_extend((void*) r1->begin, r1->end - r1->begin); 115 if (sc != RTEMS_SUCCESSFUL) { 116 bsp_fatal(BSP_FATAL_HEAP_EXTEND_ERROR); 117 } 118 } 119 } 120 121 /* 122 * Initialise after the IDLE thread exists so the protected heap 123 * extend call has a valid context. 124 */ 125 RTEMS_SYSINIT_ITEM( 126 bsp_r1_heap_extend, 127 RTEMS_SYSINIT_IDLE_THREADS, 128 RTEMS_SYSINIT_ORDER_LAST 129 ); -
bsps/include/bsp/fatal.h
rb868d0a r51ffa21 74 74 BSP_FATAL_CONSOLE_REGISTER_DEV_2, 75 75 BSP_FATAL_MMU_ADDRESS_INVALID, 76 BSP_FATAL_HEAP_EXTEND_ERROR, 76 77 77 78 /* ARM fatal codes */ -
spec/build/bsps/aarch64/xilinx-versal/linkcmds_lp64.yml
rb868d0a r51ffa21 5 5 6 6 /* 7 * Copyright (C) 2021 Gedare Bloom <gedare@rtems.org> 7 * Copyright (C) 2021 Gedare Bloom <gedare@rtems.org> 8 * Copyright (C) 2022 Chris Johns <chrisj@rtems.org> 8 9 * 9 10 * Redistribution and use in source and binary forms, with or without … … 29 30 */ 30 31 32 /* 33 * The RAM supports 32G of DDR4 or LPDDR memory using DDRMC0. 34 * 35 * The DDR Conroller (DDRC) has two regions R0 and R1. R0 is 36 * in the A32 address space and R1 is in the A64 address space. 37 */ 38 DDRMC0_REGION_0_BASE = 0x00000000000; 39 DDRMC0_REGION_0_LENGTH = 0x00080000000; 40 DDRMC0_REGION_1_BASE = 0x00800000000; 41 DDRMC0_REGION_1_LENGTH = 0x01000000000; 42 43 BSP_RAM_BASE = ${BSP_XILINX_VERSAL_RAM_BASE}; 44 45 BSP_R0_RAM_BASE = DDRMC0_REGION_0_BASE; 46 BSP_R0_RAM_LENGTH = 47 ${BSP_XILINX_VERSAL_RAM_LENGTH} >= DDRMC0_REGION_0_LENGTH ? 48 DDRMC0_REGION_0_LENGTH - BSP_RAM_BASE : ${BSP_XILINX_VERSAL_RAM_LENGTH}; 49 BSP_R0_RAM_END = BSP_RAM_BASE + BSP_R0_RAM_LENGTH; 50 51 BSP_R1_RAM_BASE = DDRMC0_REGION_1_BASE; 52 BSP_R1_RAM_LENGTH = 53 ${BSP_XILINX_VERSAL_RAM_LENGTH} >= DDRMC0_REGION_0_LENGTH ? 54 ${BSP_XILINX_VERSAL_RAM_LENGTH} - DDRMC0_REGION_0_LENGTH : 0; 55 56 AARCH64_MMU_TT_PAGES_SIZE = 0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}; 57 31 58 MEMORY { 32 RAM : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_LOAD_OFFSET}, LENGTH = ${BSP_XILINX_VERSAL_RAM_LENGTH} - ${BSP_XILINX_VERSAL_LOAD_OFFSET} - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}) 33 NOCACHE : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_RAM_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}) - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH}, LENGTH = ${BSP_XILINX_VERSAL_NOCACHE_LENGTH} 34 RAM_MMU : ORIGIN = ${BSP_XILINX_VERSAL_RAM_BASE} + ${BSP_XILINX_VERSAL_RAM_LENGTH} - (0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES}), LENGTH = 0x1000 * ${AARCH64_MMU_TRANSLATION_TABLE_PAGES} 59 RAM : ORIGIN = BSP_RAM_BASE + ${BSP_XILINX_VERSAL_LOAD_OFFSET}, 60 LENGTH = BSP_R0_RAM_LENGTH - ${BSP_XILINX_VERSAL_LOAD_OFFSET} - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH} - AARCH64_MMU_TT_PAGES_SIZE 61 RAM1 : ORIGIN = BSP_R1_RAM_BASE, 62 LENGTH = BSP_R1_RAM_LENGTH 63 NOCACHE : ORIGIN = BSP_RAM_BASE + BSP_R0_RAM_LENGTH - AARCH64_MMU_TT_PAGES_SIZE - ${BSP_XILINX_VERSAL_NOCACHE_LENGTH}, 64 LENGTH = ${BSP_XILINX_VERSAL_NOCACHE_LENGTH} 65 RAM_MMU : ORIGIN = BSP_R0_RAM_END - AARCH64_MMU_TT_PAGES_SIZE, 66 LENGTH = AARCH64_MMU_TT_PAGES_SIZE 35 67 } 36 68 … … 59 91 bsp_vector_table_in_start_section = 1; 60 92 93 bsp_r0_ram_base = DDRMC0_REGION_0_BASE; 94 bsp_r0_ram_end = ORIGIN (RAM) + LENGTH (RAM); 95 bsp_r1_ram_base = ORIGIN (RAM1); 96 bsp_r1_ram_end = ORIGIN (RAM1) + LENGTH (RAM1); 97 61 98 bsp_translation_table_base = ORIGIN (RAM_MMU); 62 99 bsp_translation_table_end = ORIGIN (RAM_MMU) + LENGTH (RAM_MMU); … … 67 104 INCLUDE linkcmds.base 68 105 copyrights: 69 - Copyright (C) 2021 Gedare Bloom <gedare@rtems.org> 106 - Copyright (C) 2021 Gedare Bloom <gedare@rtems.org> 107 - Copyright (C) 2022 Chris Johns <chrisj@rtems.org> 70 108 enabled-by: true 71 109 install-path: ${BSP_LIBDIR}
Note: See TracChangeset
for help on using the changeset viewer.