Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (C) 2014 Google, Inc. |
| 5 | * |
| 6 | * This software is licensed under the terms of the GNU General Public |
| 7 | * License version 2, as published by the Free Software Foundation, and |
| 8 | * may be copied, distributed, and modified under those terms. |
| 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. |
| 14 | */ |
| 15 | |
| 16 | #include <console/console.h> |
| 17 | #include <device/device.h> |
| 18 | #include <cbmem.h> |
| 19 | |
| 20 | static void mainboard_enable(device_t dev) |
| 21 | { |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 22 | /* |
| 23 | * Size of the emulated system RAM. On hardware, this would be external |
| 24 | * DDR memory. |
| 25 | * |
| 26 | * TODO: Get this size from the hardware-supplied configuration string. |
| 27 | */ |
| 28 | const size_t ram_size = 1*GiB; |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 29 | |
| 30 | if (!dev) { |
| 31 | printk(BIOS_EMERG, "No dev0; die\n"); |
| 32 | while (1); |
| 33 | } |
| 34 | |
Jonathan Neuschäfer | c98aac0 | 2016-07-07 20:53:29 +0200 | [diff] [blame] | 35 | ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB); |
| 36 | |
Thaminda Edirisooriya | 8fad21d | 2015-07-29 17:43:20 -0700 | [diff] [blame] | 37 | cbmem_recovery(0); |
| 38 | } |
| 39 | |
| 40 | struct chip_operations mainboard_ops = { |
| 41 | .enable_dev = mainboard_enable, |
| 42 | }; |