coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mainboard.c
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <
console/console.h
>
4
#include <
device/device.h
>
5
#include <symbols.h>
6
#include <
ramdetect.h
>
7
8
static
void
mainboard_enable
(
struct
device
*dev)
9
{
10
size_t
dram_mb_detected;
11
12
if
(!dev) {
13
die
(
"No dev0; die\n"
);
14
}
15
16
dram_mb_detected =
probe_ramsize
((
uintptr_t
)
_dram
, CONFIG_DRAM_SIZE_MB);
17
ram_resource
(dev, 0, (
uintptr_t
)
_dram
/
KiB
, dram_mb_detected *
MiB
/
KiB
);
18
}
19
20
struct
chip_operations
mainboard_ops
= {
21
.
enable_dev
=
mainboard_enable
,
22
};
mainboard_ops
struct chip_operations mainboard_ops
Definition:
mainboard.c:19
MiB
#define MiB
Definition:
helpers.h:76
KiB
#define KiB
Definition:
helpers.h:75
die
void __noreturn die(const char *fmt,...)
Definition:
die.c:17
console.h
mainboard_enable
static void mainboard_enable(struct device *dev)
Definition:
mainboard.c:8
device.h
ram_resource
#define ram_resource(dev, idx, basek, sizek)
Definition:
device.h:321
_dram
u8 _dram[]
ramdetect.h
probe_ramsize
size_t probe_ramsize(const uintptr_t dram_start, const size_t probe_size)
Definition:
ramdetect.c:40
uintptr_t
unsigned long uintptr_t
Definition:
stdint.h:21
chip_operations
Definition:
device.h:23
chip_operations::enable_dev
void(* enable_dev)(struct device *dev)
Definition:
device.h:24
device
Definition:
device.h:107
src
mainboard
emulation
qemu-riscv
mainboard.c
Generated by
1.9.1