aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/uboot-sifiveu/patches/0008-riscv-dts-Add-few-PMU-events.patch
blob: 3f3feb9da70c659bb37e7b52468413c452bf1f14 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From c29e4d84cfa17ab96eff2a9044f486ba3c8b5c43 Mon Sep 17 00:00:00 2001
From: Atish Patra <atish.patra@wdc.com>
Date: Mon, 25 Oct 2021 11:35:41 -0700
Subject: [PATCH] riscv: dts: Add few PMU events

fu740 has 2 HPM counters and many HPM events defined in the fu740 manual[1].
This patch adds some of these events and their mapping as per the
OpenSBI PMU DT binding for now.

[1]https://sifive.cdn.prismic.io/sifive/de1491e5-077c-461d-9605-e8a0ce57337d_fu740-c000-manual-v1p3.pdf

Signed-off-by: Atish Patra <atish.patra@wdc.com>
---
 arch/riscv/dts/fu740-c000.dtsi | 11 +++++++++++
 1 file changed, 11 insertions(+)

--- a/arch/riscv/dts/fu740-c000.dtsi
+++ b/arch/riscv/dts/fu740-c000.dtsi
@@ -140,6 +140,17 @@
 		#size-cells = <2>;
 		compatible = "simple-bus";
 		ranges;
+		pmu {
+			compatible = "riscv,pmu";
+			riscv,raw-event-to-mhpmcounters = <0x00000000 0x200 0x18
+							 0x00000000 0x400 0x18
+							 0x00000000 0x800 0x18>;
+			riscv,event-to-mhpmcounters = <0x05 0x06 0x18
+						     0x10009 0x10009 0x18>;
+			riscv,event-to-mhpmevent = <0x05 0x00000000 0x4000
+						  0x06 0x00000000 0x4001
+						  0x10008 0x00000000 0x102>;
+		};
 		plic0: interrupt-controller@c000000 {
 			#interrupt-cells = <1>;
 			#address-cells = <0>;