Patrick Georgi | 02363b5 | 2020-05-05 20:48:50 +0200 | [diff] [blame^] | 1 | /* This file is part of the coreboot project. */ |
T Michael Turney | 7783c60 | 2019-10-09 07:04:54 -0700 | [diff] [blame] | 2 | /* |
T Michael Turney | 7783c60 | 2019-10-09 07:04:54 -0700 | [diff] [blame] | 3 | * |
| 4 | * This program is free software; you can redistribute it and/or modify |
| 5 | * it under the terms of the GNU General Public License version 2 and |
| 6 | * only version 2 as published by the Free Software Foundation. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | */ |
| 13 | |
| 14 | #include <symbols.h> |
| 15 | #include <device/device.h> |
| 16 | #include <soc/mmu.h> |
| 17 | #include <soc/mmu_common.h> |
| 18 | #include <soc/symbols.h> |
Ravi Kumar Bokka | 6bbf8f2 | 2019-08-12 14:54:21 +0530 | [diff] [blame] | 19 | #include <soc/aop.h> |
T Michael Turney | 7783c60 | 2019-10-09 07:04:54 -0700 | [diff] [blame] | 20 | |
| 21 | static void soc_read_resources(struct device *dev) |
| 22 | { |
| 23 | ram_resource(dev, 0, (uintptr_t)ddr_region->offset / KiB, |
| 24 | ddr_region->size / KiB); |
Ravi Kumar Bokka | 6bbf8f2 | 2019-08-12 14:54:21 +0530 | [diff] [blame] | 25 | reserved_ram_resource(dev, 1, (uintptr_t)_dram_aop / KiB, |
| 26 | REGION_SIZE(dram_aop) / KiB); |
| 27 | reserved_ram_resource(dev, 2, (uintptr_t)_dram_soc / KiB, |
T Michael Turney | 7783c60 | 2019-10-09 07:04:54 -0700 | [diff] [blame] | 28 | REGION_SIZE(dram_soc) / KiB); |
| 29 | } |
| 30 | |
| 31 | static void soc_init(struct device *dev) |
| 32 | { |
Ravi Kumar Bokka | 6bbf8f2 | 2019-08-12 14:54:21 +0530 | [diff] [blame] | 33 | aop_fw_load_reset(); |
T Michael Turney | 7783c60 | 2019-10-09 07:04:54 -0700 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | static struct device_operations soc_ops = { |
| 37 | .read_resources = soc_read_resources, |
| 38 | .init = soc_init, |
| 39 | }; |
| 40 | |
| 41 | static void enable_soc_dev(struct device *dev) |
| 42 | { |
| 43 | dev->ops = &soc_ops; |
| 44 | } |
| 45 | |
| 46 | struct chip_operations soc_qualcomm_sc7180_ops = { |
| 47 | CHIP_NAME("SOC Qualcomm SC7180") |
| 48 | .enable_dev = enable_soc_dev, |
| 49 | }; |