2 * Copyright (C) 2014 ROCKCHIP, Inc.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #include <linux/delay.h>
16 #include <linux/init.h>
17 #include <linux/kernel.h>
18 #include <linux/rockchip/common.h>
19 #include <linux/rockchip/cpu.h>
20 #include <linux/rockchip/cru.h>
21 #include <linux/rockchip/grf.h>
22 #include <linux/rockchip/iomap.h>
23 #include <linux/rockchip/pmu.h>
28 #include "pm-rk312x.c"
30 char PIE_DATA(sram_stack)[1024];
31 EXPORT_PIE_SYMBOL(DATA(sram_stack));
33 static int __init rk3126b_pie_init(void)
37 if (!soc_is_rk3126b())
40 err = rockchip_pie_init();
44 rockchip_pie_chunk = pie_load_sections(rockchip_sram_pool, rk3126b);
45 if (IS_ERR(rockchip_pie_chunk)) {
46 err = PTR_ERR(rockchip_pie_chunk);
47 pr_err("%s: failed to load section %d\n", __func__, err);
48 rockchip_pie_chunk = NULL;
52 rockchip_sram_virt = kern_to_pie(rockchip_pie_chunk, &__pie_common_start[0]);
53 rockchip_sram_stack = kern_to_pie(rockchip_pie_chunk, (char *)DATA(sram_stack) + sizeof(DATA(sram_stack)));
57 arch_initcall(rk3126b_pie_init);
60 void __init rk3126b_init_suspend(void)
62 pr_info("%s\n", __func__);
64 rk312x_suspend_init();
68 #include "ddr_rk3126b.c"
69 static int __init rk3126b_ddr_init(void)
71 if (!soc_is_rk3126b())
74 ddr_change_freq = _ddr_change_freq;
75 ddr_round_rate = _ddr_round_rate;
76 ddr_set_auto_self_refresh = _ddr_set_auto_self_refresh;
77 ddr_bandwidth_get = _ddr_bandwidth_get;
78 ddr_init(DDR3_DEFAULT, 300);
82 arch_initcall_sync(rk3126b_ddr_init);