Re: [PATCH v2 5/5] platform: generic: spacemit: k3: add platform support
"Troy Mitchell" <[email protected]>
| Newsgroups | org.infradead.lists.opensbi |
|---|---|
| Message-ID | <[email protected]> |
> + /* 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
--
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi
signature.asc
(application/pgp-signature, 248 B)
-----BEGIN PGP SIGNATURE----- iIMEABYKACsWIQSL4Ay2cExaPXAQcU2YCe+A+TM0LwUCaoewDQ0caUB0cm95LXku b3JnAAoJEJgJ74D5MzQvMVQBAK9PYXl0dwizYLfTGxWYlhC7Zzjvn1gXOGCPGHmC qdRUAP0SLoAp44RhDvEeImMMomrrtv3ayUXmy4w2+Mpe08EWCg== =5cdv -----END PGP SIGNATURE-----