Skip to content

Commit

Permalink
k230.dtsi: add pmu in k230.dtsi
Browse files Browse the repository at this point in the history
add pmu node in k230.dtsi to enable perf func

Signed-off-by: abing <[email protected]>
  • Loading branch information
abing authored and RevySR committed Jul 22, 2024
1 parent bbd1130 commit de837d6
Showing 1 changed file with 111 additions and 0 deletions.
111 changes: 111 additions & 0 deletions arch/riscv/boot/dts/canaan/k230.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,117 @@
};
};

pmu {
compatible = "riscv,pmu";
riscv,event-to-mhpmevent =
/* PMU_HW_CACHE_REFERENCES -> ll_cache_read_access */
<0x00003 0x00000000 0x00000010>,
/* PMU_HW_CACHE_MISSES -> ll_cache_read_miss */
<0x00004 0x00000000 0x00000011>,
/* PMU_HW_BRANCH_INSTRUCTIONS -> inst_branch */
<0x00005 0x00000000 0x00000007>,
/* PMU_HW_BRANCH_MISSES -> inst_branch_mispredict */
<0x00006 0x00000000 0x00000006>,
/* PMU_HW_STALLED_CYCLES_FRONTEND -> ifu_stalled_cycle */
<0x00008 0x00000000 0x00000027>,
/* PMU_HW_STALLED_CYCLES_BACKEND -> idu_stalled_cycle */
<0x00009 0x00000000 0x00000028>,
/* L1D_READ_ACCESS -> l1_dcache_read_access */
<0x10000 0x00000000 0x0000000c>,
/* L1D_READ_MISS -> l1_dcache_read_miss */
<0x10001 0x00000000 0x0000000d>,
/* L1D_WRITE_ACCESS -> l1_dcache_write_access */
<0x10002 0x00000000 0x0000000e>,
/* L1D_WRITE_MISS -> l1_dcache_write_miss */
<0x10003 0x00000000 0x0000000f>,
/* L1I_READ_ACCESS -> l1_icache_access */
<0x10008 0x00000000 0x00000001>,
/* L1I_READ_MISS -> l1_icache_miss */
<0x10009 0x00000000 0x00000002>,
/* LL_READ_ACCESS -> ll_cache_read_access */
<0x10010 0x00000000 0x00000010>,
/* LL_READ_MISS -> ll_cache_read_miss */
<0x10011 0x00000000 0x00000011>,
/* LL_WRITE_ACCESS -> ll_cache_write_access */
<0x10012 0x00000000 0x00000012>,
/* LL_WRITE_MISS -> ll_cache_write_miss */
<0x10013 0x00000000 0x00000013>,
/* DTLB_READ_MISS -> dtlb_miss */
<0x10019 0x00000000 0x00000004>,
/* ITLB_READ_MISS -> itlb_miss */
<0x10021 0x00000000 0x00000003>,
/* BPU_READ_ACCESS -> branch_direction_prediction */
<0x10030 0x00000000 0x0000001c>,
/* BPU_READ_MISS -> branch_direction_misprediction */
<0x10031 0x00000000 0x0000001b>;
riscv,event-to-mhpmcounters =
<0x00003 0x00003 0xfffffff8>,
<0x00004 0x00004 0xfffffff8>,
<0x00005 0x00005 0xfffffff8>,
<0x00006 0x00006 0xfffffff8>,
<0x00007 0x00007 0xfffffff8>,
<0x00008 0x00008 0xfffffff8>,
<0x00009 0x00009 0xfffffff8>,
<0x0000a 0x0000a 0xfffffff8>,
<0x10000 0x10000 0xfffffff8>,
<0x10001 0x10001 0xfffffff8>,
<0x10002 0x10002 0xfffffff8>,
<0x10003 0x10003 0xfffffff8>,
<0x10008 0x10008 0xfffffff8>,
<0x10009 0x10009 0xfffffff8>,
<0x10010 0x10010 0xfffffff8>,
<0x10011 0x10011 0xfffffff8>,
<0x10012 0x10012 0xfffffff8>,
<0x10013 0x10013 0xfffffff8>,
<0x10019 0x10019 0xfffffff8>,
<0x10021 0x10021 0xfffffff8>,
<0x10030 0x10030 0xfffffff8>,
<0x10031 0x10031 0xfffffff8>;
riscv,raw-event-to-mhpmcounters =
<0x00000000 0x00000001 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000002 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000003 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000004 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000005 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000006 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000007 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000008 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000009 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000a 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000b 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000c 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000d 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000e 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000000f 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000010 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000011 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000012 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000013 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000014 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000015 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000016 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000017 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000018 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000019 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001a 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001b 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001c 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001d 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001e 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000001f 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000020 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000021 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000022 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000023 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000024 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000025 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000026 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000027 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000028 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x00000029 0xffffffff 0xffffffff 0xfffffff8>,
<0x00000000 0x0000002a 0xffffffff 0xffffffff 0xfffffff8>;
};

apb_clk: apb-clk-clock {
compatible = "fixed-clock";
clock-frequency = <50000000>;
Expand Down

0 comments on commit de837d6

Please sign in to comment.