diff options
author | Alex <mailinglist@miromico.ch> | 2008-03-17 09:55:06 -0400 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-06-27 09:07:16 -0400 |
commit | 60ed7951d0c9bf8de8588384134f16474367b410 (patch) | |
tree | 42e97bace8d7e3c41b6a7f4c1c42a4bc48648645 /arch/avr32 | |
parent | 8bd8974fcddc468d66bd67f33c578f37987b302e (diff) |
avr32: Allow board to define oscillator rates
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>
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 7 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 6 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1003.c | 7 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1004.c | 7 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 9 |
5 files changed, 28 insertions, 8 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index a398be284966..00ce961c52a5 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -25,6 +25,13 @@ | |||
25 | #include <asm/arch/init.h> | 25 | #include <asm/arch/init.h> |
26 | #include <asm/arch/portmux.h> | 26 | #include <asm/arch/portmux.h> |
27 | 27 | ||
28 | /* Oscillator frequencies. These are board-specific */ | ||
29 | unsigned long at32_board_osc_rates[3] = { | ||
30 | [0] = 32768, /* 32.768 kHz on RTC osc */ | ||
31 | [1] = 20000000, /* 20 MHz on osc0 */ | ||
32 | [2] = 12000000, /* 12 MHz on osc1 */ | ||
33 | }; | ||
34 | |||
28 | /* Initialized by bootloader-specific startup code. */ | 35 | /* Initialized by bootloader-specific startup code. */ |
29 | struct tag *bootloader_tags __initdata; | 36 | struct tag *bootloader_tags __initdata; |
30 | 37 | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 000eb4220a12..0e1332686867 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -28,6 +28,12 @@ | |||
28 | 28 | ||
29 | #include "atstk1000.h" | 29 | #include "atstk1000.h" |
30 | 30 | ||
31 | /* Oscillator frequencies. These are board specific */ | ||
32 | unsigned long at32_board_osc_rates[3] = { | ||
33 | [0] = 32768, /* 32.768 kHz on RTC osc */ | ||
34 | [1] = 20000000, /* 20 MHz on osc0 */ | ||
35 | [2] = 12000000, /* 12 MHz on osc1 */ | ||
36 | }; | ||
31 | 37 | ||
32 | struct eth_addr { | 38 | struct eth_addr { |
33 | u8 addr[6]; | 39 | u8 addr[6]; |
diff --git a/arch/avr32/boards/atstk1000/atstk1003.c b/arch/avr32/boards/atstk1000/atstk1003.c index a0b223df35a2..ea109f435a83 100644 --- a/arch/avr32/boards/atstk1000/atstk1003.c +++ b/arch/avr32/boards/atstk1000/atstk1003.c | |||
@@ -27,6 +27,13 @@ | |||
27 | 27 | ||
28 | #include "atstk1000.h" | 28 | #include "atstk1000.h" |
29 | 29 | ||
30 | /* Oscillator frequencies. These are board specific */ | ||
31 | unsigned long at32_board_osc_rates[3] = { | ||
32 | [0] = 32768, /* 32.768 kHz on RTC osc */ | ||
33 | [1] = 20000000, /* 20 MHz on osc0 */ | ||
34 | [2] = 12000000, /* 12 MHz on osc1 */ | ||
35 | }; | ||
36 | |||
30 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC | 37 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC |
31 | static struct at73c213_board_info at73c213_data = { | 38 | static struct at73c213_board_info at73c213_data = { |
32 | .ssc_id = 0, | 39 | .ssc_id = 0, |
diff --git a/arch/avr32/boards/atstk1000/atstk1004.c b/arch/avr32/boards/atstk1000/atstk1004.c index e765a8652b3e..cbf09dd0db53 100644 --- a/arch/avr32/boards/atstk1000/atstk1004.c +++ b/arch/avr32/boards/atstk1000/atstk1004.c | |||
@@ -29,6 +29,13 @@ | |||
29 | 29 | ||
30 | #include "atstk1000.h" | 30 | #include "atstk1000.h" |
31 | 31 | ||
32 | /* Oscillator frequencies. These are board specific */ | ||
33 | unsigned long at32_board_osc_rates[3] = { | ||
34 | [0] = 32768, /* 32.768 kHz on RTC osc */ | ||
35 | [1] = 20000000, /* 20 MHz on osc0 */ | ||
36 | [2] = 12000000, /* 12 MHz on osc1 */ | ||
37 | }; | ||
38 | |||
32 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC | 39 | #ifdef CONFIG_BOARD_ATSTK1000_EXTDAC |
33 | static struct at73c213_board_info at73c213_data = { | 40 | static struct at73c213_board_info at73c213_data = { |
34 | .ssc_id = 0, | 41 | .ssc_id = 0, |
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 0f24b4f85c17..34b56de4ea60 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -93,19 +93,12 @@ static struct clk devname##_##_name = { \ | |||
93 | 93 | ||
94 | static DEFINE_SPINLOCK(pm_lock); | 94 | static DEFINE_SPINLOCK(pm_lock); |
95 | 95 | ||
96 | unsigned long at32ap7000_osc_rates[3] = { | ||
97 | [0] = 32768, | ||
98 | /* FIXME: these are ATSTK1002-specific */ | ||
99 | [1] = 20000000, | ||
100 | [2] = 12000000, | ||
101 | }; | ||
102 | |||
103 | static struct clk osc0; | 96 | static struct clk osc0; |
104 | static struct clk osc1; | 97 | static struct clk osc1; |
105 | 98 | ||
106 | static unsigned long osc_get_rate(struct clk *clk) | 99 | static unsigned long osc_get_rate(struct clk *clk) |
107 | { | 100 | { |
108 | return at32ap7000_osc_rates[clk->index]; | 101 | return at32_board_osc_rates[clk->index]; |
109 | } | 102 | } |
110 | 103 | ||
111 | static unsigned long pll_get_rate(struct clk *clk, unsigned long control) | 104 | static unsigned long pll_get_rate(struct clk *clk, unsigned long control) |