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