blob: eced9ae3b95f89008ff73c03f407a597838cf6d4 [file] [log] [blame]
Vladimir Serbinenko77231332016-02-19 22:50:50 +01001/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright (C) 2016 Vladimir Serbinenko <phcoder@gmail.com>
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 or, at your option, any later
9 * version of the License.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 */
16
17#include <console/console.h>
18#include <device/device.h>
19#include <cbmem.h>
20#include <string.h>
21#include <halt.h>
22#include "mainboard.h"
23
24static void mainboard_enable(device_t dev)
25{
26 int discovered;
27 if (!dev) {
28 printk(BIOS_EMERG, "No dev0; die\n");
29 halt();
30 }
31
32 discovered = probe_ramsize();
33 printk(BIOS_DEBUG, "%d MiB of RAM discovered\n", discovered);
34 ram_resource(dev, 0, 0x60000000 >> 10, discovered << 10);
35 cbmem_recovery(0);
36}
37
38struct chip_operations mainboard_ops = {
39 .enable_dev = mainboard_enable,
40};