diff options
Diffstat (limited to 'arch/avr32/mach-at32ap')
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap700x.c | 11 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/cpufreq.c | 14 | ||||
-rw-r--r-- | arch/avr32/mach-at32ap/include/mach/board.h | 10 |
3 files changed, 31 insertions, 4 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap700x.c b/arch/avr32/mach-at32ap/at32ap700x.c index 813b6844cdf6..0c6e02f80a31 100644 --- a/arch/avr32/mach-at32ap/at32ap700x.c +++ b/arch/avr32/mach-at32ap/at32ap700x.c | |||
@@ -813,7 +813,7 @@ static struct resource pio4_resource[] = { | |||
813 | DEFINE_DEV(pio, 4); | 813 | DEFINE_DEV(pio, 4); |
814 | DEV_CLK(mck, pio4, pba, 14); | 814 | DEV_CLK(mck, pio4, pba, 14); |
815 | 815 | ||
816 | void __init at32_add_system_devices(void) | 816 | static int __init system_device_init(void) |
817 | { | 817 | { |
818 | platform_device_register(&at32_pm0_device); | 818 | platform_device_register(&at32_pm0_device); |
819 | platform_device_register(&at32_intc0_device); | 819 | platform_device_register(&at32_intc0_device); |
@@ -832,7 +832,10 @@ void __init at32_add_system_devices(void) | |||
832 | platform_device_register(&pio2_device); | 832 | platform_device_register(&pio2_device); |
833 | platform_device_register(&pio3_device); | 833 | platform_device_register(&pio3_device); |
834 | platform_device_register(&pio4_device); | 834 | platform_device_register(&pio4_device); |
835 | |||
836 | return 0; | ||
835 | } | 837 | } |
838 | core_initcall(system_device_init); | ||
836 | 839 | ||
837 | /* -------------------------------------------------------------------- | 840 | /* -------------------------------------------------------------------- |
838 | * PSIF | 841 | * PSIF |
@@ -1091,7 +1094,9 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data) | |||
1091 | pin_mask |= (1 << 11); /* RXD2 */ | 1094 | pin_mask |= (1 << 11); /* RXD2 */ |
1092 | pin_mask |= (1 << 12); /* RXD3 */ | 1095 | pin_mask |= (1 << 12); /* RXD3 */ |
1093 | pin_mask |= (1 << 14); /* RXCK */ | 1096 | pin_mask |= (1 << 14); /* RXCK */ |
1097 | #ifndef CONFIG_BOARD_MIMC200 | ||
1094 | pin_mask |= (1 << 18); /* SPD */ | 1098 | pin_mask |= (1 << 18); /* SPD */ |
1099 | #endif | ||
1095 | } | 1100 | } |
1096 | 1101 | ||
1097 | select_peripheral(PIOC, pin_mask, PERIPH_A, 0); | 1102 | select_peripheral(PIOC, pin_mask, PERIPH_A, 0); |
@@ -1112,8 +1117,10 @@ at32_add_device_eth(unsigned int id, struct eth_platform_data *data) | |||
1112 | pin_mask |= (1 << 3); /* MDC */ | 1117 | pin_mask |= (1 << 3); /* MDC */ |
1113 | pin_mask |= (1 << 2); /* MDIO */ | 1118 | pin_mask |= (1 << 2); /* MDIO */ |
1114 | 1119 | ||
1120 | #ifndef CONFIG_BOARD_MIMC200 | ||
1115 | if (!data->is_rmii) | 1121 | if (!data->is_rmii) |
1116 | pin_mask |= (1 << 15); /* SPD */ | 1122 | pin_mask |= (1 << 15); /* SPD */ |
1123 | #endif | ||
1117 | 1124 | ||
1118 | select_peripheral(PIOD, pin_mask, PERIPH_B, 0); | 1125 | select_peripheral(PIOD, pin_mask, PERIPH_B, 0); |
1119 | 1126 | ||
@@ -1470,7 +1477,7 @@ at32_add_device_lcdc(unsigned int id, struct atmel_lcdfb_info *data, | |||
1470 | pin_mask = ATMEL_LCDC_PRI_24BIT | ATMEL_LCDC_PRI_CONTROL; | 1477 | pin_mask = ATMEL_LCDC_PRI_24BIT | ATMEL_LCDC_PRI_CONTROL; |
1471 | 1478 | ||
1472 | /* LCDC on port C */ | 1479 | /* LCDC on port C */ |
1473 | portc_mask = (pin_mask & 0xfff80000) >> 19; | 1480 | portc_mask = pin_mask & 0xfff80000; |
1474 | select_peripheral(PIOC, portc_mask, PERIPH_A, 0); | 1481 | select_peripheral(PIOC, portc_mask, PERIPH_A, 0); |
1475 | 1482 | ||
1476 | /* LCDC on port D */ | 1483 | /* LCDC on port D */ |
diff --git a/arch/avr32/mach-at32ap/cpufreq.c b/arch/avr32/mach-at32ap/cpufreq.c index d84efe4984ab..024c586e936c 100644 --- a/arch/avr32/mach-at32ap/cpufreq.c +++ b/arch/avr32/mach-at32ap/cpufreq.c | |||
@@ -40,6 +40,9 @@ static unsigned int at32_get_speed(unsigned int cpu) | |||
40 | return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000); | 40 | return (unsigned int)((clk_get_rate(cpuclk) + 500) / 1000); |
41 | } | 41 | } |
42 | 42 | ||
43 | static unsigned int ref_freq; | ||
44 | static unsigned long loops_per_jiffy_ref; | ||
45 | |||
43 | static int at32_set_target(struct cpufreq_policy *policy, | 46 | static int at32_set_target(struct cpufreq_policy *policy, |
44 | unsigned int target_freq, | 47 | unsigned int target_freq, |
45 | unsigned int relation) | 48 | unsigned int relation) |
@@ -61,8 +64,19 @@ static int at32_set_target(struct cpufreq_policy *policy, | |||
61 | freqs.cpu = 0; | 64 | freqs.cpu = 0; |
62 | freqs.flags = 0; | 65 | freqs.flags = 0; |
63 | 66 | ||
67 | if (!ref_freq) { | ||
68 | ref_freq = freqs.old; | ||
69 | loops_per_jiffy_ref = boot_cpu_data.loops_per_jiffy; | ||
70 | } | ||
71 | |||
64 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); | 72 | cpufreq_notify_transition(&freqs, CPUFREQ_PRECHANGE); |
73 | if (freqs.old < freqs.new) | ||
74 | boot_cpu_data.loops_per_jiffy = cpufreq_scale( | ||
75 | loops_per_jiffy_ref, ref_freq, freqs.new); | ||
65 | clk_set_rate(cpuclk, freq); | 76 | clk_set_rate(cpuclk, freq); |
77 | if (freqs.new < freqs.old) | ||
78 | boot_cpu_data.loops_per_jiffy = cpufreq_scale( | ||
79 | loops_per_jiffy_ref, ref_freq, freqs.new); | ||
66 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); | 80 | cpufreq_notify_transition(&freqs, CPUFREQ_POSTCHANGE); |
67 | 81 | ||
68 | pr_debug("cpufreq: set frequency %lu Hz\n", freq); | 82 | pr_debug("cpufreq: set frequency %lu Hz\n", freq); |
diff --git a/arch/avr32/mach-at32ap/include/mach/board.h b/arch/avr32/mach-at32ap/include/mach/board.h index c48386d66bc3..aafaf7a78886 100644 --- a/arch/avr32/mach-at32ap/include/mach/board.h +++ b/arch/avr32/mach-at32ap/include/mach/board.h | |||
@@ -14,8 +14,14 @@ | |||
14 | */ | 14 | */ |
15 | extern unsigned long at32_board_osc_rates[]; | 15 | extern unsigned long at32_board_osc_rates[]; |
16 | 16 | ||
17 | /* Add basic devices: system manager, interrupt controller, portmuxes, etc. */ | 17 | /* |
18 | void at32_add_system_devices(void); | 18 | * This used to add essential system devices, but this is now done |
19 | * automatically. Please don't use it in new board code. | ||
20 | */ | ||
21 | static inline void __deprecated at32_add_system_devices(void) | ||
22 | { | ||
23 | |||
24 | } | ||
19 | 25 | ||
20 | #define ATMEL_MAX_UART 4 | 26 | #define ATMEL_MAX_UART 4 |
21 | extern struct platform_device *atmel_default_console_device; | 27 | extern struct platform_device *atmel_default_console_device; |