Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Opdenacker <michael.opdenacker@rootcommit.com>
To: Junhui Liu <junhui.liu@pigmoral.tech>
Cc: michael.opdenacker@rootcommit.com,
	linux-riscv <linux-riscv@lists.infradead.org>
Subject: Re: SpacemiT k1: Linux crashes setting up smp with mainline U-Boot
Date: Fri, 12 Dec 2025 06:43:40 +0000 (UTC)	[thread overview]
Message-ID: <16c8f942-9860-43bf-a865-5de3ae955abc@rootcommit.com> (raw)
In-Reply-To: <fb38c759-b7e0-4cff-91f6-7ad3e4313f55@pigmoral.tech>

Hi Junhui

On 12/12/25 06:40, Junhui Liu wrote:
> OpenSBI v1.7-89-g51fe6a8b
>    ____                    _____ ____ _____
>   / __ \                  / ____|  _ \_   _|
>  | |  | |_ __   ___ _ __ | (___ | |_) || |
>  | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
>  | |__| | |_) |  __/ | | |____) | |_) || |_
>   \____/| .__/ \___|_| |_|_____/|____/_____|
>         | |
>         |_|
>
> Platform Name               : Banana Pi BPI-F3
> Platform Features           : medeleg
> Platform HART Count         : 8
> Platform IPI Device         : aclint-mswi
> Platform Timer Device       : aclint-mtimer @ 24000000Hz
> Platform Console Device     : uart8250
> Platform HSM Device         : spacemit-hsm
> Platform PMU Device         : ---
> Platform Reboot Device      : ---
> Platform Shutdown Device    : ---
> Platform Suspend Device     : ---
> Platform CPPC Device        : ---
> Firmware Base               : 0x0
> Firmware Size               : 407 KB
> Firmware RW Offset          : 0x40000
> Firmware RW Size            : 151 KB
> Firmware Heap Offset        : 0x55000
> Firmware Heap Size          : 67 KB (total), 1 KB (reserved), 13 KB 
> (used), 52 KB (free)
> Firmware Scratch Size       : 4096 B (total), 1464 B (used), 2632 B 
> (free)
> Runtime SBI Version         : 3.0
> Standard SBI Extensions     : 
> time,rfnc,ipi,base,hsm,pmu,dbcn,fwft,legacy,dbtr,sse
> Experimental SBI Extensions : none
>
> Domain0 Name                : root
> Domain0 Boot HART           : 0
> Domain0 HARTs               : 0*,1*,2*,3*,4*,5*,6*,7*
> Domain0 Region00            : 0x0000000000000000-0x000000000003ffff M: 
> (F,R,X) S/U: ()
> Domain0 Region01            : 0x0000000000040000-0x000000000007ffff M: 
> (F,R,W) S/U: ()
> Domain0 Region02            : 0x00000000d4017000-0x00000000d4017fff M: 
> (I,R,W) S/U: (R,W)
> Domain0 Region03            : 0x00000000e4000000-0x00000000e400ffff M: 
> (I,R,W) S/U: ()
> Domain0 Region04            : 0x00000000e0000000-0x00000000e3ffffff M: 
> (I,R,W) S/U: (R,W)
> Domain0 Region05            : 0x0000000000000000-0xffffffffffffffff M: 
> () S/U: (R,W,X)
> Domain0 Next Address        : 0x0000000000200000
> Domain0 Next Arg1           : 0x00000000002610b8
> Domain0 Next Mode           : S-mode
> Domain0 SysReset            : yes
> Domain0 SysSuspend          : yes
>
> Boot HART ID                : 0
> Boot HART Domain            : root
> Boot HART Priv Version      : v1.12
> Boot HART Base ISA          : rv64imafdcbvx
> Boot HART ISA Extensions    : 
> sscofpmf,sstc,zicntr,zihpm,zicboz,zicbom,svpbmt,sdtrig
> Boot HART PMP Count         : 32
> Boot HART PMP Granularity   : 12 bits
> Boot HART PMP Address Bits  : 38
> Boot HART MHPM Info         : 16 (0x0007fff8)
> Boot HART Debug Triggers    : 8 triggers
> Boot HART MIDELEG           : 0x0000000000002222
> Boot HART MEDELEG           : 0x000000000000b109
>
>
> The log above is from my OpenSBI boot. Although I haven't had the time to
> test booting the mainline kernel with mainline U-Boot yet, I noticed some
> differences:
>
> 1. the version printed in my log is "OpenSBI v1.7-89-g51fe6a8b" (which
>    corresponds to the latest commit 
> 51fe6a8bc958166ff79805cf69bafe5e297776f4),
>    whereas your output shows only "OpenSBI v1.7".
> 2. your boot log does not seem to list the HSM device:
>    Platform HSM Device         : spacemit-hsm
>
> I personally suggest checking these two points:
>
> 1. After updating the OpenSBI repository, run "rm -r build" to clear
>    previous build cache before recompiling. This ensures that all the
>    necessary files are effectively included in the build.
> 2. Check if the compatible in U-Boot's device tree (which should
>    be used by OpenSBI) matches the one in the OpenSBI code 
> (specifically in
>    platform/generic/spacemit/k1.c and lib/utils/hsm/fdt_hsm_spacemit.c).


Thanks a lot for your help!
It turned out I copied the old image, not the new one. My apologies!

Now indeed, the bug is gone and I can boot mainline Linux on mainline 
U-Boot and mainline OpenSBI.
I will publish Yocto recipes (meta-riscv layer) in the next days to 
allow everyone to build such images.

This will help with supporting other K1-based platforms too.
Thanks a lot for your contributions,  guidance and patience.
Cheers
Michael.


-- 
Michael Opdenacker
Root Commit
Yocto Project and OpenEmbedded Training course - Learn by doing:
https://rootcommit.com/training/yocto/


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

      reply	other threads:[~2025-12-12  6:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 20:34 SpacemiT k1: Linux crashes setting up smp with mainline U-Boot Michael Opdenacker
2025-12-12  1:50 ` Junhui Liu
2025-12-12  4:37   ` Michael Opdenacker
2025-12-12  5:40     ` Junhui Liu
2025-12-12  6:43       ` Michael Opdenacker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16c8f942-9860-43bf-a865-5de3ae955abc@rootcommit.com \
    --to=michael.opdenacker@rootcommit.com \
    --cc=junhui.liu@pigmoral.tech \
    --cc=linux-riscv@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox