Skip to content

Commit bdba825

Browse files
lyakhlgirdwood
authored andcommitted
Add a command line option to set an Intel-specific PV bit
Add a '-p' command line flag to set Intel reserved bit in IMR area. Signed-off-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
1 parent 1c48208 commit bdba825

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

src/adsp_config.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,6 @@ static int parse_css_v2_5(const toml_table_t *toml, struct parse_ctx *pctx,
929929
return ret;
930930

931931
/* hardcoded to align with meu */
932-
out->reserved0 = 0;
933932
out->reserved1[0] = 0xf;
934933
out->reserved1[1] = 0x048e0000; // TODO: what is this ?
935934

src/rimage.c

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ static void usage(char *name)
3131
fprintf(stdout, "\t -e build extended manifest\n");
3232
fprintf(stdout, "\t -y verify signed file\n");
3333
fprintf(stdout, "\t -q resign binary\n");
34+
fprintf(stdout, "\t -p set PV bit\n");
3435
}
3536

3637
int main(int argc, char *argv[])
@@ -41,10 +42,11 @@ int main(int argc, char *argv[])
4142
int opt, ret, i, first_non_opt;
4243
int imr_type = MAN_DEFAULT_IMR_TYPE;
4344
int use_ext_man = 0;
45+
unsigned int pv_bit = 0;
4446

4547
memset(&image, 0, sizeof(image));
4648

47-
while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:")) != -1) {
49+
while ((opt = getopt(argc, argv, "ho:va:s:k:ri:f:b:ec:y:q:p")) != -1) {
4850
switch (opt) {
4951
case 'o':
5052
image.out_file = optarg;
@@ -88,6 +90,9 @@ int main(int argc, char *argv[])
8890
case 'q':
8991
image.in_file = optarg;
9092
break;
93+
case 'p':
94+
pv_bit = 1;
95+
break;
9196
default:
9297
/* getopt's default error message is good enough */
9398
return 1;
@@ -163,15 +168,21 @@ int main(int argc, char *argv[])
163168
return resign_image(&image);
164169
}
165170

166-
/* set IMR Type in found machine definition */
167-
if (image.adsp->man_v1_8)
171+
/* set IMR Type and the PV bit in found machine definition */
172+
if (image.adsp->man_v1_8) {
168173
image.adsp->man_v1_8->adsp_file_ext.imr_type = imr_type;
174+
image.adsp->man_v1_8->css.reserved0 = pv_bit;
175+
}
169176

170-
if (image.adsp->man_v2_5)
177+
if (image.adsp->man_v2_5) {
171178
image.adsp->man_v2_5->adsp_file_ext.imr_type = imr_type;
179+
image.adsp->man_v2_5->css.reserved0 = pv_bit;
180+
}
172181

173-
if (image.adsp->man_ace_v1_5)
182+
if (image.adsp->man_ace_v1_5) {
174183
image.adsp->man_ace_v1_5->adsp_file_ext.imr_type = imr_type;
184+
image.adsp->man_ace_v1_5->css.reserved0 = pv_bit;
185+
}
175186

176187
/* parse input ELF files */
177188
image.num_modules = argc - first_non_opt;

0 commit comments

Comments
 (0)