Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 4 | * |
Martin Roth | b28f466 | 2018-05-26 17:58:47 -0600 | [diff] [blame] | 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. |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 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. |
| 13 | */ |
| 14 | |
| 15 | #include <console/console.h> |
| 16 | #include <device/device.h> |
| 17 | #include <cbmem.h> |
| 18 | |
Elyes HAOUAS | 5cb876c | 2018-06-08 18:31:43 +0200 | [diff] [blame] | 19 | static void mainboard_enable(struct device *dev) |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 20 | { |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 21 | /* |
| 22 | * Size of the emulated system RAM. On hardware, this would be external |
| 23 | * DDR memory. |
| 24 | * |
| 25 | * TODO: Get this size from the hardware-supplied configuration string. |
| 26 | */ |
| 27 | const size_t ram_size = 1*GiB; |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 28 | |
| 29 | if (!dev) { |
Jonathan Neuschäfer | 2af174a | 2016-10-12 00:18:00 +0200 | [diff] [blame] | 30 | die("No dev0; die\n"); |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 31 | } |
| 32 | |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 33 | ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB); |
| 34 | |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 35 | cbmem_recovery(0); |
| 36 | } |
| 37 | |
| 38 | struct chip_operations mainboard_ops = { |
| 39 | .enable_dev = mainboard_enable, |
| 40 | }; |