smc.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. * All timing parameters are in nanoseconds.
  16. */
  17. struct smc_config {
  18. /* Delay from address valid to assertion of given strobe */
  19. u16 ncs_read_setup;
  20. u16 nrd_setup;
  21. u16 ncs_write_setup;
  22. u16 nwe_setup;
  23. /* Pulse length of given strobe */
  24. u16 ncs_read_pulse;
  25. u16 nrd_pulse;
  26. u16 ncs_write_pulse;
  27. u16 nwe_pulse;
  28. /* Total cycle length of given operation */
  29. u16 read_cycle;
  30. u16 write_cycle;
  31. /* Bus width in bytes */
  32. u8 bus_width;
  33. /*
  34. * 0: Data is sampled on rising edge of NCS
  35. * 1: Data is sampled on rising edge of NRD
  36. */
  37. unsigned int nrd_controlled:1;
  38. /*
  39. * 0: Data is driven on falling edge of NCS
  40. * 1: Data is driven on falling edge of NWR
  41. */
  42. unsigned int nwe_controlled:1;
  43. /*
  44. * 0: Byte select access type
  45. * 1: Byte write access type
  46. */
  47. unsigned int byte_write:1;
  48. };
  49. extern int smc_set_configuration(int cs, const struct smc_config *config);
  50. extern struct smc_config *smc_get_configuration(int cs);
  51. #endif /* __ARCH_AT32AP_SMC_H */