blob: 6b4a96b43b664c41f1d141bd203f4741fe565074 [file] [log] [blame]
Angel Pons585495e2020-04-03 01:21:38 +02001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -07003
4#include <console/console.h>
5#include <device/device.h>
6#include <cbmem.h>
7
Elyes HAOUAS5cb876c2018-06-08 18:31:43 +02008static void mainboard_enable(struct device *dev)
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -07009{
Jonathan Neuschäferc98aac02016-07-07 20:53:29 +020010 /*
11 * Size of the emulated system RAM. On hardware, this would be external
12 * DDR memory.
13 *
14 * TODO: Get this size from the hardware-supplied configuration string.
15 */
16 const size_t ram_size = 1*GiB;
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070017
18 if (!dev) {
Jonathan Neuschäfer2af174a2016-10-12 00:18:00 +020019 die("No dev0; die\n");
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070020 }
21
Jonathan Neuschäferc98aac02016-07-07 20:53:29 +020022 ram_resource(dev, 0, 0x80000000/KiB, ram_size/KiB);
23
Thaminda Edirisooriya8fad21d2015-07-29 17:43:20 -070024 cbmem_recovery(0);
25}
26
27struct chip_operations mainboard_ops = {
28 .enable_dev = mainboard_enable,
29};