test_rom_cheri: expect a manifest on the 2nd-level firmware image Change-Id: I48a4cef6ad15f3b7f882fa207a4aeaaab83d95d6
diff --git a/sw/device/lib/testing/test_rom/test_rom_cheri.c b/sw/device/lib/testing/test_rom/test_rom_cheri.c index d12d04f..2cdd308 100644 --- a/sw/device/lib/testing/test_rom/test_rom_cheri.c +++ b/sw/device/lib/testing/test_rom/test_rom_cheri.c
@@ -275,8 +275,8 @@ CHECK_DIF_OK( dif_flash_ctrl_set_exec_enablement(&flash_ctrl, kDifToggleEnabled)); - // Always select slot A (NB: there is no hw address translation so ignore the - // manifest). + // Always select slot A (NB: there is no hw address translation so ignore any + // manifest setting). const manifest_t *manifest = (const manifest_t *)cderivecap(root_cap, TOP_MATCHA_EFLASH_BASE_ADDR, sizeof(manifest_t), CHERI_PERM_LOAD); @@ -312,8 +312,10 @@ (void *)get_mmio_ptr(root_cap, RAM_START, RAM_SIZE_BYTES), RAM_START + RAM_SIZE_BYTES); if (load_result == kDifOk) { - // TODO(sleffler): get entry point from manifest - entry_point = 0x10000000; + const manifest_t *manifest = (const manifest_t *)cderivecap( + root_cap, RAM_START, sizeof(manifest_t), CHERI_PERM_LOAD); + // Maybe vet with manifest_check? + entry_point = manifest_entry_point_get(manifest); #endif } else { LOG_FATAL("Failed to load program from SPI flash!");