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 <soc/devapc.h>
6 #include <soc/dfd.h>
7 #include <soc/emi.h>
8 #include <soc/mmu_operations.h>
9 #include <soc/sspm.h>
10 #include <symbols.h>
11 
13 {
14  if (CONFIG(MTK_DFD))
16 }
17 
18 static void soc_read_resources(struct device *dev)
19 {
20  ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
21 }
22 
23 static void soc_init(struct device *dev)
24 {
26  sspm_init();
27  dapc_init();
28 
29  if (CONFIG(MTK_DFD))
30  dfd_init();
31 }
32 
33 static struct device_operations soc_ops = {
35  .set_resources = noop_set_resources,
36  .init = soc_init,
37 };
38 
39 static void enable_soc_dev(struct device *dev)
40 {
41  dev->ops = &soc_ops;
42 }
43 
45  CHIP_NAME("SOC Mediatek MT8186")
46  .enable_dev = enable_soc_dev,
47 };
@ BM_MEM_RESERVED
Definition: bootmem.h:24
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
void dfd_init(void)
Definition: dfd.c:7
@ CONFIG
Definition: dsi_common.h:201
#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[]
void mtk_mmu_disable_l2c_sram(void)
static void enable_soc_dev(struct device *dev)
Definition: soc.c:39
struct chip_operations soc_mediatek_mt8186_ops
Definition: soc.c:44
static void soc_read_resources(struct device *dev)
Definition: soc.c:18
static struct device_operations soc_ops
Definition: soc.c:33
static void soc_init(struct device *dev)
Definition: soc.c:23
void dapc_init(void)
Definition: devapc.c:1306
#define DFD_DUMP_SIZE
Definition: dfd.h:10
#define DFD_DUMP_ADDRESS
Definition: dfd.h:9
void sspm_init(void)
Definition: sspm.c:19
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