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 <symbols.h>
4 #include <device/device.h>
5 #include <soc/mmu.h>
6 #include <soc/mmu_common.h>
7 #include <soc/symbols_common.h>
8 #include <soc/aop_common.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_aop / KiB,
18  REGION_SIZE(dram_aop) / KiB);
19  reserved_ram_resource(dev, 2, (uintptr_t)_dram_soc / KiB,
20  REGION_SIZE(dram_soc) / KiB);
21  if (soc_modem_carve_out(&start, &end))
22  reserved_ram_resource(dev, 3, (uintptr_t)start / KiB, (end - start) / KiB);
23 }
24 
25 static void soc_init(struct device *dev)
26 {
28 }
29 
30 static struct device_operations soc_ops = {
32  .init = soc_init,
33 };
34 
35 static void enable_soc_dev(struct device *dev)
36 {
37  dev->ops = &soc_ops;
38 }
39 
41  CHIP_NAME("SOC Qualcomm SC7180")
42  .enable_dev = enable_soc_dev,
43 };
void aop_fw_load_reset(void)
Definition: aop_load_reset.c:9
#define KiB
Definition: helpers.h:75
#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:35
struct chip_operations soc_qualcomm_sc7180_ops
Definition: soc.c:40
static void soc_read_resources(struct device *dev)
Definition: soc.c:10
static struct device_operations soc_ops
Definition: soc.c:30
static void soc_init(struct device *dev)
Definition: soc.c:25
#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