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

Anup Patel anup at brainfault.org
Thu Nov 16 02:39:39 PST 2023


On Thu, Nov 16, 2023 at 2:36 PM Inochi Amaoto <inochiama at 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 at outlook.com>
> Link: https://lore.kernel.org/linux-riscv/6e48cbe5e60f9ada2fd1fe58e803e127f1a678e5.1696433229.git.unicorn_wang@outlook.com/
> Reviewed-by: Guo Ren <guoren at kernel.org>

Looks good to me.

Reviewed-by: Anup Patel <anup at brainfault.org>

Regards,
Anup

> ---
>  lib/utils/timer/fdt_timer_mtimer.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/lib/utils/timer/fdt_timer_mtimer.c b/lib/utils/timer/fdt_timer_mtimer.c
> index 29560fb..86ad1aa 100644
> --- a/lib/utils/timer/fdt_timer_mtimer.c
> +++ b/lib/utils/timer/fdt_timer_mtimer.c
> @@ -145,10 +145,17 @@ 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,
> +       .custom_aclint  = true,
> +};
> +
>  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.1
>
>
> --
> opensbi mailing list
> opensbi at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/opensbi



More information about the opensbi mailing list