aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-kirkwood/board-dt.c
diff options
context:
space:
mode:
authorAndrew Lunn <andrew@lunn.ch>2012-11-17 09:22:28 -0500
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-11-20 08:46:50 -0500
commit1611f872513735ac7105535689c0dd668fbf1c04 (patch)
treed8fdd2f1f9b7df6b6e3543af6435b7d11f5da45e /arch/arm/mach-kirkwood/board-dt.c
parent5b03df9ace680d7cdd34a69dfd85ca5f74159d18 (diff)
ARM: Kirkwood: switch to DT clock providers
With true DT clock providers available switch Kirkwood clock setup in DT- enabled boards. While AUXDATA can be removed completely from bus probing, some devices still don't know about DT. Therefore, some clkdev aliases are created until these devices also move to DT. Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Diffstat (limited to 'arch/arm/mach-kirkwood/board-dt.c')
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c71
1 files changed, 58 insertions, 13 deletions
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index d94872fed8c0..8bdfaa4db091 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -14,11 +14,15 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/clk-provider.h>
18#include <linux/clk/mvebu.h>
17#include <linux/kexec.h> 19#include <linux/kexec.h>
18#include <asm/mach/arch.h> 20#include <asm/mach/arch.h>
19#include <asm/mach/map.h> 21#include <asm/mach/map.h>
20#include <mach/bridge-regs.h> 22#include <mach/bridge-regs.h>
23#include <linux/platform_data/usb-ehci-orion.h>
21#include <plat/irq.h> 24#include <plat/irq.h>
25#include <plat/common.h>
22#include "common.h" 26#include "common.h"
23 27
24static struct of_device_id kirkwood_dt_match_table[] __initdata = { 28static struct of_device_id kirkwood_dt_match_table[] __initdata = {
@@ -26,16 +30,58 @@ static struct of_device_id kirkwood_dt_match_table[] __initdata = {
26 { } 30 { }
27}; 31};
28 32
29struct of_dev_auxdata kirkwood_auxdata_lookup[] __initdata = { 33/*
30 OF_DEV_AUXDATA("marvell,orion-spi", 0xf1010600, "orion_spi.0", NULL), 34 * There are still devices that doesn't know about DT yet. Get clock
31 OF_DEV_AUXDATA("marvell,mv64xxx-i2c", 0xf1011000, "mv64xxx_i2c.0", 35 * gates here and add a clock lookup alias, so that old platform
32 NULL), 36 * devices still work.
33 OF_DEV_AUXDATA("marvell,orion-wdt", 0xf1020300, "orion_wdt", NULL), 37*/
34 OF_DEV_AUXDATA("marvell,orion-sata", 0xf1080000, "sata_mv.0", NULL), 38
35 OF_DEV_AUXDATA("marvell,orion-nand", 0xf4000000, "orion_nand", NULL), 39static void __init kirkwood_legacy_clk_init(void)
36 OF_DEV_AUXDATA("marvell,orion-crypto", 0xf1030000, "mv_crypto", NULL), 40{
37 {}, 41
38}; 42 struct device_node *np = of_find_compatible_node(
43 NULL, NULL, "marvell,kirkwood-gating-clock");
44
45 struct of_phandle_args clkspec;
46
47 clkspec.np = np;
48 clkspec.args_count = 1;
49
50 clkspec.args[0] = CGC_BIT_GE0;
51 orion_clkdev_add(NULL, "mv643xx_eth_port.0",
52 of_clk_get_from_provider(&clkspec));
53
54 clkspec.args[0] = CGC_BIT_PEX0;
55 orion_clkdev_add("0", "pcie",
56 of_clk_get_from_provider(&clkspec));
57
58 clkspec.args[0] = CGC_BIT_USB0;
59 orion_clkdev_add(NULL, "orion-ehci.0",
60 of_clk_get_from_provider(&clkspec));
61
62 clkspec.args[0] = CGC_BIT_XOR0;
63 orion_clkdev_add(NULL, "mv_xor_shared.0",
64 of_clk_get_from_provider(&clkspec));
65
66 clkspec.args[0] = CGC_BIT_XOR1;
67 orion_clkdev_add(NULL, "mv_xor_shared.1",
68 of_clk_get_from_provider(&clkspec));
69
70 clkspec.args[0] = CGC_BIT_PEX1;
71 orion_clkdev_add("1", "pcie",
72 of_clk_get_from_provider(&clkspec));
73
74 clkspec.args[0] = CGC_BIT_GE1;
75 orion_clkdev_add(NULL, "mv643xx_eth_port.1",
76 of_clk_get_from_provider(&clkspec));
77
78}
79
80static void __init kirkwood_of_clk_init(void)
81{
82 mvebu_clocks_init();
83 kirkwood_legacy_clk_init();
84}
39 85
40static void __init kirkwood_dt_init(void) 86static void __init kirkwood_dt_init(void)
41{ 87{
@@ -54,7 +100,7 @@ static void __init kirkwood_dt_init(void)
54 kirkwood_l2_init(); 100 kirkwood_l2_init();
55 101
56 /* Setup root of clk tree */ 102 /* Setup root of clk tree */
57 kirkwood_clk_init(); 103 kirkwood_of_clk_init();
58 104
59 /* internal devices that every board has */ 105 /* internal devices that every board has */
60 kirkwood_xor0_init(); 106 kirkwood_xor0_init();
@@ -94,8 +140,7 @@ static void __init kirkwood_dt_init(void)
94 if (of_machine_is_compatible("keymile,km_kirkwood")) 140 if (of_machine_is_compatible("keymile,km_kirkwood"))
95 km_kirkwood_init(); 141 km_kirkwood_init();
96 142
97 of_platform_populate(NULL, kirkwood_dt_match_table, 143 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
98 kirkwood_auxdata_lookup, NULL);
99} 144}
100 145
101static const char *kirkwood_dt_board_compat[] = { 146static const char *kirkwood_dt_board_compat[] = {