From 72e31757078d98bcbd36cb7981b0275b57527e97 Mon Sep 17 00:00:00 2001 From: songyanguang <345810377@qq.com> Date: Thu, 12 Dec 2024 16:56:41 +0800 Subject: [PATCH] Get boot hartid from uboot --- .../hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S | 5 +++++ .../hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/smp.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S index d0edd59c6..7936bc59f 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S @@ -20,9 +20,11 @@ _boot_start: + mv s0, a0 call _debug_uart_init_early la a0, debug_string_start call _debug_uart_printascii + mv a0, s0 j _start_kernel @@ -42,6 +44,9 @@ clear_bss: blt a3, a4, clear_bss clear_bss_done: + la a2, boot_cpu_hartid + sd a0, (a2) + la sp, stacks_top /* Initialize page tables and relocate to virtual addresses */ diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/smp.c b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/smp.c index 395b3e32e..fc12003e6 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/smp.c +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/smp.c @@ -47,6 +47,8 @@ Modification: *************************************************/ #include +unsigned long boot_cpu_hartid; + #define PSCI_CPUON 0xc4000003 struct xizi_smccc_res { unsigned long a0;