aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-at91/board-sam9g20ek.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-at91/board-sam9g20ek.c')
-rw-r--r--arch/arm/mach-at91/board-sam9g20ek.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/arch/arm/mach-at91/board-sam9g20ek.c b/arch/arm/mach-at91/board-sam9g20ek.c
index b588ead14d68..81439fe6fb3d 100644
--- a/arch/arm/mach-at91/board-sam9g20ek.c
+++ b/arch/arm/mach-at91/board-sam9g20ek.c
@@ -37,7 +37,9 @@
37 37
38#include <mach/board.h> 38#include <mach/board.h>
39#include <mach/gpio.h> 39#include <mach/gpio.h>
40#include <mach/at91sam9_smc.h>
40 41
42#include "sam9_smc.h"
41#include "generic.h" 43#include "generic.h"
42 44
43 45
@@ -156,6 +158,38 @@ static struct atmel_nand_data __initdata ek_nand_data = {
156#endif 158#endif
157}; 159};
158 160
161static struct sam9_smc_config __initdata ek_nand_smc_config = {
162 .ncs_read_setup = 0,
163 .nrd_setup = 2,
164 .ncs_write_setup = 0,
165 .nwe_setup = 2,
166
167 .ncs_read_pulse = 4,
168 .nrd_pulse = 4,
169 .ncs_write_pulse = 4,
170 .nwe_pulse = 4,
171
172 .read_cycle = 7,
173 .write_cycle = 7,
174
175 .mode = AT91_SMC_READMODE | AT91_SMC_WRITEMODE | AT91_SMC_EXNWMODE_DISABLE,
176 .tdf_cycles = 3,
177};
178
179static void __init ek_add_device_nand(void)
180{
181 /* setup bus-width (8 or 16) */
182 if (ek_nand_data.bus_width_16)
183 ek_nand_smc_config.mode |= AT91_SMC_DBW_16;
184 else
185 ek_nand_smc_config.mode |= AT91_SMC_DBW_8;
186
187 /* configure chip-select 3 (NAND) */
188 sam9_smc_configure(3, &ek_nand_smc_config);
189
190 at91_add_device_nand(&ek_nand_data);
191}
192
159 193
160/* 194/*
161 * MCI (SD/MMC) 195 * MCI (SD/MMC)
@@ -195,7 +229,7 @@ static void __init ek_board_init(void)
195 /* SPI */ 229 /* SPI */
196 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices)); 230 at91_add_device_spi(ek_spi_devices, ARRAY_SIZE(ek_spi_devices));
197 /* NAND */ 231 /* NAND */
198 at91_add_device_nand(&ek_nand_data); 232 ek_add_device_nand();
199 /* Ethernet */ 233 /* Ethernet */
200 at91_add_device_eth(&ek_macb_data); 234 at91_add_device_eth(&ek_macb_data);
201 /* MMC */ 235 /* MMC */