coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
amd_mtrr.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <amdblocks/biosram.h>
4 #include <console/console.h>
5 #include <device/device.h>
6 #include <cpu/amd/mtrr.h>
7 
8 void add_uma_resource_below_tolm(struct device *nb, int idx)
9 {
10  uint32_t topmem = amd_topmem();
11  uint32_t top_of_cacheable = restore_top_of_low_cacheable();
12 
13  if (top_of_cacheable == topmem)
14  return;
15 
16  uint32_t uma_base = top_of_cacheable;
17  uint32_t uma_size = topmem - top_of_cacheable;
18 
19  printk(BIOS_INFO, "%s: uma size 0x%08x, memory start 0x%08x\n",
20  __func__, uma_size, uma_base);
21 
22  uma_resource(nb, idx, uma_base / KiB, uma_size / KiB);
23 }
static uint64_t amd_topmem(void)
Definition: mtrr.h:69
void add_uma_resource_below_tolm(struct device *nb, int idx)
Definition: amd_mtrr.c:8
uintptr_t restore_top_of_low_cacheable(void)
Definition: biosram.c:66
#define KiB
Definition: helpers.h:75
#define printk(level,...)
Definition: stdlib.h:16
#define uma_resource(dev, idx, basek, sizek)
Definition: device.h:331
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
unsigned int uint32_t
Definition: stdint.h:14
Definition: device.h:107