blob: af0df9c9b4f2792045fd14be522634174fbda4f8 [file] [log] [blame]
Angel Pons585495e2020-04-03 01:21:38 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00002
3#include <console/console.h>
4#include <device/device.h>
Philipp Hug2ef569a2018-12-31 14:13:47 +01005#include <symbols.h>
Patrick Rudolphbd4bcab2019-06-30 22:12:15 +02006#include <ramdetect.h>
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00007
Elyes HAOUAS5cb876c2018-06-08 18:31:43 +02008static void mainboard_enable(struct device *dev)
Ronald G. Minniche0e784a2014-11-26 19:25:47 +00009{
Patrick Rudolphbd4bcab2019-06-30 22:12:15 +020010 size_t dram_mb_detected;
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000011
12 if (!dev) {
Jonathan Neuschäfer2af174a2016-10-12 00:18:00 +020013 die("No dev0; die\n");
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000014 }
15
Patrick Rudolphbd4bcab2019-06-30 22:12:15 +020016 dram_mb_detected = probe_ramsize((uintptr_t)_dram, CONFIG_DRAM_SIZE_MB);
Kyösti Mälkki27d62992022-05-24 20:25:58 +030017 ram_resource_kb(dev, 0, (uintptr_t)_dram / KiB, dram_mb_detected * MiB / KiB);
Ronald G. Minniche0e784a2014-11-26 19:25:47 +000018}
19
20struct chip_operations mainboard_ops = {
21 .enable_dev = mainboard_enable,
22};