Path: blob/master/arch/avr32/mach-at32ap/include/mach/smc.h
10820 views
/*1* Static Memory Controller for AT32 chips2*3* Copyright (C) 2006 Atmel Corporation4*5* Inspired by the OMAP2 General-Purpose Memory Controller interface6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/11#ifndef __ARCH_AT32AP_SMC_H12#define __ARCH_AT32AP_SMC_H1314/*15* All timing parameters are in nanoseconds.16*/17struct smc_timing {18/* Delay from address valid to assertion of given strobe */19int ncs_read_setup;20int nrd_setup;21int ncs_write_setup;22int nwe_setup;2324/* Pulse length of given strobe */25int ncs_read_pulse;26int nrd_pulse;27int ncs_write_pulse;28int nwe_pulse;2930/* Total cycle length of given operation */31int read_cycle;32int write_cycle;3334/* Minimal recovery times, will extend cycle if needed */35int ncs_read_recover;36int nrd_recover;37int ncs_write_recover;38int nwe_recover;39};4041/*42* All timing parameters are in clock cycles.43*/44struct smc_config {4546/* Delay from address valid to assertion of given strobe */47u8 ncs_read_setup;48u8 nrd_setup;49u8 ncs_write_setup;50u8 nwe_setup;5152/* Pulse length of given strobe */53u8 ncs_read_pulse;54u8 nrd_pulse;55u8 ncs_write_pulse;56u8 nwe_pulse;5758/* Total cycle length of given operation */59u8 read_cycle;60u8 write_cycle;6162/* Bus width in bytes */63u8 bus_width;6465/*66* 0: Data is sampled on rising edge of NCS67* 1: Data is sampled on rising edge of NRD68*/69unsigned int nrd_controlled:1;7071/*72* 0: Data is driven on falling edge of NCS73* 1: Data is driven on falling edge of NWR74*/75unsigned int nwe_controlled:1;7677/*78* 0: NWAIT is disabled79* 1: Reserved80* 2: NWAIT is frozen mode81* 3: NWAIT in ready mode82*/83unsigned int nwait_mode:2;8485/*86* 0: Byte select access type87* 1: Byte write access type88*/89unsigned int byte_write:1;9091/*92* Number of clock cycles before data is released after93* the rising edge of the read controlling signal94*95* Total cycles from SMC is tdf_cycles + 196*/97unsigned int tdf_cycles:4;9899/*100* 0: TDF optimization disabled101* 1: TDF optimization enabled102*/103unsigned int tdf_mode:1;104};105106extern void smc_set_timing(struct smc_config *config,107const struct smc_timing *timing);108109extern int smc_set_configuration(int cs, const struct smc_config *config);110extern struct smc_config *smc_get_configuration(int cs);111112#endif /* __ARCH_AT32AP_SMC_H */113114115