Heiko Stuebner | 87b9a3c | 2019-03-14 22:12:04 +0100 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | #ifndef ROCKCHIP_PLAT_LD_S |
| 7 | #define ROCKCHIP_PLAT_LD_S |
| 8 | |
| 9 | #include <lib/xlat_tables/xlat_tables_defs.h> |
| 10 | |
| 11 | MEMORY { |
| 12 | SRAM (rwx): ORIGIN = SRAM_BASE, LENGTH = SRAM_SIZE |
| 13 | PMUSRAM (rwx): ORIGIN = PMUSRAM_BASE, LENGTH = PMUSRAM_RSIZE |
| 14 | } |
| 15 | |
| 16 | SECTIONS |
| 17 | { |
| 18 | . = SRAM_BASE; |
| 19 | ASSERT(. == ALIGN(PAGE_SIZE), |
| 20 | "SRAM_BASE address is not aligned on a page boundary.") |
| 21 | |
| 22 | .text_sram : ALIGN(PAGE_SIZE) { |
| 23 | __bl32_sram_text_start = .; |
| 24 | *(.sram.text) |
| 25 | *(.sram.rodata) |
| 26 | __bl32_sram_text_real_end = .; |
| 27 | . = ALIGN(PAGE_SIZE); |
| 28 | __bl32_sram_text_end = .; |
| 29 | } >SRAM |
| 30 | ASSERT((__bl32_sram_text_real_end - __bl32_sram_text_start) <= |
| 31 | SRAM_TEXT_LIMIT, ".text_sram has exceeded its limit") |
| 32 | |
| 33 | .data_sram : ALIGN(PAGE_SIZE) { |
| 34 | __bl32_sram_data_start = .; |
| 35 | *(.sram.data) |
| 36 | __bl32_sram_data_real_end = .; |
| 37 | . = ALIGN(PAGE_SIZE); |
| 38 | __bl32_sram_data_end = .; |
| 39 | } >SRAM |
| 40 | ASSERT((__bl32_sram_data_real_end - __bl32_sram_data_start) <= |
| 41 | SRAM_DATA_LIMIT, ".data_sram has exceeded its limit") |
| 42 | |
| 43 | .stack_sram : ALIGN(PAGE_SIZE) { |
| 44 | __bl32_sram_stack_start = .; |
| 45 | . += PAGE_SIZE; |
| 46 | __bl32_sram_stack_end = .; |
| 47 | } >SRAM |
| 48 | |
| 49 | . = PMUSRAM_BASE; |
| 50 | |
| 51 | /* |
| 52 | * pmu_cpuson_entrypoint request address |
| 53 | * align 64K when resume, so put it in the |
| 54 | * start of pmusram |
| 55 | */ |
| 56 | .pmusram : { |
| 57 | ASSERT(. == ALIGN(64 * 1024), |
| 58 | ".pmusram.entry request 64K aligned."); |
| 59 | *(.pmusram.entry) |
| 60 | |
| 61 | __bl32_pmusram_text_start = .; |
| 62 | *(.pmusram.text) |
| 63 | *(.pmusram.rodata) |
| 64 | __bl32_pmusram_text_end = .; |
| 65 | |
| 66 | __bl32_pmusram_data_start = .; |
| 67 | *(.pmusram.data) |
| 68 | __bl32_pmusram_data_end = .; |
| 69 | } >PMUSRAM |
| 70 | } |
| 71 | |
| 72 | #endif /* ROCKCHIP_PLAT_LD_S */ |