diff options
author | Jiafei Pan <Jiafei.Pan@nxp.com> | 2022-02-24 10:47:33 +0800 |
---|---|---|
committer | Jiafei Pan <Jiafei.Pan@nxp.com> | 2022-03-27 23:24:24 +0800 |
commit | 96a8ed14b74cca33a8caf567d0f0a2d3b2483a3b (patch) | |
tree | 64d2a54478598d5a645f3fd140a06e35fc76e2c2 /bl2 | |
parent | ceae374357b85b4953f8462512412e2f4f1c3d76 (diff) |
feat(bl2): add support to separate no-loadable sections
Add new options SEPARATE_BL2_NOLOAD_REGION to separate no-loadable
sections (.bss, stack, page tables) to a ram region specified
by BL2_NOLOAD_START and BL2_NOLOAD_LIMIT.
Signed-off-by: Jiafei Pan <Jiafei.Pan@nxp.com>
Change-Id: I844ee0fc405474af0aff978d292c826fbe0a82fd
Diffstat (limited to 'bl2')
-rw-r--r-- | bl2/bl2_el3.ld.S | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/bl2/bl2_el3.ld.S b/bl2/bl2_el3.ld.S index bc1794c06..6aa7afd61 100644 --- a/bl2/bl2_el3.ld.S +++ b/bl2/bl2_el3.ld.S @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2022, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -17,6 +17,11 @@ MEMORY { RAM (rwx): ORIGIN = BL2_RW_BASE, LENGTH = BL2_RW_LIMIT - BL2_RW_BASE #else RAM (rwx): ORIGIN = BL2_BASE, LENGTH = BL2_LIMIT - BL2_BASE +#if SEPARATE_BL2_NOLOAD_REGION + RAM_NOLOAD (rw!a): ORIGIN = BL2_NOLOAD_START, LENGTH = BL2_NOLOAD_LIMIT - BL2_NOLOAD_START +#else +#define RAM_NOLOAD RAM +#endif #endif } @@ -106,9 +111,18 @@ SECTIONS __DATA_RAM_END__ = __DATA_END__; RELA_SECTION >RAM - STACK_SECTION >RAM - BSS_SECTION >RAM - XLAT_TABLE_SECTION >RAM +#if SEPARATE_BL2_NOLOAD_REGION + SAVED_ADDR = .; + . = BL2_NOLOAD_START; + __BL2_NOLOAD_START__ = .; +#endif + STACK_SECTION >RAM_NOLOAD + BSS_SECTION >RAM_NOLOAD + XLAT_TABLE_SECTION >RAM_NOLOAD +#if SEPARATE_BL2_NOLOAD_REGION + __BL2_NOLOAD_END__ = .; + . = SAVED_ADDR; +#endif #if USE_COHERENT_MEM /* |