David Hendricks | 6802dc8 | 2013-02-15 16:18:28 -0800 | [diff] [blame^] | 1 | #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 | |
| 8 | static void domain_read_resources(device_t dev) |
| 9 | { |
| 10 | ram_resource(dev, 0, RAM_BASE, RAM_SIZE); |
| 11 | } |
| 12 | |
| 13 | static void domain_set_resources(device_t dev) |
| 14 | { |
| 15 | assign_resources(dev->link_list); |
| 16 | } |
| 17 | |
| 18 | static unsigned int domain_scan_bus(device_t dev, unsigned int max) |
| 19 | { |
| 20 | return max; |
| 21 | } |
| 22 | |
| 23 | |
| 24 | static 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 | |
| 32 | static void cpu_init(device_t dev) |
| 33 | { |
| 34 | } |
| 35 | |
| 36 | static void cpu_noop(device_t dev) |
| 37 | { |
| 38 | } |
| 39 | |
| 40 | static 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 | |
| 48 | static 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 | |
| 58 | struct chip_operations cpu_samsung_exynos5250_ops = { |
| 59 | CHIP_NAME("CPU Samsung Exynos 5250") |
| 60 | .enable_dev = enable_dev, |
| 61 | }; |