lib: utils/timer: mtimer: add separate T-Head C9xx CLINT mtimer compatible
authorInochi Amaoto <inochiama@outlook.com>
Thu, 16 Nov 2023 09:07:14 +0000 (17:07 +0800)
committerAnup Patel <anup@brainfault.org>
Thu, 16 Nov 2023 11:23:48 +0000 (16:53 +0530)
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/
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Anup Patel <anup@brainfault.org>
lib/utils/timer/fdt_timer_mtimer.c

index 3d2dce02c413c67f20cc25e0a1129e326ac1a213..3ba6b8f9f98ee1cdd19febbe8919db7f450c2d90 100644 (file)
@@ -147,10 +147,16 @@ static const struct timer_mtimer_quirks thead_clint_quirks = {
        .clint_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" },
        { },
 };