blob: 98b62cc25ae6496b3b35a4a2c877be0e0d789dc1 [file] [log] [blame]
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +05301/* SPDX-License-Identifier: GPL-2.0-only */
2
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +05303#include <device/device.h>
4#include <soc/mmu.h>
5#include <soc/mmu_common.h>
6#include <soc/symbols_common.h>
Ravi Kumar Bokka5fa09cb2021-10-21 20:18:12 +05307#include <soc/aop_common.h>
Ravi Kumar Bokkab0d48ed2021-01-21 02:54:48 +05308#include <soc/cpucp.h>
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +05309
10static void soc_read_resources(struct device *dev)
11{
T Michael Turney730107e2022-01-19 18:27:47 -080012 void *start = NULL;
13 void *end = NULL;
14
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +053015 ram_resource(dev, 0, (uintptr_t)ddr_region->offset / KiB,
16 ddr_region->size / KiB);
17 reserved_ram_resource(dev, 1, (uintptr_t)_dram_soc / KiB,
18 REGION_SIZE(dram_soc) / KiB);
Ravi Kumar Bokka414b4262021-05-31 20:50:12 +053019 reserved_ram_resource(dev, 2, (uintptr_t)_dram_wlan / KiB,
Ravi Kumar Bokkab0d48ed2021-01-21 02:54:48 +053020 REGION_SIZE(dram_wlan) / KiB);
Ravi Kumar Bokka414b4262021-05-31 20:50:12 +053021 reserved_ram_resource(dev, 3, (uintptr_t)_dram_wpss / KiB,
Ravi Kumar Bokkab0d48ed2021-01-21 02:54:48 +053022 REGION_SIZE(dram_wpss) / KiB);
Ravi Kumar Bokkaf8e4ba02021-10-21 20:14:09 +053023 reserved_ram_resource(dev, 4, (uintptr_t)_dram_aop / KiB,
24 REGION_SIZE(dram_aop) / KiB);
Ravi Kumar Bokkab0d48ed2021-01-21 02:54:48 +053025 reserved_ram_resource(dev, 5, (uintptr_t)_dram_cpucp / KiB,
26 REGION_SIZE(dram_cpucp) / KiB);
T Michael Turney730107e2022-01-19 18:27:47 -080027 if (soc_modem_carve_out(&start, &end))
28 reserved_ram_resource(dev, 6, (uintptr_t)start / KiB, (end - start) / KiB);
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +053029}
30
31static void soc_init(struct device *dev)
32{
Ravi Kumar Bokka5fa09cb2021-10-21 20:18:12 +053033 aop_fw_load_reset();
Ravi Kumar Bokkab0d48ed2021-01-21 02:54:48 +053034 cpucp_fw_load_reset();
Ravi Kumar Bokka0c9eb312021-03-31 08:04:13 +053035}
36
37static struct device_operations soc_ops = {
38 .read_resources = soc_read_resources,
39 .init = soc_init,
40};
41
42static void enable_soc_dev(struct device *dev)
43{
44 dev->ops = &soc_ops;
45}
46
47struct chip_operations soc_qualcomm_sc7280_ops = {
48 CHIP_NAME("SOC Qualcomm SC7280")
49 .enable_dev = enable_soc_dev,
50};