Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 4 | * |
| 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; version 2 of the License. |
| 8 | * |
| 9 | * This program is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | * GNU General Public License for more details. |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 13 | */ |
| 14 | |
| 15 | #include <memlayout.h> |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 16 | #include <arch/header.ld> |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 17 | #include <mainboard/addressmap.h> |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 18 | |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 19 | // Stages start after CBFS in DRAM |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 20 | #define STAGES_START (QEMU_VIRT_DRAM + CONFIG_ROM_SIZE) |
Philipp Hug | 2ef569a | 2018-12-31 14:13:47 +0100 | [diff] [blame] | 21 | |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 22 | SECTIONS |
| 23 | { |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 24 | // the virt target doesn't emulate flash and just puts the CBFS into DRAM. |
| 25 | // fake SRAM where CBFS resides. It's only done for better integration. |
| 26 | SRAM_START(QEMU_VIRT_DRAM) |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 27 | BOOTBLOCK(QEMU_VIRT_DRAM, 64K) |
| 28 | // CBFS goes here |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 29 | SRAM_END(STAGES_START) |
| 30 | DRAM_START(STAGES_START) |
| 31 | |
| 32 | #if ENV_ROMSTAGE |
| 33 | ROMSTAGE(STAGES_START, 128K) |
| 34 | #endif |
Patrick Rudolph | 871d2c7 | 2019-07-05 19:41:24 +0200 | [diff] [blame] | 35 | #if ENV_RAMSTAGE |
| 36 | REGION(opensbi, STAGES_START, 128K, 4K) |
| 37 | #endif |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 38 | PRERAM_CBMEM_CONSOLE(STAGES_START + 128K, 8K) |
Julius Werner | 8245bd2 | 2019-12-04 20:32:15 -0800 | [diff] [blame] | 39 | FMAP_CACHE(STAGES_START + 136K, 2K) |
Patrick Rudolph | c6ba36f | 2019-06-12 09:48:31 +0200 | [diff] [blame] | 40 | RAMSTAGE(STAGES_START + 200K, 16M) |
Patrick Rudolph | 8a48c92 | 2019-06-12 16:22:11 +0200 | [diff] [blame] | 41 | STACK(STAGES_START + 200K + 16M, 4K) |
Julius Werner | ec5e5e0 | 2014-08-20 15:29:56 -0700 | [diff] [blame] | 42 | } |