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 | |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 7 | static void cpu_init(device_t dev) |
| 8 | { |
David Hendricks | 3cc0d1e | 2013-03-26 16:28:21 -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 cpu_noop(device_t dev) |
| 13 | { |
| 14 | } |
| 15 | |
| 16 | static struct device_operations cpu_ops = { |
| 17 | .read_resources = cpu_noop, |
| 18 | .set_resources = cpu_noop, |
| 19 | .enable_resources = cpu_noop, |
| 20 | .init = cpu_init, |
| 21 | .scan_bus = 0, |
| 22 | }; |
| 23 | |
David Hendricks | 0175587 | 2013-03-26 04:25:46 +0100 | [diff] [blame] | 24 | static void enable_dev(device_t dev) |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 25 | { |
| 26 | /* Set the operations if it is a special bus type */ |
David Hendricks | 3cc0d1e | 2013-03-26 16:28:21 -0700 | [diff] [blame] | 27 | if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 28 | dev->ops = &cpu_ops; |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | struct chip_operations cpu_samsung_exynos5250_ops = { |
| 33 | CHIP_NAME("CPU Samsung Exynos 5250") |
David Hendricks | 0175587 | 2013-03-26 04:25:46 +0100 | [diff] [blame] | 34 | .enable_dev = enable_dev, |
David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame] | 35 | }; |