diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/avr32/boards/atstk1000/Kconfig | 4 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/Makefile | 1 | ||||
-rw-r--r-- | arch/avr32/boards/atstk1000/atstk1002.c | 78 |
3 files changed, 81 insertions, 2 deletions
diff --git a/arch/avr32/boards/atstk1000/Kconfig b/arch/avr32/boards/atstk1000/Kconfig index af90b00100fd..8dc48214f0b7 100644 --- a/arch/avr32/boards/atstk1000/Kconfig +++ b/arch/avr32/boards/atstk1000/Kconfig | |||
@@ -18,6 +18,10 @@ config BOARD_ATSTK1004 | |||
18 | bool "ATSTK1004" | 18 | bool "ATSTK1004" |
19 | select CPU_AT32AP7002 | 19 | select CPU_AT32AP7002 |
20 | 20 | ||
21 | config BOARD_ATSTK1006 | ||
22 | bool "ATSTK1006" | ||
23 | select CPU_AT32AP7000 | ||
24 | |||
21 | endchoice | 25 | endchoice |
22 | 26 | ||
23 | 27 | ||
diff --git a/arch/avr32/boards/atstk1000/Makefile b/arch/avr32/boards/atstk1000/Makefile index beead86462e8..edecee03742d 100644 --- a/arch/avr32/boards/atstk1000/Makefile +++ b/arch/avr32/boards/atstk1000/Makefile | |||
@@ -2,3 +2,4 @@ obj-y += setup.o flash.o | |||
2 | obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o | 2 | obj-$(CONFIG_BOARD_ATSTK1002) += atstk1002.o |
3 | obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o | 3 | obj-$(CONFIG_BOARD_ATSTK1003) += atstk1003.o |
4 | obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o | 4 | obj-$(CONFIG_BOARD_ATSTK1004) += atstk1004.o |
5 | obj-$(CONFIG_BOARD_ATSTK1006) += atstk1002.o | ||
diff --git a/arch/avr32/boards/atstk1000/atstk1002.c b/arch/avr32/boards/atstk1000/atstk1002.c index 000eb4220a12..5bfaf4d87b3f 100644 --- a/arch/avr32/boards/atstk1000/atstk1002.c +++ b/arch/avr32/boards/atstk1000/atstk1002.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * ATSTK1002 daughterboard-specific init code | 2 | * ATSTK1002/ATSTK1006 daughterboard-specific init code |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2006 Atmel Corporation | 4 | * Copyright (C) 2005-2007 Atmel Corporation |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify | 6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License version 2 as | 7 | * it under the terms of the GNU General Public License version 2 as |
@@ -29,6 +29,74 @@ | |||
29 | #include "atstk1000.h" | 29 | #include "atstk1000.h" |
30 | 30 | ||
31 | 31 | ||
32 | /* | ||
33 | * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both | ||
34 | * have the AT32AP7000 chip on board; the difference is that the | ||
35 | * STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on | ||
36 | * the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has | ||
37 | * none.) | ||
38 | * | ||
39 | * The RAM difference is handled by the boot loader, so the only | ||
40 | * difference we end up handling here is the NAND flash. | ||
41 | */ | ||
42 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
43 | #include <linux/mtd/partitions.h> | ||
44 | #include <asm/arch/smc.h> | ||
45 | |||
46 | static struct smc_timing nand_timing __initdata = { | ||
47 | .ncs_read_setup = 0, | ||
48 | .nrd_setup = 10, | ||
49 | .ncs_write_setup = 0, | ||
50 | .nwe_setup = 10, | ||
51 | |||
52 | .ncs_read_pulse = 30, | ||
53 | .nrd_pulse = 15, | ||
54 | .ncs_write_pulse = 30, | ||
55 | .nwe_pulse = 15, | ||
56 | |||
57 | .read_cycle = 30, | ||
58 | .write_cycle = 30, | ||
59 | |||
60 | .ncs_read_recover = 0, | ||
61 | .nrd_recover = 15, | ||
62 | .ncs_write_recover = 0, | ||
63 | /* WE# high -> RE# low min 60 ns */ | ||
64 | .nwe_recover = 50, | ||
65 | }; | ||
66 | |||
67 | static struct smc_config nand_config __initdata = { | ||
68 | .bus_width = 1, | ||
69 | .nrd_controlled = 1, | ||
70 | .nwe_controlled = 1, | ||
71 | .nwait_mode = 0, | ||
72 | .byte_write = 0, | ||
73 | .tdf_cycles = 2, | ||
74 | .tdf_mode = 0, | ||
75 | }; | ||
76 | |||
77 | static struct mtd_partition nand_partitions[] = { | ||
78 | { | ||
79 | .name = "main", | ||
80 | .offset = 0x00000000, | ||
81 | .size = MTDPART_SIZ_FULL, | ||
82 | }, | ||
83 | }; | ||
84 | |||
85 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
86 | { | ||
87 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
88 | return nand_partitions; | ||
89 | } | ||
90 | |||
91 | struct atmel_nand_data atstk1006_nand_data __initdata = { | ||
92 | .cle = 21, | ||
93 | .ale = 22, | ||
94 | .rdy_pin = GPIO_PIN_PB(30), | ||
95 | .enable_pin = GPIO_PIN_PB(29), | ||
96 | .partition_info = nand_part_info, | ||
97 | }; | ||
98 | #endif | ||
99 | |||
32 | struct eth_addr { | 100 | struct eth_addr { |
33 | u8 addr[6]; | 101 | u8 addr[6]; |
34 | }; | 102 | }; |
@@ -212,6 +280,12 @@ static int __init atstk1002_init(void) | |||
212 | 280 | ||
213 | at32_add_system_devices(); | 281 | at32_add_system_devices(); |
214 | 282 | ||
283 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
284 | smc_set_timing(&nand_config, &nand_timing); | ||
285 | smc_set_configuration(3, &nand_config); | ||
286 | at32_add_device_nand(0, &atstk1006_nand_data); | ||
287 | #endif | ||
288 | |||
215 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 289 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
216 | at32_add_device_usart(1); | 290 | at32_add_device_usart(1); |
217 | #else | 291 | #else |