blob: 4bb06e8b4a9d92a47faac01dd6fe5a2b0ff157da [file] [log] [blame]
David Hendricks6802dc82013-02-15 16:18:28 -08001#include <console/console.h>
2#include <device/device.h>
David Hendricksc01d1382013-03-28 19:04:58 -07003#include <arch/cache.h>
4#include <cpu/samsung/exynos5250/cpu.h>
David Hendricks6802dc82013-02-15 16:18:28 -08005
David Hendricks0f5a3fc2013-03-12 20:16:44 -07006#define RAM_BASE_KB (CONFIG_SYS_SDRAM_BASE >> 10)
7#define RAM_SIZE_KB (CONFIG_DRAM_SIZE_MB << 10UL)
David Hendricks6802dc82013-02-15 16:18:28 -08008
David Hendricks6802dc82013-02-15 16:18:28 -08009static void cpu_init(device_t dev)
10{
David Hendricks3cc0d1e2013-03-26 16:28:21 -070011 ram_resource(dev, 0, RAM_BASE_KB, RAM_SIZE_KB);
David Hendricks6802dc82013-02-15 16:18:28 -080012}
13
14static void cpu_noop(device_t dev)
15{
16}
17
18static struct device_operations cpu_ops = {
19 .read_resources = cpu_noop,
20 .set_resources = cpu_noop,
21 .enable_resources = cpu_noop,
22 .init = cpu_init,
23 .scan_bus = 0,
24};
25
David Hendricks01755872013-03-26 04:25:46 +010026static void enable_dev(device_t dev)
David Hendricks6802dc82013-02-15 16:18:28 -080027{
28 /* Set the operations if it is a special bus type */
David Hendricks3cc0d1e2013-03-26 16:28:21 -070029 if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) {
David Hendricks6802dc82013-02-15 16:18:28 -080030 dev->ops = &cpu_ops;
31 }
32}
33
34struct chip_operations cpu_samsung_exynos5250_ops = {
35 CHIP_NAME("CPU Samsung Exynos 5250")
David Hendricks01755872013-03-26 04:25:46 +010036 .enable_dev = enable_dev,
David Hendricks6802dc82013-02-15 16:18:28 -080037};
David Hendricksc01d1382013-03-28 19:04:58 -070038
39void exynos5250_config_l2_cache(void)
40{
41 uint32_t val;
42
43 /*
44 * Bit 9 - L2 tag RAM setup (1 cycle)
45 * Bits 8:6 - L2 tag RAM latency (3 cycles)
46 * Bit 5 - L2 data RAM setup (1 cycle)
47 * Bits 2:0 - L2 data RAM latency (3 cycles)
48 */
49 val = (1 << 9) | (0x2 << 6) | (1 << 5) | (0x2);
50 write_l2ctlr(val);
51}