avr32: Allow board to define oscillator rates
authorAlex <mailinglist@miromico.ch>
Mon, 17 Mar 2008 13:55:06 +0000 (14:55 +0100)
committerHaavard Skinnemoen <haavard.skinnemoen@atmel.com>
Fri, 27 Jun 2008 13:07:16 +0000 (15:07 +0200)
On our custom board we have other oscillator rates than on atngw100 and
atstk100x.

Currently these rates are hardcoded in arch/avr32/mach-at32ap/at32ap700x.c.

This patch moves them into board specific code.

Signed-off-by: Alex Raimondi <raimondi@miromico.ch>
Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
arch/avr32/boards/atngw100/setup.c
arch/avr32/boards/atstk1000/atstk1002.c
arch/avr32/boards/atstk1000/atstk1003.c
arch/avr32/boards/atstk1000/atstk1004.c
arch/avr32/mach-at32ap/at32ap700x.c
include/asm-avr32/arch-at32ap/board.h

index a398be2849666bf974696ba383800df885ee3cf7..00ce961c52a5add473a2839b7fc026ee878fd15e 100644 (file)
 #include <asm/arch/init.h>
 #include <asm/arch/portmux.h>
 
+/* Oscillator frequencies. These are board-specific */
+unsigned long at32_board_osc_rates[3] = {
+       [0] = 32768,    /* 32.768 kHz on RTC osc */
+       [1] = 20000000, /* 20 MHz on osc0 */
+       [2] = 12000000, /* 12 MHz on osc1 */
+};
+
 /* Initialized by bootloader-specific startup code. */
 struct tag *bootloader_tags __initdata;
 
index 000eb4220a12619b4e9b9922f5ed7d9e4c958064..0e1332686867b6d5814bc21c32c660829c396657 100644 (file)
 
 #include "atstk1000.h"
 
+/* Oscillator frequencies. These are board specific */
+unsigned long at32_board_osc_rates[3] = {
+       [0] = 32768,    /* 32.768 kHz on RTC osc */
+       [1] = 20000000, /* 20 MHz on osc0 */
+       [2] = 12000000, /* 12 MHz on osc1 */
+};
 
 struct eth_addr {
        u8 addr[6];
index a0b223df35a253ed1afa45106864dc47ade6b744..ea109f435a83adc6ffb67cd8264d8a84552f52c9 100644 (file)
 
 #include "atstk1000.h"
 
+/* Oscillator frequencies. These are board specific */
+unsigned long at32_board_osc_rates[3] = {
+       [0] = 32768,    /* 32.768 kHz on RTC osc */
+       [1] = 20000000, /* 20 MHz on osc0 */
+       [2] = 12000000, /* 12 MHz on osc1 */
+};
+
 #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC
 static struct at73c213_board_info at73c213_data = {
        .ssc_id         = 0,
index e765a8652b3ee58480847302923170ed668150d3..cbf09dd0db53ac5bc05c9bcb90c341bd8b7258e2 100644 (file)
 
 #include "atstk1000.h"
 
+/* Oscillator frequencies. These are board specific */
+unsigned long at32_board_osc_rates[3] = {
+       [0] = 32768,    /* 32.768 kHz on RTC osc */
+       [1] = 20000000, /* 20 MHz on osc0 */
+       [2] = 12000000, /* 12 MHz on osc1 */
+};
+
 #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC
 static struct at73c213_board_info at73c213_data = {
        .ssc_id         = 0,
index 0f24b4f85c17c6022b4dccf624532ec7e4aeb7db..34b56de4ea60ff6a1e733c96c95008688a020e21 100644 (file)
@@ -93,19 +93,12 @@ static struct clk devname##_##_name = {                             \
 
 static DEFINE_SPINLOCK(pm_lock);
 
-unsigned long at32ap7000_osc_rates[3] = {
-       [0] = 32768,
-       /* FIXME: these are ATSTK1002-specific */
-       [1] = 20000000,
-       [2] = 12000000,
-};
-
 static struct clk osc0;
 static struct clk osc1;
 
 static unsigned long osc_get_rate(struct clk *clk)
 {
-       return at32ap7000_osc_rates[clk->index];
+       return at32_board_osc_rates[clk->index];
 }
 
 static unsigned long pll_get_rate(struct clk *clk, unsigned long control)
index a4e2d28bfb5884c52af09f110fa543d776386f57..cfd3060d5b26c711e02a193456c34886fcff365b 100644 (file)
@@ -8,6 +8,12 @@
 
 #define GPIO_PIN_NONE  (-1)
 
+/*
+ * Clock rates for various on-board oscillators. The number of entries
+ * in this array is chip-dependent.
+ */
+extern unsigned long at32_board_osc_rates[];
+  
 /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */
 void at32_add_system_devices(void);
 
This page took 0.028767 seconds and 5 git commands to generate.