Esempio n. 1
0
static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf)
{
	const char *type;

	if (cpu_is_rk3288())
		type = "rk3288";
	else if (cpu_is_rk319x())
		type = "rk319x";
	else if (cpu_is_rk3188())
		type = "rk3188";
	else if (cpu_is_rk3066b())
		type = "rk3066b";
	else if (cpu_is_rk3026())
		type = "rk3026";
	else if (cpu_is_rk30xx())
		type = "rk30xx";
	else if (cpu_is_rk2928())
		type = "rk2928";
	else if (cpu_is_rk312x())
		type = "rk312x";
	else
		type = "";

	if (rockchip_get_cpu_version())
		return sprintf(buf, "%sv%lu\n", type,
			       rockchip_get_cpu_version());

	return sprintf(buf, "%s\n", type);
}
Esempio n. 2
0
static int __init rk3288_ddr_init(void)
{
    if (cpu_is_rk3288())
    {
        ddr_change_freq = _ddr_change_freq;
        ddr_round_rate = _ddr_round_rate;
        ddr_set_auto_self_refresh = _ddr_set_auto_self_refresh;

        ddr_init(DDR3_DEFAULT, 300);
    }

    return 0;
}
Esempio n. 3
0
u32 pvtm_get_value(u32 ch, u32 time_us)
{
	u32 val = 0;

	if (IS_ERR_OR_NULL(ch_clk[ch]))
		return 0;

	clk_prepare_enable(ch_clk[ch]);
	mutex_lock(&pvtm_mutex);
	if (cpu_is_rk3288())
		val = rk3288_pvtm_get_value(ch, time_us);
	//else if (cpu_is_rk312x())
	//	val = rk312x_pvtm_get_value(ch, time_us);
	mutex_unlock(&pvtm_mutex);
	clk_disable_unprepare(ch_clk[ch]);

	return val;
}
static int __init rk3288_ddr_init(void)
{
    if (cpu_is_rk3288()
#ifdef CONFIG_ARM_TRUSTZONE
	&& false
#endif
	)
    {
	ddr_change_freq = _ddr_change_freq;
	ddr_round_rate = _ddr_round_rate;
	ddr_set_auto_self_refresh = _ddr_set_auto_self_refresh;
	ddr_bandwidth_get = _ddr_bandwidth_get;

	ddr_init(DDR3_DEFAULT, 0);
    }

    return 0;
}
Esempio n. 5
0
static int __init rk3288_pie_init(void)
{
	int err;
	if (!cpu_is_rk3288())
		return 0;

	err = rockchip_pie_init();
	if (err)
		return err;

	rockchip_pie_chunk = pie_load_sections(rockchip_sram_pool, rk3288);
	if (IS_ERR(rockchip_pie_chunk)) {
		err = PTR_ERR(rockchip_pie_chunk);
		pr_err("%s: failed to load section %d\n", __func__, err);
		rockchip_pie_chunk = NULL;
		return err;
	}

	rockchip_sram_virt = kern_to_pie(rockchip_pie_chunk, &__pie_common_start[0]);
	rockchip_sram_stack = kern_to_pie(rockchip_pie_chunk, (char *) DATA(sram_stack) + sizeof(DATA(sram_stack)));

    return 0;
}