diff options
author | Kristoffer Nyborg Gregertsen <kngregertsen@norway.atmel.com> | 2007-08-17 10:59:57 -0400 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-10-11 07:32:49 -0400 |
commit | af8184718a322ae589efa583aa69ffdae61bf266 (patch) | |
tree | 7324ba9e6a14e78b89b703bea7d0594a0ae9ef6e /include/asm-avr32 | |
parent | 193fdd1a99db8623697cb18a13dbcaa4eadbb1f2 (diff) |
[AVR32] SMC configuration in clock cycles
This patch makes the SMC configuration take timings in clock cycles
instead of nanoseconds. A function to calculate timings in clock
cycles is added.
This patch removes the rounding troubles of the previous SMC
configuration method.
[hskinnemoen@atmel.com: fix atstk1002/atngw100 flash config]
Signed-off-by: Kristoffer Nyborg Gregertsen <gregerts@stud.ntnu.no>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'include/asm-avr32')
-rw-r--r-- | include/asm-avr32/arch-at32ap/smc.h | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/include/asm-avr32/arch-at32ap/smc.h b/include/asm-avr32/arch-at32ap/smc.h index 07152b7fd9c9..c98eea44a70a 100644 --- a/include/asm-avr32/arch-at32ap/smc.h +++ b/include/asm-avr32/arch-at32ap/smc.h | |||
@@ -15,22 +15,50 @@ | |||
15 | /* | 15 | /* |
16 | * All timing parameters are in nanoseconds. | 16 | * All timing parameters are in nanoseconds. |
17 | */ | 17 | */ |
18 | struct smc_timing { | ||
19 | /* Delay from address valid to assertion of given strobe */ | ||
20 | int ncs_read_setup; | ||
21 | int nrd_setup; | ||
22 | int ncs_write_setup; | ||
23 | int nwe_setup; | ||
24 | |||
25 | /* Pulse length of given strobe */ | ||
26 | int ncs_read_pulse; | ||
27 | int nrd_pulse; | ||
28 | int ncs_write_pulse; | ||
29 | int nwe_pulse; | ||
30 | |||
31 | /* Total cycle length of given operation */ | ||
32 | int read_cycle; | ||
33 | int write_cycle; | ||
34 | |||
35 | /* Minimal recovery times, will extend cycle if needed */ | ||
36 | int ncs_read_recover; | ||
37 | int nrd_recover; | ||
38 | int ncs_write_recover; | ||
39 | int nwe_recover; | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * All timing parameters are in clock cycles. | ||
44 | */ | ||
18 | struct smc_config { | 45 | struct smc_config { |
46 | |||
19 | /* Delay from address valid to assertion of given strobe */ | 47 | /* Delay from address valid to assertion of given strobe */ |
20 | u16 ncs_read_setup; | 48 | u8 ncs_read_setup; |
21 | u16 nrd_setup; | 49 | u8 nrd_setup; |
22 | u16 ncs_write_setup; | 50 | u8 ncs_write_setup; |
23 | u16 nwe_setup; | 51 | u8 nwe_setup; |
24 | 52 | ||
25 | /* Pulse length of given strobe */ | 53 | /* Pulse length of given strobe */ |
26 | u16 ncs_read_pulse; | 54 | u8 ncs_read_pulse; |
27 | u16 nrd_pulse; | 55 | u8 nrd_pulse; |
28 | u16 ncs_write_pulse; | 56 | u8 ncs_write_pulse; |
29 | u16 nwe_pulse; | 57 | u8 nwe_pulse; |
30 | 58 | ||
31 | /* Total cycle length of given operation */ | 59 | /* Total cycle length of given operation */ |
32 | u16 read_cycle; | 60 | u8 read_cycle; |
33 | u16 write_cycle; | 61 | u8 write_cycle; |
34 | 62 | ||
35 | /* Bus width in bytes */ | 63 | /* Bus width in bytes */ |
36 | u8 bus_width; | 64 | u8 bus_width; |
@@ -76,6 +104,9 @@ struct smc_config { | |||
76 | unsigned int tdf_mode:1; | 104 | unsigned int tdf_mode:1; |
77 | }; | 105 | }; |
78 | 106 | ||
107 | extern void smc_set_timing(struct smc_config *config, | ||
108 | const struct smc_timing *timing); | ||
109 | |||
79 | extern int smc_set_configuration(int cs, const struct smc_config *config); | 110 | extern int smc_set_configuration(int cs, const struct smc_config *config); |
80 | extern struct smc_config *smc_get_configuration(int cs); | 111 | extern struct smc_config *smc_get_configuration(int cs); |
81 | 112 | ||