static void __init tango4_clkgen_setup(struct device_node *np)
{
	struct clk **pp = clk_data.clks;
	void __iomem *base = of_iomap(np, 0);
	const char *parent = of_clk_get_parent_name(np, 0);

	if (!base)
		panic("%s: invalid address\n", np->name);

	if (readl(base + CPUCLK_DIV) & DIV_BYPASS)
		panic("%s: unsupported cpuclk setup\n", np->name);

	if (readl(base + SYSCLK_DIV) & DIV_BYPASS)
		panic("%s: unsupported sysclk setup\n", np->name);

	writel(0x100, base + CPUCLK_DIV); /* disable frequency ramping */

	make_pll(0, parent, base);
	make_pll(1, parent, base);
	make_pll(2, parent, base);
	make_cd(2, base + 0x80);
	make_cd(6, base + 0x80);

	pp[0] = clk_register_divider(NULL, "cpu_clk", "pll0", 0,
			base + CPUCLK_DIV, 8, 8, CLK_DIVIDER_ONE_BASED, NULL);
	pp[1] = clk_register_fixed_factor(NULL, "sys_clk", "pll1", 0, 1, 4);
	pp[2] = clk_register_fixed_factor(NULL,  "usb_clk", "cd2", 0, 1, 2);
	pp[3] = clk_register_fixed_factor(NULL, "sdio_clk", "cd6", 0, 1, 2);

	if (IS_ERR(pp[0]) || IS_ERR(pp[1]) || IS_ERR(pp[2]) || IS_ERR(pp[3]))
		panic("%s: clk registration failed\n", np->name);

	if (of_clk_add_provider(np, of_clk_src_onecell_get, &clk_data))
		panic("%s: clk provider registration failed\n", np->name);
}
Esempio n. 2
0
void prepare_to_parse(void)
{
	reset();
	scope_stack = make_stack(128,4,0);
	push(scope_stack,lobby);
	current_col_size = 0;
	current_node = cons(NULL,NULL);
	lexical_stack = malloc(sizeof(double));
	*lexical_stack=make_cd(LIVEQ,peek(scope_stack),current_node);
	on_string = false;
	on_comment = false;	
}
Esempio n. 3
0
void go_up_level(bool is_quote)
{
	int col_tag;
	lexical_stack_height++;
	lexical_stack = realloc(lexical_stack,sizeof(void*)*lexical_stack_height);
	/* This is where the tagging takes place: */
	if(is_quote==true)
	{
		col_tag=QUOTE;
		push(scope_stack,make_context(peek(scope_stack)));
	}
	else
		col_tag=LIST;
	ccell* new_cell = cons(NULL,NULL);
	lexical_stack[lexical_stack_height-1] =make_cd(col_tag,peek(scope_stack),new_cell);
	current_col_size = 0;
	current_node = new_cell;
}