mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
Merge 915b8818b8 into fb2ac429de
This commit is contained in:
commit
a547815fe1
2 changed files with 14 additions and 2 deletions
|
|
@ -128,8 +128,9 @@ GetSerialRegisterBase (
|
|||
UINTN SerialRegisterBase;
|
||||
|
||||
//
|
||||
// The LoongArchVirt serial hook path uses KS1 to hand off the UART base.
|
||||
// Reuse it here to avoid repeated FDT lookups during early debug output.
|
||||
// SEC initializes KS1 before the first debug output. The LoongArchVirt
|
||||
// serial hook path then uses it to hand off the UART base. Reuse the value
|
||||
// here to avoid repeated FDT lookups during early debug output.
|
||||
//
|
||||
SerialRegisterBase = CsrRead (LOONGARCH_CSR_KS1);
|
||||
if (SerialRegisterBase != 0) {
|
||||
|
|
|
|||
|
|
@ -29,6 +29,17 @@ ASM_PFX(_ModuleEntryPoint):
|
|||
li.w $a0, 0x1FFF
|
||||
bl DisableLocalInterrupts
|
||||
|
||||
/* Clear per-CPU scratch registers left by the previous boot */
|
||||
csrwr $zero, LOONGARCH_CSR_KS0
|
||||
csrwr $zero, LOONGARCH_CSR_KS1
|
||||
csrwr $zero, LOONGARCH_CSR_KS2
|
||||
csrwr $zero, LOONGARCH_CSR_KS3
|
||||
csrwr $zero, LOONGARCH_CSR_KS4
|
||||
csrwr $zero, LOONGARCH_CSR_KS5
|
||||
csrwr $zero, LOONGARCH_CSR_KS6
|
||||
csrwr $zero, LOONGARCH_CSR_KS7
|
||||
csrwr $zero, LOONGARCH_CSR_KS8
|
||||
|
||||
/* Read physical cpu number id */
|
||||
bl GetApicId
|
||||
li.d $t0, BOOTCORE_ID //0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue