coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
soc.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootmem.h>
4 #include <device/device.h>
5 #include <symbols.h>
6 #include <soc/emi.h>
7 
9 {
10  bootmem_add_range(0x101000, 124 * KiB, BM_MEM_BL31);
11 }
12 
13 static void soc_read_resources(struct device *dev)
14 {
15  ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
16 }
17 
18 static void soc_init(struct device *dev)
19 {
20 }
21 
22 static struct device_operations soc_ops = {
24  .set_resources = noop_set_resources,
25  .init = soc_init,
26 };
27 
28 static void enable_soc_dev(struct device *dev)
29 {
30  dev->ops = &soc_ops;
31 }
32 
34  CHIP_NAME("SOC Mediatek MT8173")
35  .enable_dev = enable_soc_dev,
36 };
@ BM_MEM_BL31
Definition: bootmem.h:30
void bootmem_add_range(uint64_t start, uint64_t size, const enum bootmem_type tag)
Definition: bootmem.c:88
#define KiB
Definition: helpers.h:75
void bootmem_platform_add_ranges(void)
Definition: soc.c:312
size_t sdram_size(void)
Definition: emi.c:117
#define CHIP_NAME(X)
Definition: device.h:32
static void noop_set_resources(struct device *dev)
Definition: device.h:74
#define ram_resource(dev, idx, basek, sizek)
Definition: device.h:321
u8 _dram[]
static void enable_soc_dev(struct device *dev)
Definition: soc.c:28
static void soc_read_resources(struct device *dev)
Definition: soc.c:13
static struct device_operations soc_ops
Definition: soc.c:22
static void soc_init(struct device *dev)
Definition: soc.c:18
struct chip_operations soc_mediatek_mt8173_ops
Definition: soc.c:33
unsigned long uintptr_t
Definition: stdint.h:21
void(* read_resources)(struct device *dev)
Definition: device.h:39
Definition: device.h:107
struct device_operations * ops
Definition: device.h:143