diff options
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 29 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 8 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1003.c | 7 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1004.c | 9 |
4 files changed, 51 insertions, 2 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index a398be284966..a51bb9fb3c89 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -9,6 +9,8 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/clk.h> | 10 | #include <linux/clk.h> |
11 | #include <linux/etherdevice.h> | 11 | #include <linux/etherdevice.h> |
12 | #include <linux/irq.h> | ||
13 | #include <linux/i2c.h> | ||
12 | #include <linux/i2c-gpio.h> | 14 | #include <linux/i2c-gpio.h> |
13 | #include <linux/init.h> | 15 | #include <linux/init.h> |
14 | #include <linux/linkage.h> | 16 | #include <linux/linkage.h> |
@@ -25,6 +27,13 @@ | |||
25 | #include <asm/arch/init.h> | 27 | #include <asm/arch/init.h> |
26 | #include <asm/arch/portmux.h> | 28 | #include <asm/arch/portmux.h> |
27 | 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 | |||
28 | /* Initialized by bootloader-specific startup code. */ | 37 | /* Initialized by bootloader-specific startup code. */ |
29 | struct tag *bootloader_tags __initdata; | 38 | struct tag *bootloader_tags __initdata; |
30 | 39 | ||
@@ -140,6 +149,10 @@ static struct platform_device i2c_gpio_device = { | |||
140 | }, | 149 | }, |
141 | }; | 150 | }; |
142 | 151 | ||
152 | static struct i2c_board_info __initdata i2c_info[] = { | ||
153 | /* NOTE: original ATtiny24 firmware is at address 0x0b */ | ||
154 | }; | ||
155 | |||
143 | static int __init atngw100_init(void) | 156 | static int __init atngw100_init(void) |
144 | { | 157 | { |
145 | unsigned i; | 158 | unsigned i; |
@@ -165,12 +178,28 @@ static int __init atngw100_init(void) | |||
165 | } | 178 | } |
166 | platform_device_register(&ngw_gpio_leds); | 179 | platform_device_register(&ngw_gpio_leds); |
167 | 180 | ||
181 | /* all these i2c/smbus pins should have external pullups for | ||
182 | * open-drain sharing among all I2C devices. SDA and SCL do; | ||
183 | * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus), | ||
184 | * but it's not available off-board. | ||
185 | */ | ||
186 | at32_select_periph(GPIO_PIN_PB(28), 0, AT32_GPIOF_PULLUP); | ||
168 | at32_select_gpio(i2c_gpio_data.sda_pin, | 187 | at32_select_gpio(i2c_gpio_data.sda_pin, |
169 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | 188 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); |
170 | at32_select_gpio(i2c_gpio_data.scl_pin, | 189 | at32_select_gpio(i2c_gpio_data.scl_pin, |
171 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | 190 | AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); |
172 | platform_device_register(&i2c_gpio_device); | 191 | platform_device_register(&i2c_gpio_device); |
192 | i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info)); | ||
173 | 193 | ||
174 | return 0; | 194 | return 0; |
175 | } | 195 | } |
176 | postcore_initcall(atngw100_init); | 196 | postcore_initcall(atngw100_init); |
197 | |||
198 | static int __init atngw100_arch_init(void) | ||
199 | { | ||
200 | /* set_irq_type() after the arch_initcall for EIC has run, and | ||
201 | * before the I2C subsystem could try using this IRQ. | ||
202 | */ | ||
203 | return set_irq_type(AT32_EXTINT(3), IRQ_TYPE_EDGE_FALLING); | ||
204 | } | ||
205 | arch_initcall(atngw100_arch_init); | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 000eb4220a12..86b363c1c25b 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]; |
@@ -232,7 +238,7 @@ static int __init atstk1002_init(void) | |||
232 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); | 238 | set_hw_addr(at32_add_device_eth(1, ð_data[1])); |
233 | #else | 239 | #else |
234 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 240 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
235 | fbmem_start, fbmem_size); | 241 | fbmem_start, fbmem_size, 0); |
236 | #endif | 242 | #endif |
237 | at32_add_device_usba(0, NULL); | 243 | at32_add_device_usba(0, NULL); |
238 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM | 244 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM |
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..c7236df74d74 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, |
@@ -133,7 +140,7 @@ static int __init atstk1004_init(void) | |||
133 | at32_add_device_mci(0); | 140 | at32_add_device_mci(0); |
134 | #endif | 141 | #endif |
135 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, | 142 | at32_add_device_lcdc(0, &atstk1000_lcdc_data, |
136 | fbmem_start, fbmem_size); | 143 | fbmem_start, fbmem_size, 0); |
137 | at32_add_device_usba(0, NULL); | 144 | at32_add_device_usba(0, NULL); |
138 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM | 145 | #ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM |
139 | at32_add_device_ssc(0, ATMEL_SSC_TX); | 146 | at32_add_device_ssc(0, ATMEL_SSC_TX); |