From: "Troy Mitchell" <troy.mitchell@linux.spacemit.com>
To: "Samuel Holland" <samuel.holland@sifive.com>,
<opensbi@lists.infradead.org>
Cc: "Xianbin Zhu" <xianbin.zhu@linux.spacemit.com>,
"Anup Patel" <anup@brainfault.org>, "Bo Gan" <ganboing@gmail.com>,
"Troy Mitchell" <troy.mitchell@linux.spacemit.com>
Subject: Re: [PATCH v2 5/5] platform: generic: spacemit: k3: add platform support
Date: Fri, 21 Aug 2026 09:55:25 +0800 [thread overview]
Message-ID: <DKU8XOF2Z3GT.3HYZYL8V7VCF9@linux.spacemit.com> (raw)
In-Reply-To: <d3217c02-1dc6-4bcf-a5eb-da30c9a9860d@sifive.com>
[-- Attachment #1.1: Type: text/plain, Size: 1716 bytes --]
> + /* Clear core and cluster power-down votes so WFI does not trigger power-down. */
> + for (i = 0; i < PLATFORM_MAX_CPUS; i++)
> + spacemit_disable_pwrdown_core(i);
>
> [...]
>
> + for (i = 1; i < array_size(core_wakeup_reg); i++)
> + writel(1 << i, (void *)(unsigned long)core_wakeup_reg[i]);
>
> [...]
>
> + for (i = 1; i < PLATFORM_MAX_CPUS; i++) {
> + u64 deadline = sbi_timer_value_after_msecs(HART_WFI_TIMEOUT_MS);
> +
> + while (!(readl((void *)(unsigned long)wfi_status_reg[i]) &
> + wfi_status_mask[i])) {
> + /* ... */
> + }
> + }
>
> The operations in these loops should be in a .hart_start function of an HSM
> driver, not run in a loop at cold boot. You will need to do this anyway to
> support power management, and it makes cold boot faster.
Agreed. I will add a K3 HSM .hart_start callback which clears the target
hart's core and cluster power-down votes and wakes only that hart. The
cold-boot path will retain the one-time boot-vector and CCI setup, but
will no longer wake all secondary harts or wait for them to enter WFI.
This also removes the WFI status tables and timeout.
> +static bool spacemit_cold_boot_allowed(u32 hartid)
> +{
> + return !hartid;
> +}
>
> If harts 1-15 are not powered on until spacemit_k3_pre_init(), this callback
> won't do anything, because hart 0 is the only hart running at this point.
Right. Since only hart 0 is running before platform early init, the
callback is redundant. I will remove it and its assignment.
- Troy
[-- 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
next prev parent reply other threads:[~2026-08-21 1:56 UTC|newest]
Thread overview: 15+ 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-20 14:25 ` Samuel Holland
2026-08-21 1:55 ` Troy Mitchell [this message]
2026-08-21 13:28 ` Heinrich Schuchardt
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
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=DKU8XOF2Z3GT.3HYZYL8V7VCF9@linux.spacemit.com \
--to=troy.mitchell@linux.spacemit.com \
--cc=anup@brainfault.org \
--cc=ganboing@gmail.com \
--cc=opensbi@lists.infradead.org \
--cc=samuel.holland@sifive.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.