commit d0b6ad16c6db0d0d47f081de34eb97db9eb84d66 from: Aleksey Ryndin date: Wed Oct 11 16:44:27 2023 UTC Append capsule/squat/reports/0.0.2.gmi (WiP) commit - d95db136134b6ff0cfaf04ae5de2c72a53825e8d commit + d0b6ad16c6db0d0d47f081de34eb97db9eb84d66 blob - 193aa5aa23a417fd236f419a52162b54fca8d922 blob + 4e96ba7189e5c7caa0583c2395209fcfba2949a5 --- capsule/squat/reports/0.0.2.gmi +++ capsule/squat/reports/0.0.2.gmi @@ -75,3 +75,40 @@ aarch64-linux-gnu-gcc -Wp,-MD,spl/arch/arm/cpu/armv8/. ``` aarch64-linux-gnu-objdump -d spl/u-boot-spl | less ``` + +После пары безсмысленных (после применения препроцессора) переходов управление получает следующий кусок кода: +``` + /* + * Could be EL3/EL2/EL1, Initial State: + * Little Endian, MMU Disabled, i/dCache Disabled + */ + switch_el x1, 3f, 2f, 1f +3: set_vbar vbar_el3, x0 + mrs x0, scr_el3 + orr x0, x0, #0xf /* SCR_EL3.NS|IRQ|FIQ|EA */ + msr scr_el3, x0 + msr cptr_el3, xzr /* Enable FP/SIMD */ +#ifdef COUNTER_FREQUENCY + ldr x0, =COUNTER_FREQUENCY + msr cntfrq_el0, x0 /* Initialize CNTFRQ */ +#endif + b 0f +2: set_vbar vbar_el2, x0 + mov x0, #0x33ff + msr cptr_el2, x0 /* Enable FP/SIMD */ + b 0f +1: set_vbar vbar_el1, x0 + mov x0, #3 << 20 + msr cpacr_el1, x0 /* Enable FP/SIMD */ +0: + isb +``` + +Тут макрос set_vbar разворачивается в пустышку. + +А код инициализации CNTFRQ выполняется: +=> https://developer.arm.com/documentation/ddi0601/2023-06/AArch64-Registers/CNTFRQ-EL0--Counter-timer-Frequency-Register +> Bits [31:0] +> Clock frequency. Indicates the system counter clock frequency, in Hz. + +