From c9ff5179f9eff60562a6a1db4f69cecfea0cc804 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Wed, 27 Mar 2024 09:47:28 +0200 Subject: [PATCH] exo: use mixed version identification --- bootloader/hos/secmon_exo.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/bootloader/hos/secmon_exo.c b/bootloader/hos/secmon_exo.c index 7b81e8a..9fb95cb 100644 --- a/bootloader/hos/secmon_exo.c +++ b/bootloader/hos/secmon_exo.c @@ -156,28 +156,24 @@ void config_exosphere(launch_ctxt_t *ctxt, u32 warmboot_base) //! TODO: Replace current HOS version decoding (as it's bound to break in the future). - // Old exosphere target versioning. Use fuses for a simpler decoding. - if (ctxt->pkg1_id->fuses <= 3 || ctxt->pkg1_id->fuses >= 10) // 1.0.0 - 3.0.0, 8.1.0+. + // Old exosphere target versioning. + if (ctxt->pkg1_id->kb >= HOS_KB_VERSION_1210) // 12.1.0+ + exo_fw_no = ctxt->pkg1_id->kb + 4; + else if (ctxt->pkg1_id->fuses <= 3 || ctxt->pkg1_id->fuses >= 10) // 1.0.0 - 3.0.0, 8.1.0 - 12.0.3. exo_fw_no = ctxt->pkg1_id->fuses; else - exo_fw_no = ctxt->pkg1_id->fuses - 1; // 3.0.1 - 7.0.1, 8.0.x. + exo_fw_no = ctxt->pkg1_id->fuses - 1; // 3.0.1 - 7.0.1, 8.0.x. + + // Handle versions that change API and do not burn new fuse. + if (!memcmp(ctxt->pkg1_id->id, "20190314", 8) || // 8.0.x, same fuses with 7.0.1. + !memcmp(ctxt->pkg1_id->id, "20210129", 8) // 12.0.0, same fuses with 11.0.0. + ) + exo_fw_no++; // Set 12.1.0 specific revision. if (ctxt->pkg1_id->kb == HOS_KB_VERSION_1210) ctxt->exo_ctx.hos_revision = 1; - // Handle 15.0.0+. - if (ctxt->pkg1_id->fuses >= 17) - exo_fw_no++; - - // Handle versions that change API and do not burn new fuse. - if (!memcmp(ctxt->pkg1_id->id, "20190314", 8) || // 8.0.x, same fuses with 7.0.1. - !memcmp(ctxt->pkg1_id->id, "20210129", 8) || // 12.0.0, same fuses with 11.0.0. - !memcmp(ctxt->pkg1_id->id, "20210805", 8) || // 13.0.0, same fuses with 12.1.0. - !memcmp(ctxt->pkg1_id->id, "20220209", 8) // 14.0.0, same fuses with 13.2.1. - ) - exo_fw_no++; - // Feed old exosphere target versioning to new. switch (exo_fw_no) {