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