@@ -21,8 +21,9 @@ use caliptra_cfi_lib_git::CfiCounter;
21
21
use caliptra_common:: { cprintln, handle_fatal_error} ;
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,20 @@ 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 = & 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
+
95
+ // Test if RT version is compatible with the FMC version
96
+ if !compatibility:: is_fmc_compatible ( & fht, & manifest) {
97
+ cprintln ! ( "[rt] Runtime is not compatible with FMC" ) ;
98
+ handle_fatal_error ( caliptra_drivers:: CaliptraError :: RUNTIME_FMC_NOT_COMPATIBLE . into ( ) ) ;
99
+ }
100
+
90
101
cprintln ! ( "[rt] Runtime listening for mailbox commands..." ) ;
91
102
if let Err ( e) = caliptra_runtime:: handle_mailbox_commands ( & mut drivers) {
92
103
handle_fatal_error ( e. into ( ) ) ;
0 commit comments