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 <device/device.h>
4 #include <soc/emi.h>
5 #include <soc/md_ctrl.h>
6 #include <soc/mmu_operations.h>
7 #include <soc/rtc.h>
8 #include <soc/sspm.h>
9 #include <symbols.h>
10 
11 static void soc_read_resources(struct device *dev)
12 {
13  ram_resource(dev, 0, (uintptr_t)_dram / KiB, sdram_size() / KiB);
14 }
15 
16 static void soc_init(struct device *dev)
17 {
21  sspm_init();
22 }
23 
24 static struct device_operations soc_ops = {
26  .set_resources = noop_set_resources,
27  .init = soc_init,
28 };
29 
30 static void enable_soc_dev(struct device *dev)
31 {
32  dev->ops = &soc_ops;
33 }
34 
36  CHIP_NAME("SOC Mediatek MT8183")
37  .enable_dev = enable_soc_dev,
38 };
#define KiB
Definition: helpers.h:75
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[]
void mtk_md_early_init(void)
Definition: md_ctrl.c:23
void mtk_mmu_disable_l2c_sram(void)
static void enable_soc_dev(struct device *dev)
Definition: soc.c:30
static void soc_read_resources(struct device *dev)
Definition: soc.c:11
static struct device_operations soc_ops
Definition: soc.c:24
struct chip_operations soc_mediatek_mt8183_ops
Definition: soc.c:35
static void soc_init(struct device *dev)
Definition: soc.c:16
void mt6358_dcxo_disable_unused(void)
Definition: rtc.c:326
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