All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Troy Mitchell" <troy.mitchell@linux.spacemit.com>
To: "Heinrich Schuchardt" <heinrich.schuchardt@canonical.com>,
	"Troy Mitchell" <troy.mitchell@linux.spacemit.com>,
	"Xianbin Zhu" <xianbin.zhu@linux.spacemit.com>
Cc: "Anup Patel" <anup@brainfault.org>, "Bo Gan" <ganboing@gmail.com>,
	<opensbi@lists.infradead.org>
Subject: Re: [PATCH v2 5/5] platform: generic: spacemit: k3: add platform support
Date: Thu, 27 Aug 2026 10:53:47 +0800	[thread overview]
Message-ID: <DKZDXMRLBZNF.1KHCLNNO3MO7J@linux.spacemit.com> (raw)
In-Reply-To: <2df8921e-a562-47c0-ba49-452a2860a830@canonical.com>


[-- Attachment #1.1: Type: text/plain, Size: 3228 bytes --]

On Fri Aug 21, 2026 at 9:28 PM +08, Heinrich Schuchardt wrote:
> On 8/18/26 03:14, Troy Mitchell wrote:
>> From: Xianbin Zhu <xianbin.zhu@linux.spacemit.com>
>> 
>> Add initial OpenSBI platform support for the SpacemiT K3 SoC, which has
>> 16 harts: eight X100 harts in clusters C0/C1 and eight A100 harts in
>> C2/C3.
>> 
>> During cold boot, the boot hart sets warm-boot entry vectors for all
>> four clusters, enables CCI snooping, clears PMU power-down vote bits for
>> all harts so WFI does not trigger power-down, and wakes all non-boot
>> harts (1-15). Wait up to 100 ms for each secondary hart to enter WFI,
>> then warn and continue so one failed hart cannot stall boot indefinitely.
>> 
>> Run per-hart initialization from the nascent hook on both cold- and
>> warm-boot paths. Program PMA attributes, enable the D-cache and I-cache
>> through MSETUP, set smpen[x] in ML2SETUP to enable L1 D-cache snooping
>> and prefetch, and enable the H extension in MISA for X100 harts. MISA.H
>> is writable on K3 X100 cores, and M-mode must set it explicitly to
>> activate hypervisor support.
>> 
>> Start secondary harts through an assembly stub that enables caches and
>> sets smpen[x] before entering common warm-boot code. This lets them
>> observe shared-data writes made by the boot hart during cold-boot
>> initialization. Enable global CCI-550 snoop and DVM requests on the boot
>> hart before waking the secondary harts.
>> 
>> Signed-off-by: Xianbin Zhu <xianbin.zhu@linux.spacemit.com>
>> Co-developed-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
>> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
>> ---
>>   platform/generic/Kconfig                   |   5 +
>>   platform/generic/configs/defconfig         |   1 +
>>   platform/generic/include/spacemit/common.h |   4 +-
>>   platform/generic/include/spacemit/k3.h     | 144 ++++++++++++++++
>>   platform/generic/include/spacemit/k3_asm.h |  16 ++
>>   platform/generic/spacemit/k3.c             | 266 +++++++++++++++++++++++++++++
>>   platform/generic/spacemit/k3_asm.S         |  33 ++++
>>   platform/generic/spacemit/objects.mk       |   2 +
>>   8 files changed, 470 insertions(+), 1 deletion(-)
>> 
>> diff --git a/platform/generic/spacemit/objects.mk b/platform/generic/spacemit/objects.mk
>> index 8309ad1f..282543b5 100644
>> --- a/platform/generic/spacemit/objects.mk
>> +++ b/platform/generic/spacemit/objects.mk
>> @@ -5,3 +5,5 @@
>
> With this patch applied
>
> CROSS_COMPILE=riscv64-linux-gnu- \
> make PLATFORM_RISCV_XLEN=32 PLATFORM=generic
>
> fails with errors like
>
> platform/generic/spacemit/k3.c:134:19: error: left shift count >= width 
> of type [-Werror=shift-count-overflow]
>    134 |                   << PMACFG0_AUDIO_BUF_FIELD_SHIFT);
>
> Please, ensure that the SpacemiT K3 and K1 platforms are not built in 
> the 32bit case. Unfortunately PLATFORM_RISCV_XLEN is not a configuration 
> variable.
>
> Other platforms use
>
> ifeq ($(PLATFORM_RISCV_XLEN), 64)
>
> at the start of the *.mk file.
Confirmed. K1 and K3 are RV64-only. I will add the XLEN guard to
platform/generic/spacemit/objects.mk as suggested.


-- 
Troy Mitchell


[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 248 bytes --]

[-- Attachment #2: Type: text/plain, Size: 105 bytes --]

-- 
opensbi mailing list
opensbi@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/opensbi

  reply	other threads:[~2026-08-27  2:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-18  1:14 [PATCH v2 0/5] platform: generic: spacemit: add K3 platform support Troy Mitchell
2026-08-18  1:14 ` [PATCH v2 1/5] lib: sbi: select expected trap handler per hart Troy Mitchell
2026-08-20  8:40   ` Bo Gan
2026-08-18  1:14 ` [PATCH v2 2/5] platform: generic: spacemit: k1: rename cache flush operation Troy Mitchell
2026-08-18  1:14 ` [PATCH v2 3/5] platform: generic: spacemit: k1: move hart init to nascent hook Troy Mitchell
2026-08-20  8:42   ` Bo Gan
2026-08-18  1:14 ` [PATCH v2 4/5] platform: generic: spacemit: k1: refactor platform support Troy Mitchell
2026-08-18  1:14 ` [PATCH v2 5/5] platform: generic: spacemit: k3: add " Troy Mitchell
2026-08-20  9:18   ` Bo Gan
2026-08-27  3:21     ` Troy Mitchell
2026-08-20 14:25   ` Samuel Holland
2026-08-21  1:55     ` Troy Mitchell
2026-08-21 13:28   ` Heinrich Schuchardt
2026-08-27  2:53     ` Troy Mitchell [this message]
2026-08-20  9:26 ` [PATCH v2 0/5] platform: generic: spacemit: add K3 " Bo Gan
2026-08-21  1:18   ` Troy Mitchell
2026-08-21 14:33 ` Heinrich Schuchardt
2026-08-27  2:50   ` Troy Mitchell

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=DKZDXMRLBZNF.1KHCLNNO3MO7J@linux.spacemit.com \
    --to=troy.mitchell@linux.spacemit.com \
    --cc=anup@brainfault.org \
    --cc=ganboing@gmail.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=opensbi@lists.infradead.org \
    --cc=xianbin.zhu@linux.spacemit.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.