aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards
diff options
context:
space:
mode:
authorDavid Woodhouse <David.Woodhouse@intel.com>2008-07-25 10:40:14 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2008-07-25 10:40:14 -0400
commitff877ea80efa2015b6263766f78ee42c2a1b32f9 (patch)
tree85205005c611ab774702148558321c6fb92f1ccd /arch/avr32/boards
parent30821fee4f0cb3e6d241d9f7ddc37742212e3eb7 (diff)
parentd37e6bf68fc1eb34a4ad21d9ae8890ed37ea80e7 (diff)
Merge branch 'linux-next' of git://git.infradead.org/~dedekind/ubi-2.6
Diffstat (limited to 'arch/avr32/boards')
-rw-r--r--arch/avr32/boards/atngw100/setup.c36
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c11
-rw-r--r--arch/avr32/boards/atstk1000/atstk1003.c7
-rw-r--r--arch/avr32/boards/atstk1000/atstk1004.c9
4 files changed, 61 insertions, 2 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c
index a398be284966..c7fe94d03a1e 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>
@@ -17,6 +19,7 @@
17#include <linux/leds.h> 19#include <linux/leds.h>
18#include <linux/spi/spi.h> 20#include <linux/spi/spi.h>
19 21
22#include <asm/atmel-mci.h>
20#include <asm/io.h> 23#include <asm/io.h>
21#include <asm/setup.h> 24#include <asm/setup.h>
22 25
@@ -25,6 +28,13 @@
25#include <asm/arch/init.h> 28#include <asm/arch/init.h>
26#include <asm/arch/portmux.h> 29#include <asm/arch/portmux.h>
27 30
31/* Oscillator frequencies. These are board-specific */
32unsigned 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};
37
28/* Initialized by bootloader-specific startup code. */ 38/* Initialized by bootloader-specific startup code. */
29struct tag *bootloader_tags __initdata; 39struct tag *bootloader_tags __initdata;
30 40
@@ -42,6 +52,11 @@ static struct spi_board_info spi0_board_info[] __initdata = {
42 }, 52 },
43}; 53};
44 54
55static struct mci_platform_data __initdata mci0_data = {
56 .detect_pin = GPIO_PIN_PC(25),
57 .wp_pin = GPIO_PIN_PE(0),
58};
59
45/* 60/*
46 * The next two functions should go away as the boot loader is 61 * The next two functions should go away as the boot loader is
47 * supposed to initialize the macb address registers with a valid 62 * supposed to initialize the macb address registers with a valid
@@ -140,6 +155,10 @@ static struct platform_device i2c_gpio_device = {
140 }, 155 },
141}; 156};
142 157
158static struct i2c_board_info __initdata i2c_info[] = {
159 /* NOTE: original ATtiny24 firmware is at address 0x0b */
160};
161
143static int __init atngw100_init(void) 162static int __init atngw100_init(void)
144{ 163{
145 unsigned i; 164 unsigned i;
@@ -157,6 +176,7 @@ static int __init atngw100_init(void)
157 set_hw_addr(at32_add_device_eth(1, &eth_data[1])); 176 set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
158 177
159 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); 178 at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info));
179 at32_add_device_mci(0, &mci0_data);
160 at32_add_device_usba(0, NULL); 180 at32_add_device_usba(0, NULL);
161 181
162 for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { 182 for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) {
@@ -165,12 +185,28 @@ static int __init atngw100_init(void)
165 } 185 }
166 platform_device_register(&ngw_gpio_leds); 186 platform_device_register(&ngw_gpio_leds);
167 187
188 /* all these i2c/smbus pins should have external pullups for
189 * open-drain sharing among all I2C devices. SDA and SCL do;
190 * PB28/EXTINT3 doesn't; it should be SMBALERT# (for PMBus),
191 * but it's not available off-board.
192 */
193 at32_select_periph(GPIO_PIN_PB(28), 0, AT32_GPIOF_PULLUP);
168 at32_select_gpio(i2c_gpio_data.sda_pin, 194 at32_select_gpio(i2c_gpio_data.sda_pin,
169 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); 195 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
170 at32_select_gpio(i2c_gpio_data.scl_pin, 196 at32_select_gpio(i2c_gpio_data.scl_pin,
171 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); 197 AT32_GPIOF_MULTIDRV | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH);
172 platform_device_register(&i2c_gpio_device); 198 platform_device_register(&i2c_gpio_device);
199 i2c_register_board_info(0, i2c_info, ARRAY_SIZE(i2c_info));
173 200
174 return 0; 201 return 0;
175} 202}
176postcore_initcall(atngw100_init); 203postcore_initcall(atngw100_init);
204
205static int __init atngw100_arch_init(void)
206{
207 /* set_irq_type() after the arch_initcall for EIC has run, and
208 * before the I2C subsystem could try using this IRQ.
209 */
210 return set_irq_type(AT32_EXTINT(3), IRQ_TYPE_EDGE_FALLING);
211}
212arch_initcall(atngw100_arch_init);
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c
index 5bfaf4d87b3f..14dc5a143695 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 */
32unsigned 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/* 38/*
33 * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both 39 * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both
@@ -302,11 +308,14 @@ static int __init atstk1002_init(void)
302#ifdef CONFIG_BOARD_ATSTK100X_SPI1 308#ifdef CONFIG_BOARD_ATSTK100X_SPI1
303 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info)); 309 at32_add_device_spi(1, spi1_board_info, ARRAY_SIZE(spi1_board_info));
304#endif 310#endif
311#ifndef CONFIG_BOARD_ATSTK1002_SW2_CUSTOM
312 at32_add_device_mci(0, NULL);
313#endif
305#ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM 314#ifdef CONFIG_BOARD_ATSTK1002_SW5_CUSTOM
306 set_hw_addr(at32_add_device_eth(1, &eth_data[1])); 315 set_hw_addr(at32_add_device_eth(1, &eth_data[1]));
307#else 316#else
308 at32_add_device_lcdc(0, &atstk1000_lcdc_data, 317 at32_add_device_lcdc(0, &atstk1000_lcdc_data,
309 fbmem_start, fbmem_size); 318 fbmem_start, fbmem_size, 0);
310#endif 319#endif
311 at32_add_device_usba(0, NULL); 320 at32_add_device_usba(0, NULL);
312#ifndef CONFIG_BOARD_ATSTK100X_SW3_CUSTOM 321#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 */
31unsigned 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
31static struct at73c213_board_info at73c213_data = { 38static 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 */
33unsigned 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
33static struct at73c213_board_info at73c213_data = { 40static 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);