diff options
author | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2006-09-26 02:32:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-09-26 11:48:54 -0400 |
commit | bc157b75960f1f33566074e820342690216629b9 (patch) | |
tree | 3f494ec585eb4bf3e7def5de2b2455b13b5c42c8 /include/asm-avr32 | |
parent | 5f97f7f9400de47ae837170bb274e90ad3934386 (diff) |
[PATCH] AVR32 MTD: Static Memory Controller driver
This patchset adds the necessary drivers and infrastructure to access the
external flash on the ATSTK1000 board through the MTD subsystem. With this
stuff in place, it will be possible to use a jffs2 filesystem stored in the
external flash as a root filesystem. It might also be possible to update the
boot loader if you drop the write protection of partition 0.
As suggested by David Woodhouse, I reworked the patches to use the physmap
driver instead of introducing a separate mapping driver for the ATSTK1000.
I've also cleaned up the hsmc header by removing useless comments and
converting spaces to tabs (my headerfile generator needs some work.)
Unfortunately, I couldn't unlock the flash in fixup_use_atmel_lock because the
erase regions hadn't been set up yet, so I had to do it from cfi_amdstd_setup
instead.
This patch:
This adds a simple API for configuring the static memory controller along with
an implementation for the Atmel HSMC.
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-avr32')
-rw-r--r-- | include/asm-avr32/arch-at32ap/smc.h | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/include/asm-avr32/arch-at32ap/smc.h b/include/asm-avr32/arch-at32ap/smc.h new file mode 100644 index 000000000000..3732b328303d --- /dev/null +++ b/include/asm-avr32/arch-at32ap/smc.h | |||
@@ -0,0 +1,60 @@ | |||
1 | /* | ||
2 | * Static Memory Controller for AT32 chips | ||
3 | * | ||
4 | * Copyright (C) 2006 Atmel Corporation | ||
5 | * | ||
6 | * Inspired by the OMAP2 General-Purpose Memory Controller interface | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | #ifndef __ARCH_AT32AP_SMC_H | ||
13 | #define __ARCH_AT32AP_SMC_H | ||
14 | |||
15 | /* | ||
16 | * All timing parameters are in nanoseconds. | ||
17 | */ | ||
18 | struct smc_config { | ||
19 | /* Delay from address valid to assertion of given strobe */ | ||
20 | u16 ncs_read_setup; | ||
21 | u16 nrd_setup; | ||
22 | u16 ncs_write_setup; | ||
23 | u16 nwe_setup; | ||
24 | |||
25 | /* Pulse length of given strobe */ | ||
26 | u16 ncs_read_pulse; | ||
27 | u16 nrd_pulse; | ||
28 | u16 ncs_write_pulse; | ||
29 | u16 nwe_pulse; | ||
30 | |||
31 | /* Total cycle length of given operation */ | ||
32 | u16 read_cycle; | ||
33 | u16 write_cycle; | ||
34 | |||
35 | /* Bus width in bytes */ | ||
36 | u8 bus_width; | ||
37 | |||
38 | /* | ||
39 | * 0: Data is sampled on rising edge of NCS | ||
40 | * 1: Data is sampled on rising edge of NRD | ||
41 | */ | ||
42 | unsigned int nrd_controlled:1; | ||
43 | |||
44 | /* | ||
45 | * 0: Data is driven on falling edge of NCS | ||
46 | * 1: Data is driven on falling edge of NWR | ||
47 | */ | ||
48 | unsigned int nwe_controlled:1; | ||
49 | |||
50 | /* | ||
51 | * 0: Byte select access type | ||
52 | * 1: Byte write access type | ||
53 | */ | ||
54 | unsigned int byte_write:1; | ||
55 | }; | ||
56 | |||
57 | extern int smc_set_configuration(int cs, const struct smc_config *config); | ||
58 | extern struct smc_config *smc_get_configuration(int cs); | ||
59 | |||
60 | #endif /* __ARCH_AT32AP_SMC_H */ | ||