blob: c5d9d08324d1217cbb6548bd1e09aa676e0b7dd9 [file] [log] [blame]
Angel Ponse67ab182020-04-04 18:51:11 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Tristan Shieh3ddf57e2018-05-31 09:20:53 +08002
3#include <memlayout.h>
4
5#include <arch/header.ld>
6
7/*
8 * SRAM_L2C is the half part of L2 cache that we borrow to be used as SRAM.
9 * It will be returned before starting the ramstage.
10 * SRAM_L2C and SRAM can be cached, but only SRAM is DMA-able.
11 */
Julius Werner82d16b12020-12-30 15:51:10 -080012#define SRAM_L2C_START(addr) REGION_START(sram_l2c, addr)
13#define SRAM_L2C_END(addr) REGION_END(sram_l2c, addr)
Huayang Duan846be442019-08-30 18:01:19 +080014#define DRAM_INIT_CODE(addr, size) \
15 REGION(dram_init_code, addr, size, 4)
Tristan Shieh3ddf57e2018-05-31 09:20:53 +080016
Yidi Linc221d562020-12-02 16:43:43 +080017#define DRAM_DMA(addr, size) \
18 REGION(dram_dma, addr, size, 4K) \
19 _ = ASSERT(size % 4K == 0, \
20 "DRAM DMA buffer should be multiple of smallest page size (4K)!");
21
Tristan Shieh3ddf57e2018-05-31 09:20:53 +080022SECTIONS
23{
24 SRAM_START(0x00100000)
25 VBOOT2_WORK(0x00100000, 12K)
Sergii Dmytruk2710df72022-11-10 00:40:51 +020026 TPM_LOG(0x00103000, 2K)
Hung-Te Line4776262019-11-13 17:37:17 +080027 FMAP_CACHE(0x00103800, 2K)
28 WATCHDOG_TOMBSTONE(0x00104000, 4)
29 PRERAM_CBMEM_CONSOLE(0x00104004, 63K - 4)
30 TIMESTAMP(0x00113c00, 1K)
Tristan Shieh4b5eefa2019-08-16 15:35:50 +080031 STACK(0x00114000, 16K)
32 TTB(0x00118000, 28K)
33 DMA_COHERENT(0x0011f000, 4K)
Tristan Shieh3ddf57e2018-05-31 09:20:53 +080034 SRAM_END(0x00120000)
35
36 SRAM_L2C_START(0x00200000)
Tristan Shieh526d8402019-08-06 14:19:03 +080037 OVERLAP_DECOMPRESSOR_VERSTAGE_ROMSTAGE(0x00201000, 188K)
Julius Wernerbaf27db2019-10-02 17:28:56 -070038 BOOTBLOCK(0x00230000, 56K)
39 CBFS_MCACHE(0x0023e000, 8K)
Hung-Te Line4776262019-11-13 17:37:17 +080040 DRAM_INIT_CODE(0x00240000, 208K)
41 PRERAM_CBFS_CACHE(0x00274000, 48K)
Tristan Shieh3ddf57e2018-05-31 09:20:53 +080042 SRAM_L2C_END(0x00280000)
43
44 DRAM_START(0x40000000)
Yidi Linc221d562020-12-02 16:43:43 +080045 DRAM_DMA(0x40000000, 1M)
46 POSTRAM_CBFS_CACHE(0x40100000, 1M)
Patrick Georgi42f15052023-10-07 11:16:43 +020047 RAMSTAGE(0x40200000, 2M)
Ting Shendff29e02019-01-28 18:15:00 +080048
49 BL31(0x54600000, 0x60000)
Tristan Shieh3ddf57e2018-05-31 09:20:53 +080050}