From 8ce81d0fbcbb10d4ad9e924c8cd64925b79e0cb6 Mon Sep 17 00:00:00 2001 From: Wei Liang Lim Date: Fri, 1 Dec 2023 23:14:15 +0800 Subject: platform: generic: starfive: Changing naming from jh8100 to dubhe Signed-off-by: Wei Liang Lim --- platform/generic/starfive/dubhe.c | 47 +++++++++++++++++++++++++++++++++++ platform/generic/starfive/dubhe.h | 18 ++++++++++++++ platform/generic/starfive/jh8100.c | 48 ------------------------------------ platform/generic/starfive/jh8100.h | 18 -------------- platform/generic/starfive/objects.mk | 4 +-- 5 files changed, 67 insertions(+), 68 deletions(-) create mode 100644 platform/generic/starfive/dubhe.c create mode 100644 platform/generic/starfive/dubhe.h delete mode 100644 platform/generic/starfive/jh8100.c delete mode 100644 platform/generic/starfive/jh8100.h diff --git a/platform/generic/starfive/dubhe.c b/platform/generic/starfive/dubhe.c new file mode 100644 index 0000000..95ef611 --- /dev/null +++ b/platform/generic/starfive/dubhe.c @@ -0,0 +1,47 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 StarFive Technology Co., Ltd. + * + * Author: Jun Liang Tan + * + */ + +#include +#include +#include +#include +#include + +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_dubhe_match[] = { + { .compatible = "starfive,dubhe" }, + { }, +}; + +const struct platform_override starfive_dubhe = { + .match_table = starfive_dubhe_match, + .vendor_ext_provider = starfive_vendor_ext_provider, +}; diff --git a/platform/generic/starfive/dubhe.h b/platform/generic/starfive/dubhe.h new file mode 100644 index 0000000..3326cf6 --- /dev/null +++ b/platform/generic/starfive/dubhe.h @@ -0,0 +1,18 @@ +/* + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2022 StarFive Technology Co., Ltd. + * + * Author: Jun Liang Tan + * + */ + +#ifndef _STARFIVE_DUBHE_H_ +#define _STARFIVE_DUBHE_H_ + +enum sbi_ext_dubhe_cmo_fid { + SBI_EXT_STARFIVE_DUBHE_L2_FLUSH = 0, + SBI_EXT_STARFIVE_DUBHE_L2_INVALIDATE, +}; + +#endif /* _STARFIVE_DUBHE_H_ */ diff --git a/platform/generic/starfive/jh8100.c b/platform/generic/starfive/jh8100.c deleted file mode 100644 index b11ffcf..0000000 --- a/platform/generic/starfive/jh8100.c +++ /dev/null @@ -1,48 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 StarFive Technology Co., Ltd. - * - * Author: Jun Liang Tan - * - */ - -#include -#include -#include -#include -#include - -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, -}; diff --git a/platform/generic/starfive/jh8100.h b/platform/generic/starfive/jh8100.h deleted file mode 100644 index c905f84..0000000 --- a/platform/generic/starfive/jh8100.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2022 StarFive Technology Co., Ltd. - * - * Author: Jun Liang Tan - * - */ - -#ifndef _STARFIVE_JH8100_H_ -#define _STARFIVE_JH8100_H_ - -enum sbi_ext_dubhe_cmo_fid { - SBI_EXT_STARFIVE_DUBHE_L2_FLUSH = 0, - SBI_EXT_STARFIVE_DUBHE_L2_INVALIDATE, -}; - -#endif /* _STARFIVE_JH8100_H_ */ diff --git a/platform/generic/starfive/objects.mk b/platform/generic/starfive/objects.mk index 0baa9f7..931d966 100644 --- a/platform/generic/starfive/objects.mk +++ b/platform/generic/starfive/objects.mk @@ -6,6 +6,6 @@ # Author: Jun Liang Tan # -carray-platform_override_modules-y += starfive_jh8xxx +carray-platform_override_modules-y += starfive_dubhe platform-objs-y += starfive/dubhe_cache.o -platform-objs-y += starfive/jh8100.o +platform-objs-y += starfive/dubhe.o -- cgit v1.2.3