diff options
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 10 | ||||
-rw-r--r-- | drivers/dma/mv_xor.c | 15 | ||||
-rw-r--r-- | drivers/dma/mv_xor.h | 1 |
3 files changed, 21 insertions, 5 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index b9b341ff91b4..ab27d06ac4a5 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -87,7 +87,7 @@ static struct clk __init *kirkwood_register_gate(const char *name, u8 bit_idx) | |||
87 | void __init kirkwood_clk_init(void) | 87 | void __init kirkwood_clk_init(void) |
88 | { | 88 | { |
89 | struct clk *runit, *ge0, *ge1, *sata0, *sata1, *usb0, *sdio; | 89 | struct clk *runit, *ge0, *ge1, *sata0, *sata1, *usb0, *sdio; |
90 | struct clk *crypto; | 90 | struct clk *crypto, *xor0, *xor1; |
91 | 91 | ||
92 | tclk = clk_register_fixed_rate(NULL, "tclk", NULL, | 92 | tclk = clk_register_fixed_rate(NULL, "tclk", NULL, |
93 | CLK_IS_ROOT, kirkwood_tclk); | 93 | CLK_IS_ROOT, kirkwood_tclk); |
@@ -100,8 +100,8 @@ void __init kirkwood_clk_init(void) | |||
100 | usb0 = kirkwood_register_gate("usb0", CGC_BIT_USB0); | 100 | usb0 = kirkwood_register_gate("usb0", CGC_BIT_USB0); |
101 | sdio = kirkwood_register_gate("sdio", CGC_BIT_SDIO); | 101 | sdio = kirkwood_register_gate("sdio", CGC_BIT_SDIO); |
102 | crypto = kirkwood_register_gate("crypto", CGC_BIT_CRYPTO); | 102 | crypto = kirkwood_register_gate("crypto", CGC_BIT_CRYPTO); |
103 | kirkwood_register_gate("xor0", CGC_BIT_XOR0); | 103 | xor0 = kirkwood_register_gate("xor0", CGC_BIT_XOR0); |
104 | kirkwood_register_gate("xor1", CGC_BIT_XOR1); | 104 | xor1 = kirkwood_register_gate("xor1", CGC_BIT_XOR1); |
105 | kirkwood_register_gate("pex0", CGC_BIT_PEX0); | 105 | kirkwood_register_gate("pex0", CGC_BIT_PEX0); |
106 | kirkwood_register_gate("pex1", CGC_BIT_PEX1); | 106 | kirkwood_register_gate("pex1", CGC_BIT_PEX1); |
107 | kirkwood_register_gate("audio", CGC_BIT_AUDIO); | 107 | kirkwood_register_gate("audio", CGC_BIT_AUDIO); |
@@ -120,6 +120,8 @@ void __init kirkwood_clk_init(void) | |||
120 | orion_clkdev_add(NULL, "orion_nand", runit); | 120 | orion_clkdev_add(NULL, "orion_nand", runit); |
121 | orion_clkdev_add(NULL, "mvsdio", sdio); | 121 | orion_clkdev_add(NULL, "mvsdio", sdio); |
122 | orion_clkdev_add(NULL, "mv_crypto", crypto); | 122 | orion_clkdev_add(NULL, "mv_crypto", crypto); |
123 | orion_clkdev_add(NULL, MV_XOR_SHARED_NAME ".0", xor0); | ||
124 | orion_clkdev_add(NULL, MV_XOR_SHARED_NAME ".1", xor1); | ||
123 | } | 125 | } |
124 | 126 | ||
125 | /***************************************************************************** | 127 | /***************************************************************************** |
@@ -336,7 +338,6 @@ void __init kirkwood_crypto_init(void) | |||
336 | void __init kirkwood_xor0_init(void) | 338 | void __init kirkwood_xor0_init(void) |
337 | { | 339 | { |
338 | kirkwood_clk_ctrl |= CGC_XOR0; | 340 | kirkwood_clk_ctrl |= CGC_XOR0; |
339 | |||
340 | orion_xor0_init(XOR0_PHYS_BASE, XOR0_HIGH_PHYS_BASE, | 341 | orion_xor0_init(XOR0_PHYS_BASE, XOR0_HIGH_PHYS_BASE, |
341 | IRQ_KIRKWOOD_XOR_00, IRQ_KIRKWOOD_XOR_01); | 342 | IRQ_KIRKWOOD_XOR_00, IRQ_KIRKWOOD_XOR_01); |
342 | } | 343 | } |
@@ -348,7 +349,6 @@ void __init kirkwood_xor0_init(void) | |||
348 | void __init kirkwood_xor1_init(void) | 349 | void __init kirkwood_xor1_init(void) |
349 | { | 350 | { |
350 | kirkwood_clk_ctrl |= CGC_XOR1; | 351 | kirkwood_clk_ctrl |= CGC_XOR1; |
351 | |||
352 | orion_xor1_init(XOR1_PHYS_BASE, XOR1_HIGH_PHYS_BASE, | 352 | orion_xor1_init(XOR1_PHYS_BASE, XOR1_HIGH_PHYS_BASE, |
353 | IRQ_KIRKWOOD_XOR_10, IRQ_KIRKWOOD_XOR_11); | 353 | IRQ_KIRKWOOD_XOR_10, IRQ_KIRKWOOD_XOR_11); |
354 | } | 354 | } |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index fa5d55fea46c..0b12e68bf79c 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/interrupt.h> | 25 | #include <linux/interrupt.h> |
26 | #include <linux/platform_device.h> | 26 | #include <linux/platform_device.h> |
27 | #include <linux/memory.h> | 27 | #include <linux/memory.h> |
28 | #include <linux/clk.h> | ||
28 | #include <plat/mv_xor.h> | 29 | #include <plat/mv_xor.h> |
29 | 30 | ||
30 | #include "dmaengine.h" | 31 | #include "dmaengine.h" |
@@ -1307,11 +1308,25 @@ static int mv_xor_shared_probe(struct platform_device *pdev) | |||
1307 | if (dram) | 1308 | if (dram) |
1308 | mv_xor_conf_mbus_windows(msp, dram); | 1309 | mv_xor_conf_mbus_windows(msp, dram); |
1309 | 1310 | ||
1311 | /* Not all platforms can gate the clock, so it is not | ||
1312 | * an error if the clock does not exists. | ||
1313 | */ | ||
1314 | msp->clk = clk_get(&pdev->dev, NULL); | ||
1315 | if (!IS_ERR(msp->clk)) | ||
1316 | clk_prepare_enable(msp->clk); | ||
1317 | |||
1310 | return 0; | 1318 | return 0; |
1311 | } | 1319 | } |
1312 | 1320 | ||
1313 | static int mv_xor_shared_remove(struct platform_device *pdev) | 1321 | static int mv_xor_shared_remove(struct platform_device *pdev) |
1314 | { | 1322 | { |
1323 | struct mv_xor_shared_private *msp = platform_get_drvdata(pdev); | ||
1324 | |||
1325 | if (!IS_ERR(msp->clk)) { | ||
1326 | clk_disable_unprepare(msp->clk); | ||
1327 | clk_put(msp->clk); | ||
1328 | } | ||
1329 | |||
1315 | return 0; | 1330 | return 0; |
1316 | } | 1331 | } |
1317 | 1332 | ||
diff --git a/drivers/dma/mv_xor.h b/drivers/dma/mv_xor.h index 654876b7ba1d..a5b422f5a8ab 100644 --- a/drivers/dma/mv_xor.h +++ b/drivers/dma/mv_xor.h | |||
@@ -55,6 +55,7 @@ | |||
55 | struct mv_xor_shared_private { | 55 | struct mv_xor_shared_private { |
56 | void __iomem *xor_base; | 56 | void __iomem *xor_base; |
57 | void __iomem *xor_high_base; | 57 | void __iomem *xor_high_base; |
58 | struct clk *clk; | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | 61 | ||