aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/bcm63xx/clk.c
diff options
context:
space:
mode:
authorJonas Gorski <jonas.gorski@gmail.com>2012-10-28 07:49:53 -0400
committerJohn Crispin <blogic@openwrt.org>2012-11-09 05:37:17 -0500
commitf2d1035e956052d29c83fe8f8da0d056af6d221a (patch)
tree1cb6769113f52ebf6e4457b6ec0adc38e7886e0b /arch/mips/bcm63xx/clk.c
parentb8ebbaff03798180c4d9661105670e03276afe83 (diff)
MIPS: BCM63XX: add and use a clock for PCIe
Add a PCIe clock and use that instead of directly touching the clock control register. While at it, fail if there is no such clock. Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Acked-by: Florian Fainelli <florian@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/4452 Signed-off-by: John Crispin <blogic@openwrt.org>
Diffstat (limited to 'arch/mips/bcm63xx/clk.c')
-rw-r--r--arch/mips/bcm63xx/clk.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/mips/bcm63xx/clk.c b/arch/mips/bcm63xx/clk.c
index dff79ab6005e..89a5fb077862 100644
--- a/arch/mips/bcm63xx/clk.c
+++ b/arch/mips/bcm63xx/clk.c
@@ -253,6 +253,19 @@ static struct clk clk_ipsec = {
253}; 253};
254 254
255/* 255/*
256 * PCIe clock
257 */
258
259static void pcie_set(struct clk *clk, int enable)
260{
261 bcm_hwclock_set(CKCTL_6328_PCIE_EN, enable);
262}
263
264static struct clk clk_pcie = {
265 .set = pcie_set,
266};
267
268/*
256 * Internal peripheral clock 269 * Internal peripheral clock
257 */ 270 */
258static struct clk clk_periph = { 271static struct clk clk_periph = {
@@ -313,6 +326,8 @@ struct clk *clk_get(struct device *dev, const char *id)
313 return &clk_pcm; 326 return &clk_pcm;
314 if (BCMCPU_IS_6368() && !strcmp(id, "ipsec")) 327 if (BCMCPU_IS_6368() && !strcmp(id, "ipsec"))
315 return &clk_ipsec; 328 return &clk_ipsec;
329 if (BCMCPU_IS_6328() && !strcmp(id, "pcie"))
330 return &clk_pcie;
316 return ERR_PTR(-ENOENT); 331 return ERR_PTR(-ENOENT);
317} 332}
318 333