@@ -18,11 +18,12 @@ Abstract:
18
18
core:: arch:: global_asm!( include_str!( "ext_intr.S" ) ) ;
19
19
20
20
use caliptra_cfi_lib_git:: CfiCounter ;
21
- use caliptra_common:: { cprintln, handle_fatal_error} ;
21
+ use caliptra_common:: { cprintln, handle_fatal_error, FirmwareHandoffTable } ;
22
22
use caliptra_cpu:: { log_trap_record, TrapRecord } ;
23
23
use caliptra_error:: CaliptraError ;
24
+ use caliptra_image_types:: ImageManifest ;
24
25
use caliptra_registers:: soc_ifc:: SocIfcReg ;
25
- use caliptra_runtime:: Drivers ;
26
+ use caliptra_runtime:: { compatibility , Drivers } ;
26
27
use core:: hint:: black_box;
27
28
28
29
#[ cfg( feature = "std" ) ]
@@ -83,10 +84,18 @@ pub extern "C" fn entry_point() -> ! {
83
84
handle_fatal_error ( e. into ( ) ) ;
84
85
} ) ;
85
86
86
- if !drivers. persistent_data . get ( ) . fht . is_valid ( ) {
87
+ let fht: & FirmwareHandoffTable = & drivers. persistent_data . get ( ) . fht ;
88
+ if !fht. is_valid ( ) {
87
89
cprintln ! ( "[rt] Runtime can't load FHT" ) ;
88
90
handle_fatal_error ( caliptra_drivers:: CaliptraError :: RUNTIME_HANDOFF_FHT_NOT_LOADED . into ( ) ) ;
89
91
}
92
+
93
+ let manifest: & ImageManifest = & drivers. persistent_data . get ( ) . manifest1 ;
94
+ if !compatibility:: is_fmc_compatible ( fht, manifest) {
95
+ cprintln ! ( "[rt] Runtime is not compatible with FMC" ) ;
96
+ handle_fatal_error ( caliptra_drivers:: CaliptraError :: RUNTIME_FMC_NOT_COMPATIBLE . into ( ) ) ;
97
+ }
98
+
90
99
cprintln ! ( "[rt] Runtime listening for mailbox commands..." ) ;
91
100
if let Err ( e) = caliptra_runtime:: handle_mailbox_commands ( & mut drivers) {
92
101
handle_fatal_error ( e. into ( ) ) ;
0 commit comments