sdram.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*====================================================================*
  2. *
  3. * Copyright (c) 2013 Qualcomm Atheros, Inc.
  4. *
  5. * All rights reserved.
  6. *
  7. *====================================================================*/
  8. /*====================================================================*
  9. *
  10. * sdram.h - SDRAM definitions and declarations;
  11. *
  12. * the first section if an NVM file contains SDRAM parameters used
  13. * by the bootloader;
  14. *
  15. * Contributor(s):
  16. * Charles Maier <cmaier@qca.qualcomm.com>
  17. *
  18. *--------------------------------------------------------------------*/
  19. #ifndef SDRAM_HEADER
  20. #define SDRAM_HEADER
  21. /*====================================================================*
  22. * system header files;
  23. *--------------------------------------------------------------------*/
  24. #include <stdint.h>
  25. /*====================================================================*
  26. * custom header files;
  27. *--------------------------------------------------------------------*/
  28. #include "../tools/types.h"
  29. #include "../tools/flags.h"
  30. /*====================================================================*
  31. * constants;
  32. *--------------------------------------------------------------------*/
  33. #define SDRAM_SILENCE (1 << 0)
  34. #define SDRAM_VERBOSE (1 << 1)
  35. #define SDRAM_BASENAME (1 << 2)
  36. /*====================================================================*
  37. * variables;
  38. *--------------------------------------------------------------------*/
  39. #ifndef __GNUC__
  40. #pragma pack (push,1)
  41. #endif
  42. typedef struct __packed config_ram
  43. {
  44. uint32_t SDRAMSIZE;
  45. uint32_t SDRAMCONF;
  46. uint32_t SDRAMTIM0;
  47. uint32_t SDRAMTIM1;
  48. uint32_t SDRAMCNTRL;
  49. uint32_t SDRAMREF;
  50. uint32_t MACCLOCK;
  51. uint32_t SDRAMRSVD;
  52. }
  53. config_ram;
  54. #ifndef __GNUC__
  55. #pragma pack (pop)
  56. #endif
  57. /*====================================================================*
  58. * functions;
  59. *--------------------------------------------------------------------*/
  60. void sdrampeek (struct config_ram * config_ram);
  61. void sdramtext (struct config_ram * config_ram);
  62. int sdramfile (int fd, char const * title, flag_t flags);
  63. int sdramfileA (int fd, char const * title, flag_t flags);
  64. /*====================================================================*
  65. *
  66. *--------------------------------------------------------------------*/
  67. #endif