[RFC PATCH 14/50] ARM: at91: move at91sam9260 SoC to new at91 clk implem

2013-06-07 Thread Boris BREZILLON
This patch removes all references to the old at91 clks implementation and
make use of the new at91 clk implem for at91sam9260 SoC.

All dt specific lookups are removed (handled in clk device tree binding).  

Signed-off-by: Boris BREZILLON 
---
 arch/arm/mach-at91/at91sam9260.c |  692 +-
 1 file changed, 457 insertions(+), 235 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index df32768..45a8169c 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -26,7 +26,6 @@
 #include "at91_rstc.h"
 #include "soc.h"
 #include "generic.h"
-#include "clock.h"
 #include "sam9_smc.h"
 
 /* 
@@ -36,255 +35,478 @@
 /*
  * The peripheral clocks.
  */
-static struct clk pioA_clk = {
-   .name   = "pioA_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_PIOA,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioB_clk = {
-   .name   = "pioB_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_PIOB,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioC_clk = {
-   .name   = "pioC_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_PIOC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk adc_clk = {
-   .name   = "adc_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_ADC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-
-static struct clk adc_op_clk = {
-   .name   = "adc_op_clk",
-   .type   = CLK_TYPE_PERIPHERAL,
-   .rate_hz= 500,
-};
-
-static struct clk usart0_clk = {
-   .name   = "usart0_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart1_clk = {
-   .name   = "usart1_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart2_clk = {
-   .name   = "usart2_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US2,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk mmc_clk = {
-   .name   = "mci_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_MCI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk udc_clk = {
-   .name   = "udc_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_UDP,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk twi_clk = {
-   .name   = "twi_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_TWI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi0_clk = {
-   .name   = "spi0_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_SPI0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi1_clk = {
-   .name   = "spi1_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_SPI1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ssc_clk = {
-   .name   = "ssc_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_SSC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc0_clk = {
-   .name   = "tc0_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_TC0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc1_clk = {
-   .name   = "tc1_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_TC1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc2_clk = {
-   .name   = "tc2_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_TC2,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ohci_clk = {
-   .name   = "ohci_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_UHP,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk macb_clk = {
-   .name   = "pclk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_EMAC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk isi_clk = {
-   .name   = "isi_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_ISI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart3_clk = {
-   .name   = "usart3_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US3,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart4_clk = {
-   .name   = "usart4_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US4,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart5_clk = {
-   .name   = "usart5_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_US5,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc3_clk = {
-   .name   = "tc3_clk",
-   .pmc_mask   = 1 << AT91SAM9260_ID_TC3,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc4_clk = {
-   .name  

[RFC PATCH 14/50] ARM: at91: move at91sam9260 SoC to new at91 clk implem

2013-06-07 Thread Boris BREZILLON
This patch removes all references to the old at91 clks implementation and
make use of the new at91 clk implem for at91sam9260 SoC.

All dt specific lookups are removed (handled in clk device tree binding).  

Signed-off-by: Boris BREZILLON b.brezil...@overkiz.com
---
 arch/arm/mach-at91/at91sam9260.c |  692 +-
 1 file changed, 457 insertions(+), 235 deletions(-)

diff --git a/arch/arm/mach-at91/at91sam9260.c b/arch/arm/mach-at91/at91sam9260.c
index df32768..45a8169c 100644
--- a/arch/arm/mach-at91/at91sam9260.c
+++ b/arch/arm/mach-at91/at91sam9260.c
@@ -26,7 +26,6 @@
 #include at91_rstc.h
 #include soc.h
 #include generic.h
-#include clock.h
 #include sam9_smc.h
 
 /* 
@@ -36,255 +35,478 @@
 /*
  * The peripheral clocks.
  */
-static struct clk pioA_clk = {
-   .name   = pioA_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_PIOA,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioB_clk = {
-   .name   = pioB_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_PIOB,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk pioC_clk = {
-   .name   = pioC_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_PIOC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk adc_clk = {
-   .name   = adc_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_ADC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-
-static struct clk adc_op_clk = {
-   .name   = adc_op_clk,
-   .type   = CLK_TYPE_PERIPHERAL,
-   .rate_hz= 500,
-};
-
-static struct clk usart0_clk = {
-   .name   = usart0_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart1_clk = {
-   .name   = usart1_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart2_clk = {
-   .name   = usart2_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US2,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk mmc_clk = {
-   .name   = mci_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_MCI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk udc_clk = {
-   .name   = udc_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_UDP,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk twi_clk = {
-   .name   = twi_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TWI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi0_clk = {
-   .name   = spi0_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_SPI0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk spi1_clk = {
-   .name   = spi1_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_SPI1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ssc_clk = {
-   .name   = ssc_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_SSC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc0_clk = {
-   .name   = tc0_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TC0,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc1_clk = {
-   .name   = tc1_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TC1,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc2_clk = {
-   .name   = tc2_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TC2,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk ohci_clk = {
-   .name   = ohci_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_UHP,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk macb_clk = {
-   .name   = pclk,
-   .pmc_mask   = 1  AT91SAM9260_ID_EMAC,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk isi_clk = {
-   .name   = isi_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_ISI,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart3_clk = {
-   .name   = usart3_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US3,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart4_clk = {
-   .name   = usart4_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US4,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk usart5_clk = {
-   .name   = usart5_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_US5,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc3_clk = {
-   .name   = tc3_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TC3,
-   .type   = CLK_TYPE_PERIPHERAL,
-};
-static struct clk tc4_clk = {
-   .name   = tc4_clk,
-   .pmc_mask   = 1  AT91SAM9260_ID_TC4,
-