clk: at91: add PMC sama5d2 support
authorNicolas Ferre <nicolas.ferre@atmel.com>
Thu, 18 Jun 2015 12:43:29 +0000 (14:43 +0200)
committerStephen Boyd <sboyd@codeaurora.org>
Thu, 1 Oct 2015 19:39:44 +0000 (12:39 -0700)
Add support for the new sama5d2 SoC and adapt capabilities.

Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
drivers/clk/at91/pmc.c
include/dt-bindings/clock/at91.h
include/linux/clk/at91_pmc.h

index d1844f1f37292a79bac681d9037141586b4ba203..dd2bd1cba40f19790c2d5133a04d477c6673a837 100644 (file)
@@ -206,6 +206,14 @@ static const struct at91_pmc_caps at91sam9x5_caps = {
                          AT91_PMC_MOSCRCS | AT91_PMC_CFDEV,
 };
 
+static const struct at91_pmc_caps sama5d2_caps = {
+       .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY |
+                         AT91_PMC_LOCKU | AT91_PMC_PCK0RDY |
+                         AT91_PMC_PCK1RDY | AT91_PMC_PCK2RDY |
+                         AT91_PMC_MOSCSELS | AT91_PMC_MOSCRCS |
+                         AT91_PMC_CFDEV | AT91_PMC_GCKRDY,
+};
+
 static const struct at91_pmc_caps sama5d3_caps = {
        .available_irqs = AT91_PMC_MOSCS | AT91_PMC_LOCKA | AT91_PMC_MCKRDY |
                          AT91_PMC_LOCKU | AT91_PMC_PCK0RDY |
@@ -436,6 +444,13 @@ static void __init of_at91sam9x5_pmc_setup(struct device_node *np)
 CLK_OF_DECLARE(at91sam9x5_clk_pmc, "atmel,at91sam9x5-pmc",
               of_at91sam9x5_pmc_setup);
 
+static void __init of_sama5d2_pmc_setup(struct device_node *np)
+{
+       of_at91_pmc_setup(np, &sama5d2_caps);
+}
+CLK_OF_DECLARE(sama5d2_clk_pmc, "atmel,sama5d2-pmc",
+              of_sama5d2_pmc_setup);
+
 static void __init of_sama5d3_pmc_setup(struct device_node *np)
 {
        of_at91_pmc_setup(np, &sama5d3_caps);
index 0b4cb999a3f7a2b2aa714b45e0b9d6cd960d55d5..ab3ee241d10c50577694ab5eeacabf8c8cabcb39 100644 (file)
@@ -18,5 +18,6 @@
 #define AT91_PMC_MOSCSELS      16              /* Main Oscillator Selection */
 #define AT91_PMC_MOSCRCS       17              /* Main On-Chip RC */
 #define AT91_PMC_CFDEV         18              /* Clock Failure Detector Event */
+#define AT91_PMC_GCKRDY                24              /* Generated Clocks */
 
 #endif
index dfc59e2b64fb425de0b0ec10c9b548a7acd6fcdf..dc2a0fa62eaa7eb8f575fb60f99976caf16c07dd 100644 (file)
@@ -164,6 +164,7 @@ extern void __iomem *at91_pmc_base;
 #define                AT91_PMC_MOSCSELS       (1 << 16)               /* Main Oscillator Selection [some SAM9] */
 #define                AT91_PMC_MOSCRCS        (1 << 17)               /* Main On-Chip RC [some SAM9] */
 #define                AT91_PMC_CFDEV          (1 << 18)               /* Clock Failure Detector Event [some SAM9] */
+#define                AT91_PMC_GCKRDY         (1 << 24)               /* Generated Clocks */
 #define        AT91_PMC_IMR            0x6c                    /* Interrupt Mask Register */
 
 #define AT91_PMC_PLLICPR       0x80                    /* PLL Charge Pump Current Register */