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/mmu.h>
5 #include <soc/mmu_common.h>
6 #include <soc/symbols_common.h>
7 #include <soc/aop_common.h>
8 #include <soc/cpucp.h>
9 
10 static void soc_read_resources(struct device *dev)
11 {
12  void *start = NULL;
13  void *end = NULL;
14 
16  ddr_region->size / KiB);
17  reserved_ram_resource(dev, 1, (uintptr_t)_dram_soc / KiB,
18  REGION_SIZE(dram_soc) / KiB);
19  reserved_ram_resource(dev, 2, (uintptr_t)_dram_wlan / KiB,
20  REGION_SIZE(dram_wlan) / KiB);
21  reserved_ram_resource(dev, 3, (uintptr_t)_dram_wpss / KiB,
22  REGION_SIZE(dram_wpss) / KiB);
23  reserved_ram_resource(dev, 4, (uintptr_t)_dram_aop / KiB,
24  REGION_SIZE(dram_aop) / KiB);
25  reserved_ram_resource(dev, 5, (uintptr_t)_dram_cpucp / KiB,
26  REGION_SIZE(dram_cpucp) / KiB);
27  if (soc_modem_carve_out(&start, &end))
28  reserved_ram_resource(dev, 6, (uintptr_t)start / KiB, (end - start) / KiB);
29 }
30 
31 static void soc_init(struct device *dev)
32 {
35 }
36 
37 static struct device_operations soc_ops = {
39  .init = soc_init,
40 };
41 
42 static void enable_soc_dev(struct device *dev)
43 {
44  dev->ops = &soc_ops;
45 }
46 
48  CHIP_NAME("SOC Qualcomm SC7280")
49  .enable_dev = enable_soc_dev,
50 };
void aop_fw_load_reset(void)
Definition: aop_load_reset.c:9
#define KiB
Definition: helpers.h:75
void cpucp_fw_load_reset(void)
#define CHIP_NAME(X)
Definition: device.h:32
#define ram_resource(dev, idx, basek, sizek)
Definition: device.h:321
#define reserved_ram_resource(dev, idx, basek, sizek)
Definition: device.h:324
#define REGION_SIZE(name)
Definition: symbols.h:10
bool soc_modem_carve_out(void **start, void **end)
Definition: mmu.c:8
static struct region *const ddr_region
Definition: mmu_common.h:13
static void enable_soc_dev(struct device *dev)
Definition: soc.c:42
static void soc_read_resources(struct device *dev)
Definition: soc.c:10
struct chip_operations soc_qualcomm_sc7280_ops
Definition: soc.c:47
static struct device_operations soc_ops
Definition: soc.c:37
static void soc_init(struct device *dev)
Definition: soc.c:31
#define NULL
Definition: stddef.h: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
size_t size
Definition: region.h:78
size_t offset
Definition: region.h:77