diff mbox series

[2/3] lib: utils/timer: mtimer: add separate T-Head C9xx CLINT mtimer compatible

Message ID IA1PR20MB49536237AE535BE87D81558DBBD3A@IA1PR20MB4953.namprd20.prod.outlook.com
State Superseded
Headers show
Series lib: utils: Add T-HEAD C900 ACLINT | expand

Commit Message

Inochi Amaoto Oct. 12, 2023, 9:01 a.m. UTC
T-HEAD allows soc vendor to map the mtimer and mswi of C9xx clint on
different address, which may cause a misuse if use the same compatible
string, add a new timer compatible string to avoid this.

Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
Link: https://lore.kernel.org/linux-riscv/6e48cbe5e60f9ada2fd1fe58e803e127f1a678e5.1696433229.git.unicorn_wang@outlook.com/
---
 lib/utils/timer/fdt_timer_mtimer.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Guo Ren Oct. 12, 2023, 9:20 a.m. UTC | #1
On Thu, Oct 12, 2023 at 5:01 PM Inochi Amaoto <inochiama@outlook.com> wrote:
>
> T-HEAD allows soc vendor to map the mtimer and mswi of C9xx clint on
> different address, which may cause a misuse if use the same compatible
> string, add a new timer compatible string to avoid this.
>
> Signed-off-by: Inochi Amaoto <inochiama@outlook.com>
> Link: https://lore.kernel.org/linux-riscv/6e48cbe5e60f9ada2fd1fe58e803e127f1a678e5.1696433229.git.unicorn_wang@outlook.com/
> ---
>  lib/utils/timer/fdt_timer_mtimer.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c
> index cd14f75..8c45fdf 100644
> --- a/lib/utils/timer/fdt_timer_mtimer.c
> +++ b/lib/utils/timer/fdt_timer_mtimer.c
> @@ -153,10 +153,16 @@ static const struct timer_mtimer_quirks thead_clint_quirks = {
>         .without_mtime  = true,
>  };
>
> +static const struct timer_mtimer_quirks thead_aclint_quirks = {
> +       .has_64bit_mmio = false,
> +};
Yes, split mtimer & mswi of clint.

Reviewed-by: Guo Ren <guoren@kernel.org>

> +
>  static const struct fdt_match timer_mtimer_match[] = {
>         { .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
>         { .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
>         { .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
> +       { .compatible = "thead,c900-aclint-mtimer",
> +         .data = &thead_aclint_quirks },
>         { .compatible = "riscv,aclint-mtimer" },
>         { },
>  };
> --
> 2.42.0
>
diff mbox series

Patch

diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c
index cd14f75..8c45fdf 100644
--- a/lib/utils/timer/fdt_timer_mtimer.c
+++ b/lib/utils/timer/fdt_timer_mtimer.c
@@ -153,10 +153,16 @@  static const struct timer_mtimer_quirks thead_clint_quirks = {
 	.without_mtime  = true,
 };
 
+static const struct timer_mtimer_quirks thead_aclint_quirks = {
+	.has_64bit_mmio	= false,
+};
+
 static const struct fdt_match timer_mtimer_match[] = {
 	{ .compatible = "riscv,clint0", .data = &sifive_clint_quirks },
 	{ .compatible = "sifive,clint0", .data = &sifive_clint_quirks },
 	{ .compatible = "thead,c900-clint", .data = &thead_clint_quirks },
+	{ .compatible = "thead,c900-aclint-mtimer",
+	  .data = &thead_aclint_quirks },
 	{ .compatible = "riscv,aclint-mtimer" },
 	{ },
 };