blob: 1369a54d7013e7983c6b47d277f1e4878fc5202c [file] [log] [blame]
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -07001/*
2 * This file is part of the coreboot project.
3 *
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -07004 *
Martin Rothb28f4662018-05-26 17:58:47 -06005 * 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 Edirisooriya8fad21d2015-07-29 17:43:20 -07008 *
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 HAOUAS5cb876c2018-06-08 18:31:43 +020019static void mainboard_enable(struct device *dev)
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070020{
Jonathan Neuschäferc98aac02016-07-07 20:53:29 +020021 /*
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 Edirisooriya8fad21d2015-07-29 17:43:20 -070028
29 if (!dev) {
Jonathan Neuschäfer2af174a2016-10-12 00:18:00 +020030 die("No dev0; die\n");
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070031 }
32
Jonathan Neuschäferc98aac02016-07-07 20:53:29 +020033 ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB);
34
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070035 cbmem_recovery(0);
36}
37
38struct chip_operations mainboard_ops = {
39 .enable_dev = mainboard_enable,
40};