Angel Pons | 585495e | 2020-04-03 01:21:38 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 2 | |
| 3 | #include <memlayout.h> |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 4 | #include <arch/header.ld> |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 5 | #include <mainboard/addressmap.h> |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 6 | |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 7 | // Stages start after CBFS in DRAM |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 8 | #define STAGES_START (QEMU_VIRT_DRAM + CONFIG_ROM_SIZE) |
Philipp Hug | 2ef569a | 2018-12-31 14:13:47 +0100 | [diff] [blame] | 9 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 10 | SECTIONS |
| 11 | { |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 12 | // the virt target doesn't emulate flash and just puts the CBFS into DRAM. |
| 13 | // fake SRAM where CBFS resides. It's only done for better integration. |
| 14 | SRAM_START(QEMU_VIRT_DRAM) |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 15 | BOOTBLOCK(QEMU_VIRT_DRAM, 64K) |
| 16 | // CBFS goes here |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 17 | SRAM_END(STAGES_START) |
| 18 | DRAM_START(STAGES_START) |
| 19 | |
Arthur Heymans | a2bc254 | 2021-05-29 08:10:49 +0200 | [diff] [blame^] | 20 | #if ENV_SEPARATE_ROMSTAGE |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 21 | ROMSTAGE(STAGES_START, 128K) |
| 22 | #endif |
Patrick Rudolph | 871d2c7 | 2019-07-05 19:41:24 +0200 | [diff] [blame] | 23 | #if ENV_RAMSTAGE |
| 24 | REGION(opensbi, STAGES_START, 128K, 4K) |
| 25 | #endif |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 26 | PRERAM_CBMEM_CONSOLE(STAGES_START + 128K, 8K) |
Julius Werner | 8245bd2 | 2019-12-04 20:32:15 -0800 | [diff] [blame] | 27 | FMAP_CACHE(STAGES_START + 136K, 2K) |
Julius Werner | baf27db | 2019-10-02 17:28:56 -0700 | [diff] [blame] | 28 | CBFS_MCACHE(STAGES_START + 138K, 8K) |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 29 | RAMSTAGE(STAGES_START + 200K, 16M) |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 30 | STACK(STAGES_START + 200K + 16M, 4K) |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 31 | } |