Debian Codegraph @

src/soc/qualcomm/ipq806x/soc.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <console/console.h>
4 #include <device/device.h>
5 #include <symbols.h>
6 #include <soc/ipq_uart.h>
7
8 #define RESERVED_SIZE 0x01500000 /* 21 MiB */
9
10 static void soc_read_resources(struct device *dev)
11 {
12 /* Reserve bottom 21 MiB for NSS, SMEM, etc. */
13 uintptr_t reserve_ram_end = (uintptr_t)_dram + RESERVED_SIZE;
14 uint64_t ram_end = CONFIG_DRAM_SIZE_MB * (uint64_t)MiB;
15
16 reserved_ram_from_to(dev, 0, (uintptr_t)_dram, reserve_ram_end);
17 ram_from_to(dev, 1, reserve_ram_end, ram_end);
18 }
19
20 static void soc_init(struct device *dev)
21 {
22 /*
23 * Do this in case console is not enabled: kernel's earlyprintk()
24 * should work no matter what the firmware console configuration is.
25 */
26 ipq806x_uart_init();
27
28 printk(BIOS_INFO, "CPU: Qualcomm 8064\n");
29 }
30
31 static struct device_operations soc_ops = {
32 .read_resources = soc_read_resources,
33 .init = soc_init,
34 };
35
36 static void enable_soc_dev(struct device *dev)
37 {
38 dev->ops = &soc_ops;
39 }
40
41 struct chip_operations soc_qualcomm_ipq806x_ops = {
42 .name = "SOC Qualcomm 8064",
43 .enable_dev = enable_soc_dev,
44 };