diff options
author | Jun Liang Tan <junliang.tan@linux.starfivetech.com> | 2022-08-01 11:03:00 +0300 |
---|---|---|
committer | Jun Liang Tan <junliang.tan@linux.starfivetech.com> | 2022-10-27 11:42:31 +0300 |
commit | bee8253d8f04c56017860386d1b2132cf4f4b7c5 (patch) | |
tree | 812ff760c32c9818f7d18a9c9d6e8178668b82e8 /platform/generic/starfive/jh8100.c | |
parent | 361530eceac3fe7209adc47341afb68130b224f2 (diff) | |
download | opensbi-starfive-v1.1-dubhe.tar.xz |
platform: generic: starfive: Add platform specific Cache Maintenance OperationsREL_DUBHE_JAN2023starfive-v1.1-dubhe
Add SBI call for L2 cache flush and L2 cache invalidate for Dubhe
Signed-off-by: Jun Liang Tan <junliang.tan@linux.starfivetech.com>
Diffstat (limited to 'platform/generic/starfive/jh8100.c')
-rw-r--r-- | platform/generic/starfive/jh8100.c | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/platform/generic/starfive/jh8100.c b/platform/generic/starfive/jh8100.c new file mode 100644 index 0000000..b11ffcf --- /dev/null +++ b/platform/generic/starfive/jh8100.c @@ -0,0 +1,48 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 StarFive Technology Co., Ltd. + * + * Author: Jun Liang Tan <junliang.tan@linux.starfivetech.com> + * + */ + +#include <cache.h> +#include <jh8100.h> +#include <platform_override.h> +#include <sbi/sbi_console.h> +#include <sbi_utils/fdt/fdt_helper.h> + +static int starfive_vendor_ext_provider(long extid, long funcid, + const struct sbi_trap_regs *regs, + unsigned long *out_value, + struct sbi_trap_info *out_trap, + const struct fdt_match *match) +{ + int ret = 0; + + switch (funcid) { + case SBI_EXT_STARFIVE_DUBHE_L2_FLUSH: + __sbi_dubhe_L2_flush_range(regs->a0, regs->a1); + break; + case SBI_EXT_STARFIVE_DUBHE_L2_INVALIDATE: + __sbi_dubhe_L2_inv_range(regs->a0, regs->a1); + break; + default: + sbi_printf("Unsupported vendor sbi call : %ld\n", funcid); + asm volatile("ebreak"); + } + + return ret; +} + +static const struct fdt_match starfive_jh8xxx_match[] = { + { .compatible = "starfive,dubhe" }, + { .compatible = "starfive,jh8100" }, + { }, +}; + +const struct platform_override starfive_jh8xxx = { + .match_table = starfive_jh8xxx_match, + .vendor_ext_provider = starfive_vendor_ext_provider, +}; |