Files
opensbi/platform/generic/sifive/fu540.c
Samuel Holland b353af63e2 platform: generic: Modify platform ops instead of using hooks
Switch all existing platform overrides to use the helper pattern instead
of the platform hooks. After this commit, only the .match_table and
.init members of struct platform_override are used.

There are two minor behavioral differences:
 - For Allwinner D1, fdt_add_cpu_idle_states() is now called before the
   body of generic_final_init(). This should have no functional impact.
 - For StarFive JH7110, if the /chosen/starfive,boot-hart-id property is
   missing, the code now falls back to using generic_coldboot_harts,
   instead of accepting any hart.

Signed-off-by: Samuel Holland <samuel.holland@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20250325234342.711447-7-samuel.holland@sifive.com
Signed-off-by: Anup Patel <anup@brainfault.org>
2025-04-23 12:32:51 +05:30

42 lines
1011 B
C

/*
* SPDX-License-Identifier: BSD-2-Clause
*
* Copyright (c) 2020 Western Digital Corporation or its affiliates.
*
* Authors:
* Anup Patel <anup.patel@wdc.com>
*/
#include <platform_override.h>
#include <sbi_utils/fdt/fdt_helper.h>
#include <sbi_utils/fdt/fdt_fixup.h>
static u64 sifive_fu540_tlbr_flush_limit(void)
{
/*
* The sfence.vma by virtual address does not work on
* SiFive FU540 so we return remote TLB flush limit as zero.
*/
return 0;
}
static int sifive_fu540_platform_init(const void *fdt, int nodeoff, const struct fdt_match *match)
{
generic_platform_ops.get_tlbr_flush_limit = sifive_fu540_tlbr_flush_limit;
return 0;
}
static const struct fdt_match sifive_fu540_match[] = {
{ .compatible = "sifive,fu540" },
{ .compatible = "sifive,fu540g" },
{ .compatible = "sifive,fu540-c000" },
{ .compatible = "sifive,hifive-unleashed-a00" },
{ },
};
const struct platform_override sifive_fu540 = {
.match_table = sifive_fu540_match,
.init = sifive_fu540_platform_init,
};