aboutsummaryrefslogtreecommitdiffstats
path: root/arch/avr32/boards/atstk1000/atstk1002.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/avr32/boards/atstk1000/atstk1002.c')
-rw-r--r--arch/avr32/boards/atstk1000/atstk1002.c78
1 files changed, 76 insertions, 2 deletions
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
52static 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
73static 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
83static struct mtd_partition nand_partitions[] = {
84 {
85 .name = "main",
86 .offset = 0x00000000,
87 .size = MTDPART_SIZ_FULL,
88 },
89};
90
91static 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
97struct 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
38struct eth_addr { 106struct 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