diff options
author | Christian Ruppert <christian.ruppert@abilis.com> | 2013-04-12 02:40:59 -0400 |
---|---|---|
committer | Vineet Gupta <vgupta@synopsys.com> | 2013-05-07 04:13:59 -0400 |
commit | 072eb693904a52df95ac3d8e8ee00752ed82342c (patch) | |
tree | 4b411af0a97d82526b5a4619f3e5e10c0524df03 /arch/arc/plat-tb10x/tb10x.c | |
parent | 2eb9504bcc1f164ac137cd12c5deeb1e21cc6b1b (diff) |
ARC: [TB10x] Add support for TB10x platform
Infrastructure required to make the Linux kernel compile and boot on the
Abilis Systems TB10x series of SOCs based on ARC700 CPUs:
- Kmake related files (Kconfig, Makefile, tb10x_defconfig)
- TB10x platform initialisation
Signed-off-by: Christian Ruppert <christian.ruppert@abilis.com>
Signed-off-by: Pierrick Hascoet <pierrick.hascoet@abilis.com>
Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/plat-tb10x/tb10x.c')
-rw-r--r-- | arch/arc/plat-tb10x/tb10x.c | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/arch/arc/plat-tb10x/tb10x.c b/arch/arc/plat-tb10x/tb10x.c new file mode 100644 index 000000000000..d3567691c7e1 --- /dev/null +++ b/arch/arc/plat-tb10x/tb10x.c | |||
@@ -0,0 +1,71 @@ | |||
1 | /* | ||
2 | * Abilis Systems TB10x platform initialisation | ||
3 | * | ||
4 | * Copyright (C) Abilis Systems 2012 | ||
5 | * | ||
6 | * Author: Christian Ruppert <christian.ruppert@abilis.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | */ | ||
21 | |||
22 | |||
23 | #include <linux/init.h> | ||
24 | #include <linux/of_platform.h> | ||
25 | #include <linux/clk-provider.h> | ||
26 | #include <linux/pinctrl/consumer.h> | ||
27 | |||
28 | #include <asm/mach_desc.h> | ||
29 | |||
30 | |||
31 | static void __init tb10x_platform_init(void) | ||
32 | { | ||
33 | of_clk_init(NULL); | ||
34 | of_platform_populate(NULL, of_default_bus_match_table, NULL, NULL); | ||
35 | } | ||
36 | |||
37 | static void __init tb10x_platform_late_init(void) | ||
38 | { | ||
39 | struct device_node *dn; | ||
40 | |||
41 | /* | ||
42 | * Pinctrl documentation recommends setting up the iomux here for | ||
43 | * all modules which don't require control over the pins themselves. | ||
44 | * Modules which need this kind of assistance are compatible with | ||
45 | * "abilis,simple-pinctrl", i.e. we can easily iterate over them. | ||
46 | * TODO: Does this recommended method work cleanly with pins required | ||
47 | * by modules? | ||
48 | */ | ||
49 | for_each_compatible_node(dn, NULL, "abilis,simple-pinctrl") { | ||
50 | struct platform_device *pd = of_find_device_by_node(dn); | ||
51 | struct pinctrl *pctl; | ||
52 | |||
53 | pctl = pinctrl_get_select(&pd->dev, "abilis,simple-default"); | ||
54 | if (IS_ERR(pctl)) { | ||
55 | int ret = PTR_ERR(pctl); | ||
56 | dev_err(&pd->dev, "Could not set up pinctrl: %d\n", | ||
57 | ret); | ||
58 | } | ||
59 | } | ||
60 | } | ||
61 | |||
62 | static const char *tb10x_compat[] __initdata = { | ||
63 | "abilis,arc-tb10x", | ||
64 | NULL, | ||
65 | }; | ||
66 | |||
67 | MACHINE_START(TB10x, "tb10x") | ||
68 | .dt_compat = tb10x_compat, | ||
69 | .init_machine = tb10x_platform_init, | ||
70 | .init_late = tb10x_platform_late_init, | ||
71 | MACHINE_END | ||