From 87cf0b9308df7b3a78f264116b94c74ca22265f8 Mon Sep 17 00:00:00 2001 From: Mary Ruthven Date: Tue, 9 Nov 2021 14:07:01 -0600 Subject: Revert "core: Allow .bss and .data sections in DRAM" This reverts commit 0528c46598c8c89f04b7129722de50e178b62aa2. BUG=b:200823466 TEST=make buildall -j Change-Id: I7777cf51e2fee18975ae8267df9af4d2ac266de8 Signed-off-by: Mary Ruthven Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3273368 Reviewed-by: Vadim Sukhomlinov --- core/cortex-m/ec.lds.S | 71 +++----------------------------------------------- 1 file changed, 3 insertions(+), 68 deletions(-) (limited to 'core') diff --git a/core/cortex-m/ec.lds.S b/core/cortex-m/ec.lds.S index 0e712f7e9c..b00c538552 100644 --- a/core/cortex-m/ec.lds.S +++ b/core/cortex-m/ec.lds.S @@ -475,74 +475,9 @@ SECTIONS #endif /* CONFIG_CHIP_MEMORY_REGIONS */ #ifdef CONFIG_DRAM_BASE - - /* - * Sections in DRAM region are constructed as like in non-DRAM regions: - * .dram.data LMA is for preserving initialized data across resets. - * The only difference is that they are all in the DRAM region: - * .dram.text | LOAD - * .dram.rodata | LOAD - * .dram.data LMA | LOAD - * .dram.data VMA | - * .dram.bss | NOLOAD - * TODO(b:123269246): Enable MPU protectable DRAM section. This might - * introduce a RO-DRAM section for .dram.text, .dram.rodata and - * .dram.data LMA. - */ - - .dram.text : { - . = ALIGN(4); - KEEP(*(SORT(.dram.text.keep.*))) - *(SORT(.dram.text.*)) - . = ALIGN(4); - } > DRAM - - .dram.rodata : { - . = ALIGN(4); - KEEP(*(SORT(.dram.rodata.keep.*))) - *(SORT(.dram.rodata.*)) - . = ALIGN(4); - } > DRAM - - __dram_data_lma_start = ADDR(.dram.rodata) + SIZEOF(.dram.rodata); - - /* Place .dram.data LMA in between .dram.rodata and .dram.data VMA. */ -#ifdef __clang__ - /* - * The evaluation timing for SIZEOF() and symbols are different in - * ld and lld. - */ - .dram.data __dram_data_lma_start + SIZEOF(.dram.data) : { -#else - .dram.data __dram_data_lma_start + - (__dram_data_end - __dram_data_start) : { -#endif /* __clang__ */ - . = ALIGN(4); - __dram_data_start = .; - *(.dram.data*) - . = ALIGN(4); - __dram_data_end = .; - - /* - * Normally, '> DRAM AT > DRAM' should be the same as '> DRAM', - * and they will be at the same address. However, if the address - * of VMA specified, LMA and VMA might have different addresses: - * '> DRAM' places VMA at the address where section declaration - * specified. - * 'AT > DRAM' places LMA at the location counter's address. - */ - } > DRAM AT > DRAM - - /* - * ld assigns correct attribute for .bss, but not for other .*.bss, - * we need an explicltly NOLOAD. - */ - .dram.bss(NOLOAD) : { - . = ALIGN(4); - __dram_bss_start = .; - *(SORT(.dram.bss*)) - . = ALIGN(4); - __dram_bss_end = .; + .dram : { + KEEP(*(SORT(.dram.keep.*))) + *(SORT(.dram.*)) } > DRAM #endif -- cgit v1.2.1