2 * Static Memory Controller for AT32 chips
4 * Copyright (C) 2006 Atmel Corporation
6 * Inspired by the OMAP2 General-Purpose Memory Controller interface
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.
12 #ifndef __ARCH_AT32AP_SMC_H
13 #define __ARCH_AT32AP_SMC_H
16 * All timing parameters are in nanoseconds.
19 /* Delay from address valid to assertion of given strobe */
25 /* Pulse length of given strobe */
31 /* Total cycle length of given operation */
35 /* Minimal recovery times, will extend cycle if needed */
38 int ncs_write_recover;
43 * All timing parameters are in clock cycles.
47 /* Delay from address valid to assertion of given strobe */
53 /* Pulse length of given strobe */
59 /* Total cycle length of given operation */
63 /* Bus width in bytes */
67 * 0: Data is sampled on rising edge of NCS
68 * 1: Data is sampled on rising edge of NRD
70 unsigned int nrd_controlled:1;
73 * 0: Data is driven on falling edge of NCS
74 * 1: Data is driven on falling edge of NWR
76 unsigned int nwe_controlled:1;
79 * 0: NWAIT is disabled
81 * 2: NWAIT is frozen mode
82 * 3: NWAIT in ready mode
84 unsigned int nwait_mode:2;
87 * 0: Byte select access type
88 * 1: Byte write access type
90 unsigned int byte_write:1;
93 * Number of clock cycles before data is released after
94 * the rising edge of the read controlling signal
96 * Total cycles from SMC is tdf_cycles + 1
98 unsigned int tdf_cycles:4;
101 * 0: TDF optimization disabled
102 * 1: TDF optimization enabled
104 unsigned int tdf_mode:1;
107 extern void smc_set_timing(struct smc_config *config,
108 const struct smc_timing *timing);
110 extern int smc_set_configuration(int cs, const struct smc_config *config);
111 extern struct smc_config *smc_get_configuration(int cs);
113 #endif /* __ARCH_AT32AP_SMC_H */