All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bo Gan <ganboing@gmail.com>
To: Troy Mitchell <troy.mitchell@linux.spacemit.com>,
	opensbi@lists.infradead.org
Cc: Xianbin Zhu <xianbin.zhu@linux.spacemit.com>,
	Anup Patel <anup@brainfault.org>
Subject: Re: [PATCH 0/3] platform: generic: spacemit: add K3 platform support
Date: Sat, 25 Jul 2026 18:14:33 -0700	[thread overview]
Message-ID: <e702f291-dde8-4b99-a65e-182d2b847720@gmail.com> (raw)
In-Reply-To: <20260724-spacemit-k3-v1-0-f0e49329feb8@linux.spacemit.com>

Hi Troy, Xianbin,

On 7/24/26 02:27, Troy Mitchell wrote:
> Add initial OpenSBI platform support for the SpacemiT K3 SoC. K3 has
> 16 harts split across four clusters: eight X100 harts in C0/C1 and
> eight A100 harts in C2/C3.
> 

One thing to watch out for is the lack of 'H' in A100. This can cause
issues where the code assumed all cores to have the same extensions:
https://github.com/riscv-software-src/opensbi/blob/c0f87f10d1bfb9e72a84ddfafb5604ee1bfe9d04/lib/sbi/sbi_hart.c#L704

	if (cold_boot) {
		if (misa_extension('H'))
			sbi_hart_expected_trap = &__sbi_expected_trap_hext;
	...

At least this `sbi_hart_expected_trap` needs to be enhanced to account for
heterogeneous cores. Perhaps wrap it as a function, such as
ulong sbi_hart_expected_trap_addr(void), and fix up all users:

- register ulong mtvec = (ulong)sbi_hart_expected_trap;
+ register ulong mtvec = sbi_hart_expected_trap_addr();

Please also check other places where it's assuming homogeneous cores. Can
you also describe in detail the different extensions between X100/A100?
Apart from H/no-H, and different vlen's, anything else?


> The first patch corrects a misleading K1 cache-operation name without
> changing its encoded value or behavior.
> 
> The second patch refactors the existing K1 support by moving the
> definitions and CCI-550 programming helper needed by both SoCs into
> common SpacemiT files. The K1 CCI topology, boot flow, and HSM
> implementation remain K1-specific.
> 
> The third patch adds the K3 platform implementation. During cold boot,
> the boot hart configures the cluster warm-boot vectors, enables CCI
> snoop and DVM requests, disables core and cluster power-down on WFI,
> and wakes the secondary harts. Per-hart initialization configures PMA
> attributes, caches, L1 D-cache snooping, prefetch, and the H extension
> on X100 harts.
> 
> The series has been build-tested with:
>   - the generic default configuration
>   - a K1-only configuration with the SpacemiT HSM driver
>   - a K3-only configuration without the K1 HSM driver
> 
> Signed-off-by: Troy Mitchell <troy.mitchell@linux.spacemit.com>
> ---
> Xianbin Zhu (3):
>        platform: generic: spacemit: k1: rename cache flush operation
>        platform: generic: spacemit: k1: refactor platform support
>        platform: generic: spacemit: k3: add platform support
> 
>   lib/utils/hsm/fdt_hsm_spacemit.c             |   7 +-
>   platform/generic/Kconfig                     |   9 +
>   platform/generic/configs/defconfig           |   1 +
>   platform/generic/include/spacemit/common.h   |  88 +++++++++
>   platform/generic/include/spacemit/k1.h       |  96 ++--------
>   platform/generic/include/spacemit/k3.h       | 144 +++++++++++++++
>   platform/generic/include/spacemit/k3_asm.h   |  16 ++
>   platform/generic/include/spacemit/spacemit.h |  14 ++
>   platform/generic/spacemit/k1.c               |  33 +---
>   platform/generic/spacemit/k3.c               | 264 +++++++++++++++++++++++++++
>   platform/generic/spacemit/k3_asm.S           |  33 ++++
>   platform/generic/spacemit/objects.mk         |   3 +
>   platform/generic/spacemit/spacemit.c         |  36 ++++
>   13 files changed, 636 insertions(+), 108 deletions(-)
> ---
> base-commit: c0f87f10d1bfb9e72a84ddfafb5604ee1bfe9d04
> change-id: 20260723-spacemit-k3-84720a7be53d
> 
> Best regards,
> --
> Troy Mitchell <troy.mitchell@linux.spacemit.com>
> 
> 

Bo


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

      parent reply	other threads:[~2026-07-26  1:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-24  9:27 [PATCH 0/3] platform: generic: spacemit: add K3 platform support Troy Mitchell
2026-07-24  9:27 ` [PATCH 1/3] platform: generic: spacemit: k1: rename cache flush operation Troy Mitchell
2026-07-24  9:27 ` [PATCH 2/3] platform: generic: spacemit: k1: refactor platform support Troy Mitchell
2026-07-24  9:27 ` [PATCH 3/3] platform: generic: spacemit: k3: add " Troy Mitchell
2026-07-26  1:14 ` Bo Gan [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=e702f291-dde8-4b99-a65e-182d2b847720@gmail.com \
    --to=ganboing@gmail.com \
    --cc=anup@brainfault.org \
    --cc=opensbi@lists.infradead.org \
    --cc=troy.mitchell@linux.spacemit.com \
    --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.