diff options
Diffstat (limited to 'arch/arm/mach-kirkwood/common.c')
-rw-r--r-- | arch/arm/mach-kirkwood/common.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c index a02cae881f2f..3ad037385a5e 100644 --- a/arch/arm/mach-kirkwood/common.c +++ b/arch/arm/mach-kirkwood/common.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/ata_platform.h> | 15 | #include <linux/ata_platform.h> |
16 | #include <linux/mtd/nand.h> | 16 | #include <linux/mtd/nand.h> |
17 | #include <linux/dma-mapping.h> | 17 | #include <linux/dma-mapping.h> |
18 | #include <linux/of.h> | ||
18 | #include <net/dsa.h> | 19 | #include <net/dsa.h> |
19 | #include <asm/page.h> | 20 | #include <asm/page.h> |
20 | #include <asm/timex.h> | 21 | #include <asm/timex.h> |
@@ -482,6 +483,9 @@ static int __init kirkwood_clock_gate(void) | |||
482 | unsigned int curr = readl(CLOCK_GATING_CTRL); | 483 | unsigned int curr = readl(CLOCK_GATING_CTRL); |
483 | u32 dev, rev; | 484 | u32 dev, rev; |
484 | 485 | ||
486 | #ifdef CONFIG_OF | ||
487 | struct device_node *np; | ||
488 | #endif | ||
485 | kirkwood_pcie_id(&dev, &rev); | 489 | kirkwood_pcie_id(&dev, &rev); |
486 | printk(KERN_DEBUG "Gating clock of unused units\n"); | 490 | printk(KERN_DEBUG "Gating clock of unused units\n"); |
487 | printk(KERN_DEBUG "before: 0x%08x\n", curr); | 491 | printk(KERN_DEBUG "before: 0x%08x\n", curr); |
@@ -489,6 +493,14 @@ static int __init kirkwood_clock_gate(void) | |||
489 | /* Make sure those units are accessible */ | 493 | /* Make sure those units are accessible */ |
490 | writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); | 494 | writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); |
491 | 495 | ||
496 | #ifdef CONFIG_OF | ||
497 | np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand"); | ||
498 | if (np && of_device_is_available(np)) { | ||
499 | kirkwood_clk_ctrl |= CGC_RUNIT; | ||
500 | of_node_put(np); | ||
501 | } | ||
502 | #endif | ||
503 | |||
492 | /* For SATA: first shutdown the phy */ | 504 | /* For SATA: first shutdown the phy */ |
493 | if (!(kirkwood_clk_ctrl & CGC_SATA0)) { | 505 | if (!(kirkwood_clk_ctrl & CGC_SATA0)) { |
494 | /* Disable PLL and IVREF */ | 506 | /* Disable PLL and IVREF */ |