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