Commit | Line | Data |
---|---|---|
e10f8711 MB |
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 | ||
13 | #ifndef __WMFW_H | |
14 | #define __WMFW_H | |
15 | ||
16 | #include <linux/types.h> | |
17 | ||
18 | struct wmfw_header { | |
19 | char magic[4]; | |
20 | __le32 len; | |
21 | __le16 rev; | |
22 | u8 core; | |
23 | u8 ver; | |
24 | } __packed; | |
25 | ||
26 | struct wmfw_footer { | |
27 | __le64 timestamp; | |
28 | __le32 checksum; | |
29 | } __packed; | |
30 | ||
31 | struct wmfw_adsp1_sizes { | |
32 | __le32 dm; | |
33 | __le32 pm; | |
34 | __le32 zm; | |
35 | } __packed; | |
36 | ||
2159ad93 MB |
37 | struct wmfw_adsp2_sizes { |
38 | __le32 xm; | |
39 | __le32 ym; | |
40 | __le32 pm; | |
41 | __le32 zm; | |
42 | } __packed; | |
43 | ||
e10f8711 MB |
44 | struct wmfw_region { |
45 | union { | |
46 | __be32 type; | |
47 | __le32 offset; | |
48 | }; | |
49 | __le32 len; | |
50 | u8 data[]; | |
51 | } __packed; | |
52 | ||
6e87badd MB |
53 | struct wmfw_id_hdr { |
54 | __be32 core_id; | |
55 | __be32 core_rev; | |
56 | __be32 id; | |
57 | __be32 ver; | |
58 | } __packed; | |
59 | ||
60 | struct wmfw_adsp1_id_hdr { | |
61 | struct wmfw_id_hdr fw; | |
62 | __be32 zm; | |
63 | __be32 dm; | |
64 | __be32 algs; | |
65 | } __packed; | |
66 | ||
2159ad93 MB |
67 | struct wmfw_adsp2_id_hdr { |
68 | struct wmfw_id_hdr fw; | |
69 | __be32 zm; | |
70 | __be32 xm; | |
71 | __be32 ym; | |
72 | __be32 algs; | |
73 | } __packed; | |
74 | ||
6e87badd MB |
75 | struct wmfw_alg_hdr { |
76 | __be32 id; | |
77 | __be32 ver; | |
78 | } __packed; | |
79 | ||
80 | struct wmfw_adsp1_alg_hdr { | |
81 | struct wmfw_alg_hdr alg; | |
82 | __be32 zm; | |
83 | __be32 dm; | |
84 | } __packed; | |
85 | ||
2159ad93 MB |
86 | struct wmfw_adsp2_alg_hdr { |
87 | struct wmfw_alg_hdr alg; | |
88 | __be32 zm; | |
89 | __be32 xm; | |
90 | __be32 ym; | |
91 | } __packed; | |
92 | ||
6e87badd MB |
93 | struct wmfw_coeff_hdr { |
94 | u8 magic[4]; | |
95 | __le32 len; | |
96 | __le32 ver; | |
97 | u8 data[]; | |
98 | } __packed; | |
99 | ||
100 | struct wmfw_coeff_item { | |
101 | union { | |
102 | __be32 type; | |
103 | __le32 offset; | |
104 | }; | |
105 | __le32 id; | |
106 | __le32 ver; | |
107 | __le32 sr; | |
108 | __le32 len; | |
109 | u8 data[]; | |
110 | } __packed; | |
2159ad93 | 111 | |
e10f8711 | 112 | #define WMFW_ADSP1 1 |
2159ad93 | 113 | #define WMFW_ADSP2 2 |
e10f8711 MB |
114 | |
115 | #define WMFW_ABSOLUTE 0xf0 | |
116 | #define WMFW_NAME_TEXT 0xfe | |
117 | #define WMFW_INFO_TEXT 0xff | |
118 | ||
119 | #define WMFW_ADSP1_PM 2 | |
120 | #define WMFW_ADSP1_DM 3 | |
121 | #define WMFW_ADSP1_ZM 4 | |
122 | ||
2159ad93 MB |
123 | #define WMFW_ADSP2_PM 2 |
124 | #define WMFW_ADSP2_ZM 4 | |
125 | #define WMFW_ADSP2_XM 5 | |
126 | #define WMFW_ADSP2_YM 6 | |
127 | ||
e10f8711 | 128 | #endif |