wmfw.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. * wmfw.h - Wolfson firmware format information
  3. *
  4. * Copyright 2012 Wolfson Microelectronics plc
  5. *
  6. * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
  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 __WMFW_H
  13. #define __WMFW_H
  14. #include <linux/types.h>
  15. struct wmfw_header {
  16. char magic[4];
  17. __le32 len;
  18. __le16 rev;
  19. u8 core;
  20. u8 ver;
  21. } __packed;
  22. struct wmfw_footer {
  23. __le64 timestamp;
  24. __le32 checksum;
  25. } __packed;
  26. struct wmfw_adsp1_sizes {
  27. __le32 dm;
  28. __le32 pm;
  29. __le32 zm;
  30. } __packed;
  31. struct wmfw_adsp2_sizes {
  32. __le32 xm;
  33. __le32 ym;
  34. __le32 pm;
  35. __le32 zm;
  36. } __packed;
  37. struct wmfw_region {
  38. union {
  39. __be32 type;
  40. __le32 offset;
  41. };
  42. __le32 len;
  43. u8 data[];
  44. } __packed;
  45. struct wmfw_id_hdr {
  46. __be32 core_id;
  47. __be32 core_rev;
  48. __be32 id;
  49. __be32 ver;
  50. } __packed;
  51. struct wmfw_adsp1_id_hdr {
  52. struct wmfw_id_hdr fw;
  53. __be32 zm;
  54. __be32 dm;
  55. __be32 algs;
  56. } __packed;
  57. struct wmfw_adsp2_id_hdr {
  58. struct wmfw_id_hdr fw;
  59. __be32 zm;
  60. __be32 xm;
  61. __be32 ym;
  62. __be32 algs;
  63. } __packed;
  64. struct wmfw_alg_hdr {
  65. __be32 id;
  66. __be32 ver;
  67. } __packed;
  68. struct wmfw_adsp1_alg_hdr {
  69. struct wmfw_alg_hdr alg;
  70. __be32 zm;
  71. __be32 dm;
  72. } __packed;
  73. struct wmfw_adsp2_alg_hdr {
  74. struct wmfw_alg_hdr alg;
  75. __be32 zm;
  76. __be32 xm;
  77. __be32 ym;
  78. } __packed;
  79. struct wmfw_coeff_hdr {
  80. u8 magic[4];
  81. __le32 len;
  82. __le32 ver;
  83. u8 data[];
  84. } __packed;
  85. struct wmfw_coeff_item {
  86. union {
  87. __be32 type;
  88. __le32 offset;
  89. };
  90. __le32 id;
  91. __le32 ver;
  92. __le32 sr;
  93. __le32 len;
  94. u8 data[];
  95. } __packed;
  96. #define WMFW_ADSP1 1
  97. #define WMFW_ADSP2 2
  98. #define WMFW_ABSOLUTE 0xf0
  99. #define WMFW_NAME_TEXT 0xfe
  100. #define WMFW_INFO_TEXT 0xff
  101. #define WMFW_ADSP1_PM 2
  102. #define WMFW_ADSP1_DM 3
  103. #define WMFW_ADSP1_ZM 4
  104. #define WMFW_ADSP2_PM 2
  105. #define WMFW_ADSP2_ZM 4
  106. #define WMFW_ADSP2_XM 5
  107. #define WMFW_ADSP2_YM 6
  108. #endif