From 87b1eef59836f6e91c43965c1e73bfcf844ee930 Mon Sep 17 00:00:00 2001 From: CTCaer Date: Fri, 8 Aug 2025 15:55:01 +0300 Subject: [PATCH] hos: simplify warmboot pa id calculation --- bootloader/hos/pkg1.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bootloader/hos/pkg1.c b/bootloader/hos/pkg1.c index c801b2b8..be1ec5d8 100644 --- a/bootloader/hos/pkg1.c +++ b/bootloader/hos/pkg1.c @@ -403,16 +403,11 @@ int pkg1_warmboot_config(void *hos_ctxt, u32 warmboot_base, u32 fuses_fw, u8 mke burnt_fuses = fuses_fw; } - // Configure Warmboot parameters. Anything lower is not supported. - switch (burnt_fuses) - { - case 7 ... 8: - pa_id = 0x21 * (burnt_fuses - 3) + 3; - break; - default: // From 7.0.0 and up PA id is 0x21 multiplied with fuses. - pa_id = 0x21 * burnt_fuses; - break; - } + // Configure warmboot parameters. Anything lower than 6.0.0 is not supported. + // From 7.0.0 and up, it's not derived from PA segment but it's 0x21 * fuses. + pa_id = 0x21 * burnt_fuses; + if (burnt_fuses <= 8) // Old method. + pa_id -= 0x60; // Set Warmboot Physical Address ID and lock SECURE_SCRATCH32 register. PMC(APBDEV_PMC_SECURE_SCRATCH32) = pa_id;