summaryrefslogtreecommitdiffstats
path: root/tools/flex
Commit message (Collapse)AuthorAgeFilesLines
* tools: remove static linking supportJo-Philipp Wich2015-02-061-1/+0
| | | | | | Signed-off-by: Jo-Philipp Wich <jow@openwrt.org> SVN-Revision: 44285
* tools/flex: disable building shared libfl.soFelix Fietkau2014-08-271-0/+1
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 42308
* flex: upgrade to version 2.5.39Luka Perkov2014-04-191-2/+2
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 40533
* flex: fix build error due to undefined library symbolsFelix Fietkau2014-03-121-0/+18
| | | | | | Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 39888
* flex: upgrade to version 2.5.38Luka Perkov2014-03-101-3/+3
| | | | | | Signed-off-by: Luka Perkov <luka@openwrt.org> SVN-Revision: 39856
* flex: upgrade to version 2.5.37Luka Perkov2013-02-281-3/+3
| | | | SVN-Revision: 35824
* tools/flex: enable parallel buildsFelix Fietkau2012-09-151-0/+2
| | | | SVN-Revision: 33438
* use HOST_STATIC_LINKING instead of hardcoding -staticJo-Philipp Wich2012-08-121-1/+1
| | | | SVN-Revision: 33140
* flex: link staticallyJo-Philipp Wich2012-08-101-0/+2
| | | | SVN-Revision: 33091
* tools: clean up Makefiles / make ccache workJohn Crispin2012-01-151-8/+0
| | | | SVN-Revision: 29754
* build flex on the host, some pakcages need it in the newest versionJo-Philipp Wich2010-12-171-0/+32
SVN-Revision: 24631
weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*
 *  Ralink RT305X clock API
 *
 *  Copyright (C) 2011 Gabor Juhos <juhosg@openwrt.org>
 *
 *  This program is free software; you can redistribute it and/or modify it
 *  under the terms of the GNU General Public License version 2 as published
 *  by the Free Software Foundation.
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/err.h>
#include <linux/clk.h>

#include <asm/mach-ralink/common.h>
#include <asm/mach-ralink/rt305x.h>
#include <asm/mach-ralink/rt305x_regs.h>
#include "common.h"

struct clk {
	unsigned long rate;
};

static struct clk rt305x_cpu_clk;
static struct clk rt305x_sys_clk;
static struct clk rt305x_wdt_clk;
static struct clk rt305x_uart_clk;

void __init rt305x_clocks_init(void)
{
	u32	t;

	t = rt305x_sysc_rr(SYSC_REG_SYSTEM_CONFIG);

	if (soc_is_rt305x() || soc_is_rt3350()) {
		t = (t >> RT305X_SYSCFG_CPUCLK_SHIFT) &
		     RT305X_SYSCFG_CPUCLK_MASK;
		switch (t) {
		case RT305X_SYSCFG_CPUCLK_LOW:
			rt305x_cpu_clk.rate = 320000000;
			break;
		case RT305X_SYSCFG_CPUCLK_HIGH:
			rt305x_cpu_clk.rate = 384000000;
			break;
		}
		rt305x_sys_clk.rate = rt305x_cpu_clk.rate / 3;
		rt305x_uart_clk.rate = rt305x_sys_clk.rate;
		rt305x_wdt_clk.rate = rt305x_sys_clk.rate;
	} else if (soc_is_rt3352()) {
		t = (t >> RT3352_SYSCFG0_CPUCLK_SHIFT) &
		     RT3352_SYSCFG0_CPUCLK_MASK;
		switch (t) {
		case RT3352_SYSCFG0_CPUCLK_LOW:
			rt305x_cpu_clk.rate = 384000000;
			break;
		case RT3352_SYSCFG0_CPUCLK_HIGH:
			rt305x_cpu_clk.rate = 400000000;
			break;
		}
		rt305x_sys_clk.rate = rt305x_cpu_clk.rate / 3;
		rt305x_uart_clk.rate = 40000000;
		rt305x_wdt_clk.rate = rt305x_sys_clk.rate;
	} else if (soc_is_rt5350()) {
		t = (t >> RT5350_SYSCFG0_CPUCLK_SHIFT) &
		     RT5350_SYSCFG0_CPUCLK_MASK;
		switch (t) {
		case RT5350_SYSCFG0_CPUCLK_360:
			rt305x_cpu_clk.rate = 360000000;
			rt305x_sys_clk.rate = rt305x_cpu_clk.rate / 3;
			break;
		case RT5350_SYSCFG0_CPUCLK_320:
			rt305x_cpu_clk.rate = 320000000;
			rt305x_sys_clk.rate = rt305x_cpu_clk.rate / 4;
			break;
		case RT5350_SYSCFG0_CPUCLK_300:
			rt305x_cpu_clk.rate = 300000000;
			rt305x_sys_clk.rate = rt305x_cpu_clk.rate / 3;
			break;
		default:
			BUG();
		}
		rt305x_uart_clk.rate = 40000000;
		rt305x_wdt_clk.rate = rt305x_sys_clk.rate;
	} else {
		BUG();
	}

}

/*
 * Linux clock API
 */
struct clk *clk_get(struct device *dev, const char *id)
{
	if (!strcmp(id, "sys"))
		return &rt305x_sys_clk;

	if (!strcmp(id, "cpu"))
		return &rt305x_cpu_clk;

	if (!strcmp(id, "wdt"))
		return &rt305x_wdt_clk;

	if (!strcmp(id, "uart"))
		return &rt305x_uart_clk;

	return ERR_PTR(-ENOENT);
}
EXPORT_SYMBOL(clk_get);

int clk_enable(struct clk *clk)
{
	return 0;
}
EXPORT_SYMBOL(clk_enable);

void clk_disable(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_disable);

unsigned long clk_get_rate(struct clk *clk)
{
	return clk->rate;
}
EXPORT_SYMBOL(clk_get_rate);

void clk_put(struct clk *clk)
{
}
EXPORT_SYMBOL(clk_put);