@@ -93,6 +93,13 @@ static int __init arc_cs_setup_gfrc(struct device_node *node)
return -ENXIO;
}
+ /*
+ * Halt GFRC if either of 4 cores in SMP cluster is halted.
+ * Only works for ARC HS v3.0+, on earlier versions has no effect.
+ * TODO: set mask only for used cores.
+ */
+ __mcip_cmd_data(CMD_GFRC_SET_CORE, 0, 0xf);
+
ret = arc_get_timer_clk(node);
if (ret)
return ret;
@@ -40,6 +40,7 @@ struct mcip_cmd {
#define CMD_GFRC_READ_LO 0x42
#define CMD_GFRC_READ_HI 0x43
+#define CMD_GFRC_SET_CORE 0x47
#define CMD_IDU_ENABLE 0x71
#define CMD_IDU_DISABLE 0x72
Currently GFRC is running regardless state of ARC cores in the SMP cluster. That means even if ARC cores are halted when doing JTAG debugging GFRC [our source of wall-time] continues to run giving us unexpected warnings once we allow ARC cores to run due to some tasks being stuck for too long. Starting from ARC HS v3.0 it's possible to tie GFRC to state of up-to 4 ARC cores with help of GFRC's CORE register where we set a mask for cores which state we need to rely on. For now we set GFRC to be halted whenever either of 4 ARC cores (currently max number of ARC cores in SMP cluster) is halted. That setting is safe for clusters with fewer ARC cores as well because bits for missign cores won't be written anyways. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> --- drivers/clocksource/arc_timer.c | 7 +++++++ include/soc/arc/mcip.h | 1 + 2 files changed, 8 insertions(+)