Skip to contentSkip to conversation

platform: generic: spacemit: add K1

PATCH Troy Mitchell 1 participant 1 message Oct 9, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 26 lines · 朱贤彬

Hi Xiang W

Only the primary core will be brought up, so we do not need to implement

cold_boot_allowed. The CSR operation here can be moved to nascent_init

From our platform, the nascent_init cann't be called from generic_nascent_init

                    Xiang W<[email protected]&gt;&nbsp;在 2025年9月26日 周五 15:17 写道:

&gt; +static int spacemit_k1_final_init(bool cold_boot)
&gt; +{
&gt; + return generic_final_init(cold_boot);
&gt; +}
&gt; +
&gt; +static bool spacemit_cold_boot_allowed(u32 hartid) &gt; +{
&gt; + csr_set(CSR_ML2SETUP, 1 << (hartid % PLATFORM_MAX_CPUS_PER_CLUSTER));
&gt; +
&gt; + return !hartid;
&gt; +}
Only the primary core will be brought up, so we do not need to implement cold_boot_allowed. The CSR operation here can be moved to nascent_init

Quoted 2 lines

Regards,
Xiang W

Since Xianbin sent a wrong style email, so I clarfy it here:

"From our platform, the nascent_init cann't be called from generic_nascent_init"

Thanks,

- Troy

Quoted 24 lines

&gt; +
&gt; +static int spacemit_k1_platform_init(const void *fdt, int nodeoff,
&gt; + &nbsp;&nbsp;&nbsp;&nbsp; const struct fdt_match *match)
&gt; +{
&gt; + generic_platform_ops.early_init = spacemit_k1_early_init;
&gt; + generic_platform_ops.final_init = spacemit_k1_final_init;
&gt; + generic_platform_ops.cold_boot_allowed = spacemit_cold_boot_allowed;
&gt; +
&gt; + return 0;
&gt; +}
&gt; +
&gt; +static const struct fdt_match spacemit_k1_match[] = {
&gt; + { .compatible = "spacemit,k1" },
&gt; + { /* sentinel */ }
&gt; +};
&gt; +
&gt; +const struct fdt_driver spacemit_k1 = {
&gt; + .match_table = spacemit_k1_match,
&gt; + .init = spacemit_k1_platform_init,
&gt; +};
&gt;
&gt; --
&gt; 2.51.0
&gt;

Signature · 3 lines
opensbi mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/opensbi