arm64: renesas: Convert boards over to is_cortex_a() functions
authorMarek Vasut <marek.vasut+renesas@mailbox.org>
Wed, 1 Jan 2025 19:19:06 +0000 (20:19 +0100)
committerMarek Vasut <marek.vasut+renesas@mailbox.org>
Sun, 12 Jan 2025 22:49:58 +0000 (23:49 +0100)
Use generic is_cortex_a() functions instead of open-coded midr_el1 read.
No functional change.

Reviewed-by: Paul Barker <paul.barker.ct@bp.renesas.com>
Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org>
board/hoperun/hihope-rzg2/hihope-rzg2.c
board/renesas/rcar-common/gen3-common.c

index 8b635ef..d2c5aaa 100644 (file)
@@ -6,6 +6,7 @@
  * Copyright (C) 2021 Renesas Electronics Corporation
  */
 
+#include <asm/armv8/cpu.h>
 #include <asm/global_data.h>
 #include <asm/io.h>
 #include <asm/processor.h>
@@ -66,12 +67,7 @@ int board_init(void)
 
 void reset_cpu(void)
 {
-       unsigned long midr, cputype;
-
-       asm volatile("mrs %0, midr_el1" : "=r" (midr));
-       cputype = (midr >> 4) & 0xfff;
-
-       if (cputype == 0xd03)
+       if (is_cortex_a53())
                writel(RST_CA53_CODE, RST_CA53RESCNT);
        else
                writel(RST_CA57_CODE, RST_CA57RESCNT);
index 4291e1d..004feca 100644 (file)
@@ -7,6 +7,7 @@
  * Copyright (C) 2015 Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
  */
 
+#include <asm/armv8/cpu.h>
 #include <dm.h>
 #include <fdt_support.h>
 #include <hang.h>
@@ -50,14 +51,9 @@ int fdtdec_board_setup(const void *fdt_blob)
 
 void __weak reset_cpu(void)
 {
-       unsigned long midr, cputype;
-
-       asm volatile("mrs %0, midr_el1" : "=r" (midr));
-       cputype = (midr >> 4) & 0xfff;
-
-       if (cputype == 0xd03)
+       if (is_cortex_a53())
                writel(RST_CA53_CODE, RST_CA53RESCNT);
-       else if (cputype == 0xd07)
+       else if (is_cortex_a57())
                writel(RST_CA57_CODE, RST_CA57RESCNT);
        else
                hang();