David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 1 | #include <console/console.h> |
| 2 | #include <device/device.h> |
| 3 | |
David Hendricks | 0f5a3fc | 2013-03-12 20:16:44 -0700 | [diff] [blame] | 4 | #define RAM_BASE_KB (CONFIG_SYS_SDRAM_BASE >> 10) |
| 5 | #define RAM_SIZE_KB (CONFIG_DRAM_SIZE_MB << 10UL) |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 6 | |
| 7 | static void domain_read_resources(device_t dev) |
| 8 | { |
David Hendricks | 0f5a3fc | 2013-03-12 20:16:44 -0700 | [diff] [blame] | 9 | ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB); |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 10 | } |
| 11 | |
| 12 | static void domain_set_resources(device_t dev) |
| 13 | { |
| 14 | assign_resources(dev->link_list); |
| 15 | } |
| 16 | |
| 17 | static unsigned int domain_scan_bus(device_t dev, unsigned int max) |
| 18 | { |
| 19 | return max; |
| 20 | } |
| 21 | |
| 22 | |
| 23 | static 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 | |
| 31 | static void cpu_init(device_t dev) |
| 32 | { |
| 33 | } |
| 34 | |
| 35 | static void cpu_noop(device_t dev) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | static 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 Hendricks | 0175587 | 2013-03-26 04:25:46 +0100 | [diff] [blame^] | 47 | static void enable_dev(device_t dev) |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 48 | { |
| 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 | |
| 57 | struct chip_operations cpu_samsung_exynos5250_ops = { |
| 58 | CHIP_NAME("CPU Samsung Exynos 5250") |
David Hendricks | 0175587 | 2013-03-26 04:25:46 +0100 | [diff] [blame^] | 59 | .enable_dev = enable_dev, |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 60 | }; |