blob: ef163360a7459ebd7a8a70af00118cbcdb95717e [file] [log] [blame]
Mark Browne10f8712012-10-04 16:31:52 +01001/*
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
18struct wmfw_header {
19 char magic[4];
20 __le32 len;
21 __le16 rev;
22 u8 core;
23 u8 ver;
24} __packed;
25
26struct wmfw_footer {
27 __le64 timestamp;
28 __le32 checksum;
29} __packed;
30
31struct wmfw_adsp1_sizes {
32 __le32 dm;
33 __le32 pm;
34 __le32 zm;
35} __packed;
36
Mark Brown2159ad92012-10-11 11:54:02 +090037struct wmfw_adsp2_sizes {
38 __le32 xm;
39 __le32 ym;
40 __le32 pm;
41 __le32 zm;
42} __packed;
43
Mark Browne10f8712012-10-04 16:31:52 +010044struct wmfw_region {
45 union {
46 __be32 type;
47 __le32 offset;
48 };
49 __le32 len;
50 u8 data[];
51} __packed;
52
Mark Brown6e87bad2012-10-05 19:43:18 +010053struct wmfw_id_hdr {
54 __be32 core_id;
55 __be32 core_rev;
56 __be32 id;
57 __be32 ver;
58} __packed;
59
60struct wmfw_adsp1_id_hdr {
61 struct wmfw_id_hdr fw;
62 __be32 zm;
63 __be32 dm;
64 __be32 algs;
65} __packed;
66
Mark Brown2159ad92012-10-11 11:54:02 +090067struct 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
Mark Brown6e87bad2012-10-05 19:43:18 +010075struct wmfw_alg_hdr {
76 __be32 id;
77 __be32 ver;
78} __packed;
79
80struct wmfw_adsp1_alg_hdr {
81 struct wmfw_alg_hdr alg;
82 __be32 zm;
83 __be32 dm;
84} __packed;
85
Mark Brown2159ad92012-10-11 11:54:02 +090086struct wmfw_adsp2_alg_hdr {
87 struct wmfw_alg_hdr alg;
88 __be32 zm;
89 __be32 xm;
90 __be32 ym;
91} __packed;
92
Mark Brown6e87bad2012-10-05 19:43:18 +010093struct wmfw_coeff_hdr {
94 u8 magic[4];
95 __le32 len;
Mark Brownc7123262013-01-16 16:59:04 +090096 union {
97 __be32 rev;
98 __le32 ver;
99 };
100 union {
101 __be32 core;
102 __le32 core_ver;
103 };
Mark Brown6e87bad2012-10-05 19:43:18 +0100104 u8 data[];
105} __packed;
106
107struct wmfw_coeff_item {
Mark Brownc7123262013-01-16 16:59:04 +0900108 __le16 offset;
109 __le16 type;
Mark Brown6e87bad2012-10-05 19:43:18 +0100110 __le32 id;
111 __le32 ver;
112 __le32 sr;
113 __le32 len;
114 u8 data[];
115} __packed;
Mark Brown2159ad92012-10-11 11:54:02 +0900116
Mark Browne10f8712012-10-04 16:31:52 +0100117#define WMFW_ADSP1 1
Mark Brown2159ad92012-10-11 11:54:02 +0900118#define WMFW_ADSP2 2
Mark Browne10f8712012-10-04 16:31:52 +0100119
120#define WMFW_ABSOLUTE 0xf0
121#define WMFW_NAME_TEXT 0xfe
122#define WMFW_INFO_TEXT 0xff
123
124#define WMFW_ADSP1_PM 2
125#define WMFW_ADSP1_DM 3
126#define WMFW_ADSP1_ZM 4
127
Mark Brown2159ad92012-10-11 11:54:02 +0900128#define WMFW_ADSP2_PM 2
129#define WMFW_ADSP2_ZM 4
130#define WMFW_ADSP2_XM 5
131#define WMFW_ADSP2_YM 6
132
Mark Browne10f8712012-10-04 16:31:52 +0100133#endif