@@ -46,7 +46,7 @@ GLOBAL(sl_header)
4646 .word _end_of_measured /* SL header SKL measured length */
4747 .byte 0xda , 0x75 , 0xc4 , 0x0e , 0xd0 , 0xd3 , 0x5d , 0x48 , 0xb6 , 0xae , 0x3c , 0xb2 , 0xf , 0xb7 , 0xad , 0x3a
4848 .long 0xffffffff /* Reserved */
49- .long 0xaaaa5555 /* Total Length including signature and pubkey raw data */
49+ .long _end_of_signed + 0x640 /* Total Length including signature and pubkey raw data */
5050 .word soc_flag /* Offset to SOCFLAG Structure, see below */
5151 .word skl_info /* Offset to SKL info with UUID and version */
5252 .word bootloader_data /* Offset to SLRT filled by the bootloader */
@@ -320,11 +320,42 @@ gdt:
320320.Lgdt_end:
321321ENDDATA(gdt)
322322
323- /*
324- .section .skinit_reserved, "a", @progbits
325- GLOBAL(skinit_reserved)
326- .fill 0x740, 1, 0x00
327- */
323+ #ifdef AMDSL
324+ .section .skl_sig_hdr, "a" , @progbits
325+ .fill 16 , 1 , 0x00 /* Nonce */
326+ .long 0x31534124 /* HeaderVersion, "$AS1" */
327+ .long _end_of_signed /* Signed Fw Size in bytes */
328+ .fill 4 +4 +16 , 1 , 0x00 /* Encryption options, algorithm ID and parameters */
329+ .long 1 /* SigOption, 1 - signed */
330+ .long 0 /* SigAlgID, unknown encoding */
331+ .byte KEY_ID /* Key ID */
332+ .long 0 /* Compression option */
333+ .long 1 /* Security patch level */
334+ .fill 4 +4 +8 , 1 , 0x00 /* Uncompr. size, compr. size, compr. parameters */
335+ .long 0x02000200 /* ImageVersion */
336+ .fill 4 +4 , 1 , 0x00 /* APU Family ID and Firmware Load Address */
337+ .long _end_of_signed + 0x200 /* FW size with signature */
338+ .fill 4 +4 +4 +1 +1 +2 +16 +16 +96 /* The rest */
339+
340+ /* Signature is filled during final objcopy */
341+ .section .skl_sig, "a" , @progbits
342+ .fill 0x200 , 1 , 0x00
343+
344+ .section .skl_pubkey_hdr, "a" , @progbits
345+ .long 2 /* Version ID */
346+ .byte KEY_ID /* Key ID */
347+ .byte KEY_ID /* Certifying key ID */
348+ .fill 4 +1 +1 +14 , 1 , 0x00 /* Key usage, platform vendor ID, model ID, reserved */
349+ .long 4096 /* Public exponent size in bits */
350+ .long 4096 /* Modulus size in bits */
351+
352+ .long 0x10001 /* Exponent */
353+ .fill 508 , 1 , 0x00 /* XXX: does it have to be so oversized? */
354+
355+ /* Modulus is stored in a dedicated section, filled during final objcopy */
356+ .section .skl_pubkey_modulus, "a" , @progbits
357+ .fill 0x200 , 1 , 0x00
358+ #endif
328359
329360#ifdef __x86_64__
330361 /* 64bit Pagetables, identity map of the first 4G of RAM. */
0 commit comments