*/
#include <andes/andes45.h>
-#include <andes/andes_hpm.h>
#include <andes/andes_pmu.h>
#include <sbi/sbi_bitops.h>
#include <sbi/sbi_error.h>
int andes_pmu_init(const struct fdt_match *match)
{
struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
- void *fdt = fdt_get_address();
- int pmu_offset;
if (sbi_hart_has_extension(scratch, SBI_HART_EXT_XANDESPMU))
sbi_pmu_set_device(&andes_pmu);
- /*
- * Populate default mappings if device-tree doesn't
- * provide a valid pmu node.
- */
- pmu_offset = fdt_node_offset_by_compatible(fdt, -1, "riscv,pmu");
- if (pmu_offset < 0)
- return (pmu_offset == -FDT_ERR_NOTFOUND) ? andes_pmu_setup()
- : SBI_EFAIL;
-
return 0;
}
+++ /dev/null
-/*
- * SPDX-License-Identifier: BSD-2-Clause
- *
- * Copyright (c) 2023 Andes Technology Corporation
- */
-
-#ifndef _ANDES_HPM_H_
-#define _ANDES_HPM_H_
-
-static inline int andes_pmu_setup(void) { return 0; }
-
-#endif /* _ANDES_HPM_H_ */