diff options
author | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-07-27 07:54:08 -0400 |
---|---|---|
committer | Haavard Skinnemoen <haavard.skinnemoen@atmel.com> | 2008-07-27 07:54:08 -0400 |
commit | eda3d8f5604860aae1bb9996bb5efc4213778369 (patch) | |
tree | 9d3887d2665bcc5f5abf200758794545c7b2c69b /arch/avr32/boards | |
parent | 87a9f704658a40940e740b1d73d861667e9164d3 (diff) | |
parent | 8be1a6d6c77ab4532e4476fdb8177030ef48b52c (diff) |
Merge commit 'upstream/master'
Diffstat (limited to 'arch/avr32/boards')
-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 e11659b732fa..14dc5a143695 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 |
@@ -35,6 +35,74 @@ unsigned long at32_board_osc_rates[3] = { | |||
35 | [2] = 12000000, /* 12 MHz on osc1 */ | 35 | [2] = 12000000, /* 12 MHz on osc1 */ |
36 | }; | 36 | }; |
37 | 37 | ||
38 | /* | ||
39 | * The ATSTK1006 daughterboard is very similar to the ATSTK1002. Both | ||
40 | * have the AT32AP7000 chip on board; the difference is that the | ||
41 | * STK1006 has 128 MB SDRAM (the STK1002 uses the 8 MB SDRAM chip on | ||
42 | * the STK1000 motherboard) and 256 MB NAND flash (the STK1002 has | ||
43 | * none.) | ||
44 | * | ||
45 | * The RAM difference is handled by the boot loader, so the only | ||
46 | * difference we end up handling here is the NAND flash. | ||
47 | */ | ||
48 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
49 | #include <linux/mtd/partitions.h> | ||
50 | #include <asm/arch/smc.h> | ||
51 | |||
52 | static struct smc_timing nand_timing __initdata = { | ||
53 | .ncs_read_setup = 0, | ||
54 | .nrd_setup = 10, | ||
55 | .ncs_write_setup = 0, | ||
56 | .nwe_setup = 10, | ||
57 | |||
58 | .ncs_read_pulse = 30, | ||
59 | .nrd_pulse = 15, | ||
60 | .ncs_write_pulse = 30, | ||
61 | .nwe_pulse = 15, | ||
62 | |||
63 | .read_cycle = 30, | ||
64 | .write_cycle = 30, | ||
65 | |||
66 | .ncs_read_recover = 0, | ||
67 | .nrd_recover = 15, | ||
68 | .ncs_write_recover = 0, | ||
69 | /* WE# high -> RE# low min 60 ns */ | ||
70 | .nwe_recover = 50, | ||
71 | }; | ||
72 | |||
73 | static struct smc_config nand_config __initdata = { | ||
74 | .bus_width = 1, | ||
75 | .nrd_controlled = 1, | ||
76 | .nwe_controlled = 1, | ||
77 | .nwait_mode = 0, | ||
78 | .byte_write = 0, | ||
79 | .tdf_cycles = 2, | ||
80 | .tdf_mode = 0, | ||
81 | }; | ||
82 | |||
83 | static struct mtd_partition nand_partitions[] = { | ||
84 | { | ||
85 | .name = "main", | ||
86 | .offset = 0x00000000, | ||
87 | .size = MTDPART_SIZ_FULL, | ||
88 | }, | ||
89 | }; | ||
90 | |||
91 | static struct mtd_partition *nand_part_info(int size, int *num_partitions) | ||
92 | { | ||
93 | *num_partitions = ARRAY_SIZE(nand_partitions); | ||
94 | return nand_partitions; | ||
95 | } | ||
96 | |||
97 | struct atmel_nand_data atstk1006_nand_data __initdata = { | ||
98 | .cle = 21, | ||
99 | .ale = 22, | ||
100 | .rdy_pin = GPIO_PIN_PB(30), | ||
101 | .enable_pin = GPIO_PIN_PB(29), | ||
102 | .partition_info = nand_part_info, | ||
103 | }; | ||
104 | #endif | ||
105 | |||
38 | struct eth_addr { | 106 | struct eth_addr { |
39 | u8 addr[6]; | 107 | u8 addr[6]; |
40 | }; | 108 | }; |
@@ -218,6 +286,12 @@ static int __init atstk1002_init(void) | |||
218 | 286 | ||
219 | at32_add_system_devices(); | 287 | at32_add_system_devices(); |
220 | 288 | ||
289 | #ifdef CONFIG_BOARD_ATSTK1006 | ||
290 | smc_set_timing(&nand_config, &nand_timing); | ||
291 | smc_set_configuration(3, &nand_config); | ||
292 | at32_add_device_nand(0, &atstk1006_nand_data); | ||
293 | #endif | ||
294 | |||
221 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM | 295 | #ifdef CONFIG_BOARD_ATSTK100X_SW2_CUSTOM |
222 | at32_add_device_usart(1); | 296 | at32_add_device_usart(1); |
223 | #else | 297 | #else |