Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2016, ARM Limited and Contributors. All rights reserved. |
| 3 | * |
dp-arm | fa3cf0b | 2017-05-03 09:38:09 +0100 | [diff] [blame] | 4 | * SPDX-License-Identifier: BSD-3-Clause |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 5 | */ |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 6 | #ifndef ROCKCHIP_PLAT_LD_S |
| 7 | #define ROCKCHIP_PLAT_LD_S |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 8 | |
Antonio Nino Diaz | e0f9063 | 2018-12-14 00:18:21 +0000 | [diff] [blame] | 9 | #include <lib/xlat_tables/xlat_tables_defs.h> |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 10 | |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 11 | MEMORY { |
| 12 | SRAM (rwx): ORIGIN = SRAM_BASE, LENGTH = SRAM_SIZE |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 13 | PMUSRAM (rwx): ORIGIN = PMUSRAM_BASE, LENGTH = PMUSRAM_RSIZE |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 14 | } |
| 15 | |
| 16 | SECTIONS |
| 17 | { |
| 18 | . = SRAM_BASE; |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 19 | ASSERT(. == ALIGN(PAGE_SIZE), |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 20 | "SRAM_BASE address is not aligned on a page boundary.") |
| 21 | |
| 22 | /* |
| 23 | * The SRAM space allocation for RK3399 |
| 24 | * ---------------- |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 25 | * | m0 code bin |
| 26 | * ---------------- |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 27 | * | sram text |
| 28 | * ---------------- |
| 29 | * | sram data |
| 30 | * ---------------- |
| 31 | */ |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 32 | .incbin_sram : ALIGN(PAGE_SIZE) { |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 33 | __sram_incbin_start = .; |
| 34 | *(.sram.incbin) |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 35 | __sram_incbin_real_end = .; |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 36 | . = ALIGN(PAGE_SIZE); |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 37 | __sram_incbin_end = .; |
| 38 | } >SRAM |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 39 | ASSERT((__sram_incbin_real_end - __sram_incbin_start) <= |
| 40 | SRAM_BIN_LIMIT, ".incbin_sram has exceeded its limit") |
Caesar Wang | b400374 | 2016-10-12 08:10:12 +0800 | [diff] [blame] | 41 | |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 42 | .text_sram : ALIGN(PAGE_SIZE) { |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 43 | __bl31_sram_text_start = .; |
| 44 | *(.sram.text) |
| 45 | *(.sram.rodata) |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 46 | __bl31_sram_text_real_end = .; |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 47 | . = ALIGN(PAGE_SIZE); |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 48 | __bl31_sram_text_end = .; |
| 49 | } >SRAM |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 50 | ASSERT((__bl31_sram_text_real_end - __bl31_sram_text_start) <= |
| 51 | SRAM_TEXT_LIMIT, ".text_sram has exceeded its limit") |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 52 | |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 53 | .data_sram : ALIGN(PAGE_SIZE) { |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 54 | __bl31_sram_data_start = .; |
| 55 | *(.sram.data) |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 56 | __bl31_sram_data_real_end = .; |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 57 | . = ALIGN(PAGE_SIZE); |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 58 | __bl31_sram_data_end = .; |
| 59 | } >SRAM |
Lin Huang | 88dd123 | 2017-05-16 16:40:46 +0800 | [diff] [blame] | 60 | ASSERT((__bl31_sram_data_real_end - __bl31_sram_data_start) <= |
| 61 | SRAM_DATA_LIMIT, ".data_sram has exceeded its limit") |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 62 | |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 63 | .stack_sram : ALIGN(PAGE_SIZE) { |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 64 | __bl31_sram_stack_start = .; |
Antonio Nino Diaz | 2ce2b09 | 2017-11-15 11:45:35 +0000 | [diff] [blame] | 65 | . += PAGE_SIZE; |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 66 | __bl31_sram_stack_end = .; |
| 67 | } >SRAM |
| 68 | |
| 69 | . = PMUSRAM_BASE; |
| 70 | |
| 71 | /* |
| 72 | * pmu_cpuson_entrypoint request address |
| 73 | * align 64K when resume, so put it in the |
| 74 | * start of pmusram |
| 75 | */ |
| 76 | .pmusram : { |
| 77 | ASSERT(. == ALIGN(64 * 1024), |
| 78 | ".pmusram.entry request 64K aligned."); |
| 79 | *(.pmusram.entry) |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 80 | |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 81 | __bl31_pmusram_text_start = .; |
| 82 | *(.pmusram.text) |
| 83 | *(.pmusram.rodata) |
| 84 | __bl31_pmusram_text_end = .; |
Lin Huang | 00960ba | 2018-04-20 15:55:21 +0800 | [diff] [blame] | 85 | |
| 86 | /* M0 start address request 4K align */ |
| 87 | . = ALIGN(4096); |
| 88 | __pmusram_incbin_start = .; |
| 89 | *(.pmusram.incbin) |
| 90 | __pmusram_incbin_end = .; |
| 91 | |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 92 | __bl31_pmusram_data_start = .; |
| 93 | *(.pmusram.data) |
| 94 | __bl31_pmusram_data_end = .; |
Lin Huang | 30e4339 | 2017-05-04 16:02:45 +0800 | [diff] [blame] | 95 | } >PMUSRAM |
Caesar Wang | d90f43e | 2016-10-11 09:36:00 +0800 | [diff] [blame] | 96 | } |
| 97 | |
Antonio Nino Diaz | 5eb8837 | 2018-11-08 10:20:19 +0000 | [diff] [blame] | 98 | #endif /* ROCKCHIP_PLAT_LD_S */ |