sdram.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. #ifndef _SDRAM_H_
  2. #define _SDRAM_H_
  3. /*
  4. * Copyright (C) 2012 by Ole Reinhardt (ole.reinhardt@embedded-it.de)
  5. *
  6. * All rights reserved.
  7. *
  8. * Redistribution and use in source and binary forms, with or without
  9. * modification, are permitted provided that the following conditions
  10. * are met:
  11. *
  12. * 1. Redistributions of source code must retain the above copyright
  13. * notice, this list of conditions and the following disclaimer.
  14. * 2. Redistributions in binary form must reproduce the above copyright
  15. * notice, this list of conditions and the following disclaimer in the
  16. * documentation and/or other materials provided with the distribution.
  17. * 3. Neither the name of the copyright holders nor the names of
  18. * contributors may be used to endorse or promote products derived
  19. * from this software without specific prior written permission.
  20. *
  21. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  22. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  23. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  24. * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  25. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  26. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  27. * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
  28. * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  29. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  30. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
  31. * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  32. * SUCH DAMAGE.
  33. *
  34. * For additional information see http://www.ethernut.de/
  35. */
  36. /*
  37. * \file dev/sdram.h
  38. * \brief Datastructs to specify SDRAM timings for several sdrams
  39. *
  40. *
  41. * \verbatim
  42. * $Id: $
  43. * \endverbatim
  44. */
  45. typedef struct _sdram_params {
  46. uint32_t base_addr;
  47. uint32_t size;
  48. uint32_t bus_width;
  49. uint8_t rows;
  50. uint8_t cols;
  51. uint8_t ras_latency; /* row address strobe latency (cycles) */
  52. uint8_t cas_latency; /* collumn address strobe latency (cycles) */
  53. uint8_t tRP; /* precharge to activate time (ns) */
  54. uint8_t tRAS; /* active to precharge time (ns) */
  55. uint8_t tSREX; /* self refresh exit time. (ns) for devices
  56. without this parameter use the same value
  57. as tXSR */
  58. uint8_t tAPR; /* last active data out to active (cycles) */
  59. uint8_t tDAL; /* data-in to active time (cycles) */
  60. uint8_t tWR; /* write recovery time (cycles) */
  61. uint8_t tRC; /* active to active time (ns) */
  62. uint8_t tRFC; /* auto-refresh, and auto-refresh to active time (ns) */
  63. uint8_t tXSR; /* exit self-refresh to active time (ns) */
  64. uint8_t tRRD; /* active bank A to active bank B latency (ns)*/
  65. uint8_t tMRD; /* load mode register to active time (cycles) */
  66. uint16_t refresh; /* refresh time for array (us) */
  67. } SDRAM;
  68. #endif