diff options
| author | Gregory CLEMENT <gregory.clement@free-electrons.com> | 2012-11-17 09:22:29 -0500 |
|---|---|---|
| committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2012-11-20 08:44:00 -0500 |
| commit | c4c34d608482b48c1c007fecea5a7a5c65168fa2 (patch) | |
| tree | 3da57b6fd49826983b81f8a34d9eb9d49c4e169a /drivers/clk | |
| parent | f97d0d7aa8f8cec29a24d65afa12a777c6d2a2f1 (diff) | |
clk: mvebu: armada 370/XP add clock gating control provider for DT
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'drivers/clk')
| -rw-r--r-- | drivers/clk/mvebu/clk-gating-ctrl.c | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/drivers/clk/mvebu/clk-gating-ctrl.c b/drivers/clk/mvebu/clk-gating-ctrl.c index fa69f87c579..c6d3c263b07 100644 --- a/drivers/clk/mvebu/clk-gating-ctrl.c +++ b/drivers/clk/mvebu/clk-gating-ctrl.c | |||
| @@ -88,10 +88,21 @@ static void __init mvebu_clk_gating_setup( | |||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | for (n = 0; n < ctrl->num_gates; n++) { | 90 | for (n = 0; n < ctrl->num_gates; n++) { |
| 91 | u8 flags = 0; | ||
| 91 | const char *parent = | 92 | const char *parent = |
| 92 | (descr[n].parent) ? descr[n].parent : default_parent; | 93 | (descr[n].parent) ? descr[n].parent : default_parent; |
| 94 | |||
| 95 | /* | ||
| 96 | * On Armada 370, the DDR clock is a special case: it | ||
| 97 | * isn't taken by any driver, but should anyway be | ||
| 98 | * kept enabled, so we mark it as IGNORE_UNUSED for | ||
| 99 | * now. | ||
| 100 | */ | ||
| 101 | if (!strcmp(descr[n].name, "ddr")) | ||
| 102 | flags |= CLK_IGNORE_UNUSED; | ||
| 103 | |||
| 93 | ctrl->gates[n] = clk_register_gate(NULL, descr[n].name, parent, | 104 | ctrl->gates[n] = clk_register_gate(NULL, descr[n].name, parent, |
| 94 | 0, base, descr[n].bit_idx, 0, &ctrl->lock); | 105 | flags, base, descr[n].bit_idx, 0, &ctrl->lock); |
| 95 | WARN_ON(IS_ERR(ctrl->gates[n])); | 106 | WARN_ON(IS_ERR(ctrl->gates[n])); |
| 96 | } | 107 | } |
| 97 | of_clk_add_provider(np, mvebu_clk_gating_get_src, ctrl); | 108 | of_clk_add_provider(np, mvebu_clk_gating_get_src, ctrl); |
| @@ -101,6 +112,53 @@ static void __init mvebu_clk_gating_setup( | |||
| 101 | * SoC specific clock gating control | 112 | * SoC specific clock gating control |
| 102 | */ | 113 | */ |
| 103 | 114 | ||
| 115 | #ifdef CONFIG_MACH_ARMADA_370 | ||
| 116 | static const struct mvebu_soc_descr __initconst armada_370_gating_descr[] = { | ||
| 117 | { "audio", NULL, 0 }, | ||
| 118 | { "pex0_en", NULL, 1 }, | ||
| 119 | { "pex1_en", NULL, 2 }, | ||
| 120 | { "ge1", NULL, 3 }, | ||
| 121 | { "ge0", NULL, 4 }, | ||
| 122 | { "pex0", NULL, 5 }, | ||
| 123 | { "pex1", NULL, 9 }, | ||
| 124 | { "sata0", NULL, 15 }, | ||
| 125 | { "sdio", NULL, 17 }, | ||
| 126 | { "tdm", NULL, 25 }, | ||
| 127 | { "ddr", NULL, 28 }, | ||
| 128 | { "sata1", NULL, 30 }, | ||
| 129 | { } | ||
| 130 | }; | ||
| 131 | #endif | ||
| 132 | |||
| 133 | #ifdef CONFIG_MACH_ARMADA_XP | ||
| 134 | static const struct mvebu_soc_descr __initconst armada_xp_gating_descr[] = { | ||
| 135 | { "audio", NULL, 0 }, | ||
| 136 | { "ge3", NULL, 1 }, | ||
| 137 | { "ge2", NULL, 2 }, | ||
| 138 | { "ge1", NULL, 3 }, | ||
| 139 | { "ge0", NULL, 4 }, | ||
| 140 | { "pex0", NULL, 5 }, | ||
| 141 | { "pex1", NULL, 6 }, | ||
| 142 | { "pex2", NULL, 7 }, | ||
| 143 | { "pex3", NULL, 8 }, | ||
| 144 | { "bp", NULL, 13 }, | ||
| 145 | { "sata0lnk", NULL, 14 }, | ||
| 146 | { "sata0", "sata0lnk", 15 }, | ||
| 147 | { "lcd", NULL, 16 }, | ||
| 148 | { "sdio", NULL, 17 }, | ||
| 149 | { "usb0", NULL, 18 }, | ||
| 150 | { "usb1", NULL, 19 }, | ||
| 151 | { "usb2", NULL, 20 }, | ||
| 152 | { "xor0", NULL, 22 }, | ||
| 153 | { "crypto", NULL, 23 }, | ||
| 154 | { "tdm", NULL, 25 }, | ||
| 155 | { "xor1", NULL, 28 }, | ||
| 156 | { "sata1lnk", NULL, 29 }, | ||
| 157 | { "sata1", "sata1lnk", 30 }, | ||
| 158 | { } | ||
| 159 | }; | ||
| 160 | #endif | ||
| 161 | |||
| 104 | #ifdef CONFIG_ARCH_DOVE | 162 | #ifdef CONFIG_ARCH_DOVE |
| 105 | static const struct mvebu_soc_descr __initconst dove_gating_descr[] = { | 163 | static const struct mvebu_soc_descr __initconst dove_gating_descr[] = { |
| 106 | { "usb0", NULL, 0 }, | 164 | { "usb0", NULL, 0 }, |
| @@ -147,6 +205,20 @@ static const struct mvebu_soc_descr __initconst kirkwood_gating_descr[] = { | |||
| 147 | #endif | 205 | #endif |
| 148 | 206 | ||
| 149 | static const __initdata struct of_device_id clk_gating_match[] = { | 207 | static const __initdata struct of_device_id clk_gating_match[] = { |
| 208 | #ifdef CONFIG_MACH_ARMADA_370 | ||
| 209 | { | ||
| 210 | .compatible = "marvell,armada-370-gating-clock", | ||
| 211 | .data = armada_370_gating_descr, | ||
| 212 | }, | ||
| 213 | #endif | ||
| 214 | |||
| 215 | #ifdef CONFIG_MACH_ARMADA_XP | ||
| 216 | { | ||
| 217 | .compatible = "marvell,armada-xp-gating-clock", | ||
| 218 | .data = armada_xp_gating_descr, | ||
| 219 | }, | ||
| 220 | #endif | ||
| 221 | |||
| 150 | #ifdef CONFIG_ARCH_DOVE | 222 | #ifdef CONFIG_ARCH_DOVE |
| 151 | { | 223 | { |
| 152 | .compatible = "marvell,dove-gating-clock", | 224 | .compatible = "marvell,dove-gating-clock", |
