[PATCH v3 1/3] platform: generic: spacemit: add K1

Troy Mitchell troy.mitchell at linux.spacemit.com
Sun Oct 19 22:29:08 PDT 2025


On Mon, Oct 20, 2025 at 10:39:10AM +0530, Anup Patel wrote:
> On Thu, Sep 25, 2025 at 3:19 PM Troy Mitchell
> <troy.mitchell at linux.spacemit.com> wrote:
> >
> > From: Xianbin Zhu <xianbin.zhu at linux.spacemit.com>
> >
> > Add initial platform support for the SpacemiT K1 SoC, including
> > early/final init hooks, cold boot handling, and CCI-550 snoop/DVM
> > enablement.
> >
> > Co-authored-by: Troy Mitchell <troy.mitchell at linux.spacemit.com>
> > Signed-off-by: Troy Mitchell <troy.mitchell at linux.spacemit.com>
> > Signed-off-by: Xianbin Zhu <xianbin.zhu at linux.spacemit.com>
> > ---
> >  platform/generic/Kconfig               |   4 ++
> >  platform/generic/include/spacemit/k1.h |  98 +++++++++++++++++++++++++++
> >  platform/generic/spacemit/k1.c         | 119 +++++++++++++++++++++++++++++++++
> >  3 files changed, 221 insertions(+)
> >
[...]
> > +static int spacemit_k1_final_init(bool cold_boot)
> > +{
> > +       return generic_final_init(cold_boot);
> > +}
> 
> The spacemit_k1_final_init() is redundant because it does nothing
> and falls back to generic_final_init();
> 
> > +
> > +static bool spacemit_cold_boot_allowed(u32 hartid)
> > +{
> > +       csr_set(CSR_ML2SETUP, 1 << (hartid % PLATFORM_MAX_CPUS_PER_CLUSTER));
> > +
> > +       return !hartid;
> 
> For now it's okay but try to avoid register programming
> spacemit_cold_boot_allowed().
> 
> > +}
> > +
> > +static int spacemit_k1_platform_init(const void *fdt, int nodeoff,
> > +                                    const struct fdt_match *match)
> > +{
> > +       generic_platform_ops.early_init = spacemit_k1_early_init;
> > +       generic_platform_ops.final_init = spacemit_k1_final_init;
> > +       generic_platform_ops.cold_boot_allowed = spacemit_cold_boot_allowed;
> > +
> > +       return 0;
> > +}
> > +
> > +static const struct fdt_match spacemit_k1_match[] = {
> > +       { .compatible = "spacemit,k1" },
> > +       { /* sentinel */ }
> > +};
> > +
> > +const struct fdt_driver spacemit_k1 = {
> > +       .match_table = spacemit_k1_match,
> > +       .init = spacemit_k1_platform_init,
> > +};
> >
> > --
> > 2.51.0
> >
> >
> > --
> > opensbi mailing list
> > opensbi at lists.infradead.org
> > http://lists.infradead.org/mailman/listinfo/opensbi
> 
> Otherwise, this looks good to me. I have dropped
> spacemit_k1_final_init() at the time of merging.
Thanks for your patience, Anup.

                    - Troy
> 
> Reviewed-by: Anup Patel <anup at brainfault.org>
> 
> Applied this patch to the riscv/opensbi repo.
> 
> Thanks,
> Anup
> 



More information about the opensbi mailing list