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/apusys.h>
6 #include <soc/devapc.h>
7 #include <soc/dfd.h>
8 #include <soc/emi.h>
9 #include <soc/mcupm.h>
10 #include <soc/mmu_operations.h>
11 #include <soc/sspm.h>
12 #include <soc/ufs.h>
13 #include <symbols.h>
14 
16 {
17  if (CONFIG(MTK_DFD))
19 }
20 
21 static void soc_read_resources(struct device *dev)
22 {
23  ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
24 }
25 
26 static void soc_init(struct device *dev)
27 {
29  apusys_init();
30  dapc_init();
31  mcupm_init();
32  sspm_init();
33  if (CONFIG(MTK_DFD))
34  dfd_init();
36 }
37 
38 static struct device_operations soc_ops = {
40  .set_resources = noop_set_resources,
41  .init = soc_init,
42 };
43 
44 static void enable_soc_dev(struct device *dev)
45 {
46  dev->ops = &soc_ops;
47 }
48 
50  CHIP_NAME("SOC Mediatek MT8192")
51  .enable_dev = enable_soc_dev,
52 };
@ 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 mcupm_init(void)
Definition: mcupm.c:24
void mtk_mmu_disable_l2c_sram(void)
static void enable_soc_dev(struct device *dev)
Definition: soc.c:44
struct chip_operations soc_mediatek_mt8192_ops
Definition: soc.c:49
static void soc_read_resources(struct device *dev)
Definition: soc.c:21
static struct device_operations soc_ops
Definition: soc.c:38
static void soc_init(struct device *dev)
Definition: soc.c:26
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 apusys_init(void)
Definition: apusys.c:30
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
void ufs_disable_refclk(void)
Definition: ufs.c:5