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