blob: 0a49e1edc95f9222151c4f10df56ead1e29f5064 [file] [log] [blame]
David Hendricks6802dc82013-02-15 16:18:28 -08001#include <console/console.h>
2#include <device/device.h>
3
4#define RAM_BASE ((CONFIG_SYS_SDRAM_BASE >> 10) + (CONFIG_COREBOOT_ROMSIZE_KB))
5#define RAM_SIZE (((CONFIG_DRAM_SIZE_MB << 10UL) * CONFIG_NR_DRAM_BANKS) \
6 - CONFIG_COREBOOT_ROMSIZE_KB)
7
8static void domain_read_resources(device_t dev)
9{
10 ram_resource(dev, 0, RAM_BASE, RAM_SIZE);
11}
12
13static void domain_set_resources(device_t dev)
14{
15 assign_resources(dev->link_list);
16}
17
18static unsigned int domain_scan_bus(device_t dev, unsigned int max)
19{
20 return max;
21}
22
23
24static struct device_operations domain_ops = {
25 .read_resources = domain_read_resources,
26 .set_resources = domain_set_resources,
27 .enable_resources = NULL,
28 .init = NULL,
29 .scan_bus = domain_scan_bus,
30};
31
32static void cpu_init(device_t dev)
33{
34}
35
36static void cpu_noop(device_t dev)
37{
38}
39
40static struct device_operations cpu_ops = {
41 .read_resources = cpu_noop,
42 .set_resources = cpu_noop,
43 .enable_resources = cpu_noop,
44 .init = cpu_init,
45 .scan_bus = 0,
46};
47
48static void enable_dev(device_t dev)
49{
50 /* Set the operations if it is a special bus type */
51 if (dev->path.type == DEVICE_PATH_DOMAIN) {
52 dev->ops = &domain_ops;
53 } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
54 dev->ops = &cpu_ops;
55 }
56}
57
58struct chip_operations cpu_samsung_exynos5250_ops = {
59 CHIP_NAME("CPU Samsung Exynos 5250")
60 .enable_dev = enable_dev,
61};